diff options
author | zhangjun <zhangjun@rock-chips.com> | 2016-10-09 19:54:43 +0800 |
---|---|---|
committer | zhangjun <zhangjun@rock-chips.com> | 2016-10-11 10:30:23 +0800 |
commit | f27d1ca8e35893191bb344bb461d9f5f20be5ae7 (patch) | |
tree | 9577ecf1fe6468832414c355a1b1080cd774188c /drivers/headset_observe | |
parent | 675792285ea266455283e87b538ded71ea72b36a (diff) |
rk_headset: add micbias logic to compatible with es8316
Change-Id: I1aefdf1dc1975a95c2b746d7385c991f99e058bf
Signed-off-by: zhangjun <zhangjun@rock-chips.com>
Diffstat (limited to 'drivers/headset_observe')
-rw-r--r--[-rwxr-xr-x] | drivers/headset_observe/rk_headset_irq_hook_adc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/headset_observe/rk_headset_irq_hook_adc.c b/drivers/headset_observe/rk_headset_irq_hook_adc.c index 8fb3bc4df134..7c8b413c8cd6 100755..100644 --- a/drivers/headset_observe/rk_headset_irq_hook_adc.c +++ b/drivers/headset_observe/rk_headset_irq_hook_adc.c @@ -81,6 +81,9 @@ extern int rt5631_headset_mic_detect(bool headset_status); #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224) extern int rt3261_headset_mic_detect(int jack_insert); #endif +#if defined(CONFIG_SND_SOC_ES8316) +extern int es8316_headset_detect(int jack_insert); +#endif /* headset private data */ struct headset_priv { @@ -166,6 +169,11 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id) DBG("(headset in is %s)headset status is %s\n", pdata->headset_insert_type?"high level":"low level", headset_info->headset_status?"in":"out"); + + #if defined(CONFIG_SND_SOC_ES8316) + es8316_headset_detect(headset_info->headset_status); + #endif + if(headset_info->headset_status == HEADSET_IN) { if(pdata->chan != 0) @@ -189,7 +197,7 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id) } else if(headset_info->headset_status == HEADSET_OUT) { - headset_info->cur_headset_status = ~(BIT_HEADSET|BIT_HEADSET_NO_MIC); + headset_info->cur_headset_status = HEADSET_OUT; cancel_delayed_work(&headset_info->hook_work); if(headset_info->isMic) { @@ -204,6 +212,7 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id) #ifdef CONFIG_SND_SOC_RT5631_PHONE rt5631_headset_mic_detect(false); #endif + headset_info->isMic = 0; } if(pdata->headset_insert_type == HEADSET_IN_HIGH) |