summaryrefslogtreecommitdiff
path: root/sound/soc/intel/common/sst-ipc.c
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-09-26 11:05:28 +0530
committerMark Brown <broonie@kernel.org>2016-10-28 19:05:48 +0100
commitf999d1fd69ede11012a872cbdba33bd9c9c2e386 (patch)
tree30e85621453dab0d6b6242db70d040efb6353ad1 /sound/soc/intel/common/sst-ipc.c
parent6a7f5e41128de638fae7522262d18a6ef9cf1096 (diff)
ASoC: Intel: Add check_dsp_lp_on callback on IPC
Some controllers support power modes which can't communicate using IPC. So add a callback to check and wake DSP before sending IPC and then put to sleep if it is in these power modes. Signed-off-by: Jayachandran B <jayachandran.b@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/common/sst-ipc.c')
-rw-r--r--sound/soc/intel/common/sst-ipc.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c
index 6c672ac79cce..45a85190a081 100644
--- a/sound/soc/intel/common/sst-ipc.c
+++ b/sound/soc/intel/common/sst-ipc.c
@@ -190,8 +190,25 @@ static void ipc_tx_msgs(struct kthread_work *work)
int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc, u64 header,
void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes)
{
- return ipc_tx_message(ipc, header, tx_data, tx_bytes,
+ int ret;
+
+ /*
+ * DSP maybe in lower power active state, so
+ * check if the DSP supports DSP lp On method
+ * if so invoke that before sending IPC
+ */
+ if (ipc->ops.check_dsp_lp_on)
+ if (ipc->ops.check_dsp_lp_on(ipc->dsp, true))
+ return -EIO;
+
+ ret = ipc_tx_message(ipc, header, tx_data, tx_bytes,
rx_data, rx_bytes, 1);
+
+ if (ipc->ops.check_dsp_lp_on)
+ if (ipc->ops.check_dsp_lp_on(ipc->dsp, false))
+ return -EIO;
+
+ return ret;
}
EXPORT_SYMBOL_GPL(sst_ipc_tx_message_wait);