asoc: tegra: cs42l73: VSPIN dapm route with DMIC event
Rahul Mittal [Mon, 29 Oct 2012 05:54:56 +0000 (10:54 +0530)]
Enable/disable VSPIN in dapm route only with DAPM event
Default enable caused 1.3W power in LP0 as codec suspend was failing

Bug 1053365
Bug 1161544

Change-Id: I8a4ed0801249ec11da089f0cc597d8abdc6c2dbb
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/159463
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

sound/soc/tegra/tegra_cs42l73.c

index d113518..b94fd85 100644 (file)
@@ -904,6 +904,11 @@ static struct snd_soc_jack_pin tegra_cs42l73_hs_jack_pins[] = {
 };
 #endif
 
+/* FIX ME */
+static const struct snd_soc_dapm_route vspin_audio_map[] = {
+       {"VSPIN", NULL, "Int D-Mic"},
+};
+
 static int tegra_cs42l73_event_int_mic(struct snd_soc_dapm_widget *w,
                                        struct snd_kcontrol *k, int event)
 {
@@ -914,9 +919,13 @@ static int tegra_cs42l73_event_int_mic(struct snd_soc_dapm_widget *w,
 
        if (machine->dmic_reg && machine->dmic_1v8_reg) {
                if (SND_SOC_DAPM_EVENT_ON(event)) {
+                       snd_soc_dapm_add_routes(dapm,
+                                       vspin_audio_map, 1);
                        regulator_enable(machine->dmic_reg);
                        regulator_enable(machine->dmic_1v8_reg);
                } else {
+                       snd_soc_dapm_weak_routes(dapm,
+                                       vspin_audio_map, 1);
                        regulator_disable(machine->dmic_reg);
                        regulator_disable(machine->dmic_1v8_reg);
                }
@@ -990,7 +999,6 @@ static const struct snd_soc_dapm_route tegra_cs42l73_audio_map[] = {
        /* 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[] = {