summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-01-11 14:22:10 +0100
committerArnd Bergmann <arnd@arndb.de>2023-01-24 21:37:47 +0100
commit91aa6280e30875f77b9ecefc909c216c8f1faa68 (patch)
tree57305ac07926cede7983863cbe9683839728e55a /arch/arm/mach-ep93xx
parentMerge tag 'omap-for-v6.3/omap1-signed' of git://git.kernel.org/pub/scm/linux/... (diff)
downloadlinux-91aa6280e30875f77b9ecefc909c216c8f1faa68.tar.xz
linux-91aa6280e30875f77b9ecefc909c216c8f1faa68.zip
ARM: ep93xx: Convert to use descriptors for GPIO LEDs
This converts the EP93xx to use GPIO descriptors for the LEDs. Cc: Nikita Shubin <nikita.shubin@maquefel.me> Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com> Cc: Hartley Sweeten <hsweeten@visionengravers.com> Cc: Lukasz Majewski <lukma@denx.de> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230111132210.134478-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/core.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 95e731676cea..71b113976420 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -426,10 +426,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
static const struct gpio_led ep93xx_led_pins[] __initconst = {
{
.name = "platform:grled",
- .gpio = EP93XX_GPIO_LINE_GRLED,
}, {
.name = "platform:rdled",
- .gpio = EP93XX_GPIO_LINE_RDLED,
},
};
@@ -438,6 +436,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
.leds = ep93xx_led_pins,
};
+static struct gpiod_lookup_table ep93xx_leds_gpio_table = {
+ .dev_id = "leds-gpio",
+ .table = {
+ /* Use local offsets on gpiochip/port "E" */
+ GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP_IDX("E", 1, NULL, 1, GPIO_ACTIVE_HIGH),
+ { }
+ },
+};
+
/*************************************************************************
* EP93xx pwm peripheral handling
*************************************************************************/
@@ -990,6 +998,7 @@ struct device __init *ep93xx_init_devices(void)
platform_device_register(&ep93xx_ohci_device);
platform_device_register(&ep93xx_wdt_device);
+ gpiod_add_lookup_table(&ep93xx_leds_gpio_table);
gpio_led_register_device(-1, &ep93xx_led_data);
return parent;