aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2020-06-04 16:22:10 +0100
committerVinod Koul <vkoul@kernel.org>2020-07-13 09:45:44 +0530
commit10ea04bb5de84a6a3f547c1dc7d81c7e802237c9 (patch)
tree8e5e691cbd0193abed2cbfdabeec237d1db86343
parenta3e99d9a3100fd8c401c1fb952729c9fa14d410e (diff)
downloadkernel-10ea04bb5de84a6a3f547c1dc7d81c7e802237c9.tar.gz
ASoC: q6asm: add support to gapless flag in asm open
This patch adds support to gapless flag to q6asm_open_write(). Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r--sound/soc/qcom/qdsp6/q6asm-dai.c4
-rw-r--r--sound/soc/qcom/qdsp6/q6asm.c6
-rw-r--r--sound/soc/qcom/qdsp6/q6asm.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index b2316fcf9461..d669bc2bf64f 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,
@@ -684,7 +684,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..891bfeb74451 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -64,7 +64,7 @@
#define ASM_ASYNC_IO_MODE 0x0002
#define ASM_TUN_READ_IO_MODE 0x0004 /* tunnel read write mode */
#define ASM_TUN_WRITE_IO_MODE 0x0008 /* tunnel read write mode */
-#define ASM_SHIFT_GAPLESS_MODE_FLAG 31
+#define ASM_SHIFT_GAPLESS_MODE_FLAG BIT(31)
#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
struct avs_cmd_shared_mem_map_regions {
@@ -923,7 +923,7 @@ err:
*/
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 |= 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 86880f5dbc26..287143454a52 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);