mirror of https://gitee.com/openkylin/linux.git
MISC driver fix for 3.8-rc4
Here is a single revert for the ti-st misc driver, fixing problem that was introduced in 3.7-rc1 that has been bothering people. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAlEAdxcACgkQMUfUDdst+ynQOgCgmsqcz6DaKFQpcMNKEl/6GWz2 KA4AoNYW3uSDQn1TUbuKmoJSN/SYALK4 =xqHP -----END PGP SIGNATURE----- Merge tag 'char-misc-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull drivers/misc fix from Greg Kroah-Hartman: "Here is a single revert for the ti-st misc driver, fixing problem that was introduced in 3.7-rc1 that has been bothering people." * tag 'char-misc-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Revert "drivers/misc/ti-st: remove gpio handling"
This commit is contained in:
commit
ae763db4ce
|
@ -468,6 +468,11 @@ long st_kim_start(void *kim_data)
|
||||||
if (pdata->chip_enable)
|
if (pdata->chip_enable)
|
||||||
pdata->chip_enable(kim_gdata);
|
pdata->chip_enable(kim_gdata);
|
||||||
|
|
||||||
|
/* Configure BT nShutdown to HIGH state */
|
||||||
|
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
|
||||||
|
mdelay(5); /* FIXME: a proper toggle */
|
||||||
|
gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
|
||||||
|
mdelay(100);
|
||||||
/* re-initialize the completion */
|
/* re-initialize the completion */
|
||||||
INIT_COMPLETION(kim_gdata->ldisc_installed);
|
INIT_COMPLETION(kim_gdata->ldisc_installed);
|
||||||
/* send notification to UIM */
|
/* send notification to UIM */
|
||||||
|
@ -509,7 +514,8 @@ long st_kim_start(void *kim_data)
|
||||||
* (b) upon failure to either install ldisc or download firmware.
|
* (b) upon failure to either install ldisc or download firmware.
|
||||||
* The function is responsible to (a) notify UIM about un-installation,
|
* The function is responsible to (a) notify UIM about un-installation,
|
||||||
* (b) flush UART if the ldisc was installed.
|
* (b) flush UART if the ldisc was installed.
|
||||||
* (c) invoke platform's chip disabling routine.
|
* (c) reset BT_EN - pull down nshutdown at the end.
|
||||||
|
* (d) invoke platform's chip disabling routine.
|
||||||
*/
|
*/
|
||||||
long st_kim_stop(void *kim_data)
|
long st_kim_stop(void *kim_data)
|
||||||
{
|
{
|
||||||
|
@ -541,6 +547,13 @@ long st_kim_stop(void *kim_data)
|
||||||
err = -ETIMEDOUT;
|
err = -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* By default configure BT nShutdown to LOW state */
|
||||||
|
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
|
||||||
|
mdelay(1);
|
||||||
|
gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
|
||||||
|
mdelay(1);
|
||||||
|
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
|
||||||
|
|
||||||
/* platform specific disable */
|
/* platform specific disable */
|
||||||
if (pdata->chip_disable)
|
if (pdata->chip_disable)
|
||||||
pdata->chip_disable(kim_gdata);
|
pdata->chip_disable(kim_gdata);
|
||||||
|
@ -733,6 +746,20 @@ static int kim_probe(struct platform_device *pdev)
|
||||||
/* refer to itself */
|
/* refer to itself */
|
||||||
kim_gdata->core_data->kim_data = kim_gdata;
|
kim_gdata->core_data->kim_data = kim_gdata;
|
||||||
|
|
||||||
|
/* Claim the chip enable nShutdown gpio from the system */
|
||||||
|
kim_gdata->nshutdown = pdata->nshutdown_gpio;
|
||||||
|
err = gpio_request(kim_gdata->nshutdown, "kim");
|
||||||
|
if (unlikely(err)) {
|
||||||
|
pr_err(" gpio %ld request failed ", kim_gdata->nshutdown);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Configure nShutdown GPIO as output=0 */
|
||||||
|
err = gpio_direction_output(kim_gdata->nshutdown, 0);
|
||||||
|
if (unlikely(err)) {
|
||||||
|
pr_err(" unable to configure gpio %ld", kim_gdata->nshutdown);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
/* get reference of pdev for request_firmware
|
/* get reference of pdev for request_firmware
|
||||||
*/
|
*/
|
||||||
kim_gdata->kim_pdev = pdev;
|
kim_gdata->kim_pdev = pdev;
|
||||||
|
@ -779,10 +806,18 @@ static int kim_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
static int kim_remove(struct platform_device *pdev)
|
static int kim_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
/* free the GPIOs requested */
|
||||||
|
struct ti_st_plat_data *pdata = pdev->dev.platform_data;
|
||||||
struct kim_data_s *kim_gdata;
|
struct kim_data_s *kim_gdata;
|
||||||
|
|
||||||
kim_gdata = dev_get_drvdata(&pdev->dev);
|
kim_gdata = dev_get_drvdata(&pdev->dev);
|
||||||
|
|
||||||
|
/* Free the Bluetooth/FM/GPIO
|
||||||
|
* nShutdown gpio from the system
|
||||||
|
*/
|
||||||
|
gpio_free(pdata->nshutdown_gpio);
|
||||||
|
pr_info("nshutdown GPIO Freed");
|
||||||
|
|
||||||
debugfs_remove_recursive(kim_debugfs_dir);
|
debugfs_remove_recursive(kim_debugfs_dir);
|
||||||
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
|
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
|
||||||
pr_info("sysfs entries removed");
|
pr_info("sysfs entries removed");
|
||||||
|
|
Loading…
Reference in New Issue