Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 2/7] ASoC: Intel: Simplify Baytrail stream control IPC construction
Date: Thu,  8 May 2014 16:07:22 +0300	[thread overview]
Message-ID: <1399554447-16297-3-git-send-email-jarkko.nikula@linux.intel.com> (raw)
In-Reply-To: <1399554447-16297-1-git-send-email-jarkko.nikula@linux.intel.com>

Baytrail ADSP stream IPC simplifies a little by moving IPC_IA_START_STREAM
construction and sending directly into sst_byt_stream_start() from
sst_byt_stream_operations(). This is because IPC_IA_START_STREAM is only
stream IPC with extra message data so this move saves a few code lines.

Main motivation for this is to prepare for passing stream start position
to sst_byt_stream_start() which will be needed in resume code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 sound/soc/intel/sst-baytrail-ipc.c | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c
index 0d31dbbf4806..69fdf5c70ea4 100644
--- a/sound/soc/intel/sst-baytrail-ipc.c
+++ b/sound/soc/intel/sst-baytrail-ipc.c
@@ -661,36 +661,32 @@ out:
 static int sst_byt_stream_operations(struct sst_byt *byt, int type,
 				     int stream_id, int wait)
 {
-	struct sst_byt_start_stream_params start_stream;
 	u64 header;
-	void *tx_msg = NULL;
-	size_t size = 0;
-
-	if (type != IPC_IA_START_STREAM) {
-		header = sst_byt_header(type, 0, false, stream_id);
-	} else {
-		start_stream.byte_offset = 0;
-		header = sst_byt_header(IPC_IA_START_STREAM,
-					sizeof(start_stream) + sizeof(u32),
-					true, stream_id);
-		tx_msg = &start_stream;
-		size = sizeof(start_stream);
-	}
 
+	header = sst_byt_header(type, 0, false, stream_id);
 	if (wait)
-		return sst_byt_ipc_tx_msg_wait(byt, header,
-					       tx_msg, size, NULL, 0);
+		return sst_byt_ipc_tx_msg_wait(byt, header, NULL, 0, NULL, 0);
 	else
-		return sst_byt_ipc_tx_msg_nowait(byt, header, tx_msg, size);
+		return sst_byt_ipc_tx_msg_nowait(byt, header, NULL, 0);
 }
 
 /* stream ALSA trigger operations */
 int sst_byt_stream_start(struct sst_byt *byt, struct sst_byt_stream *stream)
 {
+	struct sst_byt_start_stream_params start_stream;
+	void *tx_msg;
+	size_t size;
+	u64 header;
 	int ret;
 
-	ret = sst_byt_stream_operations(byt, IPC_IA_START_STREAM,
-					stream->str_id, 0);
+	start_stream.byte_offset = 0;
+	header = sst_byt_header(IPC_IA_START_STREAM,
+				sizeof(start_stream) + sizeof(u32),
+				true, stream->str_id);
+	tx_msg = &start_stream;
+	size = sizeof(start_stream);
+
+	ret = sst_byt_ipc_tx_msg_nowait(byt, header, tx_msg, size);
 	if (ret < 0)
 		dev_err(byt->dev, "ipc: error failed to start stream %d\n",
 			stream->str_id);
-- 
2.0.0.rc0

  parent reply	other threads:[~2014-05-08 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 13:07 [PATCH 0/7] ASoC: Intel: Baytrail SST suspend/resume support Jarkko Nikula
2014-05-08 13:07 ` [PATCH 1/7] ASoC: Intel: Sample Baytrail DSP DMA pointer only after each period Jarkko Nikula
2014-05-08 13:07 ` Jarkko Nikula [this message]
2014-05-08 13:07 ` [PATCH 3/7] ASoC: Intel: Pass stream start position to sst_byt_stream_start() Jarkko Nikula
2014-05-08 13:07 ` [PATCH 4/7] ASoC: Intel: Move Baytrail extended fw address saving to sst_byt_boot() Jarkko Nikula
2014-05-08 13:07 ` [PATCH 5/7] ASoC: Intel: Allow Rx/Tx message list can be cleared prior to suspend Jarkko Nikula
2014-05-08 13:07 ` [PATCH 6/7] ASoC: Intel: Add Baytrail suspend/resume support Jarkko Nikula
2014-05-08 13:07 ` [PATCH 7/7] ASoC: Intel: Allow byt-5640 machine driver and SST core go to suspend Jarkko Nikula
2014-05-12 21:02 ` [PATCH 0/7] ASoC: Intel: Baytrail SST suspend/resume support Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399554447-16297-3-git-send-email-jarkko.nikula@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox