Skip to content

Commit

Permalink
ASoC: arizona: Add event notification on voice trigger events
Browse files Browse the repository at this point in the history
Inform the notifier chain if the DSP recognises a voice trigger.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Charles Keepax authored and Mark Brown committed May 30, 2016
1 parent 2230c49 commit 7baa7e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/codecs/arizona.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
#define ARIZONA_DVFS_SR1_RQ 0x001
#define ARIZONA_DVFS_ADSP1_RQ 0x100

/* Notifier events */
#define ARIZONA_NOTIFY_VOICE_TRIGGER 0x1

struct arizona;
struct wm_adsp;

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/cs47l24.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,10 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data)
ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
if (ret != -ENODEV)
serviced++;
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
arizona_call_notifiers(arizona,
ARIZONA_NOTIFY_VOICE_TRIGGER,
(void *)i);
}

if (!serviced) {
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/wm5110.c
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,10 @@ static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]);
if (ret != -ENODEV)
serviced++;
if (ret == WM_ADSP_COMPR_VOICE_TRIGGER)
arizona_call_notifiers(arizona,
ARIZONA_NOTIFY_VOICE_TRIGGER,
(void *)i);
}

if (!serviced) {
Expand Down

0 comments on commit 7baa7e2

Please sign in to comment.