[alsa-devel] [PATCH] ASoC mc13783 codec: Add 'loudspeaker amp' and 'lineout amp'
Add Alsp (loudspeaker amp) and Arxout (lineout amp) in the same way as Asp (speaker amp) and Ahs (headphone amp) - Remove "LSPL": all output controls are added now; this one doesn't exist - Fix: "LSP" is loudspeaker amp; they indeed share the same mux according to the datasheet figure but they have separate registers. And testing shows the Asp and Alsp muxes are separated. - Add "CODEC Capture Switch" control and move "CODEC Capture Mixin Switch" to its correct place
Signed-off-by: Jürgen Lambrecht J.Lambrecht@televic.com --- sound/soc/codecs/mc13783.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index af7bc55..08fb022 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -437,6 +437,10 @@ static const SOC_ENUM_SINGLE_DECL(speaker_amp_source, MC13783_AUDIO_RX0, 4, speaker_amp_source_text); static const struct snd_kcontrol_new speaker_amp_source_mux = SOC_DAPM_ENUM("Speaker Amp Source MUX", speaker_amp_source); +static const SOC_ENUM_SINGLE_DECL(loudspeaker_amp_source, MC13783_AUDIO_RX0, 7, + speaker_amp_source_text); +static const struct snd_kcontrol_new loudspeaker_amp_source_mux = + SOC_DAPM_ENUM("Loudspeaker Amp Source MUX", loudspeaker_amp_source);
static const char * const headset_amp_source_text[] = { "CODEC", "Mixer" @@ -447,6 +451,11 @@ static const SOC_ENUM_SINGLE_DECL(headset_amp_source, MC13783_AUDIO_RX0, 11, static const struct snd_kcontrol_new headset_amp_source_mux = SOC_DAPM_ENUM("Headset Amp Source MUX", headset_amp_source);
+static const SOC_ENUM_SINGLE_DECL(lineout_amp_source, MC13783_AUDIO_RX0, 17, + headset_amp_source_text); +static const struct snd_kcontrol_new lineout_amp_source_mux = + SOC_DAPM_ENUM("Lineout Amp Source MUX", lineout_amp_source); + static const struct snd_kcontrol_new cdcout_ctl = SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 18, 1, 0);
@@ -493,10 +502,15 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = {
SND_SOC_DAPM_MUX("Speaker Amp Source MUX", SND_SOC_NOPM, 0, 0, &speaker_amp_source_mux), + SND_SOC_DAPM_MUX("Loudspeaker Amp Source MUX", SND_SOC_NOPM, 0, 0, + &loudspeaker_amp_source_mux),
SND_SOC_DAPM_MUX("Headset Amp Source MUX", SND_SOC_NOPM, 0, 0, &headset_amp_source_mux),
+ SND_SOC_DAPM_MUX("Lineout Amp Source MUX", SND_SOC_NOPM, 0, 0, + &lineout_amp_source_mux), + SND_SOC_DAPM_PGA("PGA Left Input", SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_PGA("PGA Right Input", SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -514,7 +528,6 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("RXOUTR"), SND_SOC_DAPM_OUTPUT("HSL"), SND_SOC_DAPM_OUTPUT("HSR"), - SND_SOC_DAPM_OUTPUT("LSPL"), SND_SOC_DAPM_OUTPUT("LSP"), SND_SOC_DAPM_OUTPUT("SP"), SND_SOC_DAPM_OUTPUT("CDCOUT"), @@ -563,21 +576,26 @@ static struct snd_soc_dapm_route mc13783_routes[] = {
{ "Speaker Amp Source MUX", "CODEC", "Voice CODEC PGA"}, { "Speaker Amp Source MUX", "Right", "DAC PGA"}, + { "Loudspeaker Amp Source MUX", "CODEC", "Voice CODEC PGA"}, + { "Loudspeaker Amp Source MUX", "Right", "DAC PGA"},
{ "Headset Amp Source MUX", "CODEC", "Voice CODEC PGA"}, { "Headset Amp Source MUX", "Mixer", "DAC PGA"},
+ { "Lineout Amp Source MUX", "CODEC", "Voice CODEC PGA"}, + { "Lineout Amp Source MUX", "Mixer", "DAC PGA"}, + /* Output */ { "HSL", NULL, "Headset Amp Left" }, { "HSR", NULL, "Headset Amp Right"}, { "RXOUTL", NULL, "Line out Amp Left"}, { "RXOUTR", NULL, "Line out Amp Right"}, { "SP", "Speaker Amp Switch", "Speaker Amp Source MUX"}, - { "LSP", "Loudspeaker Amp", "Speaker Amp Source MUX"}, + { "LSP", "Loudspeaker Amp", "Loudspeaker Amp Source MUX"}, { "HSL", "Headset Amp Left", "Headset Amp Source MUX"}, { "HSR", "Headset Amp Right", "Headset Amp Source MUX"}, - { "Line out Amp Left", NULL, "DAC PGA"}, - { "Line out Amp Right", NULL, "DAC PGA"}, + { "RXOUTL", "Line out Amp Left", "Lineout Amp Source MUX"}, + { "RXOUTR", "Line out Amp Right", "Lineout Amp Source MUX"}, { "DAC PGA", NULL, "DAC"}, { "DAC", NULL, "DAC_E"}, { "CDCOUT", "CDCOUT Switch", "Voice CODEC PGA"}, @@ -602,11 +620,12 @@ static struct snd_kcontrol_new mc13783_control_list[] = { SOC_DOUBLE("Headset Amp Switch", MC13783_AUDIO_RX0, 10, 9, 1, 0), SOC_DOUBLE("Line out Amp Switch", MC13783_AUDIO_RX0, 16, 15, 1, 0),
+ SOC_SINGLE("CODEC Capture Mixin Switch", MC13783_AUDIO_RX0, 21, 1, 0), SOC_SINGLE("PCM Capture Mixin Switch", MC13783_AUDIO_RX0, 22, 1, 0), SOC_SINGLE("Line in Capture Mixin Switch", MC13783_AUDIO_RX0, 23, 1, 0),
SOC_SINGLE("CODEC Capture Volume", MC13783_AUDIO_RX1, 1, 15, 0), - SOC_SINGLE("CODEC Capture Mixin Switch", MC13783_AUDIO_RX0, 21, 1, 0), + SOC_SINGLE("CODEC Capture Switch", MC13783_AUDIO_RX1, 0, 1, 0),
SOC_SINGLE("Line in Capture Volume", MC13783_AUDIO_RX1, 12, 15, 0), SOC_SINGLE("Line in Capture Switch", MC13783_AUDIO_RX1, 10, 1, 0),
participants (1)
-
Lambrecht Jürgen