aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Austin <brian.austin@cirrus.com>2013-11-13 17:05:40 -0500
committerMark Brown <broonie@linaro.org>2013-11-28 05:20:51 -0500
commita3d36bc2aba531328f7311ef57dec7687283ec57 (patch)
tree0c8a45cbb05c20f00b76a52266ecc31496077585
parent7ae10ed2ee757f2ce19188e540eaa44f337c7cd2 (diff)
ASoC: cs42l52: Reorganize MICA/B Config and Select
This patch reworks the MICA an MICB config for single-ended or differential and the selection of which MIC for the single config Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/cs42l52.h6
-rw-r--r--sound/soc/codecs/cs42l52.c25
2 files changed, 4 insertions, 27 deletions
diff --git a/include/sound/cs42l52.h b/include/sound/cs42l52.h
index 7c2be4a51894..daa91f327e4f 100644
--- a/include/sound/cs42l52.h
+++ b/include/sound/cs42l52.h
@@ -22,12 +22,6 @@ struct cs42l52_platform_data {
22 /* MICB mode selection 0=Single 1=Differential */ 22 /* MICB mode selection 0=Single 1=Differential */
23 unsigned int micb_cfg; 23 unsigned int micb_cfg;
24 24
25 /* MICA Select 0=MIC1A 1=MIC2A */
26 unsigned int mica_sel;
27
28 /* MICB Select 0=MIC2A 1=MIC2B */
29 unsigned int micb_sel;
30
31 /* Charge Pump Freq. Check datasheet Pg73 */ 25 /* Charge Pump Freq. Check datasheet Pg73 */
32 unsigned int chgfreq; 26 unsigned int chgfreq;
33 27
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 19ee10b6d6ca..18010639d0c5 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -233,7 +233,7 @@ static const struct soc_enum mic_bias_level_enum =
233 SOC_ENUM_SINGLE(CS42L52_IFACE_CTL2, 0, 233 SOC_ENUM_SINGLE(CS42L52_IFACE_CTL2, 0,
234 ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text); 234 ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text);
235 235
236static const char * const cs42l52_mic_text[] = { "Single", "Differential" }; 236static const char * const cs42l52_mic_text[] = { "MIC1", "MIC2" };
237 237
238static const struct soc_enum mica_enum = 238static const struct soc_enum mica_enum =
239 SOC_ENUM_SINGLE(CS42L52_MICA_CTL, 5, 239 SOC_ENUM_SINGLE(CS42L52_MICA_CTL, 5,
@@ -243,12 +243,6 @@ static const struct soc_enum micb_enum =
243 SOC_ENUM_SINGLE(CS42L52_MICB_CTL, 5, 243 SOC_ENUM_SINGLE(CS42L52_MICB_CTL, 5,
244 ARRAY_SIZE(cs42l52_mic_text), cs42l52_mic_text); 244 ARRAY_SIZE(cs42l52_mic_text), cs42l52_mic_text);
245 245
246static const struct snd_kcontrol_new mica_mux =
247 SOC_DAPM_ENUM("Left Mic Input Capture Mux", mica_enum);
248
249static const struct snd_kcontrol_new micb_mux =
250 SOC_DAPM_ENUM("Right Mic Input Capture Mux", micb_enum);
251
252static const char * const digital_output_mux_text[] = {"ADC", "DSP"}; 246static const char * const digital_output_mux_text[] = {"ADC", "DSP"};
253 247
254static const struct soc_enum digital_output_mux_enum = 248static const struct soc_enum digital_output_mux_enum =
@@ -425,6 +419,9 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
425 419
426 SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0), 420 SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
427 421
422 SOC_ENUM("MICA Select", mica_enum),
423 SOC_ENUM("MICB Select", micb_enum),
424
428 SOC_DOUBLE_R_TLV("MIC Gain Volume", CS42L52_MICA_CTL, 425 SOC_DOUBLE_R_TLV("MIC Gain Volume", CS42L52_MICA_CTL,
429 CS42L52_MICB_CTL, 0, 0x10, 0, mic_tlv), 426 CS42L52_MICB_CTL, 0, 0x10, 0, mic_tlv),
430 427
@@ -550,9 +547,6 @@ static const struct snd_soc_dapm_widget cs42l52_dapm_widgets[] = {
550 SND_SOC_DAPM_AIF_OUT("AIFOUTR", NULL, 0, 547 SND_SOC_DAPM_AIF_OUT("AIFOUTR", NULL, 0,
551 SND_SOC_NOPM, 0, 0), 548 SND_SOC_NOPM, 0, 0),
552 549
553 SND_SOC_DAPM_MUX("MICA Mux", SND_SOC_NOPM, 0, 0, &mica_mux),
554 SND_SOC_DAPM_MUX("MICB Mux", SND_SOC_NOPM, 0, 0, &micb_mux),
555
556 SND_SOC_DAPM_ADC("ADC Left", NULL, CS42L52_PWRCTL1, 1, 1), 550 SND_SOC_DAPM_ADC("ADC Left", NULL, CS42L52_PWRCTL1, 1, 1),
557 SND_SOC_DAPM_ADC("ADC Right", NULL, CS42L52_PWRCTL1, 2, 1), 551 SND_SOC_DAPM_ADC("ADC Right", NULL, CS42L52_PWRCTL1, 2, 1),
558 SND_SOC_DAPM_PGA("PGA Left", CS42L52_PWRCTL1, 3, 1, NULL, 0), 552 SND_SOC_DAPM_PGA("PGA Left", CS42L52_PWRCTL1, 3, 1, NULL, 0),
@@ -1239,17 +1233,6 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
1239 cs42l52->pdata.micb_cfg << 1233 cs42l52->pdata.micb_cfg <<
1240 CS42L52_MIC_CTL_TYPE_SHIFT); 1234 CS42L52_MIC_CTL_TYPE_SHIFT);
1241 1235
1242 if (cs42l52->pdata.mica_sel)
1243 regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL,
1244 CS42L52_MIC_CTL_MIC_SEL_MASK,
1245 cs42l52->pdata.mica_sel <<
1246 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1247 if (cs42l52->pdata.micb_sel)
1248 regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL,
1249 CS42L52_MIC_CTL_MIC_SEL_MASK,
1250 cs42l52->pdata.micb_sel <<
1251 CS42L52_MIC_CTL_MIC_SEL_SHIFT);
1252
1253 if (cs42l52->pdata.chgfreq) 1236 if (cs42l52->pdata.chgfreq)
1254 regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP, 1237 regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP,
1255 CS42L52_CHARGE_PUMP_MASK, 1238 CS42L52_CHARGE_PUMP_MASK,