linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
@ 2022-01-31 20:32 V sujith kumar Reddy
  2022-02-01 18:56 ` Mark Brown
  2022-02-03 12:52 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: V sujith kumar Reddy @ 2022-01-31 20:32 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	ajitkumar.pandey, V sujith kumar Reddy, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Ajit Kumar Pandey, open list

Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio
hence remove such gpio access control from machine driver to avoid conflict

Signed-off-by: V sujith kumar Reddy <vsujithkumar.reddy@amd.com>
---
 sound/soc/amd/acp/acp-mach.h     | 1 -
 sound/soc/amd/acp/acp-sof-mach.c | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h
index fd6299844ebe..c855f50d6b34 100644
--- a/sound/soc/amd/acp/acp-mach.h
+++ b/sound/soc/amd/acp/acp-mach.h
@@ -21,7 +21,6 @@
 #include <linux/gpio/consumer.h>
 
 #define EN_SPKR_GPIO_GB                0x11F
-#define EN_SPKR_GPIO_NK                0x146
 #define EN_SPKR_GPIO_NONE      -EINVAL
 
 enum be_id {
diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c
index c1d9650fc222..3346677949e3 100644
--- a/sound/soc/amd/acp/acp-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sof-mach.c
@@ -37,7 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
 	.hs_codec_id = RT5682,
 	.amp_codec_id = MAX98360A,
 	.dmic_codec_id = DMIC,
-	.gpio_spkr_en = EN_SPKR_GPIO_NK,
+	.gpio_spkr_en = EN_SPKR_GPIO_NONE,
 };
 
 static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
@@ -56,7 +56,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
 	.hs_codec_id = RT5682S,
 	.amp_codec_id = MAX98360A,
 	.dmic_codec_id = DMIC,
-	.gpio_spkr_en = EN_SPKR_GPIO_NK,
+	.gpio_spkr_en = EN_SPKR_GPIO_NONE,
 };
 
 static const struct snd_kcontrol_new acp_controls[] = {
-- 
2.25.1


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

* Re: [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
  2022-01-31 20:32 [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver V sujith kumar Reddy
@ 2022-02-01 18:56 ` Mark Brown
  2022-02-01 21:43   ` Curtis Malainey
  2022-02-03 12:52 ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-02-01 18:56 UTC (permalink / raw)
  To: V sujith kumar Reddy
  Cc: alsa-devel, Vijendar.Mukunda, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, ajitkumar.pandey, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, open list, Curtis Malainey

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

On Tue, Feb 01, 2022 at 02:02:15AM +0530, V sujith kumar Reddy wrote:

> Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio
> hence remove such gpio access control from machine driver to avoid conflict


> -	.gpio_spkr_en = EN_SPKR_GPIO_NK,
> +	.gpio_spkr_en = EN_SPKR_GPIO_NONE,
>  };
>  
>  static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
> @@ -56,7 +56,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
>  	.hs_codec_id = RT5682S,
>  	.amp_codec_id = MAX98360A,
>  	.dmic_codec_id = DMIC,
> -	.gpio_spkr_en = EN_SPKR_GPIO_NK,
> +	.gpio_spkr_en = EN_SPKR_GPIO_NONE,
>  };

This looks like a good fix for the immediate issue which fixes the
MAX9360A systems without breaking the RT1019 ones, however as I said in
the thread about Curtis' revert it's not clear what the ideal thing is
here.  There's no documentation about the RT1019 that I can find so it's
not clear to me what exactly the GPIO is controlling, if it's part of
the RT1019 or something else.  That influences where the most tasteful
place to control this GPIO is.  Curtis noted that the RT1019 driver
includes gpiolib headers but that could just as easily be cut'n'paste as
intentional.  What's the story here?

I do also note that the current code just turns the GPIO on and leaves
it on which presumably isn't great from a power management point of
view.

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

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

* Re: [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
  2022-02-01 18:56 ` Mark Brown
@ 2022-02-01 21:43   ` Curtis Malainey
  2022-02-02 13:25     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Curtis Malainey @ 2022-02-01 21:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: V sujith kumar Reddy, ALSA development, Vijendar.Mukunda,
	Hiregoudar, Basavaraj, Dommati, Sunil-kumar, Pandey, Ajit Kumar,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, open list

On Tue, Feb 1, 2022 at 10:56 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Feb 01, 2022 at 02:02:15AM +0530, V sujith kumar Reddy wrote:
>
> > Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio
> > hence remove such gpio access control from machine driver to avoid conflict
>
>
> > -     .gpio_spkr_en = EN_SPKR_GPIO_NK,
> > +     .gpio_spkr_en = EN_SPKR_GPIO_NONE,
> >  };
> >
> >  static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
> > @@ -56,7 +56,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
> >       .hs_codec_id = RT5682S,
> >       .amp_codec_id = MAX98360A,
> >       .dmic_codec_id = DMIC,
> > -     .gpio_spkr_en = EN_SPKR_GPIO_NK,
> > +     .gpio_spkr_en = EN_SPKR_GPIO_NONE,
> >  };
>
> This looks like a good fix for the immediate issue which fixes the
> MAX9360A systems without breaking the RT1019 ones, however as I said in
> the thread about Curtis' revert it's not clear what the ideal thing is
> here.  There's no documentation about the RT1019 that I can find so it's
> not clear to me what exactly the GPIO is controlling, if it's part of
> the RT1019 or something else.  That influences where the most tasteful
> place to control this GPIO is.  Curtis noted that the RT1019 driver
> includes gpiolib headers but that could just as easily be cut'n'paste as
> intentional.  What's the story here?
>
> I do also note that the current code just turns the GPIO on and leaves
> it on which presumably isn't great from a power management point of
> view.

Yes that is correct, this is the quick fix that will alleviate the
gpio contention issue. But I think there is a better solution here.
According to the sheet I have, the pin for the alc1019 is the same as
the max98357a and its a shutdown pin for the amp.

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

* Re: [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
  2022-02-01 21:43   ` Curtis Malainey
@ 2022-02-02 13:25     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-02-02 13:25 UTC (permalink / raw)
  To: Curtis Malainey
  Cc: V sujith kumar Reddy, ALSA development, Vijendar.Mukunda,
	Hiregoudar, Basavaraj, Dommati, Sunil-kumar, Pandey, Ajit Kumar,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, open list

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

On Tue, Feb 01, 2022 at 01:43:38PM -0800, Curtis Malainey wrote:

> Yes that is correct, this is the quick fix that will alleviate the
> gpio contention issue. But I think there is a better solution here.
> According to the sheet I have, the pin for the alc1019 is the same as
> the max98357a and its a shutdown pin for the amp.

OK, that sounds like it should be added to the driver then.

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

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

* Re: [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
  2022-01-31 20:32 [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver V sujith kumar Reddy
  2022-02-01 18:56 ` Mark Brown
@ 2022-02-03 12:52 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-02-03 12:52 UTC (permalink / raw)
  To: V sujith kumar Reddy, alsa-devel
  Cc: ajitkumar.pandey, Vijendar.Mukunda, Liam Girdwood, open list,
	Ajit Kumar Pandey, Takashi Iwai, Basavaraj.Hiregoudar,
	Jaroslav Kysela, Sunil-kumar.Dommati

On Tue, 1 Feb 2022 02:02:15 +0530, V sujith kumar Reddy wrote:
> Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio
> hence remove such gpio access control from machine driver to avoid conflict
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-linus

Thanks!

[1/1] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
      commit: 7fa5c33d043160eba3be9fb8e21588dff2a467c7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2022-02-03 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 20:32 [PATCH] ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver V sujith kumar Reddy
2022-02-01 18:56 ` Mark Brown
2022-02-01 21:43   ` Curtis Malainey
2022-02-02 13:25     ` Mark Brown
2022-02-03 12:52 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).