diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-26 16:05:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-26 16:05:09 -0400 |
commit | 3ab47029d91993745212624e49d16a75abc8f207 (patch) | |
tree | e0953f10e43bfaa9a3567ebe2c45a20a21d8e80b /drivers/misc | |
parent | 0cf0adb073908a66b6875ef8e016b235b9d43ee3 (diff) | |
parent | 651d62a8b0378b911f083a1712d9d228894f46d8 (diff) |
Merge branch 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
drivers:misc: ti-st: fix unexpected UART close
drivers:misc: ti-st: free skb on firmware download
drivers:misc: ti-st: wait for completion at fail
drivers:misc: ti-st: reinit completion before send
drivers:misc: ti-st: fail-safe on wrong pkt type
drivers:misc: ti-st: reinit completion on ver read
drivers:misc:ti-st: platform hooks for chip states
drivers:misc: ti-st: avoid a misleading dbg msg
base/devres.c: quiet sparse noise about context imbalance
pti: add missing CONFIG_PCI dependency
drivers/base/devtmpfs.c: correct annotation of `setup_done'
driver core: fix kernel-doc warning in platform.c
firmware: fix google/gsmi.c build warning
Diffstat (limited to 'drivers/misc')
-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 |
4 files changed, 62 insertions, 1 deletions
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 | /**********************************************************************/ |