ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
Subsystems (3)
PATCH 1/1 ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
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
--- sound/soc/amd/acp/acp-mach.h | 1 - sound/soc/amd/acp/acp-sof-mach.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
sound/soc/amd/acp/acp-mach.h +0 -1
@@ -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 -EINVALenum be_id {
sound/soc/amd/acp/acp-sof-mach.c +2 -2
@@ -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[] = {
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 10 lines · V sujith kumar Reddy
Maxim codec driver already enabling/disabling
spk_en_gpioin form ofsd_modegpio hence remove such gpio access control from machine driver to avoid conflictsound/soc/amd/acp/acp-sof-mach.c +1
-1- .gpio_spkr_en = EN_SPKR_GPIO_NK, + .gpio_spkr_en = EN_SPKR_GPIO_NONE, };static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
sound/soc/amd/acp/acp-sof-mach.c static struct acp_card_drvdata sof_rt5682s_max_data = { · line 60
Quoted 6 lines
sound/soc/amd/acp/acp-sof-mach.c +1
-1@@ -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.
Quoted 30 lines · Mark Brown
Quoted 10 lines · V sujith kumar Reddy
Maxim codec driver already enabling/disabling
spk_en_gpioin form ofsd_modegpio hence remove such gpio access control from machine driver to avoid conflictsound/soc/amd/acp/acp-sof-mach.c +1
-1- .gpio_spkr_en = EN_SPKR_GPIO_NK, + .gpio_spkr_en = EN_SPKR_GPIO_NONE, };static struct acp_card_drvdata sof_rt5682s_rt1019_data = {sound/soc/amd/acp/acp-sof-mach.c static struct acp_card_drvdata sof_rt5682s_max_data = { · line 60
Quoted 6 lines
sound/soc/amd/acp/acp-sof-mach.c +1
-1@@ -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?
Quoted 3 lines
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.
Mark Brown
maintainerQuoted 4 lines · Curtis Malainey
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.
Mark Brown
maintainerQuoted 4 lines · V sujith kumar Reddy
Maxim codec driver already enabling/disabling
spk_en_gpioin form ofsd_modegpio 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