]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: q6asm: add support to gapless flag in q6asm open
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 27 Jul 2020 09:38:02 +0000 (10:38 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Aug 2020 17:29:35 +0000 (18:29 +0100)
This patch adds support to gapless flag to q6asm_open_write().

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6asm-dai.c
sound/soc/qcom/qdsp6/q6asm.c
sound/soc/qcom/qdsp6/q6asm.h

index 2024917b6c52e850a248d614ead19edbdca79ab5..88e8452c1999134751591c2a8a3ca39aee49b87a 100644 (file)
@@ -255,7 +255,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,
@@ -682,7 +682,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");
index 8861b70fb0ce2bdf1aac2f6e6189c080f0d01522..d745a02fcd5f7d97e7263d5816f338d4f2a628dd 100644 (file)
@@ -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 |= BIT(ASM_SHIFT_GAPLESS_MODE_FLAG);
 
        /* source endpoint : matrix */
        open->sink_endpointype = ASM_END_POINT_DEVICE_MATRIX;
index 2acfc2274069b6f3bbc0402b9d3e8428b27eb325..f20e1441988f0ab498201c62993c33690ca3a232 100644 (file)
@@ -99,7 +99,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);