diff options
author | Arnd Bergmann <arnd@arndb.de> | 2024-05-07 10:48:42 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2024-05-07 10:48:42 +0200 |
commit | 5a0054ba8950f5e584c6c4284b8952852a39b081 (patch) | |
tree | aafb92c45331767555d15b79f02fbc6be762e32b /arch/arm/mach-orion5x/net2big-setup.c | |
parent | Merge tag 'imx-soc-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sha... (diff) | |
parent | ARM: orion5x: Convert TS409 board to GPIO descriptors for LEDs (diff) | |
download | linux-5a0054ba8950f5e584c6c4284b8952852a39b081.tar.gz linux-5a0054ba8950f5e584c6c4284b8952852a39b081.tar.bz2 linux-5a0054ba8950f5e584c6c4284b8952852a39b081.zip |
Merge tag 'mvebu-arm-6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into soc/arm
mvebu arm for 6.10 (part 1)
Decrease the usage of global GPIO numbers for LEDs for Orion5x boards
* tag 'mvebu-arm-6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu:
ARM: orion5x: Convert TS409 board to GPIO descriptors for LEDs
ARM: orion5x: Convert Net2big board to GPIO descriptors for LEDs
ARM: orion5x: Convert MV2120 board to GPIO descriptors for LEDs
ARM: orion5x: Convert DNS323 board to GPIO descriptors for LEDs
ARM: orion5x: Convert D2Net board to GPIO descriptors for LEDs
Link: https://lore.kernel.org/r/87h6fcndxj.fsf@BLaptop.bootlin.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-orion5x/net2big-setup.c')
-rw-r--r-- | arch/arm/mach-orion5x/net2big-setup.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c index 695cc683cd83..6ad9740b426b 100644 --- a/arch/arm/mach-orion5x/net2big-setup.c +++ b/arch/arm/mach-orion5x/net2big-setup.c @@ -18,6 +18,7 @@ #include <linux/i2c.h> #include <linux/ata_platform.h> #include <linux/gpio.h> +#include <linux/gpio/machine.h> #include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -214,19 +215,30 @@ err_free_1: static struct gpio_led net2big_leds[] = { { .name = "net2big:red:power", - .gpio = NET2BIG_GPIO_PWR_RED_LED, }, { .name = "net2big:blue:power", - .gpio = NET2BIG_GPIO_PWR_BLUE_LED, }, { .name = "net2big:red:sata0", - .gpio = NET2BIG_GPIO_SATA0_RED_LED, }, { .name = "net2big:red:sata1", - .gpio = NET2BIG_GPIO_SATA1_RED_LED, + }, +}; + +static struct gpiod_lookup_table net2big_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_RED_LED, NULL, + 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_BLUE_LED, NULL, + 1, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA0_RED_LED, NULL, + 2, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA1_RED_LED, NULL, + 3, GPIO_ACTIVE_HIGH), + { }, }, }; @@ -282,6 +294,7 @@ static void __init net2big_gpio_leds_init(void) if (err) pr_err("net2big: failed to setup SATA1 blue LED GPIO\n"); + gpiod_add_lookup_table(&net2big_leds_gpio_table); platform_device_register(&net2big_gpio_leds); } |