diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-05-13 16:45:17 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-30 16:14:59 +0100 |
commit | 20b7f7c5f13652d6db84b4a68d2473a0d767cac1 (patch) | |
tree | 978a6f9f86183911ccb16b6293730a7d52318ff2 /sound/soc/codecs/wm_adsp.c | |
parent | 97126ce8ce8d6f023b8ce3b71c3df882a2951605 (diff) | |
download | linux-20b7f7c5f13652d6db84b4a68d2473a0d767cac1.tar.bz2 |
ASoC: wm_adsp: Specifically propagate voice trigger event to caller
The DSP uses an IRQ to indicate data is available on the compressed
stream. For voice trigger use-cases the first such IRQ can be considered
an indication that the user has spoken the key phrase triggering the
firmware. Provide a means for the ADSP code to communicate back to the
calling driver whether an IRQ should be considered as trigger event or
not.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index a07bd7c2c587..378ec3095ed6 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -394,6 +394,7 @@ static const struct { int compr_direction; int num_caps; const struct wm_adsp_fw_caps *caps; + bool voice_trigger; } wm_adsp_fw[WM_ADSP_NUM_FW] = { [WM_ADSP_FW_MBC_VSS] = { .file = "mbc-vss" }, [WM_ADSP_FW_HIFI] = { .file = "hifi" }, @@ -406,6 +407,7 @@ static const struct { .compr_direction = SND_COMPRESS_CAPTURE, .num_caps = ARRAY_SIZE(ctrl_caps), .caps = ctrl_caps, + .voice_trigger = true, }, [WM_ADSP_FW_ASR] = { .file = "asr" }, [WM_ADSP_FW_TRACE] = { @@ -2998,6 +3000,9 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp) goto out; } + if (wm_adsp_fw[dsp->fw].voice_trigger && buf->irq_count == 2) + ret = WM_ADSP_COMPR_VOICE_TRIGGER; + out_notify: if (compr && compr->stream) snd_compr_fragment_elapsed(compr->stream); |