mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Headset: add parse property "rockchip,headset_wakeup".
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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__);
|
||||
|
||||
Reference in New Issue
Block a user