@@ -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 )
8282extern 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 */
8689struct 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