]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: Intel: Add generic support for DSP wake, sleep and stall
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>
Wed, 29 Oct 2014 15:40:28 +0000 (15:40 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 29 Oct 2014 16:56:55 +0000 (16:56 +0000)
Add generic functions to support DSP sleep, wake and stall.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/sst-dsp-priv.h
sound/soc/intel/sst-dsp.c
sound/soc/intel/sst-dsp.h

index be81b86b6462a974692a70ce786cad7249b9b807..b9da030e312dc66339e48baab8f17d082b169a0c 100644 (file)
@@ -36,6 +36,9 @@ struct sst_ops {
        /* DSP core boot / reset */
        void (*boot)(struct sst_dsp *);
        void (*reset)(struct sst_dsp *);
+       int (*wake)(struct sst_dsp *);
+       void (*sleep)(struct sst_dsp *);
+       void (*stall)(struct sst_dsp *);
 
        /* Shim IO */
        void (*write)(void __iomem *addr, u32 offset, u32 value);
index d0fc6853b2b7f1c0059c783e15ebfff6b2070f58..86e41084567002ebb999dca591b598a7224690fe 100644 (file)
@@ -245,6 +245,29 @@ int sst_dsp_boot(struct sst_dsp *sst)
 }
 EXPORT_SYMBOL_GPL(sst_dsp_boot);
 
+int sst_dsp_wake(struct sst_dsp *sst)
+{
+       if (sst->ops->wake)
+               return sst->ops->wake(sst);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(sst_dsp_wake);
+
+void sst_dsp_sleep(struct sst_dsp *sst)
+{
+       if (sst->ops->sleep)
+               sst->ops->sleep(sst);
+}
+EXPORT_SYMBOL_GPL(sst_dsp_sleep);
+
+void sst_dsp_stall(struct sst_dsp *sst)
+{
+       if (sst->ops->stall)
+               sst->ops->stall(sst);
+}
+EXPORT_SYMBOL_GPL(sst_dsp_stall);
+
 void sst_dsp_ipc_msg_tx(struct sst_dsp *dsp, u32 msg)
 {
        sst_dsp_shim_write_unlocked(dsp, SST_IPCX, msg | SST_IPCX_BUSY);
index 17ee9239092ab5a40aee19505f7efe7fc83b42ca..7bb4820534894f83897119f769e8dfba597a61a8 100644 (file)
@@ -245,6 +245,10 @@ void sst_memcpy_fromio_32(struct sst_dsp *sst,
 /* DSP reset & boot */
 void sst_dsp_reset(struct sst_dsp *sst);
 int sst_dsp_boot(struct sst_dsp *sst);
+int sst_dsp_wake(struct sst_dsp *sst);
+void sst_dsp_sleep(struct sst_dsp *sst);
+void sst_dsp_stall(struct sst_dsp *sst);
+
 /* DMA */
 int sst_dsp_dma_get_channel(struct sst_dsp *dsp, int chan_id);
 void sst_dsp_dma_put_channel(struct sst_dsp *dsp);