ASoC: Intel: Skylake: Use CGCTL.MISCBDCGE for Phrase detection notification
[cascardo/linux.git] / sound / soc / intel / skylake / skl-sst-ipc.c
index 62e665a..5434602 100644 (file)
 
 #include "../common/sst-dsp.h"
 #include "../common/sst-dsp-priv.h"
+#include "skl.h"
 #include "skl-sst-dsp.h"
 #include "skl-sst-ipc.h"
+#include "sound/hdaudio_ext.h"
 
 
 #define IPC_IXC_STATUS_BITS            24
@@ -322,6 +324,19 @@ static int skl_ipc_process_notification(struct sst_generic_ipc *ipc,
                        wake_up(&skl->boot_wait);
                        break;
 
+               case IPC_GLB_NOTIFY_PHRASE_DETECTED:
+                       dev_dbg(ipc->dev, "***** Phrase Detected **********\n");
+
+                       /*
+                        * Per HW recomendation, After phrase detection,
+                        * clear the CGCTL.MISCBDCGE.
+                        *
+                        * This will be set back on stream closure
+                        */
+                       skl->enable_miscbdcge(ipc->dev, false);
+                       skl->miscbdcg_disabled = true;
+                       break;
+
                default:
                        dev_err(ipc->dev, "ipc: Unhandled error msg=%x",
                                                header.primary);