asoc: codec: es755: enable DAC controls
Dara Ramesh [Mon, 1 Sep 2014 21:28:25 +0000 (14:28 -0700)]
enable DAC (Left and Right controls)  controls
based on DAPM controls.

bug 200033782

Change-Id: I7b33489105fa1ccad11a020220f7114f7759e85c
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/494526
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Tested-by: Viraj Karandikar <vkarandikar@nvidia.com>

sound/soc/codecs/audience/es-a300.c

index 1cacffa..057198f 100644 (file)
@@ -327,6 +327,7 @@ static int es_dac_enable(struct snd_soc_dapm_widget *w,
        struct snd_kcontrol *kcontrol, int event)
 {
        struct snd_soc_codec *codec = w->codec;
+       unsigned int val;
        pr_debug("%s DAC%d event %d\n", __func__, w->shift, event);
 
        switch (event) {
@@ -345,6 +346,13 @@ static int es_dac_enable(struct snd_soc_dapm_widget *w,
                                0);
                break;
        }
+
+       /* find which DAC is enabled */
+       val = snd_soc_read(codec, ES_DAC_CTRL);
+       snd_soc_update_bits(codec, ES_DAC_DIG_EN, ES_DAC0_LEFT_EN_MASK |
+               ES_DAC0_RIGHT_EN_MASK | ES_DAC1_LEFT_EN_MASK |
+               ES_DAC1_RIGHT_EN_MASK, val);
+
        return 0;
 }