From: Linus Walleij <linus.walleij@linaro.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>,
Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Maciej Falkowski <maciej.falkowski9@gmail.com>
Subject: [PATCH v2] ARM: OMAP1: Move h2 LEDs to GPIO lookup table
Date: Wed, 11 Jan 2023 14:24:03 +0100 [thread overview]
Message-ID: <20230111132403.134617-1-linus.walleij@linaro.org> (raw)
This converts the the H2 GPIO LEDs to use a machine lookup
table.
Cc: Tony Lindgren <tony@atomide.com>
Cc: Maciej Falkowski <maciej.falkowski9@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Rebased on v6.2-rc1
- I suppose Tony picks this up?
---
arch/arm/mach-omap1/board-h2.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index f28a4c3ea501..9301a5fca44e 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -47,6 +47,7 @@
/* The first 16 SoC GPIO lines are on this GPIO chip */
#define OMAP_GPIO_LABEL "gpio-0-15"
+#define OMAP_MPUIO_LABEL "mpuio"
/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
#define OMAP1610_ETHR_START 0x04000300
@@ -276,12 +277,10 @@ static const struct gpio_led h2_gpio_led_pins[] = {
{
.name = "h2:red",
.default_trigger = "heartbeat",
- .gpio = 3,
},
{
.name = "h2:green",
.default_trigger = "cpu0",
- .gpio = OMAP_MPUIO(4),
},
};
@@ -290,6 +289,14 @@ static struct gpio_led_platform_data h2_gpio_led_data = {
.num_leds = ARRAY_SIZE(h2_gpio_led_pins),
};
+static struct gpiod_lookup_table h2_leds_gpio_table = {
+ .table = {
+ GPIO_LOOKUP_IDX(OMAP_GPIO_LABEL, 3, NULL, 0, 0),
+ GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 4, NULL, 1, 0),
+ { },
+ },
+};
+
static struct platform_device h2_gpio_leds = {
.name = "leds-gpio",
.id = -1,
@@ -417,6 +424,7 @@ static void __init h2_init(void)
/* GPIO based LEDs */
omap_cfg_reg(P18_1610_GPIO3);
omap_cfg_reg(MPUIO4);
+ gpiod_add_lookup_table(&h2_leds_gpio_table);
h2_smc91x_resources[1].start = gpio_to_irq(0);
h2_smc91x_resources[1].end = gpio_to_irq(0);
--
2.34.1
next reply other threads:[~2023-01-11 13:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 13:24 Linus Walleij [this message]
2023-01-19 9:58 ` [PATCH v2] ARM: OMAP1: Move h2 LEDs to GPIO lookup table Tony Lindgren
2023-01-19 10:02 ` Tony Lindgren
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=20230111132403.134617-1-linus.walleij@linaro.org \
--to=linus.walleij@linaro.org \
--cc=aaro.koskinen@iki.fi \
--cc=jmkrzyszt@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=maciej.falkowski9@gmail.com \
--cc=tony@atomide.com \
/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).