[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230112202612.791455-3-matti.lehtimaki@gmail.com>
Date: Thu, 12 Jan 2023 22:26:05 +0200
From: Matti Lehtimäki <matti.lehtimaki@...il.com>
To: linux-arm-msm@...r.kernel.org
Cc: ~postmarketos/upstreaming@...ts.sr.ht, phone-devel@...r.kernel.org,
Luca Weiss <luca@...tu.xyz>,
Matti Lehtimäki <matti.lehtimaki@...il.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/8] remoteproc: qcom_q6v5_mss: Handle platforms with only single power domain
From: Luca Weiss <luca@...tu.xyz>
For example MSM8226 has only one power domain (cx) which is attached
internally in power domain and cannot be attached in this driver.
Signed-off-by: Luca Weiss <luca@...tu.xyz>
Signed-off-by: Matti Lehtimäki <matti.lehtimaki@...il.com>
---
drivers/remoteproc/qcom_q6v5_mss.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 2f4027664a0e..745627a36bcf 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1820,6 +1820,13 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
if (!pd_names)
return 0;
+ /* Handle single power domain */
+ if (dev->pm_domain) {
+ devs[0] = dev;
+ pm_runtime_enable(dev);
+ return 1;
+ }
+
while (pd_names[num_pds])
num_pds++;
@@ -1843,8 +1850,15 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
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 (dev->pm_domain && pd_count) {
+ pm_runtime_disable(dev);
+ return;
+ }
+
for (i = 0; i < pd_count; i++)
dev_pm_domain_detach(pds[i], false);
}
--
2.34.1
Powered by blists - more mailing lists