Headset: add parse property "rockchip,headset_wakeup".
authorSugar Zhang <sugar.zhang@rock-chips.com>
Wed, 24 Jun 2015 12:47:04 +0000 (20:47 +0800)
committerSugar Zhang <sugar.zhang@rock-chips.com>
Wed, 24 Jun 2015 12:47:04 +0000 (20:47 +0800)
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
drivers/headset_observe/rk_headset.c
drivers/headset_observe/rk_headset.h
drivers/headset_observe/rk_headset_irq_hook_adc.c
drivers/headset_observe/rockchip_headset_core.c

index 1b8a10f88606535b1da2bbdd115ac455ca05e18f..e6b6a289a548d993d31227cc09a31c565126887d 100755 (executable)
@@ -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;
index f152d5053f67f0d9ae687d191eb96abecd202537..87ee42d36745d14a1ef71ec9de5c88a1a03780d9 100755 (executable)
@@ -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
index 4f8d53555f75634ce8354e6402d1c20c6a642e3d..8fb3bc4df1348a8fc91c16fe5d0e99a6a90efa48 100755 (executable)
@@ -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;
index 0ec6708ab743e64b5dc00c65140cd49d7b6bb0a0..01b7b4e2f1aa22a9c09300eee8d6228e688ba1a0 100755 (executable)
@@ -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__);