Commit 73acd2ed authored by Linus Walleij's avatar Linus Walleij Committed by Gregory CLEMENT

ARM: orion5x: Convert Net2big board to GPIO descriptors for LEDs

This makes the LEDs on the Net2big Orion5x board use GPIO
descriptors instead of hardcoded GPIOs from the global
numberspace.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
parent 948d1a99
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/ata_platform.h> #include <linux/ata_platform.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -214,19 +215,30 @@ static void __init net2big_sata_power_init(void) ...@@ -214,19 +215,30 @@ static void __init net2big_sata_power_init(void)
static struct gpio_led net2big_leds[] = { static struct gpio_led net2big_leds[] = {
{ {
.name = "net2big:red:power", .name = "net2big:red:power",
.gpio = NET2BIG_GPIO_PWR_RED_LED,
}, },
{ {
.name = "net2big:blue:power", .name = "net2big:blue:power",
.gpio = NET2BIG_GPIO_PWR_BLUE_LED,
}, },
{ {
.name = "net2big:red:sata0", .name = "net2big:red:sata0",
.gpio = NET2BIG_GPIO_SATA0_RED_LED,
}, },
{ {
.name = "net2big:red:sata1", .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) ...@@ -282,6 +294,7 @@ static void __init net2big_gpio_leds_init(void)
if (err) if (err)
pr_err("net2big: failed to setup SATA1 blue LED GPIO\n"); 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); platform_device_register(&net2big_gpio_leds);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment