]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: arizona: Add event notification on voice trigger events
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 13 May 2016 15:45:19 +0000 (16:45 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 30 May 2016 15:14:36 +0000 (16:14 +0100)
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>
sound/soc/codecs/arizona.h
sound/soc/codecs/cs47l24.c
sound/soc/codecs/wm5110.c

index 245d13c157a50b3ad4897fa5a36fbcb0bee210a9..18d347f3bfbecbab1f864731a2ef1c1180e8037a 100644 (file)
@@ -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;
 
index fa9a6a5a6120ce82efd1db264863dba5acee3302..7e3d138d077b665bb50724d0b78538368bc3b215 100644 (file)
@@ -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) {
index 338a3b52705b2b3f3f8298fe281d199541b81b9e..dbc9b4df38a088d0e047dd287d3e3335e6b62667 100644 (file)
@@ -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) {