ASoC: tpa6130a2: Defer SW enable from power enable
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Tue, 30 Nov 2010 14:00:01 +0000 (16:00 +0200)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 30 Nov 2010 15:39:39 +0000 (15:39 +0000)
Do not enable the amplifier right after the power has been
restored to the amplifier.
The DAPM_SUPPLY widget turns on the amp early in the DAPM
power walk, and the unmuting of channel happens quite late.
Keeping the amp in SW reset state ensures better muting.
In this way the pop noise coming from other components (codec)
can be filtered out.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/tpa6130a2.c

index 199edf07f47ec22aeb6af4c6380152d60535b986..42887ae1568bdacec2c98b7f04795fc83250c2c7 100644 (file)
@@ -151,11 +151,6 @@ static int tpa6130a2_power(u8 power)
                        data->power_state = 0;
                        goto exit;
                }
-
-               /* Clear SWS */
-               val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
-               val &= ~TPA6130A2_SWS;
-               tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);
        } else {
                /* set SWS */
                val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
@@ -301,6 +296,7 @@ static void tpa6130a2_channel_enable(u8 channel, int enable)
                /* Enable amplifier */
                val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
                val |= channel;
+               val &= ~TPA6130A2_SWS;
                tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);
 
                /* Unmute channel */