]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
remoteproc: qcom_q6v5_mss: Handle platforms with one power domain
authorLuca Weiss <luca@lucaweiss.eu>
Mon, 17 Feb 2025 22:05:18 +0000 (23:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:31 +0000 (14:37 +0200)
[ Upstream commit 4641840341f37dc8231e0840ec1514b4061b4322 ]

For example MSM8974 has mx voltage rail exposed as regulator and only cx
voltage rail is exposed as power domain. This power domain (cx) is
attached internally in power domain and cannot be attached in this driver.

Fixes: 8750cf392394 ("remoteproc: qcom_q6v5_mss: Allow replacing regulators with power domains")
Co-developed-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
Link: https://lore.kernel.org/r/20250217-msm8226-modem-v5-4-2bc74b80e0ae@lucaweiss.eu
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/qcom_q6v5_mss.c

index 2d717f2ed396c66a97c5468240e678697c27a83d..8f93489aa0d492e39511a459007b1618b8747494 100644 (file)
@@ -1838,6 +1838,13 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
        while (pd_names[num_pds])
                num_pds++;
 
+       /* Handle single power domain */
+       if (num_pds == 1 && dev->pm_domain) {
+               devs[0] = dev;
+               pm_runtime_enable(dev);
+               return 1;
+       }
+
        for (i = 0; i < num_pds; i++) {
                devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
                if (IS_ERR_OR_NULL(devs[i])) {
@@ -1858,8 +1865,15 @@ unroll_attach:
 static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
                            size_t pd_count)
 {
+       struct device *dev = qproc->dev;
        int i;
 
+       /* Handle single power domain */
+       if (pd_count == 1 && dev->pm_domain) {
+               pm_runtime_disable(dev);
+               return;
+       }
+
        for (i = 0; i < pd_count; i++)
                dev_pm_domain_detach(pds[i], false);
 }
@@ -2471,13 +2485,13 @@ static const struct rproc_hexagon_res msm8974_mss = {
                        .supply = "pll",
                        .uA = 100000,
                },
-               {}
-       },
-       .fallback_proxy_supply = (struct qcom_mss_reg_res[]) {
                {
                        .supply = "mx",
                        .uV = 1050000,
                },
+               {}
+       },
+       .fallback_proxy_supply = (struct qcom_mss_reg_res[]) {
                {
                        .supply = "cx",
                        .uA = 100000,
@@ -2503,7 +2517,6 @@ static const struct rproc_hexagon_res msm8974_mss = {
                NULL
        },
        .proxy_pd_names = (char*[]){
-               "mx",
                "cx",
                NULL
        },