[PATCH v2 06/11] ASoC: q6dsp: audioreach: Add gapless feature support

From: Srinivas Kandagatla
Date: Fri Jun 09 2023 - 10:56:34 EST


From: Mohammad Rafi Shaik <quic_mohs@xxxxxxxxxxx>

Add support for setting EOS delay command and receive the
EOS response from ADSP, for seamless compress offload
playback feature.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
Co-developed-by: Mohammad Rafi Shaik <quic_mohs@xxxxxxxxxxx>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@xxxxxxxxxxx>
---
sound/soc/qcom/qdsp6/audioreach.c | 11 +++++++++++
sound/soc/qcom/qdsp6/audioreach.h | 7 +++++++
2 files changed, 18 insertions(+)

diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
index 6d0f4c8505f1..fefab20aaf1c 100644
--- a/sound/soc/qcom/qdsp6/audioreach.c
+++ b/sound/soc/qcom/qdsp6/audioreach.c
@@ -787,6 +787,14 @@ static int audioreach_module_enable(struct q6apm_graph *graph,
return audioreach_send_u32_param(graph, module, PARAM_ID_MODULE_ENABLE, enable);
}

+static int audioreach_gapless_set_media_format(struct q6apm_graph *graph,
+ struct audioreach_module *module,
+ struct audioreach_module_config *cfg)
+{
+ return audioreach_send_u32_param(graph, module, PARAM_ID_EARLY_EOS_DELAY,
+ EARLY_EOS_DELAY_MS);
+}
+
static int audioreach_mfc_set_media_format(struct q6apm_graph *graph,
struct audioreach_module *module,
struct audioreach_module_config *cfg)
@@ -1268,6 +1276,9 @@ int audioreach_set_media_format(struct q6apm_graph *graph, struct audioreach_mod
case MODULE_ID_MFC:
rc = audioreach_mfc_set_media_format(graph, module, cfg);
break;
+ case MODULE_ID_GAPLESS:
+ rc = audioreach_gapless_set_media_format(graph, module, cfg);
+ break;
default:
rc = 0;
}
diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h
index dc089879b501..e38111ffd7b9 100644
--- a/sound/soc/qcom/qdsp6/audioreach.h
+++ b/sound/soc/qcom/qdsp6/audioreach.h
@@ -27,6 +27,7 @@ struct q6apm_graph;
#define MODULE_ID_AAC_DEC 0x0700101F
#define MODULE_ID_FLAC_DEC 0x0700102F
#define MODULE_ID_MP3_DECODE 0x0700103B
+#define MODULE_ID_GAPLESS 0x0700104D
#define MODULE_ID_DISPLAY_PORT_SINK 0x07001069

#define APM_CMD_GET_SPF_STATE 0x01001021
@@ -552,6 +553,8 @@ struct param_id_sal_limiter_enable {
} __packed;

#define PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT 0x08001024
+#define PARAM_ID_EARLY_EOS_DELAY 0x0800114C
+#define EARLY_EOS_DELAY_MS 150

struct param_id_mfc_media_format {
uint32_t sample_rate;
@@ -560,6 +563,10 @@ struct param_id_mfc_media_format {
uint16_t channel_mapping[];
} __packed;

+struct param_id_gapless_early_eos_delay_t {
+ uint32_t early_eos_delay_ms;
+} __packed;
+
struct media_format {
uint32_t data_format;
uint32_t fmt_id;
--
2.21.0