ASoC: tas5805m: rework to avoid scheduling while atomic.
authorDaniel Beer <daniel.beer@igorinstitute.com>
Thu, 27 Oct 2022 08:28:31 +0000 (21:28 +1300)
committerMark Brown <broonie@kernel.org>
Mon, 6 Feb 2023 13:12:31 +0000 (13:12 +0000)
commit147323792693bf013f60dca160be1d32bd4d180a
tree5a00edf8f18d7be7ef45dc0a253e1d5c1d4a8446
parent2e7c6652f9b86c01cbd4e988057a746a3a461969
ASoC: tas5805m: rework to avoid scheduling while atomic.

There's some setup we need to do in order to get the DSP initialized,
and this can't be done until a bit-clock is ready. In an earlier version
of this driver, this work was done in a DAPM callback.

The DAPM callback doesn't guarantee that the bit-clock is running, so
the work was moved instead to the trigger callback. Unfortunately this
callback runs in atomic context, and the setup code needs to do I2C
transactions.

Here we use a work_struct to kick off the setup in a thread instead.

Fixes: ec45268467f4 ("ASoC: add support for TAS5805M digital amplifier")
Signed-off-by: Daniel Beer <daniel.beer@igorinstitute.com>
Link: https://lore.kernel.org/r/85d8ba405cb009a7a3249b556dc8f3bdb1754fdf.1675497326.git.daniel.beer@igorinstitute.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas5805m.c