From: "tip-bot2 for Linus Walleij" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
Borislav Petkov <bp@suse.de>, Hans de Goede <hdegoede@redhat.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/platform] x86/platform/geode: Convert geode LED to GPIO machine descriptor
Date: Fri, 15 Jan 2021 18:03:29 -0000 [thread overview]
Message-ID: <161073380939.414.12010085189850912559.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201124085339.6181-2-linus.walleij@linaro.org>
The following commit has been merged into the x86/platform branch of tip:
Commit-ID: ab20fda2a3da1b189a061ca045d9ca734e1db234
Gitweb: https://git.kernel.org/tip/ab20fda2a3da1b189a061ca045d9ca734e1db234
Author: Linus Walleij <linus.walleij@linaro.org>
AuthorDate: Tue, 24 Nov 2020 09:53:38 +01:00
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 15 Jan 2021 18:54:38 +01:00
x86/platform/geode: Convert geode 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-2-linus.walleij@linaro.org
---
arch/x86/platform/geode/geos.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
index 73a3f49..d263528 100644
--- a/arch/x86/platform/geode/geos.c
+++ b/arch/x86/platform/geode/geos.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 <linux/dmi.h>
#include <asm/geode.h>
@@ -53,21 +54,15 @@ static struct platform_device geos_buttons_dev = {
static struct gpio_led geos_leds[] = {
{
.name = "geos:1",
- .gpio = 6,
.default_trigger = "default-on",
- .active_low = 1,
},
{
.name = "geos:2",
- .gpio = 25,
.default_trigger = "default-off",
- .active_low = 1,
},
{
.name = "geos:3",
- .gpio = 27,
.default_trigger = "default-off",
- .active_low = 1,
},
};
@@ -76,6 +71,17 @@ static struct gpio_led_platform_data geos_leds_data = {
.leds = geos_leds,
};
+static struct gpiod_lookup_table geos_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_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 25, NULL, 1, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 27, NULL, 2, GPIO_ACTIVE_LOW),
+ { }
+ },
+};
+
static struct platform_device geos_leds_dev = {
.name = "leds-gpio",
.id = -1,
@@ -90,6 +96,7 @@ static struct platform_device *geos_devs[] __initdata = {
static void __init register_geos(void)
{
/* Setup LED control through leds-gpio driver */
+ gpiod_add_lookup_table(&geos_leds_gpio_table);
platform_add_devices(geos_devs, ARRAY_SIZE(geos_devs));
}
parent reply other threads:[~2021-01-15 18:04 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20201124085339.6181-2-linus.walleij@linaro.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=161073380939.414.12010085189850912559.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=andy.shevchenko@gmail.com \
--cc=bp@suse.de \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).