From cba216a6f52cbdaafae75271fcd5aab91c0656af Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Wed, 24 Jun 2015 20:47:04 +0800 Subject: [PATCH] Headset: add parse property "rockchip,headset_wakeup". Signed-off-by: Sugar Zhang --- drivers/headset_observe/rk_headset.c | 3 ++- drivers/headset_observe/rk_headset.h | 1 + drivers/headset_observe/rk_headset_irq_hook_adc.c | 3 ++- drivers/headset_observe/rockchip_headset_core.c | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/headset_observe/rk_headset.c b/drivers/headset_observe/rk_headset.c index 1b8a10f88606..e6b6a289a548 100755 --- a/drivers/headset_observe/rk_headset.c +++ b/drivers/headset_observe/rk_headset.c @@ -445,7 +445,8 @@ int rk_headset_probe(struct platform_device *pdev,struct rk_headset_pdata *pdata ret = request_irq(headset->irq[HEADSET], headset_interrupt, headset->irq_type[HEADSET], "headset_input", NULL); if (ret) goto failed_free_dev; - enable_irq_wake(headset->irq[HEADSET]); + if (pdata->headset_wakeup) + enable_irq_wake(headset->irq[HEADSET]); } else goto failed_free_dev; diff --git a/drivers/headset_observe/rk_headset.h b/drivers/headset_observe/rk_headset.h index f152d5053f67..87ee42d36745 100755 --- a/drivers/headset_observe/rk_headset.h +++ b/drivers/headset_observe/rk_headset.h @@ -21,6 +21,7 @@ struct rk_headset_pdata{ unsigned int main_mic_io_value; #endif struct iio_channel *chan; + int headset_wakeup; }; #define HOOK_KEY_CODE KEY_MEDIA diff --git a/drivers/headset_observe/rk_headset_irq_hook_adc.c b/drivers/headset_observe/rk_headset_irq_hook_adc.c index 4f8d53555f75..8fb3bc4df134 100755 --- a/drivers/headset_observe/rk_headset_irq_hook_adc.c +++ b/drivers/headset_observe/rk_headset_irq_hook_adc.c @@ -470,7 +470,8 @@ int rk_headset_adc_probe(struct platform_device *pdev,struct rk_headset_pdata *p ret = request_threaded_irq(headset->irq[HEADSET], NULL,headset_interrupt, headset->irq_type[HEADSET]|IRQF_NO_SUSPEND, "headset_input", NULL); if (ret) goto failed_free_dev; - enable_irq_wake(headset->irq[HEADSET]); + if (pdata->headset_wakeup) + enable_irq_wake(headset->irq[HEADSET]); } else goto failed_free_dev; diff --git a/drivers/headset_observe/rockchip_headset_core.c b/drivers/headset_observe/rockchip_headset_core.c index 0ec6708ab743..01b7b4e2f1aa 100755 --- a/drivers/headset_observe/rockchip_headset_core.c +++ b/drivers/headset_observe/rockchip_headset_core.c @@ -123,6 +123,10 @@ static int rockchip_headset_probe(struct platform_device *pdev) } #endif + ret = of_property_read_u32(node, "rockchip,headset_wakeup", &pdata->headset_wakeup); + if (ret < 0) + pdata->headset_wakeup = 1; + if(pdata->chan != NULL) {//hook adc mode printk("%s() headset have hook adc mode\n",__FUNCTION__); -- 2.34.1