Commit 20b7f7c5 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 97126ce8
...@@ -394,6 +394,7 @@ static const struct { ...@@ -394,6 +394,7 @@ static const struct {
int compr_direction; int compr_direction;
int num_caps; int num_caps;
const struct wm_adsp_fw_caps *caps; const struct wm_adsp_fw_caps *caps;
bool voice_trigger;
} wm_adsp_fw[WM_ADSP_NUM_FW] = { } wm_adsp_fw[WM_ADSP_NUM_FW] = {
[WM_ADSP_FW_MBC_VSS] = { .file = "mbc-vss" }, [WM_ADSP_FW_MBC_VSS] = { .file = "mbc-vss" },
[WM_ADSP_FW_HIFI] = { .file = "hifi" }, [WM_ADSP_FW_HIFI] = { .file = "hifi" },
...@@ -406,6 +407,7 @@ static const struct { ...@@ -406,6 +407,7 @@ static const struct {
.compr_direction = SND_COMPRESS_CAPTURE, .compr_direction = SND_COMPRESS_CAPTURE,
.num_caps = ARRAY_SIZE(ctrl_caps), .num_caps = ARRAY_SIZE(ctrl_caps),
.caps = ctrl_caps, .caps = ctrl_caps,
.voice_trigger = true,
}, },
[WM_ADSP_FW_ASR] = { .file = "asr" }, [WM_ADSP_FW_ASR] = { .file = "asr" },
[WM_ADSP_FW_TRACE] = { [WM_ADSP_FW_TRACE] = {
...@@ -2998,6 +3000,9 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp) ...@@ -2998,6 +3000,9 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp)
goto out; goto out;
} }
if (wm_adsp_fw[dsp->fw].voice_trigger && buf->irq_count == 2)
ret = WM_ADSP_COMPR_VOICE_TRIGGER;
out_notify: out_notify:
if (compr && compr->stream) if (compr && compr->stream)
snd_compr_fragment_elapsed(compr->stream); snd_compr_fragment_elapsed(compr->stream);
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#include "wmfw.h" #include "wmfw.h"
/* Return values for wm_adsp_compr_handle_irq */
#define WM_ADSP_COMPR_OK 0
#define WM_ADSP_COMPR_VOICE_TRIGGER 1
struct wm_adsp_region { struct wm_adsp_region {
int type; int type;
unsigned int base; unsigned int base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment