Skip to content

Commit eccf297

Browse files
Pavan Savoygregkh
authored andcommitted
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>
1 parent 4eb64ee commit eccf297

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

drivers/misc/ti-st/st_kim.c

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,6 @@ long st_kim_start(void *kim_data)
454454
if (pdata->chip_enable)
455455
pdata->chip_enable(kim_gdata);
456456

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);
462457
/* re-initialize the completion */
463458
INIT_COMPLETION(kim_gdata->ldisc_installed);
464459
/* send notification to UIM */
@@ -500,8 +495,7 @@ long st_kim_start(void *kim_data)
500495
* (b) upon failure to either install ldisc or download firmware.
501496
* The function is responsible to (a) notify UIM about un-installation,
502497
* (b) flush UART if the ldisc was installed.
503-
* (c) reset BT_EN - pull down nshutdown at the end.
504-
* (d) invoke platform's chip disabling routine.
498+
* (c) invoke platform's chip disabling routine.
505499
*/
506500
long st_kim_stop(void *kim_data)
507501
{
@@ -533,13 +527,6 @@ long st_kim_stop(void *kim_data)
533527
return -ETIMEDOUT;
534528
}
535529

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-
543530
/* platform specific disable */
544531
if (pdata->chip_disable)
545532
pdata->chip_disable(kim_gdata);
@@ -731,20 +718,6 @@ static int kim_probe(struct platform_device *pdev)
731718
/* refer to itself */
732719
kim_gdata->core_data->kim_data = kim_gdata;
733720

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-
}
748721
/* get reference of pdev for request_firmware
749722
*/
750723
kim_gdata->kim_pdev = pdev;
@@ -780,18 +753,10 @@ static int kim_probe(struct platform_device *pdev)
780753

781754
static int kim_remove(struct platform_device *pdev)
782755
{
783-
/* free the GPIOs requested */
784-
struct ti_st_plat_data *pdata = pdev->dev.platform_data;
785756
struct kim_data_s *kim_gdata;
786757

787758
kim_gdata = dev_get_drvdata(&pdev->dev);
788759

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-
795760
debugfs_remove_recursive(kim_debugfs_dir);
796761
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
797762
pr_info("sysfs entries removed");

0 commit comments

Comments
 (0)