[PATCH 3/9] MIPS: TXX9: rbtx4927: Use GPIO lookup table for SIO DTR
From: Geert Uytterhoeven
Date: Thu Jun 25 2026 - 08:31:34 EST
Convert SIO DTR handling from legacy GPIO calls to GPIO descriptors
using a GPIO lookup table.
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
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 31955c1d55550fd4..e57c409c318ca220 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -49,6 +49,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/gpio.h>
+#include <linux/gpio/machine.h>
#include <linux/leds.h>
#include <asm/io.h>
#include <asm/reboot.h>
@@ -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);
}
--
2.43.0