mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ARM: zii-imx8mq-dev: fixup touchscreen and ethernet switch alias
Date: Tue, 17 Dec 2019 12:18:54 +0100	[thread overview]
Message-ID: <20191217111854.3164-3-l.stach@pengutronix.de> (raw)
In-Reply-To: <20191217111854.3164-1-l.stach@pengutronix.de>

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/zii-imx8mq-dev/board.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index 0be68423d9bf..76d499a37094 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -44,7 +44,7 @@ device_initcall(zii_imx8mq_dev_init);
 
 static int zii_imx8mq_dev_fixup_egalax_ts(struct device_node *root, void *ctx)
 {
-	struct device_node *np;
+	struct device_node *np, * aliases;
 
 	/*
 	 * The 27" unit has a EETI eGalax touchscreen instead of the
@@ -64,6 +64,12 @@ static int zii_imx8mq_dev_fixup_egalax_ts(struct device_node *root, void *ctx)
 
 	of_device_enable(np);
 
+	aliases = of_find_node_by_path_from(root, "/aliases");
+	if (!aliases)
+		return -ENODEV;
+
+	of_property_write_string(aliases, "touchscreen0", np->full_name);
+
 	return 0;
 }
 
@@ -109,7 +115,8 @@ static int zii_imx8mq_dev_fixup_deb_internal(void)
 
 static int zii_imx8mq_dev_fixup_deb(struct device_node *root, void *ctx)
 {
-	struct device_node *np;
+	struct device_node *np, *aliases;
+	struct property *pp;
 
 	/*
 	 * In the kernel DT remove all devices from the DEB, which isn't
@@ -127,6 +134,16 @@ static int zii_imx8mq_dev_fixup_deb(struct device_node *root, void *ctx)
 
 	of_device_disable(np);
 
+	aliases = of_find_node_by_path_from(root, "/aliases");
+	if (!aliases)
+		return -ENODEV;
+
+	pp = of_find_property(aliases, "ethernet-switch0", NULL);
+	if (!pp)
+		return -ENODEV;
+
+	of_delete_property(pp);
+
 	return 0;
 }
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-12-17 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 11:18 [PATCH 1/3] ARM: zii-imx8mq-dev: make eMMC update target the default Lucas Stach
2019-12-17 11:18 ` [PATCH 2/3] ARM: zii-imx8mq-dev: add DT fixups Lucas Stach
2019-12-18 13:54   ` Andrey Smirnov
2019-12-18 13:56     ` Lucas Stach
2019-12-18 14:37       ` Andrey Smirnov
2019-12-18 15:05         ` Lucas Stach
2019-12-18 15:13           ` Andrey Smirnov
2019-12-17 11:18 ` Lucas Stach [this message]
2019-12-18  7:29 ` [PATCH 1/3] ARM: zii-imx8mq-dev: make eMMC update target the default 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=20191217111854.3164-3-l.stach@pengutronix.de \
    --to=l.stach@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