Headset: add parse property "rockchip,headset_wakeup".

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
Sugar Zhang
2015-06-24 20:47:04 +08:00
parent c2b8fe475f
commit cba216a6f5
4 changed files with 9 additions and 2 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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__);