From 0caeacb1169193b31f0a00e3b1cb2ba452ca2da4 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 1 Jul 2026 12:11:38 +0200 Subject: [PATCH] MIPS: TXX9: rbtx4927: Use GPIO lookup table for SIO DTR Convert SIO DTR handling from legacy GPIO calls to GPIO descriptors using a GPIO lookup table. Signed-off-by: Geert Uytterhoeven Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Signed-off-by: Thomas Bogendoerfer --- arch/mips/txx9/rbtx4927/setup.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c index 31955c1d5555..e57c409c318c 100644 --- a/arch/mips/txx9/rbtx4927/setup.c +++ b/arch/mips/txx9/rbtx4927/setup.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -157,11 +158,20 @@ static inline void tx4927_pci_setup(void) {} static inline void tx4937_pci_setup(void) {} #endif /* CONFIG_PCI */ +/* TX4927-SIO DTR on (PIO[15]) */ +GPIO_LOOKUP_SINGLE(sio_gpio_table, NULL, "TXx9", 15, "sio-dtr", + GPIO_ACTIVE_HIGH); + static void __init rbtx4927_gpio_init(void) { - /* TX4927-SIO DTR on (PIO[15]) */ - gpio_request(15, "sio-dtr"); - gpio_direction_output(15, 1); + struct gpio_desc *d; + + gpiod_add_lookup_table(&sio_gpio_table); + d = gpiod_get(NULL, "sio-dtr", GPIOD_OUT_HIGH); + if (IS_ERR(d)) + pr_err("Unable to get sio-dtr GPIO descriptor\n"); + else + gpiod_put(d); tx4927_sio_init(0, 0); }