summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJeremy McDermond <nh6z@nh6z.net>2016-04-20 20:39:11 +0200
committerMark Brown <broonie@kernel.org>2016-04-21 11:50:18 +0200
commit20d2cecbb7b9c35235c97f0dfa520525c28f8841 (patch)
tree00766fce4d79a3572663b268392f20f97912239f /sound
parentASoC: tlv320aic32x4: Add 96k sample rate (diff)
downloadlinux-20d2cecbb7b9c35235c97f0dfa520525c28f8841.tar.xz
linux-20d2cecbb7b9c35235c97f0dfa520525c28f8841.zip
ASoC: tlv320aic32x4: Implement resistors on input pins
The input pins of the aic3204 have resistors inline with them. The current code assumes that you want a 10k resistor inline with your inputs and implements it as a simple switch. This patch creates an enum for each pin and allows you to switch between not connected, 10k, 20k and 40k ohm values. This more closely models the acutal aic3204 part. These pin settings are documented in TI's SLAA557 pages 135 and 136 (http://www.ti.com/lit/ml/slaa557/slaa557.pdf). Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 2f8480c93b3c..621f4210cd27 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -183,16 +183,34 @@ static const struct snd_kcontrol_new lor_output_mixer_controls[] = {
SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_LORROUTE, 3, 1, 0),
};
+static const char * const resistor_text[] = {
+ "Off", "10 kOhm", "20 kOhm", "40 kOhm",
+};
+
+static SOC_ENUM_SINGLE_DECL(in1l_lpga_p_enum, AIC32X4_LMICPGAPIN, 6,
+ resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2l_lpga_p_enum, AIC32X4_LMICPGAPIN, 4,
+ resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3l_lpga_p_enum, AIC32X4_LMICPGAPIN, 2,
+ resistor_text);
+
static const struct snd_kcontrol_new left_input_mixer_controls[] = {
- SOC_DAPM_SINGLE("IN1_L P Switch", AIC32X4_LMICPGAPIN, 6, 1, 0),
- SOC_DAPM_SINGLE("IN2_L P Switch", AIC32X4_LMICPGAPIN, 4, 1, 0),
- SOC_DAPM_SINGLE("IN3_L P Switch", AIC32X4_LMICPGAPIN, 2, 1, 0),
+ SOC_DAPM_ENUM("IN1_L P Switch", in1l_lpga_p_enum),
+ SOC_DAPM_ENUM("IN2_L P Switch", in2l_lpga_p_enum),
+ SOC_DAPM_ENUM("IN3_L P Switch", in3l_lpga_p_enum),
};
+static SOC_ENUM_SINGLE_DECL(in1r_rpga_p_enum, AIC32X4_RMICPGAPIN, 6,
+ resistor_text);
+static SOC_ENUM_SINGLE_DECL(in2r_rpga_p_enum, AIC32X4_RMICPGAPIN, 4,
+ resistor_text);
+static SOC_ENUM_SINGLE_DECL(in3r_rpga_p_enum, AIC32X4_RMICPGAPIN, 2,
+ resistor_text);
+
static const struct snd_kcontrol_new right_input_mixer_controls[] = {
- SOC_DAPM_SINGLE("IN1_R P Switch", AIC32X4_RMICPGAPIN, 6, 1, 0),
- SOC_DAPM_SINGLE("IN2_R P Switch", AIC32X4_RMICPGAPIN, 4, 1, 0),
- SOC_DAPM_SINGLE("IN3_R P Switch", AIC32X4_RMICPGAPIN, 2, 1, 0),
+ SOC_DAPM_ENUM("IN1_R P Switch", in1r_rpga_p_enum),
+ SOC_DAPM_ENUM("IN2_R P Switch", in2r_rpga_p_enum),
+ SOC_DAPM_ENUM("IN3_R P Switch", in3r_rpga_p_enum),
};
static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {