Audio: Correct mapping for VSP right MUX
authorVaibhav Agarwal <vaibhav.agarwal@intel.com>
Thu, 15 Mar 2012 13:23:32 +0000 (18:53 +0530)
committerbuildbot <buildbot@intel.com>
Fri, 16 Mar 2012 18:26:52 +0000 (11:26 -0700)
BZ: 27435

Incorrect mapping exist for VSP right mux. This caused uplink
not working with Headset plugged-in

The solution is to modify these mapping to correct ones.

Change-Id: I823eb8bd075c2584e6b1d4fa83b2d2ee9b4429a6
Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@intel.com>
Reviewed-on: http://android.intel.com:8080/39256
Reviewed-by: Abdullah, Omair M <omair.m.abdullah@intel.com>
Reviewed-by: Babu, Ramesh <ramesh.babu@intel.com>
Reviewed-by: Koul, Vinod <vinod.koul@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
sound/soc/codecs/cs42l73.c
sound/soc/mid-x86/clv_machine.c

index 2cdfd82..c43ac92 100644 (file)
@@ -66,7 +66,6 @@ static const u8 cs42l73_reg[] = {
 /*54*/ 0x3F, 0xAA, 0x3F, 0x3F,
 /*58*/ 0x3F, 0x3F, 0x3F, 0x3F,
 /*5C*/ 0x3F, 0x3F, 0x00, 0x00,
-/*60*/ 0x00, 0x00
 };
 
 static const unsigned int hpaloa_tlv[] = {
@@ -635,7 +634,7 @@ static const struct snd_soc_dapm_route cs42l73_audio_map[] = {
 
        /* Voice Capture */
        {"VSPL Output Mixer", NULL, "Input Left Capture"},
-       {"VSPR Output Mixer", NULL, "Input Left Capture"},
+       {"VSPR Output Mixer", NULL, "Input Right Capture"},
 
        {"VSPOUTL", "VSP-IP Volume", "VSPL Output Mixer"},
        {"VSPOUTR", "VSP-IP Volume", "VSPR Output Mixer"},
@@ -1109,22 +1108,16 @@ static int cs42l73_set_mic2_bias(struct snd_soc_codec *codec, int state)
 {
        switch (state) {
        case MIC2_BIAS_DISABLE:
-               snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 0);
-               snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 0);
-               snd_soc_update_bits(codec, CS42L73_PWRCTL2, PDN_MIC2_BIAS,
-                                       PDN_MIC2_BIAS);
-               /**FIX ME -- for PR0.1, Mic1_bias needs to be enabled
-               - no board info available yet**/
-               snd_soc_update_bits(codec, CS42L73_PWRCTL2, PDN_MIC1_BIAS,
-                                       PDN_MIC1_BIAS);
+               mutex_lock(&codec->mutex);
+               snd_soc_dapm_disable_pin(&codec->dapm, "MIC2 Bias");
+               snd_soc_dapm_sync(&codec->dapm);
+               mutex_unlock(&codec->mutex);
                break;
        case MIC2_BIAS_ENABLE:
-               snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 0);
-               snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 0);
-               snd_soc_update_bits(codec, CS42L73_PWRCTL2, PDN_MIC2_BIAS, 0);
-               /**FIX ME -- for PR0.1, Mic_bias needs to be enabled
-               - no board info available yet**/
-               snd_soc_update_bits(codec, CS42L73_PWRCTL2, PDN_MIC1_BIAS, 0);
+               mutex_lock(&codec->mutex);
+               snd_soc_dapm_force_enable_pin(&codec->dapm, "MIC2 Bias");
+               snd_soc_dapm_sync(&codec->dapm);
+               mutex_unlock(&codec->mutex);
                break;
        }
        return 0;
index c8d4cf2..f59e32a 100644 (file)
@@ -108,7 +108,7 @@ static void clv_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
        int enable;
        struct snd_soc_jack *jack = gpio->jack;
        struct snd_soc_codec *codec = jack->codec;
-       enable = gpio_get_value_cansleep(gpio->gpio);
+       enable = gpio_get_value(gpio->gpio);
        if (gpio->invert)
                enable = !enable;
        cs42l73_hp_detection(codec, jack, enable);
@@ -254,7 +254,9 @@ static int clv_init(struct snd_soc_pcm_runtime *runtime)
        snd_soc_dapm_add_routes(dapm, clv_audio_map,
                                ARRAY_SIZE(clv_audio_map));
 
+       mutex_lock(&codec->mutex);
        snd_soc_dapm_sync(dapm);
+       mutex_unlock(&codec->mutex);
        /* Headset and button jack detection */
        ret = snd_soc_jack_new(codec, "Intel MID Audio Jack",
                        SND_JACK_HEADSET | SND_JACK_BTN_0 |