]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: qcom: q6apm: remove shared memory IID helpers
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Thu, 28 May 2026 18:58:02 +0000 (19:58 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 1 Jun 2026 16:19:12 +0000 (17:19 +0100)
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@oss.qualcomm.com>
Link: https://patch.msgid.link/20260528185806.6316-4-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6apm.c
sound/soc/qcom/qdsp6/q6apm.h

index 2cebeb767cd66f29bf72ff70eecc92294fb97f2f..6ae7d1645dce8baa005e79097364587cbff75c2a 100644 (file)
@@ -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);
index 376a36700c5308d36086520b02d704c5ddce78e1..8ea64085860fcf95e312c3796ec2c3f1fec5e676 100644 (file)
@@ -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);