ASoC: cs42l52: Reorganize MICA/B Config and Select
authorBrian Austin <brian.austin@cirrus.com>
Wed, 13 Nov 2013 22:05:40 +0000 (16:05 -0600)
committerMark Brown <broonie@linaro.org>
Thu, 28 Nov 2013 10:20:51 +0000 (10:20 +0000)
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>
include/sound/cs42l52.h
sound/soc/codecs/cs42l52.c

index 7c2be4a51894484e8a05fe08d11751c1cc7e04ab..daa91f327e4f76b74e8e66ffda3f37ba4e57175e 100644 (file)
@@ -22,12 +22,6 @@ struct cs42l52_platform_data {
        /* MICB mode selection 0=Single 1=Differential */
        unsigned int micb_cfg;
 
-       /* MICA Select 0=MIC1A 1=MIC2A */
-       unsigned int mica_sel;
-
-       /* MICB Select 0=MIC2A 1=MIC2B */
-       unsigned int micb_sel;
-
        /* Charge Pump Freq. Check datasheet Pg73 */
        unsigned int chgfreq;
 
index 19ee10b6d6ca56575fe1cdcab9484edbb15e4113..18010639d0c5f9d642dd5de0e11cc6c5a1fb1147 100644 (file)
@@ -233,7 +233,7 @@ static const struct soc_enum mic_bias_level_enum =
        SOC_ENUM_SINGLE(CS42L52_IFACE_CTL2, 0,
                        ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text);
 
-static const char * const cs42l52_mic_text[] = { "Single", "Differential" };
+static const char * const cs42l52_mic_text[] = { "MIC1", "MIC2" };
 
 static const struct soc_enum mica_enum =
        SOC_ENUM_SINGLE(CS42L52_MICA_CTL, 5,
@@ -243,12 +243,6 @@ static const struct soc_enum micb_enum =
        SOC_ENUM_SINGLE(CS42L52_MICB_CTL, 5,
                        ARRAY_SIZE(cs42l52_mic_text), cs42l52_mic_text);
 
-static const struct snd_kcontrol_new mica_mux =
-       SOC_DAPM_ENUM("Left Mic Input Capture Mux", mica_enum);
-
-static const struct snd_kcontrol_new micb_mux =
-       SOC_DAPM_ENUM("Right Mic Input Capture Mux", micb_enum);
-
 static const char * const digital_output_mux_text[] = {"ADC", "DSP"};
 
 static const struct soc_enum digital_output_mux_enum =
@@ -425,6 +419,9 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
 
        SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
 
+       SOC_ENUM("MICA Select", mica_enum),
+       SOC_ENUM("MICB Select", micb_enum),
+
        SOC_DOUBLE_R_TLV("MIC Gain Volume", CS42L52_MICA_CTL,
                              CS42L52_MICB_CTL, 0, 0x10, 0, mic_tlv),
 
@@ -550,9 +547,6 @@ static const struct snd_soc_dapm_widget cs42l52_dapm_widgets[] = {
        SND_SOC_DAPM_AIF_OUT("AIFOUTR", NULL,  0,
                        SND_SOC_NOPM, 0, 0),
 
-       SND_SOC_DAPM_MUX("MICA Mux", SND_SOC_NOPM, 0, 0, &mica_mux),
-       SND_SOC_DAPM_MUX("MICB Mux", SND_SOC_NOPM, 0, 0, &micb_mux),
-
        SND_SOC_DAPM_ADC("ADC Left", NULL, CS42L52_PWRCTL1, 1, 1),
        SND_SOC_DAPM_ADC("ADC Right", NULL, CS42L52_PWRCTL1, 2, 1),
        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,
                                cs42l52->pdata.micb_cfg <<
                                CS42L52_MIC_CTL_TYPE_SHIFT);
 
-       if (cs42l52->pdata.mica_sel)
-               regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL,
-                                  CS42L52_MIC_CTL_MIC_SEL_MASK,
-                               cs42l52->pdata.mica_sel <<
-                               CS42L52_MIC_CTL_MIC_SEL_SHIFT);
-       if (cs42l52->pdata.micb_sel)
-               regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL,
-                                  CS42L52_MIC_CTL_MIC_SEL_MASK,
-                               cs42l52->pdata.micb_sel <<
-                               CS42L52_MIC_CTL_MIC_SEL_SHIFT);
-
        if (cs42l52->pdata.chgfreq)
                regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP,
                                   CS42L52_CHARGE_PUMP_MASK,