Skip to content

Commit f27d1ca

Browse files
author
zhangjun
committed
rk_headset: add micbias logic to compatible with es8316
Change-Id: I1aefdf1dc1975a95c2b746d7385c991f99e058bf Signed-off-by: zhangjun <[email protected]>
1 parent 6757922 commit f27d1ca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/headset_observe/rk_headset_irq_hook_adc.c

100755100644
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ extern int rt5631_headset_mic_detect(bool headset_status);
8181
#if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
8282
extern int rt3261_headset_mic_detect(int jack_insert);
8383
#endif
84+
#if defined(CONFIG_SND_SOC_ES8316)
85+
extern int es8316_headset_detect(int jack_insert);
86+
#endif
8487

8588
/* headset private data */
8689
struct headset_priv {
@@ -166,6 +169,11 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id)
166169
DBG("(headset in is %s)headset status is %s\n",
167170
pdata->headset_insert_type?"high level":"low level",
168171
headset_info->headset_status?"in":"out");
172+
173+
#if defined(CONFIG_SND_SOC_ES8316)
174+
es8316_headset_detect(headset_info->headset_status);
175+
#endif
176+
169177
if(headset_info->headset_status == HEADSET_IN)
170178
{
171179
if(pdata->chan != 0)
@@ -189,7 +197,7 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id)
189197
}
190198
else if(headset_info->headset_status == HEADSET_OUT)
191199
{
192-
headset_info->cur_headset_status = ~(BIT_HEADSET|BIT_HEADSET_NO_MIC);
200+
headset_info->cur_headset_status = HEADSET_OUT;
193201
cancel_delayed_work(&headset_info->hook_work);
194202
if(headset_info->isMic)
195203
{
@@ -204,6 +212,7 @@ static irqreturn_t headset_interrupt(int irq, void *dev_id)
204212
#ifdef CONFIG_SND_SOC_RT5631_PHONE
205213
rt5631_headset_mic_detect(false);
206214
#endif
215+
headset_info->isMic = 0;
207216
}
208217

209218
if(pdata->headset_insert_type == HEADSET_IN_HIGH)

0 commit comments

Comments
 (0)