[alsa-devel] [PATCH v2 0/6] ARM/ASoC: omap: n810 audio support
Hi,
Changes since v1: - Fixed up the aic33 dts patch with missing entries needed for capture - Added comment and new widget for the non working HS Mic
The verification of the sdma-pcm on OMAP2 got delayed by non working audio on n810.
With the following patches audio works on n810 (both with the old omap-pcm and the new sdma-pcm).
I believe the DTS and ASoC patches are fine to go via different tree, but I wanted to keep the patches together for easier testing.
The series does not have any dependencies, I will rebase the sdma-pcm series on top of this and resend.
Playback to Speaker, Headset is working. Capture from DMIC is working. Capture from HS mic is not working due to missing mic bias (from Retu/Vilma).
Regards, Peter --- Jarkko Nikula (1): ASoC: omap: Remove OMAP_MUX dependency from Nokia N810 audio support
Peter Ujfalusi (5): ARM: dts: omap2420-n810: Enable McBSP2 for audio ARM: dts: omap2420-n810: Correct the audio codec (tlv320aic33) node ASoC: omap: n810: Correct the card level dapm_route ASoC: omap: n810: Correct the cpu_dai, platform and codec name ASoC: omap: n810: HS mic is not working, add a widget for it with comment
arch/arm/boot/dts/omap2420-n810.dts | 63 ++++++++++++++++++++++++++++- sound/soc/omap/Kconfig | 1 - sound/soc/omap/n810.c | 21 ++++++---- 3 files changed, 75 insertions(+), 10 deletions(-)
McBSP2 is used with the tlv320aic33 codec for audio. Pin mux change is needed to get the needed signals in/out from the SoC.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Tested-by: Jarkko Nikula jarkko.nikula@bitmer.com --- arch/arm/boot/dts/omap2420-n810.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/arch/arm/boot/dts/omap2420-n810.dts b/arch/arm/boot/dts/omap2420-n810.dts index 7c485fbfa535..4c412a480c3e 100644 --- a/arch/arm/boot/dts/omap2420-n810.dts +++ b/arch/arm/boot/dts/omap2420-n810.dts @@ -8,9 +8,26 @@ compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; };
+&omap2420_pmx { + mcbsp2_pins: mcbsp2_pins { + pinctrl-single,pins = < + OMAP2420_CORE_IOPAD(0x0124, PIN_INPUT | MUX_MODE1) /* eac_ac_sclk.mcbsp2_clkx */ + OMAP2420_CORE_IOPAD(0x0125, PIN_INPUT | MUX_MODE1) /* eac_ac_fs.mcbsp2_fsx */ + OMAP2420_CORE_IOPAD(0x0126, PIN_INPUT | MUX_MODE1) /* eac_ac_din.mcbsp2_dr */ + OMAP2420_CORE_IOPAD(0x0127, PIN_OUTPUT | MUX_MODE1) /* eac_ac_dout.mcbsp2_dx */ + >; + }; +}; + &i2c2 { aic3x@18 { compatible = "tlv320aic3x"; reg = <0x18>; }; }; +&mcbsp2 { + pinctrl-names = "default"; + pinctrl-0 = <&mcbsp2_pins>; + + status = "okay"; +};
* Peter Ujfalusi peter.ujfalusi@ti.com [180427 08:18]:
McBSP2 is used with the tlv320aic33 codec for audio. Pin mux change is needed to get the needed signals in/out from the SoC.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Tested-by: Jarkko Nikula jarkko.nikula@bitmer.com
Thanks applying patches 1 and 2 of this series into omap-for-v4.18/dt.
Regards,
Tony
- The n810 uses tlv320aic33 codec. - GPIO118 is used as reset GPIO for the codec, which was missing. - The MCLK of the codec is connected to the SYS_CLKOUT2 of omap2420. The SYS_CLKOUT2 needs to be running at 12MHz. - Add the pinctrl entries to configure the pins for GPIO118 and SYS_CLKOUT2 - Set DMIC clk mode for GPIO1 - Set DMIC data in for GPIO2 - Select 2V for the DMIC bias - Add fixed regulators for the codec
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- arch/arm/boot/dts/omap2420-n810.dts | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/omap2420-n810.dts b/arch/arm/boot/dts/omap2420-n810.dts index 4c412a480c3e..96b9913ecc1f 100644 --- a/arch/arm/boot/dts/omap2420-n810.dts +++ b/arch/arm/boot/dts/omap2420-n810.dts @@ -6,6 +6,20 @@ / { model = "Nokia N810"; compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2"; + + vio_ape: vio_ape { + compatible = "regulator-fixed"; + regulator-name = "vio_ape"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + v28_aic: v28_aic { + compatible = "regulator-fixed"; + regulator-name = "v28_aic"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; };
&omap2420_pmx { @@ -17,14 +31,42 @@ OMAP2420_CORE_IOPAD(0x0127, PIN_OUTPUT | MUX_MODE1) /* eac_ac_dout.mcbsp2_dx */ >; }; + + aic33_pins: aic33_pins { + pinctrl-single,pins = < + OMAP2420_CORE_IOPAD(0x0129, PIN_OUTPUT | MUX_MODE3) /* eac_ac_rst.gpio118 */ + OMAP2420_CORE_IOPAD(0x00e8, PIN_OUTPUT | MUX_MODE2) /* vlynq_tx1.sys_clkout2 */ + >; + }; };
&i2c2 { - aic3x@18 { - compatible = "tlv320aic3x"; + aic33@18 { + compatible = "ti,tlv320aic33"; reg = <0x18>; + + pinctrl-names = "default"; + pinctrl-0 = <&aic33_pins>; + + gpio-reset = <&gpio4 22 GPIO_ACTIVE_LOW>; /* gpio118 */ + + ai3x-gpio-func = < + 10 /* AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK */ + 5 /* AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT */ + >; + ai3x-micbias-vg = <1>; /* 2V */ + + AVDD-supply = <&v28_aic>; + DRVDD-supply = <&v28_aic>; + IOVDD-supply = <&vio_ape>; + DVDD-supply = <&vio_ape>; + + assigned-clocks = <&sys_clkout2_src>, <&sys_clkout2>; + assigned-clock-parents = <&func_96m_ck>; + assigned-clock-rates = <0>, <12000000>; }; }; + &mcbsp2 { pinctrl-names = "default"; pinctrl-0 = <&mcbsp2_pins>;
Fix the capture DAPM route due to core changes regarding to mic bias.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Jarkko Nikula jarkko.nikula@bitmer.com --- sound/soc/omap/n810.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 71e5f31fa306..e44bb5baac41 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -231,8 +231,8 @@ static const struct snd_soc_dapm_route audio_map[] = { {"Ext Spk", NULL, "LLOUT"}, {"Ext Spk", NULL, "RLOUT"},
- {"DMic Rate 64", NULL, "Mic Bias"}, - {"Mic Bias", NULL, "DMic"}, + {"DMic Rate 64", NULL, "DMic"}, + {"DMic", NULL, "Mic Bias"}, };
static const char *spk_function[] = {"Off", "On"};
The non DT boot is no longer supported and when booting with DT the device names are different.
Fix them up for now, but the n810.c should be updated to support probing via DT with proper bindings.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Acked-by: Jarkko Nikula jarkko.nikula@bitmer.com --- sound/soc/omap/n810.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index e44bb5baac41..3a2c448a26dd 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -257,9 +257,9 @@ static const struct snd_kcontrol_new aic33_n810_controls[] = { static struct snd_soc_dai_link n810_dai = { .name = "TLV320AIC33", .stream_name = "AIC33", - .cpu_dai_name = "omap-mcbsp.2", - .platform_name = "omap-mcbsp.2", - .codec_name = "tlv320aic3x-codec.2-0018", + .cpu_dai_name = "48076000.mcbsp", + .platform_name = "48076000.mcbsp", + .codec_name = "tlv320aic3x-codec.1-0018", .codec_dai_name = "tlv320aic3x-hifi", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM,
The bias for the analog HS microphone is coming from Retu/Vilma chip and we do not have control over it, yet.
For clarity, add a new DAPM_MIC widget for the HS mic and document the current state.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/n810.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 3a2c448a26dd..9cfefe44a75f 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -80,9 +80,9 @@ static void n810_ext_control(struct snd_soc_dapm_context *dapm) else snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack"); if (line1l) - snd_soc_dapm_enable_pin_unlocked(dapm, "LINE1L"); + snd_soc_dapm_enable_pin_unlocked(dapm, "HS Mic"); else - snd_soc_dapm_disable_pin_unlocked(dapm, "LINE1L"); + snd_soc_dapm_disable_pin_unlocked(dapm, "HS Mic");
if (n810_dmic_func) snd_soc_dapm_enable_pin_unlocked(dapm, "DMic"); @@ -222,6 +222,7 @@ static const struct snd_soc_dapm_widget aic33_dapm_widgets[] = { SND_SOC_DAPM_SPK("Ext Spk", n810_spk_event), SND_SOC_DAPM_HP("Headphone Jack", n810_jack_event), SND_SOC_DAPM_MIC("DMic", NULL), + SND_SOC_DAPM_MIC("HS Mic", NULL), };
static const struct snd_soc_dapm_route audio_map[] = { @@ -233,6 +234,12 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"DMic Rate 64", NULL, "DMic"}, {"DMic", NULL, "Mic Bias"}, + + /* + * Note that the mic bias is coming from Retu/Vilma and we don't have + * control over it atm. The analog HS mic is not working. <- TODO + */ + {"LINE1L", NULL, "HS Mic"}, };
static const char *spk_function[] = {"Off", "On"};
The patch
ASoC: omap: n810: HS mic is not working, add a widget for it with comment
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 9652bb7dbbe46bf244e3dda54ce027a359b524a4 Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi peter.ujfalusi@ti.com Date: Fri, 27 Apr 2018 11:17:14 +0300 Subject: [PATCH] ASoC: omap: n810: HS mic is not working, add a widget for it with comment
The bias for the analog HS microphone is coming from Retu/Vilma chip and we do not have control over it, yet.
For clarity, add a new DAPM_MIC widget for the HS mic and document the current state.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/omap/n810.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 3a2c448a26dd..9cfefe44a75f 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -80,9 +80,9 @@ static void n810_ext_control(struct snd_soc_dapm_context *dapm) else snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack"); if (line1l) - snd_soc_dapm_enable_pin_unlocked(dapm, "LINE1L"); + snd_soc_dapm_enable_pin_unlocked(dapm, "HS Mic"); else - snd_soc_dapm_disable_pin_unlocked(dapm, "LINE1L"); + snd_soc_dapm_disable_pin_unlocked(dapm, "HS Mic");
if (n810_dmic_func) snd_soc_dapm_enable_pin_unlocked(dapm, "DMic"); @@ -222,6 +222,7 @@ static const struct snd_soc_dapm_widget aic33_dapm_widgets[] = { SND_SOC_DAPM_SPK("Ext Spk", n810_spk_event), SND_SOC_DAPM_HP("Headphone Jack", n810_jack_event), SND_SOC_DAPM_MIC("DMic", NULL), + SND_SOC_DAPM_MIC("HS Mic", NULL), };
static const struct snd_soc_dapm_route audio_map[] = { @@ -233,6 +234,12 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"DMic Rate 64", NULL, "DMic"}, {"DMic", NULL, "Mic Bias"}, + + /* + * Note that the mic bias is coming from Retu/Vilma and we don't have + * control over it atm. The analog HS mic is not working. <- TODO + */ + {"LINE1L", NULL, "HS Mic"}, };
static const char *spk_function[] = {"Off", "On"};
On 04/27/18 11:17, Peter Ujfalusi wrote:
The bias for the analog HS microphone is coming from Retu/Vilma chip and we do not have control over it, yet.
For clarity, add a new DAPM_MIC widget for the HS mic and document the current state.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com
sound/soc/omap/n810.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Acked-by: Jarkko Nikula jarkko.nikula@bitmer.com
From: Jarkko Nikula jarkko.nikula@bitmer.com
Commit e9f5f1e45608 ("ARM: OMAP2+: Remove legacy mux code") removed CONFIG_OMAP_MUX making impossible to build Nokia N810 audio support. Remove this dependency so we can do at least build tests.
Fixes: e9f5f1e45608 ("ARM: OMAP2+: Remove legacy mux code") Signed-off-by: Jarkko Nikula jarkko.nikula@bitmer.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/omap/Kconfig | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index ba56d71c3ca7..65864a60d0e2 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -42,7 +42,6 @@ config SND_OMAP_SOC_HDMI_AUDIO config SND_OMAP_SOC_N810 tristate "SoC Audio support for Nokia N810" depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C - depends on OMAP_MUX select SND_OMAP_SOC_MCBSP select SND_SOC_TLV320AIC3X help
On 04/27/18 11:17, Peter Ujfalusi wrote:
Hi,
Changes since v1:
- Fixed up the aic33 dts patch with missing entries needed for capture
- Added comment and new widget for the non working HS Mic
The verification of the sdma-pcm on OMAP2 got delayed by non working audio on n810.
With the following patches audio works on n810 (both with the old omap-pcm and the new sdma-pcm).
I believe the DTS and ASoC patches are fine to go via different tree, but I wanted to keep the patches together for easier testing.
The series does not have any dependencies, I will rebase the sdma-pcm series on top of this and resend.
Playback to Speaker, Headset is working. Capture from DMIC is working. Capture from HS mic is not working due to missing mic bias (from Retu/Vilma).
Regards, Peter
Jarkko Nikula (1): ASoC: omap: Remove OMAP_MUX dependency from Nokia N810 audio support
Peter Ujfalusi (5): ARM: dts: omap2420-n810: Enable McBSP2 for audio ARM: dts: omap2420-n810: Correct the audio codec (tlv320aic33) node ASoC: omap: n810: Correct the card level dapm_route ASoC: omap: n810: Correct the cpu_dai, platform and codec name ASoC: omap: n810: HS mic is not working, add a widget for it with comment
DMIC is working here too this time after finding old set of mixer settings. For the remaining patches that are not applied yet:
Tested-by: Jarkko Nikula jarkko.nikula@bitmer.com
participants (4)
-
Jarkko Nikula
-
Mark Brown
-
Peter Ujfalusi
-
Tony Lindgren