diff options
| author | Pavan Savoy <pavan_savoy@ti.com> | 2012-08-03 15:49:39 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 13:11:45 -0400 |
| commit | eccf2979b2c034b516e01b8a104c3739f7ef07d1 (patch) | |
| tree | 17992e5c3b509f467a10578daf1bcce0b65d08d3 /drivers/misc | |
| parent | 4eb64ee135af6b477ff149a2072bcfa3118afb94 (diff) | |
drivers/misc/ti-st: remove gpio handling
A platform hook to enable/disable the chip was introduced to perform specific
activities to power-up and power-down the WL chip.
Moving the power-up/down sequence also there makes more sense, since different
platforms have begun to have their own ways to power-up/down the chip.
This patch removes all of the gpio handling done by the driver in
st_kim_start/st_kim_stop & any of the gpio request done in the probe function.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
| -rw-r--r-- | drivers/misc/ti-st/st_kim.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 7c14f8fd98db..5c99995f4eac 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c | |||
| @@ -454,11 +454,6 @@ long st_kim_start(void *kim_data) | |||
| 454 | if (pdata->chip_enable) | 454 | if (pdata->chip_enable) |
| 455 | pdata->chip_enable(kim_gdata); | 455 | pdata->chip_enable(kim_gdata); |
| 456 | 456 | ||
| 457 | /* Configure BT nShutdown to HIGH state */ | ||
| 458 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); | ||
| 459 | mdelay(5); /* FIXME: a proper toggle */ | ||
| 460 | gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); | ||
| 461 | mdelay(100); | ||
| 462 | /* re-initialize the completion */ | 457 | /* re-initialize the completion */ |
| 463 | INIT_COMPLETION(kim_gdata->ldisc_installed); | 458 | INIT_COMPLETION(kim_gdata->ldisc_installed); |
| 464 | /* send notification to UIM */ | 459 | /* send notification to UIM */ |
| @@ -500,8 +495,7 @@ long st_kim_start(void *kim_data) | |||
| 500 | * (b) upon failure to either install ldisc or download firmware. | 495 | * (b) upon failure to either install ldisc or download firmware. |
| 501 | * The function is responsible to (a) notify UIM about un-installation, | 496 | * The function is responsible to (a) notify UIM about un-installation, |
| 502 | * (b) flush UART if the ldisc was installed. | 497 | * (b) flush UART if the ldisc was installed. |
| 503 | * (c) reset BT_EN - pull down nshutdown at the end. | 498 | * (c) invoke platform's chip disabling routine. |
| 504 | * (d) invoke platform's chip disabling routine. | ||
| 505 | */ | 499 | */ |
| 506 | long st_kim_stop(void *kim_data) | 500 | long st_kim_stop(void *kim_data) |
| 507 | { | 501 | { |
| @@ -533,13 +527,6 @@ long st_kim_stop(void *kim_data) | |||
| 533 | return -ETIMEDOUT; | 527 | return -ETIMEDOUT; |
| 534 | } | 528 | } |
| 535 | 529 | ||
| 536 | /* By default configure BT nShutdown to LOW state */ | ||
| 537 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); | ||
| 538 | mdelay(1); | ||
| 539 | gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); | ||
| 540 | mdelay(1); | ||
| 541 | gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); | ||
| 542 | |||
| 543 | /* platform specific disable */ | 530 | /* platform specific disable */ |
| 544 | if (pdata->chip_disable) | 531 | if (pdata->chip_disable) |
| 545 | pdata->chip_disable(kim_gdata); | 532 | pdata->chip_disable(kim_gdata); |
| @@ -731,20 +718,6 @@ static int kim_probe(struct platform_device *pdev) | |||
| 731 | /* refer to itself */ | 718 | /* refer to itself */ |
| 732 | kim_gdata->core_data->kim_data = kim_gdata; | 719 | kim_gdata->core_data->kim_data = kim_gdata; |
| 733 | 720 | ||
| 734 | /* Claim the chip enable nShutdown gpio from the system */ | ||
| 735 | kim_gdata->nshutdown = pdata->nshutdown_gpio; | ||
| 736 | status = gpio_request(kim_gdata->nshutdown, "kim"); | ||
| 737 | if (unlikely(status)) { | ||
| 738 | pr_err(" gpio %ld request failed ", kim_gdata->nshutdown); | ||
| 739 | return status; | ||
| 740 | } | ||
| 741 | |||
| 742 | /* Configure nShutdown GPIO as output=0 */ | ||
| 743 | status = gpio_direction_output(kim_gdata->nshutdown, 0); | ||
| 744 | if (unlikely(status)) { | ||
| 745 | pr_err(" unable to configure gpio %ld", kim_gdata->nshutdown); | ||
| 746 | return status; | ||
| 747 | } | ||
| 748 | /* get reference of pdev for request_firmware | 721 | /* get reference of pdev for request_firmware |
| 749 | */ | 722 | */ |
| 750 | kim_gdata->kim_pdev = pdev; | 723 | kim_gdata->kim_pdev = pdev; |
| @@ -780,18 +753,10 @@ static int kim_probe(struct platform_device *pdev) | |||
| 780 | 753 | ||
| 781 | static int kim_remove(struct platform_device *pdev) | 754 | static int kim_remove(struct platform_device *pdev) |
| 782 | { | 755 | { |
| 783 | /* free the GPIOs requested */ | ||
| 784 | struct ti_st_plat_data *pdata = pdev->dev.platform_data; | ||
| 785 | struct kim_data_s *kim_gdata; | 756 | struct kim_data_s *kim_gdata; |
| 786 | 757 | ||
| 787 | kim_gdata = dev_get_drvdata(&pdev->dev); | 758 | kim_gdata = dev_get_drvdata(&pdev->dev); |
| 788 | 759 | ||
| 789 | /* Free the Bluetooth/FM/GPIO | ||
| 790 | * nShutdown gpio from the system | ||
| 791 | */ | ||
| 792 | gpio_free(pdata->nshutdown_gpio); | ||
| 793 | pr_info("nshutdown GPIO Freed"); | ||
| 794 | |||
| 795 | debugfs_remove_recursive(kim_debugfs_dir); | 760 | debugfs_remove_recursive(kim_debugfs_dir); |
| 796 | sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp); | 761 | sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp); |
| 797 | pr_info("sysfs entries removed"); | 762 | pr_info("sysfs entries removed"); |
