asoc: codec: audience: update HPL and HPL_CTRL reg
Dara Ramesh [Thu, 18 Sep 2014 11:34:07 +0000 (16:34 +0530)]
- update cached HP_L gain and HPL_CTRL to HW,
 firmware resets this register space to detecting
 wired accessory.

Change-Id: I2a0db5699785bad2a5727ab14e6dbd794410dfd0
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/500281
Reviewed-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com>
Tested-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com>

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

index 8950a27..db7df9f 100644 (file)
@@ -347,6 +347,17 @@ static int es_dac_enable(struct snd_soc_dapm_widget *w,
                break;
        }
 
+       /* writing cached HP_L gain and HPL_CTRL to HW,
+        * firmware resets this register space to detecting
+        * wired accessory
+        */
+       val = snd_soc_read(codec, ES_HP_L_GAIN);
+       snd_soc_write(codec, ES_HP_L_GAIN, 0);
+       snd_soc_write(codec, ES_HP_L_GAIN, val);
+       val = snd_soc_read(codec, ES_HP_L_CTRL);
+       snd_soc_write(codec, ES_HP_L_CTRL, 2);
+       snd_soc_write(codec, ES_HP_L_CTRL, val);
+
        /* 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 |