]> 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)
commit396fcb25fc1c21e87299f4be30179d4a6350389a
tree2c80aca55a48f54cc7cbedb252dfda6a4615beec
parentc286efef682ead92ce38a9e971c8de3cb5ca6e1e
ASoC: max98390: Fix dsm calibration reading

With the change introduced by d9a2831ebac4, 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: d9a2831ebac4 ("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