Currently, qcom_q6v5_mss hardcodes 0x12 as the instance ID for the
subsystem control (ssctl) QMI service. However, some platforms (e.g.
MDM9607) provide the service with a different instance ID (0x22).

Make it possible to override the ssctl_id per platform by adding it to the
platform-specific rproc_hexagon_res struct. The same pattern also exists
already inside qcom_q6v5_pas.

Signed-off-by: Stephan Gerhold <[email protected]>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
b/drivers/remoteproc/qcom_q6v5_mss.c
index ae78f5c7c1b6..425601af50d1 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -162,6 +162,7 @@ struct rproc_hexagon_res {
        char **active_clk_names;
        char **proxy_pd_names;
        int version;
+       int ssctl_id;
        bool need_mem_protection;
        bool need_pas_mem_setup;
        bool has_alt_reset;
@@ -2191,7 +2192,7 @@ static int q6v5_probe(struct platform_device *pdev)
        qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
        qcom_add_pdm_subdev(rproc, &qproc->pdm_subdev);
        qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
-       qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
+       qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", desc->ssctl_id);
        if (IS_ERR(qproc->sysmon)) {
                ret = PTR_ERR(qproc->sysmon);
                goto remove_subdevs;
@@ -2271,6 +2272,7 @@ static const struct rproc_hexagon_res sc7180_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_SC7180,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res sc7280_mss = {
@@ -2301,6 +2303,7 @@ static const struct rproc_hexagon_res sc7280_mss = {
        .has_ext_cntl_regs = true,
        .has_vq6 = true,
        .version = MSS_SC7280,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res sdm660_mss = {
@@ -2334,6 +2337,7 @@ static const struct rproc_hexagon_res sdm660_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_SDM660,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res sdm845_mss = {
@@ -2371,6 +2375,7 @@ static const struct rproc_hexagon_res sdm845_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_SDM845,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8998_mss = {
@@ -2404,6 +2409,7 @@ static const struct rproc_hexagon_res msm8998_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8998,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8996_mss = {
@@ -2444,6 +2450,7 @@ static const struct rproc_hexagon_res msm8996_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8996,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res mdm9607_mss = {
@@ -2479,6 +2486,7 @@ static const struct rproc_hexagon_res mdm9607_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MDM9607,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8909_mss = {
@@ -2515,6 +2523,7 @@ static const struct rproc_hexagon_res msm8909_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8909,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8916_mss = {
@@ -2562,6 +2571,7 @@ static const struct rproc_hexagon_res msm8916_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8916,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8917_mss = {
@@ -2606,6 +2616,7 @@ static const struct rproc_hexagon_res msm8917_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8917,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8937_mss = {
@@ -2650,6 +2661,7 @@ static const struct rproc_hexagon_res msm8937_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8937,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8940_mss = {
@@ -2694,6 +2706,7 @@ static const struct rproc_hexagon_res msm8940_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8940,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8953_mss = {
@@ -2731,6 +2744,7 @@ static const struct rproc_hexagon_res msm8953_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8953,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8974_mss = {
@@ -2785,6 +2799,7 @@ static const struct rproc_hexagon_res msm8974_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8974,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8226_mss = {
@@ -2824,6 +2839,7 @@ static const struct rproc_hexagon_res msm8226_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8226,
+       .ssctl_id = 0x12,
 };
 
 static const struct rproc_hexagon_res msm8926_mss = {
@@ -2871,6 +2887,7 @@ static const struct rproc_hexagon_res msm8926_mss = {
        .has_ext_cntl_regs = false,
        .has_vq6 = false,
        .version = MSS_MSM8926,
+       .ssctl_id = 0x12,
 };
 
 static const struct of_device_id q6v5_of_match[] = {

-- 
2.54.0


Reply via email to