All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] soc: mediatek: Allow gaps in SCP PDs
@ 2018-09-03 20:08 Jasper Mattsson
  0 siblings, 0 replies; only message in thread
From: Jasper Mattsson @ 2018-09-03 20:08 UTC (permalink / raw)
  To: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w

The power domains array for MT6797 contains gaps, since most MFG-related
power domains are missing. This causes a lookup for a regulator with
a NULL name fail, and this will cause the probe of SCPSYS to fail. This
patch skips gaps in the array by detecting if the power domain name is
NULL. This could all be easily solved by reordering the #defines in
dt-bindings, but that could break existing DTBs.

Signed-off-by: Jasper Mattsson <jasu-tmnvWD0sGVAk+I/owrrOrA@public.gmane.org>
---
 drivers/soc/mediatek/mtk-scpsys.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c
index 4808d71c5..c60a17e56 100644
--- a/drivers/soc/mediatek/mtk-scpsys.c
+++ b/drivers/soc/mediatek/mtk-scpsys.c
@@ -402,6 +402,9 @@ static struct scp *init_scp(struct platform_device *pdev,
 		struct scp_domain *scpd = &scp->domains[i];
 		const struct scp_domain_data *data = &scp_domain_data[i];
 
+		if (!data->name)
+			continue;
+
 		scpd->supply = devm_regulator_get_optional(&pdev->dev, data->name);
 		if (IS_ERR(scpd->supply)) {
 			if (PTR_ERR(scpd->supply) == -ENODEV)
@@ -420,6 +423,9 @@ static struct scp *init_scp(struct platform_device *pdev,
 		struct generic_pm_domain *genpd = &scpd->genpd;
 		const struct scp_domain_data *data = &scp_domain_data[i];
 
+		if (!data->name)
+			continue;
+
 		pd_data->domains[i] = genpd;
 		scpd->scp = scp;
 
@@ -457,6 +463,9 @@ static void mtk_register_power_domains(struct platform_device *pdev,
 		struct scp_domain *scpd = &scp->domains[i];
 		struct generic_pm_domain *genpd = &scpd->genpd;
 
+		if (!genpd->name)
+			continue;
+
 		/*
 		 * Initially turn on all domains to make the domains usable
 		 * with !CONFIG_PM and to get the hardware in sync with the
-- 
2.18.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-03 20:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 20:08 [PATCH 2/3] soc: mediatek: Allow gaps in SCP PDs Jasper Mattsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.