diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-03-30 19:04:46 (GMT) |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-01 20:27:36 (GMT) |
commit | 643518403c3fdecd40d9edfd50f4bafcebeda79b (patch) | |
tree | f20d1acd286d69cf171be8c1dfc263d9fd71fb54 /mm/slab.h | |
parent | ab87ce1d9bb0501fccfc00d5e5ce7c16cd2bcc3e (diff) | |
download | linux-643518403c3fdecd40d9edfd50f4bafcebeda79b.tar.xz |
ASoC: wm8971: Integrate capacitor charging into the DAPM sequence
When being powered on, either initially on probe or when resuming from
suspend, the wm8971 configures the device for quick output capacitor
charging. Since the charging can take a rather long time (up to multiple
seconds) it is done asynchronously without blocking. A delayed work item is
run once the charging is finished and the device is switched to the target
bias level.
This all done asynchronously to the regular DAPM sequence accessing the same
data structures and registers without any looking, which can lead to race
conditions. Furthermore this potentially delays the start of stream on the
CODEC while the rest of the system is already up and running, meaning the
first bytes of audio are lost. It also does no comply with the assumption of
the DAPM core that if set_bias_level() returned successfully the device will
be at the requested bias level.
This patch slightly refactors things and makes sure that the caps charging
is properly integrated into the DAPM sequence. When transitioning from
SND_SOC_BIAS_OFF to SND_SOC_BIAS_STANDBY the part will be put into fast
charging mode and a work item will be scheduled that puts it back into
standby charging once the charging period has elapsed. If a playback or
capture stream is started while charging is in progress the driver will now
wait in SND_SOC_BIAS_PREPARE until the charging is done. This makes sure
that charging is done asynchronously in the background when the chip is
idle, but at the same time makes sure that playback/capture is not started
before the charging is done.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'mm/slab.h')
0 files changed, 0 insertions, 0 deletions