summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2025-12-22 19:41:18 +0000
committerMark Brown <broonie@kernel.org>2025-12-22 19:41:18 +0000
commit0bd4b0f583e2a318441fa88ea71b3d7530ecb646 (patch)
treee89323c4d634fbaf9439a6f52b8fff3a2fdc929b
parent8db50f0fa43efe8799fd40b872dcdd39a90d7549 (diff)
parenta2a631830deb382a3d27b6f52b2d654a3e6bb427 (diff)
ASoC / soc/qcom: Constify APR/GPR callback response
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>: This constifies the response data used for APR/GPR callbacks.
-rw-r--r--include/linux/soc/qcom/apr.h6
-rw-r--r--sound/soc/qcom/qdsp6/q6adm.c6
-rw-r--r--sound/soc/qcom/qdsp6/q6afe.c6
-rw-r--r--sound/soc/qcom/qdsp6/q6apm.c10
-rw-r--r--sound/soc/qcom/qdsp6/q6asm.c10
-rw-r--r--sound/soc/qcom/qdsp6/q6core.c6
-rw-r--r--sound/soc/qcom/qdsp6/q6prm.c6
7 files changed, 25 insertions, 25 deletions
diff --git a/include/linux/soc/qcom/apr.h b/include/linux/soc/qcom/apr.h
index a532d1e4b1f4..6e1b1202e818 100644
--- a/include/linux/soc/qcom/apr.h
+++ b/include/linux/soc/qcom/apr.h
@@ -122,7 +122,7 @@ struct gpr_ibasic_rsp_accepted_t {
#define APR_SVC_MAJOR_VERSION(v) ((v >> 16) & 0xFF)
#define APR_SVC_MINOR_VERSION(v) (v & 0xFF)
-typedef int (*gpr_port_cb) (struct gpr_resp_pkt *d, void *priv, int op);
+typedef int (*gpr_port_cb) (const struct gpr_resp_pkt *d, void *priv, int op);
struct packet_router;
struct pkt_router_svc {
struct device *dev;
@@ -155,8 +155,8 @@ struct apr_driver {
int (*probe)(struct apr_device *sl);
void (*remove)(struct apr_device *sl);
int (*callback)(struct apr_device *a,
- struct apr_resp_pkt *d);
- int (*gpr_callback)(struct gpr_resp_pkt *d, void *data, int op);
+ const struct apr_resp_pkt *d);
+ gpr_port_cb gpr_callback;
struct device_driver driver;
const struct apr_device_id *id_table;
};
diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c
index bbe986293ec3..40bc44003453 100644
--- a/sound/soc/qcom/qdsp6/q6adm.c
+++ b/sound/soc/qcom/qdsp6/q6adm.c
@@ -186,11 +186,11 @@ static void q6adm_free_copp(struct kref *ref)
kfree(c);
}
-static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data)
+static int q6adm_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
- struct aprv2_ibasic_rsp_result_t *result = data->payload;
+ const struct aprv2_ibasic_rsp_result_t *result = data->payload;
int port_idx, copp_idx;
- struct apr_hdr *hdr = &data->hdr;
+ const struct apr_hdr *hdr = &data->hdr;
struct q6copp *copp;
struct q6adm *adm = dev_get_drvdata(&adev->dev);
diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index 76a05a3abe64..76e14fc1b2b5 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -956,11 +956,11 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
return ret;
}
-static int q6afe_callback(struct apr_device *adev, struct apr_resp_pkt *data)
+static int q6afe_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct q6afe *afe = dev_get_drvdata(&adev->dev);
- struct aprv2_ibasic_rsp_result_t *res;
- struct apr_hdr *hdr = &data->hdr;
+ const struct aprv2_ibasic_rsp_result_t *res;
+ const struct apr_hdr *hdr = &data->hdr;
struct q6afe_port *port;
if (!data->payload_size)
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index e30f8648ae15..1d5edf285793 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -490,14 +490,14 @@ int q6apm_get_hw_pointer(struct q6apm_graph *graph, int dir)
}
EXPORT_SYMBOL_GPL(q6apm_get_hw_pointer);
-static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op)
+static int graph_callback(const struct gpr_resp_pkt *data, void *priv, int op)
{
struct data_cmd_rsp_rd_sh_mem_ep_data_buffer_done_v2 *rd_done;
struct data_cmd_rsp_wr_sh_mem_ep_data_buffer_done_v2 *done;
struct apm_cmd_rsp_shared_mem_map_regions *rsp;
- struct gpr_ibasic_rsp_result_t *result;
+ const struct gpr_ibasic_rsp_result_t *result;
struct q6apm_graph *graph = priv;
- struct gpr_hdr *hdr = &data->hdr;
+ const struct gpr_hdr *hdr = &data->hdr;
struct device *dev = graph->dev;
uint32_t client_event;
phys_addr_t phys;
@@ -764,13 +764,13 @@ struct audioreach_module *q6apm_find_module_by_mid(struct q6apm_graph *graph, ui
}
-static int apm_callback(struct gpr_resp_pkt *data, void *priv, int op)
+static int apm_callback(const struct gpr_resp_pkt *data, void *priv, int op)
{
gpr_device_t *gdev = priv;
struct q6apm *apm = dev_get_drvdata(&gdev->dev);
struct device *dev = &gdev->dev;
struct gpr_ibasic_rsp_result_t *result;
- struct gpr_hdr *hdr = &data->hdr;
+ const struct gpr_hdr *hdr = &data->hdr;
result = data->payload;
diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
index 420176f80ffe..d76d29fa0099 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -597,12 +597,12 @@ int q6asm_get_hw_pointer(struct audio_client *ac, unsigned int dir)
EXPORT_SYMBOL_GPL(q6asm_get_hw_pointer);
static int32_t q6asm_stream_callback(struct apr_device *adev,
- struct apr_resp_pkt *data,
+ const struct apr_resp_pkt *data,
int session_id)
{
struct q6asm *q6asm = dev_get_drvdata(&adev->dev);
- struct aprv2_ibasic_rsp_result_t *result;
- struct apr_hdr *hdr = &data->hdr;
+ const struct aprv2_ibasic_rsp_result_t *result;
+ const struct apr_hdr *hdr = &data->hdr;
struct audio_port_data *port;
struct audio_client *ac;
uint32_t client_event = 0;
@@ -742,13 +742,13 @@ done:
}
static int q6asm_srvc_callback(struct apr_device *adev,
- struct apr_resp_pkt *data)
+ const struct apr_resp_pkt *data)
{
struct q6asm *q6asm = dev_get_drvdata(&adev->dev);
struct aprv2_ibasic_rsp_result_t *result;
struct audio_port_data *port;
struct audio_client *ac = NULL;
- struct apr_hdr *hdr = &data->hdr;
+ const struct apr_hdr *hdr = &data->hdr;
struct q6asm *a;
uint32_t sid = 0;
uint32_t dir = 0;
diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c
index 49cfb32cd209..f4939302b88a 100644
--- a/sound/soc/qcom/qdsp6/q6core.c
+++ b/sound/soc/qcom/qdsp6/q6core.c
@@ -67,11 +67,11 @@ struct q6core {
static struct q6core *g_core;
-static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data)
+static int q6core_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct q6core *core = dev_get_drvdata(&adev->dev);
- struct aprv2_ibasic_rsp_result_t *result;
- struct apr_hdr *hdr = &data->hdr;
+ const struct aprv2_ibasic_rsp_result_t *result;
+ const struct apr_hdr *hdr = &data->hdr;
result = data->payload;
switch (hdr->opcode) {
diff --git a/sound/soc/qcom/qdsp6/q6prm.c b/sound/soc/qcom/qdsp6/q6prm.c
index 2544c4519b26..04892fb4423f 100644
--- a/sound/soc/qcom/qdsp6/q6prm.c
+++ b/sound/soc/qcom/qdsp6/q6prm.c
@@ -175,12 +175,12 @@ int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, int clk_
}
EXPORT_SYMBOL_GPL(q6prm_set_lpass_clock);
-static int prm_callback(struct gpr_resp_pkt *data, void *priv, int op)
+static int prm_callback(const struct gpr_resp_pkt *data, void *priv, int op)
{
gpr_device_t *gdev = priv;
struct q6prm *prm = dev_get_drvdata(&gdev->dev);
- struct gpr_ibasic_rsp_result_t *result;
- struct gpr_hdr *hdr = &data->hdr;
+ const struct gpr_ibasic_rsp_result_t *result;
+ const struct gpr_hdr *hdr = &data->hdr;
switch (hdr->opcode) {
case PRM_CMD_RSP_REQUEST_HW_RSC: