ASoC: da7219-aad: Fix detection of plugged jack after resume
Subsystems (3)
PATCH 1/1 ASoC: da7219-aad: Fix detection of plugged jack after resume
Don't notify and mark the jack as unplugged during the "set_jack" action, because this action is called very late in during the resume process, forcing the jack to be unplugged after the resume, even if the jack is plugged in. Let's leave the responsibility of managing the insertion of the jack to IRQ.
--- sound/soc/codecs/da7219-aad.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/codecs/da7219-aad.c +0 -4
@@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jacstruct da7219_priv *da7219 =snd_soc_component_get_drvdata (component); da7219->aad->jack = jack; - da7219->aad->jack_inserted = false; - -/* Send an initial empty report */ -snd_soc_jack_report (jack,0 ,DA7219_AAD_REPORT_ALL_MASK );/* Enable/Disable jack detection */ snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1,
Signature · 1 line
2.47.0.277.g8800431eea-goog
Mark Brown
maintainerQuoted 6 lines · Marek Maslanka
Don't notify and mark the jack as unplugged during the "
set_jack" action, because this action is called very late in during the resume process, forcing the jack to be unplugged after the resume, even if the jack is plugged in. Let's leave the responsibility of managing the insertion of the jack to IRQ.
sound/soc/codecs/da7219-aad.c void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac · line 38
Quoted 10 lines
sound/soc/codecs/da7219-aad.c +0
-4@@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jacstruct da7219_priv *da7219 =snd_soc_component_get_drvdata (component); da7219->aad->jack = jack; - da7219->aad->jack_inserted = false; - -/* Send an initial empty report */ -snd_soc_jack_report (jack,0 ,DA7219_AAD_REPORT_ALL_MASK );/* Enable/Disable jack detection */ snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1,
This path is also (AFAICT only?) called when registering the jack by da7219_set_jack(), I'm not immediately seeing the path for resume. This suggests that what's going on here is an issue with the machine driver unregistering the jack over suspend?
Hi Mark,
Quoted 16 lines · Mark Brown
Quoted 14 lines · Marek Maslanka
Don't notify and mark the jack as unplugged during the "
set_jack" action, because this action is called very late in during the resume process, forcing the jack to be unplugged after the resume, even if the jack is plugged in. Let's leave the responsibility of managing the insertion of the jack to IRQ.sound/soc/codecs/da7219-aad.c +0
-4@@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jacstruct da7219_priv *da7219 =snd_soc_component_get_drvdata (component); da7219->aad->jack = jack; - da7219->aad->jack_inserted = false; - -/* Send an initial empty report */ -snd_soc_jack_report (jack,0 ,DA7219_AAD_REPORT_ALL_MASK );
Quoted 7 lines
sound/soc/codecs/da7219-aad.c void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac · line 38
Quoted 2 lines
sound/soc/codecs/da7219-aad.c +0
-0/* Enable/Disable jack detection */ snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1,This path is also (AFAICT only?) called when registering the jack by
da7219_set_jack(), I'm not immediately seeing the path for resume. This suggests that what's going on here is an issue with the machine driver unregistering the jack over suspend?
In my case the da7219_set_jack() is directly called from avs_card_resume_post() (sound/soc/intel/avs/boards/da7219.c) so that could be a problem too.
Mark Brown
maintainerQuoted 9 lines · Marek Maślanka
Quoted 4 lines · Mark Brown
This path is also (AFAICT only?) called when registering the jack by
da7219_set_jack(), I'm not immediately seeing the path for resume. This suggests that what's going on here is an issue with the machine driver unregistering the jack over suspend?In my case the
da7219_set_jack()is directly called fromavs_card_resume_post()(sound/soc/intel/avs/boards/da7219.c) so that could be a problem too.
Right, that's the machine driver unregistering the jack over suspend thing that I mentioned. If there's some problem with the jack detection being left enabled over suspend then that might need to be addressed in the CODEC driver, but probably the machine driver shouldn't be doing what it is.