[alsa-devel] [PATCH 1/2] ASoC: nau8810: change input PGA mixer stage
Organize the paths of the mixer, "Input Boost Stage", including the routes of the mixer. The control is not used correctly before. Besides, the driver changes the name of the mixer controls.
Signed-off-by: John Hsu KCHSU0@nuvoton.com --- sound/soc/codecs/nau8810.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index ca2ba1c..bfd74b8 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -373,9 +373,11 @@ static const struct snd_kcontrol_new nau8810_mono_mixer_controls[] = { };
/* PGA Mute */ -static const struct snd_kcontrol_new nau8810_inpga_mute[] = { +static const struct snd_kcontrol_new nau8810_pgaboost_mixer_controls[] = { SOC_DAPM_SINGLE("PGA Mute Switch", NAU8810_REG_PGAGAIN, - NAU8810_PGAMT_SFT, 1, 0), + NAU8810_PGAMT_SFT, 1, 1), + SOC_DAPM_SINGLE("PMIC PGA Switch", NAU8810_REG_ADCBOOST, + NAU8810_PMICBSTGAIN_SFT, 0x7, 0), };
/* Input PGA */ @@ -386,11 +388,6 @@ static const struct snd_kcontrol_new nau8810_inpga[] = { NAU8810_PMICPGA_SFT, 1, 0), };
-/* Mic Input boost vol */ -static const struct snd_kcontrol_new nau8810_mic_boost_controls = - SOC_DAPM_SINGLE("Mic Volume", NAU8810_REG_ADCBOOST, - NAU8810_PMICBSTGAIN_SFT, 0x7, 0); - /* Loopback Switch */ static const struct snd_kcontrol_new nau8810_loopback = SOC_DAPM_SINGLE("Switch", NAU8810_REG_COMP, @@ -429,8 +426,8 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { NAU8810_PGA_EN_SFT, 0, nau8810_inpga, ARRAY_SIZE(nau8810_inpga)), SND_SOC_DAPM_MIXER("Input Boost Stage", NAU8810_REG_POWER2, - NAU8810_BST_EN_SFT, 0, nau8810_inpga_mute, - ARRAY_SIZE(nau8810_inpga_mute)), + NAU8810_BST_EN_SFT, 0, nau8810_pgaboost_mixer_controls, + ARRAY_SIZE(nau8810_pgaboost_mixer_controls)),
SND_SOC_DAPM_SUPPLY("Mic Bias", NAU8810_REG_POWER1, NAU8810_MICBIAS_EN_SFT, 0, NULL, 0), @@ -469,8 +466,8 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = { /* Input Boost Stage */ {"ADC", NULL, "Input Boost Stage"}, {"ADC", NULL, "PLL", check_mclk_select_pll}, - {"Input Boost Stage", NULL, "Input PGA"}, - {"Input Boost Stage", NULL, "MICP"}, + {"Input Boost Stage", "PGA Mute Switch", "Input PGA"}, + {"Input Boost Stage", "PMIC PGA Switch", "MICP"},
/* Input PGA */ {"Input PGA", NULL, "Mic Bias"},
The MICBAIS will not supply if there is only one path from MICP to input boost stage. The driver fixes the issue by changing the supply target to input boost stage mixer.
Signed-off-by: John Hsu KCHSU0@nuvoton.com --- sound/soc/codecs/nau8810.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index bfd74b8..988bd18 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -468,9 +468,9 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = { {"ADC", NULL, "PLL", check_mclk_select_pll}, {"Input Boost Stage", "PGA Mute Switch", "Input PGA"}, {"Input Boost Stage", "PMIC PGA Switch", "MICP"}, + {"Input Boost Stage", NULL, "Mic Bias"},
/* Input PGA */ - {"Input PGA", NULL, "Mic Bias"}, {"Input PGA", "MicN Switch", "MICN"}, {"Input PGA", "MicP Switch", "MICP"},
On Thu, May 03, 2018 at 10:46:42AM +0800, John Hsu wrote:
The MICBAIS will not supply if there is only one path from MICP to input boost stage. The driver fixes the issue by changing the supply target to input boost stage mixer.
Does the input boost stage actually use the MICBIAS supply directly? More usually a microphone bias would supply the microphone rather than anything on the chip itself.
On 5/4/2018 7:10 AM, Mark Brown wrote:
On Thu, May 03, 2018 at 10:46:42AM +0800, John Hsu wrote:
The MICBAIS will not supply if there is only one path from MICP to input boost stage. The driver fixes the issue by changing the supply target to input boost stage mixer.
Does the input boost stage actually use the MICBIAS supply directly? More usually a microphone bias would supply the microphone rather than anything on the chip itself.
The input boost stage has a mixer of two input sources. The normal case is that MIC goes to input PGA, then to input boot stage. The case is the original design of the driver. But there is another path that MIC goes input boot stage directly. The case is less happened but has chance. Ex. The single-end MIC goes to input boot stage. Therefore, we move the target of MICBIAS to input boost stage which can supply power for both cases.
=========================================================================================== The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
On Fri, May 04, 2018 at 09:10:32AM +0800, John Hsu wrote:
On 5/4/2018 7:10 AM, Mark Brown wrote:
On Thu, May 03, 2018 at 10:46:42AM +0800, John Hsu wrote:
The MICBAIS will not supply if there is only one path from MICP to input boost stage. The driver fixes the issue by changing the supply target to input boost stage mixer.
Does the input boost stage actually use the MICBIAS supply directly? More usually a microphone bias would supply the microphone rather than anything on the chip itself.
The input boost stage has a mixer of two input sources. The normal case is that MIC goes to input PGA, then to input boot stage. The case is the original design of the driver. But there is another path that MIC goes input boot stage directly. The case is less happened but has chance. Ex. The single-end MIC goes to input boot stage. Therefore, we move the target of MICBIAS to input boost stage which can supply power for both cases.
That's not really answering the question - the issue is that the micbias is normally connected to the microphone and supplies that, it's not normally connected to anything in the CODEC itself. You're talking about the path for the signal from the microphone which isn't the same thing as the power to the microphone. The system could have external micbiases or use the input for something that isn't actually a microphone for example.
On 5/5/2018 9:01 AM, Mark Brown wrote:
On Fri, May 04, 2018 at 09:10:32AM +0800, John Hsu wrote:
On 5/4/2018 7:10 AM, Mark Brown wrote:
On Thu, May 03, 2018 at 10:46:42AM +0800, John Hsu wrote:
The MICBAIS will not supply if there is only one path from MICP to input boost stage. The driver fixes the issue by changing the supply target to input boost stage mixer.
Does the input boost stage actually use the MICBIAS supply directly? More usually a microphone bias would supply the microphone rather than anything on the chip itself.
The input boost stage has a mixer of two input sources. The normal case is that MIC goes to input PGA, then to input boot stage. The case is the original design of the driver. But there is another path that MIC goes input boot stage directly. The case is less happened but has chance. Ex. The single-end MIC goes to input boot stage. Therefore, we move the target of MICBIAS to input boost stage which can supply power for both cases.
That's not really answering the question - the issue is that the micbias is normally connected to the microphone and supplies that, it's not normally connected to anything in the CODEC itself. You're talking about the path for the signal from the microphone which isn't the same thing as the power to the microphone. The system could have external micbiases or use the input for something that isn't actually a microphone for example.
Yes, you are right. In the driver, we suppose that the input of codec is microphone always. Therefore, we make the micbias on to provide the power of microphone automatically if any input path is enabled. What advice do you have to deal with micbias? Thank you.
=========================================================================================== The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
On Mon, May 07, 2018 at 02:57:28PM +0800, John Hsu wrote:
Yes, you are right. In the driver, we suppose that the input of codec is microphone always. Therefore, we make the micbias on to provide the power of microphone automatically if any input path is enabled. What advice do you have to deal with micbias? Thank you.
Like I say you should just provide the MICBIAS pin and leave it up to the machine drivers to connect it to whatever microphones it is being used with. This means deleting the route from the driver and (in order to avoid breaking them) adding the relevant route to any machine drivers that are in mainline already.
The patch
ASoC: nau8810: change input PGA mixer stage
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
From a7ea9385d41716f8dd5f69b4a5deaf836d67d968 Mon Sep 17 00:00:00 2001
From: John Hsu KCHSU0@nuvoton.com Date: Thu, 3 May 2018 10:46:41 +0800 Subject: [PATCH] ASoC: nau8810: change input PGA mixer stage
Organize the paths of the mixer, "Input Boost Stage", including the routes of the mixer. The control is not used correctly before. Besides, the driver changes the name of the mixer controls.
Signed-off-by: John Hsu KCHSU0@nuvoton.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/nau8810.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index ca2ba1c7bb9a..bfd74b86c9d2 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -373,9 +373,11 @@ static const struct snd_kcontrol_new nau8810_mono_mixer_controls[] = { };
/* PGA Mute */ -static const struct snd_kcontrol_new nau8810_inpga_mute[] = { +static const struct snd_kcontrol_new nau8810_pgaboost_mixer_controls[] = { SOC_DAPM_SINGLE("PGA Mute Switch", NAU8810_REG_PGAGAIN, - NAU8810_PGAMT_SFT, 1, 0), + NAU8810_PGAMT_SFT, 1, 1), + SOC_DAPM_SINGLE("PMIC PGA Switch", NAU8810_REG_ADCBOOST, + NAU8810_PMICBSTGAIN_SFT, 0x7, 0), };
/* Input PGA */ @@ -386,11 +388,6 @@ static const struct snd_kcontrol_new nau8810_inpga[] = { NAU8810_PMICPGA_SFT, 1, 0), };
-/* Mic Input boost vol */ -static const struct snd_kcontrol_new nau8810_mic_boost_controls = - SOC_DAPM_SINGLE("Mic Volume", NAU8810_REG_ADCBOOST, - NAU8810_PMICBSTGAIN_SFT, 0x7, 0); - /* Loopback Switch */ static const struct snd_kcontrol_new nau8810_loopback = SOC_DAPM_SINGLE("Switch", NAU8810_REG_COMP, @@ -429,8 +426,8 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { NAU8810_PGA_EN_SFT, 0, nau8810_inpga, ARRAY_SIZE(nau8810_inpga)), SND_SOC_DAPM_MIXER("Input Boost Stage", NAU8810_REG_POWER2, - NAU8810_BST_EN_SFT, 0, nau8810_inpga_mute, - ARRAY_SIZE(nau8810_inpga_mute)), + NAU8810_BST_EN_SFT, 0, nau8810_pgaboost_mixer_controls, + ARRAY_SIZE(nau8810_pgaboost_mixer_controls)),
SND_SOC_DAPM_SUPPLY("Mic Bias", NAU8810_REG_POWER1, NAU8810_MICBIAS_EN_SFT, 0, NULL, 0), @@ -469,8 +466,8 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = { /* Input Boost Stage */ {"ADC", NULL, "Input Boost Stage"}, {"ADC", NULL, "PLL", check_mclk_select_pll}, - {"Input Boost Stage", NULL, "Input PGA"}, - {"Input Boost Stage", NULL, "MICP"}, + {"Input Boost Stage", "PGA Mute Switch", "Input PGA"}, + {"Input Boost Stage", "PMIC PGA Switch", "MICP"},
/* Input PGA */ {"Input PGA", NULL, "Mic Bias"},
participants (2)
-
John Hsu
-
Mark Brown