kim_gdata 52 drivers/misc/ti-st/st_kim.c static void validate_firmware_response(struct kim_data_s *kim_gdata) kim_gdata 54 drivers/misc/ti-st/st_kim.c struct sk_buff *skb = kim_gdata->rx_skb; kim_gdata 65 drivers/misc/ti-st/st_kim.c memcpy(kim_gdata->resp_buffer, kim_gdata 66 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb->data, kim_gdata 67 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb->len); kim_gdata 68 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_PACKET_TYPE; kim_gdata 69 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb = NULL; kim_gdata 70 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count = 0; kim_gdata 78 drivers/misc/ti-st/st_kim.c complete_all(&kim_gdata->kim_rcvd); kim_gdata 85 drivers/misc/ti-st/st_kim.c static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len) kim_gdata 87 drivers/misc/ti-st/st_kim.c register int room = skb_tailroom(kim_gdata->rx_skb); kim_gdata 92 drivers/misc/ti-st/st_kim.c validate_firmware_response(kim_gdata); kim_gdata 99 drivers/misc/ti-st/st_kim.c kfree_skb(kim_gdata->rx_skb); kim_gdata 104 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_DATA; kim_gdata 105 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count = len; kim_gdata 111 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_PACKET_TYPE; kim_gdata 112 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb = NULL; kim_gdata 113 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count = 0; kim_gdata 124 drivers/misc/ti-st/st_kim.c static void kim_int_recv(struct kim_data_s *kim_gdata, kim_gdata 140 drivers/misc/ti-st/st_kim.c if (kim_gdata->rx_count) { kim_gdata 141 drivers/misc/ti-st/st_kim.c len = min_t(unsigned int, kim_gdata->rx_count, count); kim_gdata 142 drivers/misc/ti-st/st_kim.c skb_put_data(kim_gdata->rx_skb, ptr, len); kim_gdata 143 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count -= len; kim_gdata 147 drivers/misc/ti-st/st_kim.c if (kim_gdata->rx_count) kim_gdata 151 drivers/misc/ti-st/st_kim.c switch (kim_gdata->rx_state) { kim_gdata 155 drivers/misc/ti-st/st_kim.c validate_firmware_response(kim_gdata); kim_gdata 156 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_PACKET_TYPE; kim_gdata 157 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb = NULL; kim_gdata 162 drivers/misc/ti-st/st_kim.c (unsigned char *)&kim_gdata->rx_skb->data[1]; kim_gdata 164 drivers/misc/ti-st/st_kim.c kim_check_data_len(kim_gdata, *plen); kim_gdata 171 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_HEADER; kim_gdata 172 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count = 2; kim_gdata 182 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb = kim_gdata 184 drivers/misc/ti-st/st_kim.c if (!kim_gdata->rx_skb) { kim_gdata 186 drivers/misc/ti-st/st_kim.c kim_gdata->rx_state = ST_W4_PACKET_TYPE; kim_gdata 187 drivers/misc/ti-st/st_kim.c kim_gdata->rx_count = 0; kim_gdata 190 drivers/misc/ti-st/st_kim.c skb_reserve(kim_gdata->rx_skb, 8); kim_gdata 191 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb->cb[0] = 4; kim_gdata 192 drivers/misc/ti-st/st_kim.c kim_gdata->rx_skb->cb[1] = 0; kim_gdata 198 drivers/misc/ti-st/st_kim.c static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) kim_gdata 206 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->kim_rcvd); kim_gdata 207 drivers/misc/ti-st/st_kim.c if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) { kim_gdata 213 drivers/misc/ti-st/st_kim.c &kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME)); kim_gdata 218 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->kim_rcvd); kim_gdata 224 drivers/misc/ti-st/st_kim.c MAKEWORD(kim_gdata->resp_buffer[12], kim_gdata 225 drivers/misc/ti-st/st_kim.c kim_gdata->resp_buffer[13]); kim_gdata 237 drivers/misc/ti-st/st_kim.c kim_gdata->version.full = version; kim_gdata 238 drivers/misc/ti-st/st_kim.c kim_gdata->version.chip = chip; kim_gdata 239 drivers/misc/ti-st/st_kim.c kim_gdata->version.maj_ver = maj_ver; kim_gdata 240 drivers/misc/ti-st/st_kim.c kim_gdata->version.min_ver = min_ver; kim_gdata 271 drivers/misc/ti-st/st_kim.c static long download_firmware(struct kim_data_s *kim_gdata) kim_gdata 282 drivers/misc/ti-st/st_kim.c err = read_local_version(kim_gdata, bts_scr_name); kim_gdata 288 drivers/misc/ti-st/st_kim.c request_firmware(&kim_gdata->fw_entry, bts_scr_name, kim_gdata 289 drivers/misc/ti-st/st_kim.c &kim_gdata->kim_pdev->dev); kim_gdata 290 drivers/misc/ti-st/st_kim.c if (unlikely((err != 0) || (kim_gdata->fw_entry->data == NULL) || kim_gdata 291 drivers/misc/ti-st/st_kim.c (kim_gdata->fw_entry->size == 0))) { kim_gdata 296 drivers/misc/ti-st/st_kim.c ptr = (void *)kim_gdata->fw_entry->data; kim_gdata 297 drivers/misc/ti-st/st_kim.c len = kim_gdata->fw_entry->size; kim_gdata 331 drivers/misc/ti-st/st_kim.c st_get_uart_wr_room(kim_gdata->core_data); kim_gdata 335 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 346 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 352 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->kim_rcvd); kim_gdata 359 drivers/misc/ti-st/st_kim.c err = st_int_write(kim_gdata->core_data, kim_gdata 363 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 374 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 381 drivers/misc/ti-st/st_kim.c &kim_gdata->kim_rcvd, kim_gdata 386 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 389 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->kim_rcvd); kim_gdata 405 drivers/misc/ti-st/st_kim.c release_firmware(kim_gdata->fw_entry); kim_gdata 419 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = st_gdata->kim_data; kim_gdata 424 drivers/misc/ti-st/st_kim.c kim_int_recv(kim_gdata, data, count); kim_gdata 433 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; kim_gdata 434 drivers/misc/ti-st/st_kim.c complete(&kim_gdata->ldisc_installed); kim_gdata 449 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; kim_gdata 452 drivers/misc/ti-st/st_kim.c pdata = kim_gdata->kim_pdev->dev.platform_data; kim_gdata 457 drivers/misc/ti-st/st_kim.c pdata->chip_enable(kim_gdata); kim_gdata 460 drivers/misc/ti-st/st_kim.c gpio_set_value_cansleep(kim_gdata->nshutdown, GPIO_LOW); kim_gdata 462 drivers/misc/ti-st/st_kim.c gpio_set_value_cansleep(kim_gdata->nshutdown, GPIO_HIGH); kim_gdata 465 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->ldisc_installed); kim_gdata 467 drivers/misc/ti-st/st_kim.c kim_gdata->ldisc_install = 1; kim_gdata 469 drivers/misc/ti-st/st_kim.c sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, kim_gdata 473 drivers/misc/ti-st/st_kim.c &kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME)); kim_gdata 478 drivers/misc/ti-st/st_kim.c err = st_kim_stop(kim_gdata); kim_gdata 483 drivers/misc/ti-st/st_kim.c err = download_firmware(kim_gdata); kim_gdata 488 drivers/misc/ti-st/st_kim.c err = st_kim_stop(kim_gdata); kim_gdata 511 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; kim_gdata 513 drivers/misc/ti-st/st_kim.c kim_gdata->kim_pdev->dev.platform_data; kim_gdata 514 drivers/misc/ti-st/st_kim.c struct tty_struct *tty = kim_gdata->core_data->tty; kim_gdata 516 drivers/misc/ti-st/st_kim.c reinit_completion(&kim_gdata->ldisc_installed); kim_gdata 526 drivers/misc/ti-st/st_kim.c kim_gdata->ldisc_install = 0; kim_gdata 527 drivers/misc/ti-st/st_kim.c sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, NULL, "install"); kim_gdata 531 drivers/misc/ti-st/st_kim.c &kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME)); kim_gdata 538 drivers/misc/ti-st/st_kim.c gpio_set_value_cansleep(kim_gdata->nshutdown, GPIO_LOW); kim_gdata 540 drivers/misc/ti-st/st_kim.c gpio_set_value_cansleep(kim_gdata->nshutdown, GPIO_HIGH); kim_gdata 542 drivers/misc/ti-st/st_kim.c gpio_set_value_cansleep(kim_gdata->nshutdown, GPIO_LOW); kim_gdata 546 drivers/misc/ti-st/st_kim.c pdata->chip_disable(kim_gdata); kim_gdata 556 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = (struct kim_data_s *)s->private; kim_gdata 557 drivers/misc/ti-st/st_kim.c seq_printf(s, "%04X %d.%d.%d\n", kim_gdata->version.full, kim_gdata 558 drivers/misc/ti-st/st_kim.c kim_gdata->version.chip, kim_gdata->version.maj_ver, kim_gdata 559 drivers/misc/ti-st/st_kim.c kim_gdata->version.min_ver); kim_gdata 565 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = (struct kim_data_s *)s->private; kim_gdata 566 drivers/misc/ti-st/st_kim.c kim_st_list_protocols(kim_gdata->core_data, s); kim_gdata 663 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata; kim_gdata 668 drivers/misc/ti-st/st_kim.c kim_gdata = platform_get_drvdata(pdev); kim_gdata 669 drivers/misc/ti-st/st_kim.c if (!kim_gdata) kim_gdata 672 drivers/misc/ti-st/st_kim.c *core_data = kim_gdata->core_data; kim_gdata 690 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata; kim_gdata 702 drivers/misc/ti-st/st_kim.c kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_KERNEL); kim_gdata 703 drivers/misc/ti-st/st_kim.c if (!kim_gdata) { kim_gdata 707 drivers/misc/ti-st/st_kim.c platform_set_drvdata(pdev, kim_gdata); kim_gdata 709 drivers/misc/ti-st/st_kim.c err = st_core_init(&kim_gdata->core_data); kim_gdata 716 drivers/misc/ti-st/st_kim.c kim_gdata->core_data->kim_data = kim_gdata; kim_gdata 719 drivers/misc/ti-st/st_kim.c kim_gdata->nshutdown = pdata->nshutdown_gpio; kim_gdata 720 drivers/misc/ti-st/st_kim.c err = gpio_request(kim_gdata->nshutdown, "kim"); kim_gdata 722 drivers/misc/ti-st/st_kim.c pr_err(" gpio %d request failed ", kim_gdata->nshutdown); kim_gdata 727 drivers/misc/ti-st/st_kim.c err = gpio_direction_output(kim_gdata->nshutdown, 0); kim_gdata 729 drivers/misc/ti-st/st_kim.c pr_err(" unable to configure gpio %d", kim_gdata->nshutdown); kim_gdata 734 drivers/misc/ti-st/st_kim.c kim_gdata->kim_pdev = pdev; kim_gdata 735 drivers/misc/ti-st/st_kim.c init_completion(&kim_gdata->kim_rcvd); kim_gdata 736 drivers/misc/ti-st/st_kim.c init_completion(&kim_gdata->ldisc_installed); kim_gdata 745 drivers/misc/ti-st/st_kim.c strncpy(kim_gdata->dev_name, pdata->dev_name, UART_DEV_NAME_LEN); kim_gdata 746 drivers/misc/ti-st/st_kim.c kim_gdata->flow_cntrl = pdata->flow_cntrl; kim_gdata 747 drivers/misc/ti-st/st_kim.c kim_gdata->baud_rate = pdata->baud_rate; kim_gdata 753 drivers/misc/ti-st/st_kim.c kim_gdata, &version_fops); kim_gdata 755 drivers/misc/ti-st/st_kim.c kim_gdata, &list_fops); kim_gdata 759 drivers/misc/ti-st/st_kim.c st_core_exit(kim_gdata->core_data); kim_gdata 762 drivers/misc/ti-st/st_kim.c kfree(kim_gdata); kim_gdata 771 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata; kim_gdata 773 drivers/misc/ti-st/st_kim.c kim_gdata = platform_get_drvdata(pdev); kim_gdata 785 drivers/misc/ti-st/st_kim.c kim_gdata->kim_pdev = NULL; kim_gdata 786 drivers/misc/ti-st/st_kim.c st_core_exit(kim_gdata->core_data); kim_gdata 788 drivers/misc/ti-st/st_kim.c kfree(kim_gdata); kim_gdata 789 drivers/misc/ti-st/st_kim.c kim_gdata = NULL;