Skip to contentSkip to conversation

ARM: ep93xx: Convert to use descriptors for GPIO LEDs

PATCH Applied Linus Walleij 2 participants 2 messages Jan 11, 2023 – Jan 24, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: ep93xx: Convert to use descriptors for GPIO LEDs

This converts the EP93xx to use GPIO descriptors for the LEDs.

Cc Nikita Shubin <[email protected]>
Cc Alexander Sverdlin <[email protected]>
Cc Hartley Sweeten <[email protected]>
Cc Lukasz Majewski <[email protected]>

---
ChangeLog v3->v4:
- Rebased on v6.2-rc1
- SoC folks: please apply this patch directly for suitable branch. ChangeLog v2->v3:
- Collected Alexander's Tested-by
ChangeLog v1->v2:
- Fix syntax error (doubled left parens)

---
 arch/arm/mach-ep93xx/core.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
arch/arm/mach-ep93xx/core.c +11 -2
index 95e731676cea..71b113976420 100644
@@ -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;
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to soc/soc.git (for-next) by Arnd Bergmann <[email protected]>:

Hello:

This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <[email protected]>:

Quoted 11 lines · On Wed, 11 Jan 2023 14:22:10 +0100 you wrote:

This converts the EP93xx to use GPIO descriptors for the LEDs.

Cc Nikita Shubin <[email protected]>
Cc Alexander Sverdlin <[email protected]>
Cc Hartley Sweeten <[email protected]>
Cc Lukasz Majewski <[email protected]>

[...]

Here is the summary with links:
- ARM: ep93xx: Convert to use descriptors for GPIO LEDs

    https://git.kernel.org/soc/soc/c/91aa6280e308

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html