aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-10-14 20:14:01 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-10-14 20:14:01 -0400
commit07aaae44f5a3962c3a410a6dd7936dfa7dece2b9 (patch)
tree0cdb5735800ddd63d8850aa26d3a3f1f3334267a /drivers/misc
parent07a062140372187642003e02a49edc8a2115c1ca (diff)
parent976d167615b64e14bc1491ca51d424e2ba9a5e84 (diff)
Merge commit 'v3.1-rc9' into fbdev-next
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Kconfig1
-rw-r--r--drivers/misc/ab8500-pwm.c2
-rw-r--r--drivers/misc/fsa9480.c4
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d.c14
-rw-r--r--drivers/misc/pti.c14
-rw-r--r--drivers/misc/ti-st/st_core.c10
-rw-r--r--drivers/misc/ti-st/st_kim.c33
-rw-r--r--drivers/misc/ti-st/st_ll.c19
8 files changed, 80 insertions, 17 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
147config INTEL_MID_PTI 147config 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/ab8500-pwm.c b/drivers/misc/ab8500-pwm.c
index 54e3d05b63cc..35903154ca2e 100644
--- a/drivers/misc/ab8500-pwm.c
+++ b/drivers/misc/ab8500-pwm.c
@@ -164,5 +164,5 @@ subsys_initcall(ab8500_pwm_init);
164module_exit(ab8500_pwm_exit); 164module_exit(ab8500_pwm_exit);
165MODULE_AUTHOR("Arun MURTHY <arun.murthy@stericsson.com>"); 165MODULE_AUTHOR("Arun MURTHY <arun.murthy@stericsson.com>");
166MODULE_DESCRIPTION("AB8500 Pulse Width Modulation Driver"); 166MODULE_DESCRIPTION("AB8500 Pulse Width Modulation Driver");
167MODULE_ALIAS("AB8500 PWM driver"); 167MODULE_ALIAS("platform:ab8500-pwm");
168MODULE_LICENSE("GPL v2"); 168MODULE_LICENSE("GPL v2");
diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c
index 5325a7e70dcf..27dc0d21aafa 100644
--- a/drivers/misc/fsa9480.c
+++ b/drivers/misc/fsa9480.c
@@ -455,7 +455,7 @@ static int __devinit fsa9480_probe(struct i2c_client *client,
455 455
456fail2: 456fail2:
457 if (client->irq) 457 if (client->irq)
458 free_irq(client->irq, NULL); 458 free_irq(client->irq, usbsw);
459fail1: 459fail1:
460 i2c_set_clientdata(client, NULL); 460 i2c_set_clientdata(client, NULL);
461 kfree(usbsw); 461 kfree(usbsw);
@@ -466,7 +466,7 @@ static int __devexit fsa9480_remove(struct i2c_client *client)
466{ 466{
467 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); 467 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client);
468 if (client->irq) 468 if (client->irq)
469 free_irq(client->irq, NULL); 469 free_irq(client->irq, usbsw);
470 i2c_set_clientdata(client, NULL); 470 i2c_set_clientdata(client, NULL);
471 471
472 sysfs_remove_group(&client->dev.kobj, &fsa9480_group); 472 sysfs_remove_group(&client->dev.kobj, &fsa9480_group);
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index b928bc14e97b..8b51cd62d067 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -375,12 +375,14 @@ void lis3lv02d_poweron(struct lis3lv02d *lis3)
375 * both have been read. So the value read will always be correct. 375 * both have been read. So the value read will always be correct.
376 * Set BOOT bit to refresh factory tuning values. 376 * Set BOOT bit to refresh factory tuning values.
377 */ 377 */
378 lis3->read(lis3, CTRL_REG2, &reg); 378 if (lis3->pdata) {
379 if (lis3->whoami == WAI_12B) 379 lis3->read(lis3, CTRL_REG2, &reg);
380 reg |= CTRL2_BDU | CTRL2_BOOT; 380 if (lis3->whoami == WAI_12B)
381 else 381 reg |= CTRL2_BDU | CTRL2_BOOT;
382 reg |= CTRL2_BOOT_8B; 382 else
383 lis3->write(lis3, CTRL_REG2, reg); 383 reg |= CTRL2_BOOT_8B;
384 lis3->write(lis3, CTRL_REG2, reg);
385 }
384 386
385 /* LIS3 power on delay is quite long */ 387 /* LIS3 power on delay is quite long */
386 msleep(lis3->pwron_delay / lis3lv02d_get_odr()); 388 msleep(lis3->pwron_delay / lis3lv02d_get_odr());
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 8653bd0b1a33..0b56e3f43573 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -33,6 +33,8 @@
33#include <linux/mutex.h> 33#include <linux/mutex.h>
34#include <linux/miscdevice.h> 34#include <linux/miscdevice.h>
35#include <linux/pti.h> 35#include <linux/pti.h>
36#include <linux/slab.h>
37#include <linux/uaccess.h>
36 38
37#define DRIVERNAME "pti" 39#define DRIVERNAME "pti"
38#define PCINAME "pciPTI" 40#define PCINAME "pciPTI"
@@ -163,6 +165,11 @@ static void pti_write_to_aperture(struct pti_masterchannel *mc,
163static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc, 165static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc,
164 const char *thread_name) 166 const char *thread_name)
165{ 167{
168 /*
169 * Since we access the comm member in current's task_struct, we only
170 * need to be as large as what 'comm' in that structure is.
171 */
172 char comm[TASK_COMM_LEN];
166 struct pti_masterchannel mccontrol = {.master = CONTROL_ID, 173 struct pti_masterchannel mccontrol = {.master = CONTROL_ID,
167 .channel = 0}; 174 .channel = 0};
168 const char *thread_name_p; 175 const char *thread_name_p;
@@ -170,13 +177,6 @@ static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc,
170 u8 control_frame[CONTROL_FRAME_LEN]; 177 u8 control_frame[CONTROL_FRAME_LEN];
171 178
172 if (!thread_name) { 179 if (!thread_name) {
173 /*
174 * Since we access the comm member in current's task_struct,
175 * we only need to be as large as what 'comm' in that
176 * structure is.
177 */
178 char comm[TASK_COMM_LEN];
179
180 if (!in_interrupt()) 180 if (!in_interrupt())
181 get_task_comm(comm, current); 181 get_task_comm(comm, current);
182 else 182 else
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 }
363done:
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
38static void ll_device_want_to_sleep(struct st_data_s *st_data) 39static 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
51static void ll_device_want_to_wakeup(struct st_data_s *st_data) 61static 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/**********************************************************************/