From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 7/7] oftree: expose reset_source device in device tree
Date: Sun, 25 Aug 2019 17:58:44 +0200 [thread overview]
Message-ID: <20190825155844.18455-8-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20190825155844.18455-1-u.kleine-koenig@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
common/oftree.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/common/oftree.c b/common/oftree.c
index 28a3b965ffee..09cb66021217 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -145,6 +145,7 @@ static int of_fixup_bootargs(struct device_node *root, void *unused)
const char *str;
int err;
int instance = reset_source_get_instance();
+ struct device_d *dev;
str = linux_bootargs_get();
if (!str)
@@ -164,6 +165,19 @@ static int of_fixup_bootargs(struct device_node *root, void *unused)
if (instance >= 0)
of_property_write_u32(node, "reset-source-instance", instance);
+
+ dev = reset_source_get_device();
+ if (dev && dev->device_node) {
+ phandle phandle;
+
+ phandle = of_node_create_phandle(dev->device_node);
+
+ err = of_property_write_u32(node,
+ "reset-source-device", phandle);
+ if (err)
+ return err;
+ }
+
return of_fixup_bootargs_bootsource(root, node);
}
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-08-25 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-25 15:58 [PATCH v2 0/7] clean up and complement reset source handling Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 1/7] reset_source: use instance = -1 as default Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 2/7] reset_source: fix ordering of exported functions Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 3/7] reset_source: drop reset_source_set_instance() Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 4/7] reset_source: implement helper to set a device as reset source Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 5/7] mfd: da9053: use new reset_source_set_device() Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 6/7] mfd: da9063: " Uwe Kleine-König
2019-08-25 15:58 ` Uwe Kleine-König [this message]
2019-08-28 11:34 ` [PATCH v2 0/7] clean up and complement reset source handling Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190825155844.18455-8-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox