From a176cfb82a91af942385907da6843132a6d76dc7 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Tue, 17 Dec 2019 12:18:54 +0100 Subject: ARM: zii-imx8mq-dev: fixup touchscreen and ethernet switch alias Signed-off-by: Lucas Stach Signed-off-by: Sascha Hauer --- 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 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; } -- cgit v1.2.3