[PATCH v2 3/6] ASoC: qcom: q6apm: remove shared memory IID helpers
From: Srinivas Kandagatla
Date: Thu May 28 2026 - 15:03:12 EST
The shared memory module instance ID is now cached in graph->shm_iid when
the graph is opened. The old WR/RD shared memory IID helper functions are
no longer used.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
---
sound/soc/qcom/qdsp6/q6apm.c | 41 ++++++++++++------------------------
sound/soc/qcom/qdsp6/q6apm.h | 2 --
2 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index 2cebeb767cd6..6ae7d1645dce 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -417,31 +417,6 @@ int q6apm_graph_media_format_pcm(struct q6apm_graph *graph, struct audioreach_mo
}
EXPORT_SYMBOL_GPL(q6apm_graph_media_format_pcm);
-static int q6apm_graph_get_tx_shmem_module_iid(struct q6apm_graph *graph)
-{
- struct audioreach_module *module;
-
- module = q6apm_find_module_by_mid(graph, MODULE_ID_RD_SHARED_MEM_EP);
- if (!module)
- return -ENODEV;
-
- return module->instance_id;
-
-}
-
-int q6apm_graph_get_rx_shmem_module_iid(struct q6apm_graph *graph)
-{
- struct audioreach_module *module;
-
- module = q6apm_find_module_by_mid(graph, MODULE_ID_WR_SHARED_MEM_EP);
- if (!module)
- return -ENODEV;
-
- return module->instance_id;
-
-}
-EXPORT_SYMBOL_GPL(q6apm_graph_get_rx_shmem_module_iid);
-
int q6apm_write_async(struct q6apm_graph *graph, uint32_t len, uint32_t msw_ts,
uint32_t lsw_ts, uint32_t wflags)
{
@@ -614,6 +589,18 @@ static int graph_callback(const struct gpr_resp_pkt *data, void *priv, int op)
return 0;
}
+static int q6apm_graph_get_module_iid(struct q6apm_graph *graph, uint32_t mid)
+{
+ struct audioreach_module *module;
+
+ module = q6apm_find_module_by_mid(graph, mid);
+ if (!module)
+ return -ENODEV;
+
+ return module->instance_id;
+
+}
+
struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb,
void *priv, int graph_id, int dir)
{
@@ -643,9 +630,9 @@ struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb,
graph->dev = dev;
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
- graph->shm_iid = q6apm_graph_get_rx_shmem_module_iid(graph);
+ graph->shm_iid = q6apm_graph_get_module_iid(graph, MODULE_ID_WR_SHARED_MEM_EP);
else
- graph->shm_iid = q6apm_graph_get_tx_shmem_module_iid(graph);
+ graph->shm_iid = q6apm_graph_get_module_iid(graph, MODULE_ID_RD_SHARED_MEM_EP);
mutex_init(&graph->lock);
diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h
index 376a36700c53..8ea64085860f 100644
--- a/sound/soc/qcom/qdsp6/q6apm.h
+++ b/sound/soc/qcom/qdsp6/q6apm.h
@@ -148,8 +148,6 @@ int q6apm_send_cmd_sync(struct q6apm *apm, const struct gpr_pkt *pkt,
/* Callback for graph specific */
struct audioreach_module *q6apm_find_module_by_mid(struct q6apm_graph *graph,
uint32_t mid);
-int q6apm_graph_get_rx_shmem_module_iid(struct q6apm_graph *graph);
-
bool q6apm_is_adsp_ready(void);
int q6apm_enable_compress_module(struct device *dev, struct q6apm_graph *graph, bool en);
--
2.53.0