ASoC: max98357a: move control of SD_MODE back to DAI ops
authorTzung-Bi Shih <tzungbi@google.com>
Tue, 21 Jul 2020 11:42:32 +0000 (19:42 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 21 Jul 2020 20:37:51 +0000 (21:37 +0100)
commit04a646ff5acaa9a0a6634af1c94e0d5c8115e5db
tree86cf4e4d12c3b702b6d006b562b522de043b992f
parent468ae359818e634a3bc352605a04bbfe3ea0f5a1
ASoC: max98357a: move control of SD_MODE back to DAI ops

Partially reverts commit 128f825aeab7 ("ASoC: max98357a: move control
of SD_MODE to DAPM").

In order to have mute control of max98357 from machine drivers, commit
128f825aeab7 ("ASoC: max98357a: move control of SD_MODE to DAPM")
moves the control of SD_MODE from DAI ops to DAPM events.  However, pop
noise has been observed on rk3399-gru-kevin boards due to this commit.

The commit 128f825aeab7 caused sequence of DAI clocks and SD_MODE
changed on rk3399-gru-kevin boards.

With the commit 128f825aeab7:
- SD_MODE will be set to 1 before DAI clocks start.
- SD_MODE will be set to 0 after DAI clocks stop.
As a result, pop noise.

Moves the control of SD_MODE back to DAI ops.  In the meantime, uses an
additional flag in DAPM event to provide chance of mute control for
machine drivers.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Tested-By: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20200721114232.2812254-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98357a.c