linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: broonie@kernel.org
Cc: vkoul@kernel.org, perex@perex.cz, tiwai@suse.com,
	lgirdwood@gmail.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, ckeepax@opensource.cirrus.com,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH 07/11] ASoC: q6asm: add support to gapless flag in asm open
Date: Tue,  7 Jul 2020 17:36:37 +0100	[thread overview]
Message-ID: <20200707163641.17113-8-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20200707163641.17113-1-srinivas.kandagatla@linaro.org>

This patch adds support to gapless flag to q6asm_open_write().

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/qdsp6/q6asm-dai.c | 4 ++--
 sound/soc/qcom/qdsp6/q6asm.c     | 4 +++-
 sound/soc/qcom/qdsp6/q6asm.h     | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index c3558288242a..8c214436a2c2 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -258,7 +258,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		ret = q6asm_open_write(prtd->audio_client, prtd->stream_id,
 				       FORMAT_LINEAR_PCM,
-				       0, prtd->bits_per_sample);
+				       0, prtd->bits_per_sample, false);
 	} else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
 		ret = q6asm_open_read(prtd->audio_client, prtd->stream_id,
 				      FORMAT_LINEAR_PCM,
@@ -685,7 +685,7 @@ static int q6asm_dai_compr_set_params(struct snd_soc_component *component,
 	if (dir == SND_COMPRESS_PLAYBACK) {
 		ret = q6asm_open_write(prtd->audio_client, prtd->stream_id,
 				       params->codec.id, params->codec.profile,
-				       prtd->bits_per_sample);
+				       prtd->bits_per_sample, true);
 
 		if (ret < 0) {
 			dev_err(dev, "q6asm_open_write failed\n");
diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
index 14ec7dad5b65..22ac99029e56 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -923,7 +923,7 @@ static int q6asm_ac_send_cmd_sync(struct audio_client *ac, struct apr_pkt *pkt)
  */
 int q6asm_open_write(struct audio_client *ac, uint32_t stream_id,
 		     uint32_t format, u32 codec_profile,
-		     uint16_t bits_per_sample)
+		     uint16_t bits_per_sample, bool is_gapless)
 {
 	struct asm_stream_cmd_open_write_v3 *open;
 	struct apr_pkt *pkt;
@@ -943,6 +943,8 @@ int q6asm_open_write(struct audio_client *ac, uint32_t stream_id,
 	pkt->hdr.opcode = ASM_STREAM_CMD_OPEN_WRITE_V3;
 	open->mode_flags = 0x00;
 	open->mode_flags |= ASM_LEGACY_STREAM_SESSION;
+	if (is_gapless)
+		open->mode_flags |= BIT(ASM_SHIFT_GAPLESS_MODE_FLAG);
 
 	/* source endpoint : matrix */
 	open->sink_endpointype = ASM_END_POINT_DEVICE_MATRIX;
diff --git a/sound/soc/qcom/qdsp6/q6asm.h b/sound/soc/qcom/qdsp6/q6asm.h
index e315f7ff5e54..69513ac1fa55 100644
--- a/sound/soc/qcom/qdsp6/q6asm.h
+++ b/sound/soc/qcom/qdsp6/q6asm.h
@@ -100,7 +100,7 @@ int q6asm_write_async(struct audio_client *ac, uint32_t stream_id, uint32_t len,
 		      uint32_t msw_ts, uint32_t lsw_ts, uint32_t flags);
 int q6asm_open_write(struct audio_client *ac, uint32_t stream_id,
 		     uint32_t format, u32 codec_profile,
-		     uint16_t bits_per_sample);
+		     uint16_t bits_per_sample, bool is_gapless);
 
 int q6asm_open_read(struct audio_client *ac, uint32_t stream_id,
 		    uint32_t format, uint16_t bits_per_sample);
-- 
2.21.0


  parent reply	other threads:[~2020-07-07 16:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 16:36 [PATCH 00/11] ASoC: qdsp6: add gapless compressed audio support Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 01/11] ASoC: q6asm: add command opcode to timeout error report Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 02/11] ASoC: q6asm: rename misleading session id variable Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 03/11] ASoC: q6asm: make commands specific to streams Srinivas Kandagatla
2020-07-07 16:52   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-08 13:13       ` Mark Brown
2020-07-08 15:26         ` Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 04/11] ASoC: q6asm: use flags directly from asm-dai Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 05/11] ASoC: q6asm: add length to write command token Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 06/11] ASoC: q6asm: add support to remove intial and trailing silence Srinivas Kandagatla
2020-07-07 16:55   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-07 16:36 ` Srinivas Kandagatla [this message]
2020-07-07 16:57   ` [PATCH 07/11] ASoC: q6asm: add support to gapless flag in asm open Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 08/11] ASoC: q6asm-dai: add next track metadata support Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 09/11] ASoC: qdsp6: use dev_err instead of pr_err Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 10/11] ASoC: qdsp6-dai: add gapless support Srinivas Kandagatla
2020-07-07 17:07   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-08 13:32       ` Pierre-Louis Bossart
2020-07-08 13:42         ` Mark Brown
2020-07-08 15:23         ` Srinivas Kandagatla
2020-07-08 16:58           ` Pierre-Louis Bossart
2020-07-07 16:36 ` [PATCH 11/11] ASoC: q6asm-dai: add support to copy callback Srinivas Kandagatla
2020-07-08 13:32 ` [PATCH 00/11] ASoC: qdsp6: add gapless compressed audio support Mark Brown
2020-07-08 15:24   ` Srinivas Kandagatla
2020-07-08 16:59 ` 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=20200707163641.17113-8-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).