ASoC: rt5677: Load firmware via SPI using delayed work
authorBen Zhang <benzh@chromium.org>
Wed, 6 Nov 2019 01:13:26 +0000 (17:13 -0800)
committerMark Brown <broonie@kernel.org>
Mon, 11 Nov 2019 13:01:59 +0000 (13:01 +0000)
commit461c623270e4fa9cbab44e3ac2f0ddab2842c034
tree8bcbe433fa9f08e34b63984886a5b4296f149033
parentfe965096c9495ddcf78ec163348105e2baf8d185
ASoC: rt5677: Load firmware via SPI using delayed work

The firmware rt5677_elf_vad is an ELF binary obtained from
request_firmware(). Sections of the ELF are loaded to
the DSP via SPI. A model (e.g. en_us.mmap) can optionally be
loaded to the DSP at RT5677_MODEL_ADDR to overwrite the
baked-in model in rt5677_elf_vad.

Then we switch to DSP mode, load firmware, and let DSP run.
When a hotword is detected, an interrupt is fired and
rt5677_irq() is called. When 'DSP VAD Switch' is turned off,
the codec is set back to normal mode.

The kcontrol 'DSP VAD Switch' is automatically enabled/disabled
when the hotwording PCM stream is opened/closed.

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20191106011335.223061-2-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5677-spi.c
sound/soc/codecs/rt5677.c
sound/soc/codecs/rt5677.h