summaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/geode/net5501.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-11-24 09:53:37 +0100
committerBorislav Petkov <bp@suse.de>2021-01-15 18:47:49 +0100
commit3ff13602d7cae283bca1c52caacd0ca6426f37d2 (patch)
treee5e8481e34a30f133db68e57eb3b77a584d841a7 /arch/x86/platform/geode/net5501.c
parent2b29eed3f201b49feb92fdd0178b10825a5528f4 (diff)
downloadlinux-3ff13602d7cae283bca1c52caacd0ca6426f37d2.tar.gz
linux-3ff13602d7cae283bca1c52caacd0ca6426f37d2.tar.bz2
linux-3ff13602d7cae283bca1c52caacd0ca6426f37d2.zip
x86/platform/geode: Convert net5501 LED to GPIO machine descriptor
Look up the LED from a GPIO machine descriptor table. The Geode LEDs should be on the CS5535 companion chip. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lkml.kernel.org/r/20201124085339.6181-1-linus.walleij@linaro.org
Diffstat (limited to 'arch/x86/platform/geode/net5501.c')
-rw-r--r--arch/x86/platform/geode/net5501.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
index 163e1b545517..558384acd777 100644
--- a/arch/x86/platform/geode/net5501.c
+++ b/arch/x86/platform/geode/net5501.c
@@ -20,6 +20,7 @@
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
+#include <linux/gpio/machine.h>
#include <asm/geode.h>
@@ -55,9 +56,7 @@ static struct platform_device net5501_buttons_dev = {
static struct gpio_led net5501_leds[] = {
{
.name = "net5501:1",
- .gpio = 6,
.default_trigger = "default-on",
- .active_low = 0,
},
};
@@ -66,6 +65,15 @@ static struct gpio_led_platform_data net5501_leds_data = {
.leds = net5501_leds,
};
+static struct gpiod_lookup_table net5501_leds_gpio_table = {
+ .dev_id = "leds-gpio",
+ .table = {
+ /* The Geode GPIOs should be on the CS5535 companion chip */
+ GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_HIGH),
+ { }
+ },
+};
+
static struct platform_device net5501_leds_dev = {
.name = "leds-gpio",
.id = -1,
@@ -80,6 +88,7 @@ static struct platform_device *net5501_devs[] __initdata = {
static void __init register_net5501(void)
{
/* Setup LED control through leds-gpio driver */
+ gpiod_add_lookup_table(&net5501_leds_gpio_table);
platform_add_devices(net5501_devs, ARRAY_SIZE(net5501_devs));
}