asoc: tegra: cs42l73: Add DAPM for DMIC recording
Jubeom Kim [Thu, 27 Sep 2012 02:54:07 +0000 (19:54 -0700)]
Adding DAPM widget for DMIC recording
Bug 1053229

Signed-off-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-on: http://git-master/r/139186
(cherry picked from commit 247eea2726e6f3422ce7b4b5c266f6040242976e)

Change-Id: Id0cada66bd7e72c1a5611e1666dc2b865bb7b9ca
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/146958
Reviewed-by: Automatic_Commit_Validation_User

sound/soc/codecs/cs42l73.c
sound/soc/tegra/tegra_cs42l73.c

index 3686417..5ed7c97 100644 (file)
@@ -1127,6 +1127,11 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream,
        snd_soc_write(codec, CS42L73_SPC(id), priv->config[id].spc);
        snd_soc_write(codec, CS42L73_MMCC(id), priv->config[id].mmcc);
 
+       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+               snd_soc_update_bits(codec, CS42L73_VSPAIPAA, 0xff, 0);
+               snd_soc_update_bits(codec, CS42L73_VSPBIPBA, 0xff, 0);
+       }
+
        cs42l73_update_asrc(codec, id, srate);
 
        return 0;
index a6178fd..0fe0f56 100644 (file)
@@ -275,6 +275,7 @@ static const struct snd_soc_dapm_widget tegra_cs42l73_dapm_widgets[] = {
        SND_SOC_DAPM_SPK("Int Spk", tegra_cs42l73_event_int_spk),
        SND_SOC_DAPM_HP("Headphone", NULL),
        SND_SOC_DAPM_MIC("Headset Mic", NULL),
+       SND_SOC_DAPM_INPUT("Int D-Mic"),
 };
 
 /* cs42l73 Audio Map */
@@ -284,6 +285,10 @@ static const struct snd_soc_dapm_route tegra_cs42l73_audio_map[] = {
        /* Headphone (L+R)->  HPOUTA, HPOUTB */
        {"Headphone", NULL, "HPOUTA"},
        {"Headphone", NULL, "HPOUTB"},
+       /* DMIC -> DMIC Left/Right and VSPIN */
+       {"DMIC Left", NULL, "Int D-Mic"},
+       {"DMIC Right", NULL, "Int D-Mic"},
+       {"VSPIN", NULL, "Int D-Mic"},
 };
 
 static const struct snd_kcontrol_new tegra_cs42l73_controls[] = {