[alsa-devel] [PATCH] ASoC mc13783 codec: complete capture mux

Lambrecht Jürgen J.Lambrecht at TELEVIC.com
Fri Nov 29 11:26:43 CET 2013


codec adc (capture) mux was not complete:
   * fix naming of TXIN/TX
   * reorder RXIN and TXIN to show muxing priority
   * implement RXIN/RX (R and L are the same control)

Signed-off-by: Jürgen Lambrecht <J.Lambrecht at televic.com>
---
 sound/soc/codecs/mc13783.c |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index bae6016..af7bc55 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -401,11 +401,14 @@ static const struct snd_kcontrol_new mc2_amp_ctl =
 static const struct snd_kcontrol_new atx_amp_ctl =
 	SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 11, 1, 0);
 
+static const struct snd_kcontrol_new rx_sel_ctl =
+	SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 13, 1, 0);
+
 
 /* Virtual mux. The chip does the input selection automatically
  * as soon as we enable one input. */
 static const char * const adcl_enum_text[] = {
-	"MC1L", "RXINL",
+	"MC1L", "RXL",
 };
 
 static const struct soc_enum adcl_enum =
@@ -415,7 +418,7 @@ static const struct snd_kcontrol_new left_input_mux =
 	SOC_DAPM_ENUM_VIRT("Route", adcl_enum);
 
 static const char * const adcr_enum_text[] = {
-	"MC1R", "MC2", "RXINR", "TXIN",
+	"MC1R", "MC2", "TX", "RXR",
 };
 
 static const struct soc_enum adcr_enum =
@@ -470,9 +473,9 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = {
 	SND_SOC_DAPM_INPUT("MC1LIN"),
 	SND_SOC_DAPM_INPUT("MC1RIN"),
 	SND_SOC_DAPM_INPUT("MC2IN"),
+	SND_SOC_DAPM_INPUT("TXIN"),
 	SND_SOC_DAPM_INPUT("RXINR"),
 	SND_SOC_DAPM_INPUT("RXINL"),
-	SND_SOC_DAPM_INPUT("TXIN"),
 
 	SND_SOC_DAPM_SUPPLY("MC1 Bias", MC13783_AUDIO_TX, 0, 0, NULL, 0),
 	SND_SOC_DAPM_SUPPLY("MC2 Bias", MC13783_AUDIO_TX, 1, 0, NULL, 0),
@@ -480,7 +483,8 @@ static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = {
 	SND_SOC_DAPM_SWITCH("MC1L Amp", MC13783_AUDIO_TX, 7, 0, &mc1l_amp_ctl),
 	SND_SOC_DAPM_SWITCH("MC1R Amp", MC13783_AUDIO_TX, 5, 0, &mc1r_amp_ctl),
 	SND_SOC_DAPM_SWITCH("MC2 Amp", MC13783_AUDIO_TX, 9, 0, &mc2_amp_ctl),
-	SND_SOC_DAPM_SWITCH("TXIN Amp", MC13783_AUDIO_TX, 11, 0, &atx_amp_ctl),
+	SND_SOC_DAPM_SWITCH("TX Amp", MC13783_AUDIO_TX, 11, 0, &atx_amp_ctl),
+	SND_SOC_DAPM_SWITCH("RX Sel", MC13783_AUDIO_TX, 13, 0, &rx_sel_ctl),
 
 	SND_SOC_DAPM_VIRT_MUX("PGA Left Input Mux", SND_SOC_NOPM, 0, 0,
 			      &left_input_mux),
@@ -537,14 +541,16 @@ static struct snd_soc_dapm_route mc13783_routes[] = {
 	{ "MC1L Amp", NULL, "MC1LIN"},
 	{ "MC1R Amp", NULL, "MC1RIN" },
 	{ "MC2 Amp", NULL, "MC2IN" },
-	{ "TXIN Amp", NULL, "TXIN"},
+	{ "TX Amp", NULL, "TXIN"},
+	{ "RX Sel", NULL, "RXINR"},
+	{ "RX Sel", NULL, "RXINL"}, /* indeed same control bit for RXINR and RXINL */
 
 	{ "PGA Left Input Mux", "MC1L", "MC1L Amp" },
-	{ "PGA Left Input Mux", "RXINL", "RXINL"},
+	{ "PGA Left Input Mux", "RXL", "RX Sel"},
 	{ "PGA Right Input Mux", "MC1R", "MC1R Amp" },
 	{ "PGA Right Input Mux", "MC2",  "MC2 Amp"},
-	{ "PGA Right Input Mux", "TXIN", "TXIN Amp"},
-	{ "PGA Right Input Mux", "RXINR", "RXINR"},
+	{ "PGA Right Input Mux", "TX", "TX Amp"},
+	{ "PGA Right Input Mux", "RXR", "RX Sel"},
 
 	{ "PGA Left Input", NULL, "PGA Left Input Mux"},
 	{ "PGA Right Input", NULL, "PGA Right Input Mux"},
-- 
1.7.10.4


More information about the Alsa-devel mailing list