Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pavan Savoy and committed by
Greg Kroah-Hartman
eccf2979 4eb64ee1

+1 -36
+1 -36
drivers/misc/ti-st/st_kim.c
··· 454 454 if (pdata->chip_enable) 455 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 457 /* re-initialize the completion */ 463 458 INIT_COMPLETION(kim_gdata->ldisc_installed); 464 459 /* send notification to UIM */ ··· 495 500 * (b) upon failure to either install ldisc or download firmware. 496 501 * The function is responsible to (a) notify UIM about un-installation, 497 502 * (b) flush UART if the ldisc was installed. 498 - * (c) reset BT_EN - pull down nshutdown at the end. 499 - * (d) invoke platform's chip disabling routine. 503 + * (c) invoke platform's chip disabling routine. 500 504 */ 501 505 long st_kim_stop(void *kim_data) 502 506 { ··· 526 532 pr_err(" timed out waiting for ldisc to be un-installed"); 527 533 return -ETIMEDOUT; 528 534 } 529 - 530 - /* By default configure BT nShutdown to LOW state */ 531 - gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); 532 - mdelay(1); 533 - gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); 534 - mdelay(1); 535 - gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); 536 535 537 536 /* platform specific disable */ 538 537 if (pdata->chip_disable) ··· 718 731 /* refer to itself */ 719 732 kim_gdata->core_data->kim_data = kim_gdata; 720 733 721 - /* Claim the chip enable nShutdown gpio from the system */ 722 - kim_gdata->nshutdown = pdata->nshutdown_gpio; 723 - status = gpio_request(kim_gdata->nshutdown, "kim"); 724 - if (unlikely(status)) { 725 - pr_err(" gpio %ld request failed ", kim_gdata->nshutdown); 726 - return status; 727 - } 728 - 729 - /* Configure nShutdown GPIO as output=0 */ 730 - status = gpio_direction_output(kim_gdata->nshutdown, 0); 731 - if (unlikely(status)) { 732 - pr_err(" unable to configure gpio %ld", kim_gdata->nshutdown); 733 - return status; 734 - } 735 734 /* get reference of pdev for request_firmware 736 735 */ 737 736 kim_gdata->kim_pdev = pdev; ··· 753 780 754 781 static int kim_remove(struct platform_device *pdev) 755 782 { 756 - /* free the GPIOs requested */ 757 - struct ti_st_plat_data *pdata = pdev->dev.platform_data; 758 783 struct kim_data_s *kim_gdata; 759 784 760 785 kim_gdata = dev_get_drvdata(&pdev->dev); 761 - 762 - /* Free the Bluetooth/FM/GPIO 763 - * nShutdown gpio from the system 764 - */ 765 - gpio_free(pdata->nshutdown_gpio); 766 - pr_info("nshutdown GPIO Freed"); 767 786 768 787 debugfs_remove_recursive(kim_debugfs_dir); 769 788 sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);