aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ti-st/st_kim.c
diff options
context:
space:
mode:
authorPavan Savoy <pavan_savoy@ti.com>2011-08-10 11:18:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-22 17:13:32 -0400
commit0d7c5f2572ccfa7bf83292b1506926663f2d164a (patch)
tree7ad38fe6af0fd468aa7c1af654ce2d7addbea622 /drivers/misc/ti-st/st_kim.c
parent5926cef26c72cd121266b000b8975e6373cbf2b3 (diff)
drivers:misc:ti-st: platform hooks for chip states
Certain platform specific or Host-WiLink Interface specific actions would be required to be taken when the chip is being enabled and after the chip is disabled such as configuration of the mux modes for the GPIO of host connected to the nshutdown of the chip or relinquishing UART after the chip is disabled. Similar actions can also be taken when the chip is in deep sleep or when the chip is awake. Performance enhancements such as configuring the host to run faster when chip is awake and slower when chip is asleep can also be made here. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc/ti-st/st_kim.c')
-rw-r--r--drivers/misc/ti-st/st_kim.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 38fd2f04c07..6884dd1c997 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -434,11 +434,17 @@ long st_kim_start(void *kim_data)
434{ 434{
435 long err = 0; 435 long err = 0;
436 long retry = POR_RETRY_COUNT; 436 long retry = POR_RETRY_COUNT;
437 struct ti_st_plat_data *pdata;
437 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; 438 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
438 439
439 pr_info(" %s", __func__); 440 pr_info(" %s", __func__);
441 pdata = kim_gdata->kim_pdev->dev.platform_data;
440 442
441 do { 443 do {
444 /* platform specific enabling code here */
445 if (pdata->chip_enable)
446 pdata->chip_enable(kim_gdata);
447
442 /* Configure BT nShutdown to HIGH state */ 448 /* Configure BT nShutdown to HIGH state */
443 gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); 449 gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
444 mdelay(5); /* FIXME: a proper toggle */ 450 mdelay(5); /* FIXME: a proper toggle */
@@ -489,6 +495,8 @@ long st_kim_stop(void *kim_data)
489{ 495{
490 long err = 0; 496 long err = 0;
491 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; 497 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
498 struct ti_st_plat_data *pdata =
499 kim_gdata->kim_pdev->dev.platform_data;
492 500
493 INIT_COMPLETION(kim_gdata->ldisc_installed); 501 INIT_COMPLETION(kim_gdata->ldisc_installed);
494 502
@@ -515,6 +523,10 @@ long st_kim_stop(void *kim_data)
515 gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); 523 gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
516 mdelay(1); 524 mdelay(1);
517 gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); 525 gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
526
527 /* platform specific disable */
528 if (pdata->chip_disable)
529 pdata->chip_disable(kim_gdata);
518 return err; 530 return err;
519} 531}
520 532