]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: max98390: Fix dsm calibration reading
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 16 Sep 2022 11:13:49 +0000 (14:13 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 19 Sep 2022 14:08:07 +0000 (15:08 +0100)
commite8c2b91af29b6b34988188ad1289d214c45c2e19
tree2c80aca55a48f54cc7cbedb252dfda6a4615beec
parentb5869b09a6b53b480a5c08d2363b6c565df550fe
ASoC: max98390: Fix dsm calibration reading

With the change introduced by 7f62385252dc, the calibration can only be
done after the codec probe (but questionable if it is working since
203A_AMP_EN is 0) or when the codec is powered up for audio use, in other
cases "AMP is not ready to run calibration" is printed.

This changes how this worked before the patch: the codec was force powered
on for the duration of the calibration readout, then shut down.
So, if a calibration was asked when the codec was active, it would have
powered it down?

To correct the calibration logic: check if the codec is powered on and if
it is not then enable it, do the readout and put it back to disabled.
Do this while keeping the dapm locked to avoid interfering with normal
operation via DAPM.

Fixes: 7f62385252dc ("ASoC: max98390: Remove unnecessary amp on/off conrtol")
Reported-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220916111349.4433-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98390.c