ASoC: sgtl5000: Fix VAG_POWER enabling/disabling order
authorMarek Vasut <marex@denx.de>
Tue, 28 May 2013 18:55:56 +0000 (20:55 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 4 Jun 2013 17:46:57 +0000 (18:46 +0100)
commitdd4d2d6dfb49e8916064f2cb07f0ad7b32a82fb7
treea5448d62c0b18e40182e6cc1e8bc1adb2c212985
parentaf8ee11209e749c75eabf32b2a4ca631f396acf8
ASoC: sgtl5000: Fix VAG_POWER enabling/disabling order

The VAG_POWER must be enabled after all other bits in CHIP_ANA_POWER
and disabled before any other bit in CHIP_ANA_POWER. See the SGTL5000
datasheet (Table 31, BIT 7, page 42-43). Failing to follow this order
will result in ugly loud "POP" noise at the end of playback.

To achieve such order, use the _PRE and _POST DAPM widgets to trigger
the power_vag_event, where the event type check has to be fixed
accordingly as well.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/sgtl5000.c