[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-input
Subject: [PATCH 1/3] ARM: spitz: Convert Spitz board to GPIO descriptors for LEDs
From: Linus Walleij <linus.walleij () linaro ! org>
Date: 2024-04-30 7:03:47
Message-ID: 20240430-gpio-leds-miscarm-v1-1-9c94d7711f6c () linaro ! org
[Download RAW message or body]
This makes the LEDs on the PXA Spitz board use GPIO
descriptors instead of hardcoded GPIOs from the global
numberspace.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/mach-pxa/spitz.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index cc691b199429..36aec5ea7218 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -456,12 +456,21 @@ static struct gpio_led spitz_gpio_leds[] = {
{
.name = "spitz:amber:charge",
.default_trigger = "sharpsl-charge",
- .gpio = SPITZ_GPIO_LED_ORANGE,
},
{
.name = "spitz:green:hddactivity",
.default_trigger = "disk-activity",
- .gpio = SPITZ_GPIO_LED_GREEN,
+ },
+};
+
+static struct gpiod_lookup_table spitz_gpio_leds_table = {
+ .dev_id = "leds-gpio",
+ .table = {
+ GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LED_ORANGE, NULL,
+ 0, GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LED_GREEN, NULL,
+ 1, GPIO_ACTIVE_HIGH),
+ { },
},
};
@@ -480,6 +489,7 @@ static struct platform_device spitz_led_device = {
static void __init spitz_leds_init(void)
{
+ gpiod_add_lookup_table(&spitz_gpio_leds_table);
platform_device_register(&spitz_led_device);
}
#else
--
2.44.0
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic