From: Linus Walleij <linus.walleij@linaro.org>
To: Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Mark Brown <broonie@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-spi@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 1/3] ARM: spitz: Convert Spitz board to GPIO descriptors for LEDs
Date: Tue, 30 Apr 2024 09:03:47 +0200 [thread overview]
Message-ID: <20240430-gpio-leds-miscarm-v1-1-9c94d7711f6c@linaro.org> (raw)
In-Reply-To: <20240430-gpio-leds-miscarm-v1-0-9c94d7711f6c@linaro.org>
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
next prev parent reply other threads:[~2024-04-30 7:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 7:03 [PATCH 0/3] ARM: Modernize the PXA Spitz a bit Linus Walleij
2024-04-30 7:03 ` Linus Walleij [this message]
2024-04-30 7:03 ` [PATCH 2/3] dt-bindings: ads7846: Add hsync-gpios Linus Walleij
2024-04-30 17:45 ` Conor Dooley
2024-06-21 22:24 ` Dmitry Torokhov
2024-04-30 7:03 ` [PATCH 3/3] ARM: spitz: Use software nodes for the ADS7846 touchscreen Linus Walleij
2024-05-02 8:13 ` Linus Walleij
2024-06-21 22:26 ` Dmitry Torokhov
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=20240430-gpio-leds-miscarm-v1-1-9c94d7711f6c@linaro.org \
--to=linus.walleij@linaro.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=daniel@zonque.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
--cc=robh@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).