diff mbox

[02/10] ASoC: Intel: Add sst_ipc_tx_message_nopm

Message ID 1474868137-29712-3-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Commit 80a0df18191ab50eee7da3cd56cecdd55b7ab148
Headers show

Commit Message

Vinod Koul Sept. 26, 2016, 5:35 a.m. UTC
Add a IPC API to send IPC without waking up DSP.

This is helpful when the DSP is already in woken up state(not in any low
power mode) and an IPC is to be sent.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/common/sst-ipc.c | 8 ++++++++
 sound/soc/intel/common/sst-ipc.h | 3 +++
 2 files changed, 11 insertions(+)

Comments

Mark Brown Oct. 28, 2016, 6:05 p.m. UTC | #1
On Mon, Sep 26, 2016 at 11:05:29AM +0530, Vinod Koul wrote:
> Add a IPC API to send IPC without waking up DSP.
> 
> This is helpful when the DSP is already in woken up state(not in any low
> power mode) and an IPC is to be sent.

Why is the IPC API for cases where the DSP needs to be woken not
implemented in terms of this one?
Vinod Koul Oct. 30, 2016, 9:37 p.m. UTC | #2
On Fri, Oct 28, 2016 at 07:05:34PM +0100, Mark Brown wrote:
> On Mon, Sep 26, 2016 at 11:05:29AM +0530, Vinod Koul wrote:
> > Add a IPC API to send IPC without waking up DSP.
> > 
> > This is helpful when the DSP is already in woken up state(not in any low
> > power mode) and an IPC is to be sent.
> 
> Why is the IPC API for cases where the DSP needs to be woken not
> implemented in terms of this one?

So driver can send an IPC message but it doesn't know if the device is
active or in low powered mode, so it checks...

But in case of later, the check yields another IPC message to bring up the
DSP, then send the original message. Having same API do both causes circular
dependency, so we ended up doing a nopm variant which is used to only wake
up or put into low power state.

Thanks
diff mbox

Patch

diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c
index 6ac9a8484635..1c9919d8b70a 100644
--- a/sound/soc/intel/common/sst-ipc.c
+++ b/sound/soc/intel/common/sst-ipc.c
@@ -220,6 +220,14 @@  int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc, u64 header,
 }
 EXPORT_SYMBOL_GPL(sst_ipc_tx_message_nowait);
 
+int sst_ipc_tx_message_nopm(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,
+		rx_data, rx_bytes, 1);
+}
+EXPORT_SYMBOL_GPL(sst_ipc_tx_message_nopm);
+
 struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
 	u64 header)
 {
diff --git a/sound/soc/intel/common/sst-ipc.h b/sound/soc/intel/common/sst-ipc.h
index 46871a5dff1d..f4aab1b3789a 100644
--- a/sound/soc/intel/common/sst-ipc.h
+++ b/sound/soc/intel/common/sst-ipc.h
@@ -82,6 +82,9 @@  int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc, u64 header,
 int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc, u64 header,
 	void *tx_data, size_t tx_bytes);
 
+int sst_ipc_tx_message_nopm(struct sst_generic_ipc *ipc, u64 header,
+	void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
+
 struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
 	u64 header);