diff options
| -rw-r--r-- | drivers/base/devres.c | 1 | ||||
| -rw-r--r-- | drivers/base/devtmpfs.c | 2 | ||||
| -rw-r--r-- | drivers/base/platform.c | 2 | ||||
| -rw-r--r-- | drivers/firmware/google/gsmi.c | 2 | ||||
| -rw-r--r-- | drivers/misc/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/misc/ti-st/st_core.c | 10 | ||||
| -rw-r--r-- | drivers/misc/ti-st/st_kim.c | 33 | ||||
| -rw-r--r-- | drivers/misc/ti-st/st_ll.c | 19 | ||||
| -rw-r--r-- | include/linux/ti_wilink_st.h | 27 |
9 files changed, 92 insertions, 5 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c index cf7a0c788052..65cd74832450 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c | |||
| @@ -397,6 +397,7 @@ static int remove_nodes(struct device *dev, | |||
| 397 | 397 | ||
| 398 | static int release_nodes(struct device *dev, struct list_head *first, | 398 | static int release_nodes(struct device *dev, struct list_head *first, |
| 399 | struct list_head *end, unsigned long flags) | 399 | struct list_head *end, unsigned long flags) |
| 400 | __releases(&dev->devres_lock) | ||
| 400 | { | 401 | { |
| 401 | LIST_HEAD(todo); | 402 | LIST_HEAD(todo); |
| 402 | int cnt; | 403 | int cnt; |
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index 33e1bed68fdd..a4760e095ff5 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c | |||
| @@ -376,7 +376,7 @@ int devtmpfs_mount(const char *mntdir) | |||
| 376 | return err; | 376 | return err; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | static __initdata DECLARE_COMPLETION(setup_done); | 379 | static DECLARE_COMPLETION(setup_done); |
| 380 | 380 | ||
| 381 | static int handle(const char *name, mode_t mode, struct device *dev) | 381 | static int handle(const char *name, mode_t mode, struct device *dev) |
| 382 | { | 382 | { |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 0cad9c7f6bb5..99a5272d7c2f 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(platform_bus); | |||
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * arch_setup_pdev_archdata - Allow manipulation of archdata before its used | 35 | * arch_setup_pdev_archdata - Allow manipulation of archdata before its used |
| 36 | * @dev: platform device | 36 | * @pdev: platform device |
| 37 | * | 37 | * |
| 38 | * This is called before platform_device_add() such that any pdev_archdata may | 38 | * This is called before platform_device_add() such that any pdev_archdata may |
| 39 | * be setup before the platform_notifier is called. So if a user needs to | 39 | * be setup before the platform_notifier is called. So if a user needs to |
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index 68810fd1a59d..aa83de9db1b9 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c | |||
| @@ -420,7 +420,7 @@ static efi_status_t gsmi_get_next_variable(unsigned long *name_size, | |||
| 420 | 420 | ||
| 421 | static efi_status_t gsmi_set_variable(efi_char16_t *name, | 421 | static efi_status_t gsmi_set_variable(efi_char16_t *name, |
| 422 | efi_guid_t *vendor, | 422 | efi_guid_t *vendor, |
| 423 | unsigned long attr, | 423 | u32 attr, |
| 424 | unsigned long data_size, | 424 | unsigned long data_size, |
| 425 | void *data) | 425 | void *data) |
| 426 | { | 426 | { |
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 0a4d86c6c4a4..2d6423c2d193 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
| @@ -146,6 +146,7 @@ config PHANTOM | |||
| 146 | 146 | ||
| 147 | config INTEL_MID_PTI | 147 | config INTEL_MID_PTI |
| 148 | tristate "Parallel Trace Interface for MIPI P1149.7 cJTAG standard" | 148 | tristate "Parallel Trace Interface for MIPI P1149.7 cJTAG standard" |
| 149 | depends on PCI | ||
| 149 | default n | 150 | default n |
| 150 | help | 151 | help |
| 151 | The PTI (Parallel Trace Interface) driver directs | 152 | The PTI (Parallel Trace Interface) driver directs |
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 54c91ffe4a91..ba168a7d54d4 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c | |||
| @@ -338,6 +338,12 @@ void st_int_recv(void *disc_data, | |||
| 338 | /* Unknow packet? */ | 338 | /* Unknow packet? */ |
| 339 | default: | 339 | default: |
| 340 | type = *ptr; | 340 | type = *ptr; |
| 341 | if (st_gdata->list[type] == NULL) { | ||
| 342 | pr_err("chip/interface misbehavior dropping" | ||
| 343 | " frame starting with 0x%02x", type); | ||
| 344 | goto done; | ||
| 345 | |||
| 346 | } | ||
| 341 | st_gdata->rx_skb = alloc_skb( | 347 | st_gdata->rx_skb = alloc_skb( |
| 342 | st_gdata->list[type]->max_frame_size, | 348 | st_gdata->list[type]->max_frame_size, |
| 343 | GFP_ATOMIC); | 349 | GFP_ATOMIC); |
| @@ -354,6 +360,7 @@ void st_int_recv(void *disc_data, | |||
| 354 | ptr++; | 360 | ptr++; |
| 355 | count--; | 361 | count--; |
| 356 | } | 362 | } |
| 363 | done: | ||
| 357 | spin_unlock_irqrestore(&st_gdata->lock, flags); | 364 | spin_unlock_irqrestore(&st_gdata->lock, flags); |
| 358 | pr_debug("done %s", __func__); | 365 | pr_debug("done %s", __func__); |
| 359 | return; | 366 | return; |
| @@ -717,9 +724,10 @@ static void st_tty_close(struct tty_struct *tty) | |||
| 717 | */ | 724 | */ |
| 718 | spin_lock_irqsave(&st_gdata->lock, flags); | 725 | spin_lock_irqsave(&st_gdata->lock, flags); |
| 719 | for (i = ST_BT; i < ST_MAX_CHANNELS; i++) { | 726 | for (i = ST_BT; i < ST_MAX_CHANNELS; i++) { |
| 720 | if (st_gdata->list[i] != NULL) | 727 | if (st_gdata->is_registered[i] == true) |
| 721 | pr_err("%d not un-registered", i); | 728 | pr_err("%d not un-registered", i); |
| 722 | st_gdata->list[i] = NULL; | 729 | st_gdata->list[i] = NULL; |
| 730 | st_gdata->is_registered[i] = false; | ||
| 723 | } | 731 | } |
| 724 | st_gdata->protos_registered = 0; | 732 | st_gdata->protos_registered = 0; |
| 725 | spin_unlock_irqrestore(&st_gdata->lock, flags); | 733 | spin_unlock_irqrestore(&st_gdata->lock, flags); |
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 38fd2f04c07e..3a3580566dfc 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c | |||
| @@ -68,6 +68,7 @@ void validate_firmware_response(struct kim_data_s *kim_gdata) | |||
| 68 | if (unlikely(skb->data[5] != 0)) { | 68 | if (unlikely(skb->data[5] != 0)) { |
| 69 | pr_err("no proper response during fw download"); | 69 | pr_err("no proper response during fw download"); |
| 70 | pr_err("data6 %x", skb->data[5]); | 70 | pr_err("data6 %x", skb->data[5]); |
| 71 | kfree_skb(skb); | ||
| 71 | return; /* keep waiting for the proper response */ | 72 | return; /* keep waiting for the proper response */ |
| 72 | } | 73 | } |
| 73 | /* becos of all the script being downloaded */ | 74 | /* becos of all the script being downloaded */ |
| @@ -210,6 +211,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) | |||
| 210 | pr_err(" waiting for ver info- timed out "); | 211 | pr_err(" waiting for ver info- timed out "); |
| 211 | return -ETIMEDOUT; | 212 | return -ETIMEDOUT; |
| 212 | } | 213 | } |
| 214 | INIT_COMPLETION(kim_gdata->kim_rcvd); | ||
| 213 | 215 | ||
| 214 | version = | 216 | version = |
| 215 | MAKEWORD(kim_gdata->resp_buffer[13], | 217 | MAKEWORD(kim_gdata->resp_buffer[13], |
| @@ -298,6 +300,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) | |||
| 298 | 300 | ||
| 299 | switch (((struct bts_action *)ptr)->type) { | 301 | switch (((struct bts_action *)ptr)->type) { |
| 300 | case ACTION_SEND_COMMAND: /* action send */ | 302 | case ACTION_SEND_COMMAND: /* action send */ |
| 303 | pr_debug("S"); | ||
| 301 | action_ptr = &(((struct bts_action *)ptr)->data[0]); | 304 | action_ptr = &(((struct bts_action *)ptr)->data[0]); |
| 302 | if (unlikely | 305 | if (unlikely |
| 303 | (((struct hci_command *)action_ptr)->opcode == | 306 | (((struct hci_command *)action_ptr)->opcode == |
| @@ -335,6 +338,10 @@ static long download_firmware(struct kim_data_s *kim_gdata) | |||
| 335 | release_firmware(kim_gdata->fw_entry); | 338 | release_firmware(kim_gdata->fw_entry); |
| 336 | return -ETIMEDOUT; | 339 | return -ETIMEDOUT; |
| 337 | } | 340 | } |
| 341 | /* reinit completion before sending for the | ||
| 342 | * relevant wait | ||
| 343 | */ | ||
| 344 | INIT_COMPLETION(kim_gdata->kim_rcvd); | ||
| 338 | 345 | ||
| 339 | /* | 346 | /* |
| 340 | * Free space found in uart buffer, call st_int_write | 347 | * Free space found in uart buffer, call st_int_write |
| @@ -361,6 +368,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) | |||
| 361 | } | 368 | } |
| 362 | break; | 369 | break; |
| 363 | case ACTION_WAIT_EVENT: /* wait */ | 370 | case ACTION_WAIT_EVENT: /* wait */ |
| 371 | pr_debug("W"); | ||
| 364 | if (!wait_for_completion_timeout | 372 | if (!wait_for_completion_timeout |
| 365 | (&kim_gdata->kim_rcvd, | 373 | (&kim_gdata->kim_rcvd, |
| 366 | msecs_to_jiffies(CMD_RESP_TIME))) { | 374 | msecs_to_jiffies(CMD_RESP_TIME))) { |
| @@ -434,11 +442,17 @@ long st_kim_start(void *kim_data) | |||
| 434 | { | 442 | { |
| 435 | long err = 0; | 443 | long err = 0; |
| 436 | long retry = POR_RETRY_COUNT; | 444 | long retry = POR_RETRY_COUNT; |
| 445 | struct ti_st_plat_data *pdata; | ||
| 437 | struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; | 446 | struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; |
| 438 | 447 | ||
| 439 | pr_info(" %s", __func__); | 448 | pr_info(" %s", __func__); |
| 449 | pdata = kim_gdata->kim_pdev->dev.platform_data; | ||
| 440 | 450 | ||
| 441 | do { | 451 | do { |
| 452 | /* platform specific enabling code here */ | ||
| 453 | if (pdata->chip_enable) | ||
| 454 | pdata->chip_enable(kim_gdata); | ||
| 455 | |||
| 442 | /* Configure BT nShutdown to HIGH state */ | 456 | /* Configure BT nShutdown to HIGH state */ |
| 443 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); | 457 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); |
| 444 | mdelay(5); /* FIXME: a proper toggle */ | 458 | mdelay(5); /* FIXME: a proper toggle */ |
| @@ -460,6 +474,12 @@ long st_kim_start(void *kim_data) | |||
| 460 | pr_info("ldisc_install = 0"); | 474 | pr_info("ldisc_install = 0"); |
| 461 | sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, | 475 | sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, |
| 462 | NULL, "install"); | 476 | NULL, "install"); |
| 477 | /* the following wait is never going to be completed, | ||
| 478 | * since the ldisc was never installed, hence serving | ||
| 479 | * as a mdelay of LDISC_TIME msecs */ | ||
| 480 | err = wait_for_completion_timeout | ||
| 481 | (&kim_gdata->ldisc_installed, | ||
| 482 | msecs_to_jiffies(LDISC_TIME)); | ||
| 463 | err = -ETIMEDOUT; | 483 | err = -ETIMEDOUT; |
| 464 | continue; | 484 | continue; |
| 465 | } else { | 485 | } else { |
| @@ -472,6 +492,13 @@ long st_kim_start(void *kim_data) | |||
| 472 | pr_info("ldisc_install = 0"); | 492 | pr_info("ldisc_install = 0"); |
| 473 | sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, | 493 | sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, |
| 474 | NULL, "install"); | 494 | NULL, "install"); |
| 495 | /* this wait might be completed, though in the | ||
| 496 | * tty_close() since the ldisc is already | ||
| 497 | * installed */ | ||
| 498 | err = wait_for_completion_timeout | ||
| 499 | (&kim_gdata->ldisc_installed, | ||
| 500 | msecs_to_jiffies(LDISC_TIME)); | ||
| 501 | err = -EINVAL; | ||
| 475 | continue; | 502 | continue; |
| 476 | } else { /* on success don't retry */ | 503 | } else { /* on success don't retry */ |
| 477 | break; | 504 | break; |
| @@ -489,6 +516,8 @@ long st_kim_stop(void *kim_data) | |||
| 489 | { | 516 | { |
| 490 | long err = 0; | 517 | long err = 0; |
| 491 | struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; | 518 | struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; |
| 519 | struct ti_st_plat_data *pdata = | ||
| 520 | kim_gdata->kim_pdev->dev.platform_data; | ||
| 492 | 521 | ||
| 493 | INIT_COMPLETION(kim_gdata->ldisc_installed); | 522 | INIT_COMPLETION(kim_gdata->ldisc_installed); |
| 494 | 523 | ||
| @@ -515,6 +544,10 @@ long st_kim_stop(void *kim_data) | |||
| 515 | gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); | 544 | gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); |
| 516 | mdelay(1); | 545 | mdelay(1); |
| 517 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); | 546 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); |
| 547 | |||
| 548 | /* platform specific disable */ | ||
| 549 | if (pdata->chip_disable) | ||
| 550 | pdata->chip_disable(kim_gdata); | ||
| 518 | return err; | 551 | return err; |
| 519 | } | 552 | } |
| 520 | 553 | ||
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c index 3f2495138855..1ff460a8e9c7 100644 --- a/drivers/misc/ti-st/st_ll.c +++ b/drivers/misc/ti-st/st_ll.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define pr_fmt(fmt) "(stll) :" fmt | 22 | #define pr_fmt(fmt) "(stll) :" fmt |
| 23 | #include <linux/skbuff.h> | 23 | #include <linux/skbuff.h> |
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> | ||
| 25 | #include <linux/ti_wilink_st.h> | 26 | #include <linux/ti_wilink_st.h> |
| 26 | 27 | ||
| 27 | /**********************************************************************/ | 28 | /**********************************************************************/ |
| @@ -37,6 +38,9 @@ static void send_ll_cmd(struct st_data_s *st_data, | |||
| 37 | 38 | ||
| 38 | static void ll_device_want_to_sleep(struct st_data_s *st_data) | 39 | static void ll_device_want_to_sleep(struct st_data_s *st_data) |
| 39 | { | 40 | { |
| 41 | struct kim_data_s *kim_data; | ||
| 42 | struct ti_st_plat_data *pdata; | ||
| 43 | |||
| 40 | pr_debug("%s", __func__); | 44 | pr_debug("%s", __func__); |
| 41 | /* sanity check */ | 45 | /* sanity check */ |
| 42 | if (st_data->ll_state != ST_LL_AWAKE) | 46 | if (st_data->ll_state != ST_LL_AWAKE) |
| @@ -46,10 +50,19 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data) | |||
| 46 | send_ll_cmd(st_data, LL_SLEEP_ACK); | 50 | send_ll_cmd(st_data, LL_SLEEP_ACK); |
| 47 | /* update state */ | 51 | /* update state */ |
| 48 | st_data->ll_state = ST_LL_ASLEEP; | 52 | st_data->ll_state = ST_LL_ASLEEP; |
| 53 | |||
| 54 | /* communicate to platform about chip asleep */ | ||
| 55 | kim_data = st_data->kim_data; | ||
| 56 | pdata = kim_data->kim_pdev->dev.platform_data; | ||
| 57 | if (pdata->chip_asleep) | ||
| 58 | pdata->chip_asleep(NULL); | ||
| 49 | } | 59 | } |
| 50 | 60 | ||
| 51 | static void ll_device_want_to_wakeup(struct st_data_s *st_data) | 61 | static void ll_device_want_to_wakeup(struct st_data_s *st_data) |
| 52 | { | 62 | { |
| 63 | struct kim_data_s *kim_data; | ||
| 64 | struct ti_st_plat_data *pdata; | ||
| 65 | |||
| 53 | /* diff actions in diff states */ | 66 | /* diff actions in diff states */ |
| 54 | switch (st_data->ll_state) { | 67 | switch (st_data->ll_state) { |
| 55 | case ST_LL_ASLEEP: | 68 | case ST_LL_ASLEEP: |
| @@ -70,6 +83,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data) | |||
| 70 | } | 83 | } |
| 71 | /* update state */ | 84 | /* update state */ |
| 72 | st_data->ll_state = ST_LL_AWAKE; | 85 | st_data->ll_state = ST_LL_AWAKE; |
| 86 | |||
| 87 | /* communicate to platform about chip wakeup */ | ||
| 88 | kim_data = st_data->kim_data; | ||
| 89 | pdata = kim_data->kim_pdev->dev.platform_data; | ||
| 90 | if (pdata->chip_asleep) | ||
| 91 | pdata->chip_awake(NULL); | ||
| 73 | } | 92 | } |
| 74 | 93 | ||
| 75 | /**********************************************************************/ | 94 | /**********************************************************************/ |
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index b004e557caa9..2ef4385da6bf 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
| @@ -410,7 +410,28 @@ struct gps_event_hdr { | |||
| 410 | u16 plen; | 410 | u16 plen; |
| 411 | } __attribute__ ((packed)); | 411 | } __attribute__ ((packed)); |
| 412 | 412 | ||
| 413 | /* platform data */ | 413 | /** |
| 414 | * struct ti_st_plat_data - platform data shared between ST driver and | ||
| 415 | * platform specific board file which adds the ST device. | ||
| 416 | * @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected. | ||
| 417 | * @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1) | ||
| 418 | * @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM | ||
| 419 | * purposes. | ||
| 420 | * @baud_rate: The baud rate supported by the Host UART controller, this will | ||
| 421 | * be shared across with the chip via a HCI VS command from User-Space Init | ||
| 422 | * Mgr application. | ||
| 423 | * @suspend: | ||
| 424 | * @resume: legacy PM routines hooked to platform specific board file, so as | ||
| 425 | * to take chip-host interface specific action. | ||
| 426 | * @chip_enable: | ||
| 427 | * @chip_disable: Platform/Interface specific mux mode setting, GPIO | ||
| 428 | * configuring, Host side PM disabling etc.. can be done here. | ||
| 429 | * @chip_asleep: | ||
| 430 | * @chip_awake: Chip specific deep sleep states is communicated to Host | ||
| 431 | * specific board-xx.c to take actions such as cut UART clocks when chip | ||
| 432 | * asleep or run host faster when chip awake etc.. | ||
| 433 | * | ||
| 434 | */ | ||
| 414 | struct ti_st_plat_data { | 435 | struct ti_st_plat_data { |
| 415 | long nshutdown_gpio; | 436 | long nshutdown_gpio; |
| 416 | unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ | 437 | unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ |
| @@ -418,6 +439,10 @@ struct ti_st_plat_data { | |||
| 418 | unsigned long baud_rate; | 439 | unsigned long baud_rate; |
| 419 | int (*suspend)(struct platform_device *, pm_message_t); | 440 | int (*suspend)(struct platform_device *, pm_message_t); |
| 420 | int (*resume)(struct platform_device *); | 441 | int (*resume)(struct platform_device *); |
| 442 | int (*chip_enable) (struct kim_data_s *); | ||
| 443 | int (*chip_disable) (struct kim_data_s *); | ||
| 444 | int (*chip_asleep) (struct kim_data_s *); | ||
| 445 | int (*chip_awake) (struct kim_data_s *); | ||
| 421 | }; | 446 | }; |
| 422 | 447 | ||
| 423 | #endif /* TI_WILINK_ST_H */ | 448 | #endif /* TI_WILINK_ST_H */ |
