[PATCH 4/9] MIPS: TXX9: rbtx4927: Use GPIO lookup table for TXx9 LEDs
From: Geert Uytterhoeven
Date: Thu Jun 25 2026 - 08:23:51 EST
Convert TXx9 LED description from legacy GPIO numbers to GPIO
descriptors using a GPIO lookup table.
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
arch/mips/txx9/rbtx4927/setup.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index e57c409c318ca220..618f6a6ab3de08f1 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -327,11 +327,19 @@ static void __init rbtx4927_mtd_init(void)
tx4927_mtd_init(i);
}
+static struct gpiod_lookup_table rbtx4927_gpioled_table = {
+ .table = {
+ GPIO_LOOKUP_IDX("TXx9", 0, NULL, 0, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("TXx9", 1, NULL, 1, GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
static void __init rbtx4927_gpioled_init(void)
{
static const struct gpio_led leds[] = {
- { .name = "gpioled:green:0", .gpio = 0, .active_low = 1, },
- { .name = "gpioled:green:1", .gpio = 1, .active_low = 1, },
+ { .name = "gpioled:green:0", },
+ { .name = "gpioled:green:1", },
};
static struct gpio_led_platform_data pdata = {
.num_leds = ARRAY_SIZE(leds),
@@ -344,6 +352,8 @@ static void __init rbtx4927_gpioled_init(void)
pdev->dev.platform_data = &pdata;
if (platform_device_add(pdev))
platform_device_put(pdev);
+ rbtx4927_gpioled_table.dev_id = dev_name(&pdev->dev);
+ gpiod_add_lookup_table(&rbtx4927_gpioled_table);
}
static void __init rbtx4927_device_init(void)
--
2.43.0