Skip to content

Commit 4641840

Browse files
z3ntuandersson
authored andcommitted
remoteproc: qcom_q6v5_mss: Handle platforms with one power domain
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: 8750cf3 ("remoteproc: qcom_q6v5_mss: Allow replacing regulators with power domains") Co-developed-by: Matti Lehtimäki <[email protected]> Signed-off-by: Matti Lehtimäki <[email protected]> Reviewed-by: Stephan Gerhold <[email protected]> Signed-off-by: Luca Weiss <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 41bf2a1 commit 4641840

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

drivers/remoteproc/qcom_q6v5_mss.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,13 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
18311831
while (pd_names[num_pds])
18321832
num_pds++;
18331833

1834+
/* Handle single power domain */
1835+
if (num_pds == 1 && dev->pm_domain) {
1836+
devs[0] = dev;
1837+
pm_runtime_enable(dev);
1838+
return 1;
1839+
}
1840+
18341841
for (i = 0; i < num_pds; i++) {
18351842
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
18361843
if (IS_ERR_OR_NULL(devs[i])) {
@@ -1851,8 +1858,15 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
18511858
static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
18521859
size_t pd_count)
18531860
{
1861+
struct device *dev = qproc->dev;
18541862
int i;
18551863

1864+
/* Handle single power domain */
1865+
if (pd_count == 1 && dev->pm_domain) {
1866+
pm_runtime_disable(dev);
1867+
return;
1868+
}
1869+
18561870
for (i = 0; i < pd_count; i++)
18571871
dev_pm_domain_detach(pds[i], false);
18581872
}
@@ -2449,13 +2463,13 @@ static const struct rproc_hexagon_res msm8974_mss = {
24492463
.supply = "pll",
24502464
.uA = 100000,
24512465
},
2452-
{}
2453-
},
2454-
.fallback_proxy_supply = (struct qcom_mss_reg_res[]) {
24552466
{
24562467
.supply = "mx",
24572468
.uV = 1050000,
24582469
},
2470+
{}
2471+
},
2472+
.fallback_proxy_supply = (struct qcom_mss_reg_res[]) {
24592473
{
24602474
.supply = "cx",
24612475
.uA = 100000,
@@ -2481,7 +2495,6 @@ static const struct rproc_hexagon_res msm8974_mss = {
24812495
NULL
24822496
},
24832497
.proxy_pd_names = (char*[]){
2484-
"mx",
24852498
"cx",
24862499
NULL
24872500
},

0 commit comments

Comments
 (0)