From: 邱建斌 Date: Wed, 4 Sep 2013 11:38:11 +0000 (+0800) Subject: headset driver: remove gpio info pdata. X-Git-Tag: firefly_0821_release~6662 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1b863ee7728bded43af18a2a391f1d7f4653398a;p=firefly-linux-kernel-4.4.55.git headset driver: remove gpio info pdata. --- diff --git a/drivers/headset_observe/rk_headset.c b/drivers/headset_observe/rk_headset.c index 8a017e662f14..21cac4ee505a 100755 --- a/drivers/headset_observe/rk_headset.c +++ b/drivers/headset_observe/rk_headset.c @@ -448,9 +448,13 @@ static int rockchip_headsetobserve_probe(struct platform_device *pdev) #endif //------------------------------------------------------------------ if (pdata->Headset_gpio) { - ret = pdata->headset_io_init(pdata->Headset_gpio, pdata->headset_gpio_info.iomux_name, pdata->headset_gpio_info.iomux_mode); + if(pdata->Headset_gpio == NULL){ + dev_err(&pdev->dev,"failed init hook,please full hook_io_init function in board\n"); + goto failed_free_dev; + } + ret = pdata->headset_io_init(pdata->Headset_gpio); if (ret) - goto failed_free; + goto failed_free_dev; headset->irq[HEADSET] = gpio_to_irq(pdata->Headset_gpio); @@ -467,9 +471,13 @@ static int rockchip_headsetobserve_probe(struct platform_device *pdev) goto failed_free_dev; //------------------------------------------------------------------ if (pdata->Hook_gpio) { - ret = pdata->hook_io_init(pdata->Hook_gpio, pdata->hook_gpio_info.iomux_name, pdata->hook_gpio_info.iomux_mode); + if(pdata->hook_io_init == NULL){ + dev_err(&pdev->dev,"failed init hook,please full hook_io_init function in board\n"); + goto failed_free_dev; + } + ret = pdata->hook_io_init(pdata->Hook_gpio); if (ret) - goto failed_free; + goto failed_free_dev; headset->irq[HOOK] = gpio_to_irq(pdata->Hook_gpio); headset->irq_type[HOOK] = pdata->Hook_down_type == HOOK_DOWN_HIGH ? IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING; diff --git a/drivers/headset_observe/rk_headset.h b/drivers/headset_observe/rk_headset.h index 6c5d7a6f1dca..1afd36897779 100755 --- a/drivers/headset_observe/rk_headset.h +++ b/drivers/headset_observe/rk_headset.h @@ -22,11 +22,9 @@ struct rk_headset_pdata{ unsigned int Hook_down_type; //Hook key down status int hook_key_code; unsigned int Headset_gpio;//Detection Headset--Must be set - unsigned int headset_in_type;// Headphones into the state level--Must be set - struct io_info headset_gpio_info; - struct io_info hook_gpio_info; - int (*headset_io_init)(int, char *, int); - int (*hook_io_init)(int, char *, int); + unsigned int headset_in_type;// Headphones into the state level--Must be set + int (*headset_io_init)(int); + int (*hook_io_init)(int); }; #endif