All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] imx: power-domain: Descend into pgc subnode if present
@ 2022-03-31  3:03 Marek Vasut
  2022-03-31  3:03 ` [PATCH 2/3] imx: power-domain: Inline arch-imx8m/power-domain.h Marek Vasut
  2022-03-31  3:03 ` [PATCH 3/3] imx: power-domain: Get rid of SMCCC dependency Marek Vasut
  0 siblings, 2 replies; 25+ messages in thread
From: Marek Vasut @ 2022-03-31  3:03 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Fabio Estevam, Peng Fan, Stefano Babic

In case the power domain node structure is gpc@303a0000/pgc/power-domain@N,
do not bind power domain driver to the 'pgc' node, but rather descend into
it and only bind power domain drivers to power-domain@N subnodes. This way
we do not waste one useless driver instance associated with 'pgc' node.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/power/domain/imx8m-power-domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c
index 6082ee6ff8c..ac7411f8327 100644
--- a/drivers/power/domain/imx8m-power-domain.c
+++ b/drivers/power/domain/imx8m-power-domain.c
@@ -73,6 +73,12 @@ static int imx8m_power_domain_bind(struct udevice *dev)
 		/* Bind the subnode to this driver */
 		name = fdt_get_name(gd->fdt_blob, offset, NULL);
 
+		/* Descend into 'pgc' subnode */
+		if (!strstr(name, "power-domain")) {
+			offset = fdt_first_subnode(gd->fdt_blob, offset);
+			name = fdt_get_name(gd->fdt_blob, offset, NULL);
+		}
+
 		ret = device_bind_with_driver_data(dev, dev->driver, name,
 						   dev->driver_data,
 						   offset_to_ofnode(offset),
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-04-17 22:02 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  3:03 [PATCH 1/3] imx: power-domain: Descend into pgc subnode if present Marek Vasut
2022-03-31  3:03 ` [PATCH 2/3] imx: power-domain: Inline arch-imx8m/power-domain.h Marek Vasut
2022-03-31  3:03 ` [PATCH 3/3] imx: power-domain: Get rid of SMCCC dependency Marek Vasut
2022-04-04 12:51   ` Adam Ford
2022-04-04 13:01     ` Marek Vasut
2022-04-04 14:15       ` Adam Ford
2022-04-04 14:25         ` Marek Vasut
2022-04-05 20:14           ` Tim Harvey
2022-04-05 23:00             ` Marek Vasut
2022-04-06 12:22               ` Adam Ford
2022-04-06 12:27                 ` Fabio Estevam
2022-04-06 12:40                   ` Adam Ford
2022-04-06 13:13                     ` Marek Vasut
2022-04-17 22:02             ` Adam Ford
2022-04-07 22:21   ` Tim Harvey
2022-04-16 20:49     ` Adam Ford
2022-04-17  0:35       ` Marek Vasut
2022-04-17  1:01         ` Adam Ford
2022-04-17  2:13           ` Marek Vasut
2022-04-17 13:21             ` Adam Ford
2022-04-17 15:16               ` Marek Vasut
2022-04-17 16:37                 ` Adam Ford
2022-04-17 18:15                   ` Marek Vasut
2022-04-17 18:24                     ` Adam Ford
2022-04-17 21:37                       ` Marek Vasut

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.