public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume
@ 2024-11-12  7:40 Marek Maslanka
  2024-11-12 13:16 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Maslanka @ 2024-11-12  7:40 UTC (permalink / raw)
  To: LKML
  Cc: Marek Maslanka, Support Opensource, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, linux-sound

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.

Signed-off-by: Marek Maslanka <mmaslanka@google.com>
---
 sound/soc/codecs/da7219-aad.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
index 15e5e3eb592b3..2745b55fba662 100644
--- a/sound/soc/codecs/da7219-aad.c
+++ b/sound/soc/codecs/da7219-aad.c
@@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac
 	struct 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,
-- 
2.47.0.277.g8800431eea-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume
  2024-11-12  7:40 [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume Marek Maslanka
@ 2024-11-12 13:16 ` Mark Brown
  2024-11-12 14:11   ` Marek Maślanka
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2024-11-12 13:16 UTC (permalink / raw)
  To: Marek Maslanka
  Cc: LKML, Support Opensource, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, linux-sound

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Tue, Nov 12, 2024 at 07:40:47AM +0000, Marek Maslanka wrote:
> 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.

> @@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac
>  	struct 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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume
  2024-11-12 13:16 ` Mark Brown
@ 2024-11-12 14:11   ` Marek Maślanka
  2024-11-12 14:46     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Maślanka @ 2024-11-12 14:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: LKML, Support Opensource, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, linux-sound

Hi Mark,

On Tue, Nov 12, 2024 at 2:16 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Nov 12, 2024 at 07:40:47AM +0000, Marek Maslanka wrote:
> > 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.
>
> > @@ -33,10 +33,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac
> >       struct 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?

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume
  2024-11-12 14:11   ` Marek Maślanka
@ 2024-11-12 14:46     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-11-12 14:46 UTC (permalink / raw)
  To: Marek Maślanka
  Cc: LKML, Support Opensource, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, linux-sound

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Tue, Nov 12, 2024 at 03:11:07PM +0100, Marek Maślanka wrote:
> On Tue, Nov 12, 2024 at 2:16 PM Mark Brown <broonie@kernel.org> wrote:

> > 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.

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.  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-12 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12  7:40 [PATCH] ASoC: da7219-aad: Fix detection of plugged jack after resume Marek Maslanka
2024-11-12 13:16 ` Mark Brown
2024-11-12 14:11   ` Marek Maślanka
2024-11-12 14:46     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox