diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2019-12-17 12:18:54 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-12-20 16:16:22 +0100 |
commit | a176cfb82a91af942385907da6843132a6d76dc7 (patch) | |
tree | 6706e6c80d2e480e3b75731da3b7a2cddfe54f2b | |
parent | 496b4132d8a0cfc04cbfaf3991111466ee308be1 (diff) | |
download | barebox-a176cfb82a91af942385907da6843132a6d76dc7.tar.gz barebox-a176cfb82a91af942385907da6843132a6d76dc7.tar.xz |
ARM: zii-imx8mq-dev: fixup touchscreen and ethernet switch alias
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/boards/zii-imx8mq-dev/board.c | 21 |
1 files 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 7326dcd2dc..ac455990b0 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; } |