public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: s3c: use gpio lookup table for LEDs
@ 2026-04-27 14:35 Arnd Bergmann
  2026-04-27 14:38 ` Arnd Bergmann
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arnd Bergmann @ 2026-04-27 14:35 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Arnd Bergmann, Alim Akhtar, Linus Walleij, Charles Keepax,
	Bartosz Golaszewski, patches, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c/mach-crag6410.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-s3c/mach-crag6410.c b/arch/arm/mach-s3c/mach-crag6410.c
index 7def8824bbc5..57176719d8a6 100644
--- a/arch/arm/mach-s3c/mach-crag6410.c
+++ b/arch/arm/mach-s3c/mach-crag6410.c
@@ -779,46 +779,53 @@ static struct s3c_sdhci_platdata crag6410_hsmmc0_pdata = {
 static const struct gpio_led gpio_leds[] = {
 	{
 		.name = "d13:green:",
-		.gpio = MMGPIO_GPIO_BASE + 0,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d14:green:",
-		.gpio = MMGPIO_GPIO_BASE + 1,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d15:green:",
-		.gpio = MMGPIO_GPIO_BASE + 2,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d16:green:",
-		.gpio = MMGPIO_GPIO_BASE + 3,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d17:green:",
-		.gpio = MMGPIO_GPIO_BASE + 4,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d18:green:",
-		.gpio = MMGPIO_GPIO_BASE + 5,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d19:green:",
-		.gpio = MMGPIO_GPIO_BASE + 6,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 	{
 		.name = "d20:green:",
-		.gpio = MMGPIO_GPIO_BASE + 7,
 		.default_state = LEDS_GPIO_DEFSTATE_ON,
 	},
 };
 
+static struct gpiod_lookup_table crag_leds_table = {
+	.dev_id = "leds-gpio",
+	.table = {
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 0, "cs", 0, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 1, "cs", 1, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 2, "cs", 2, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 3, "cs", 3, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 4, "cs", 4, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 5, "cs", 5, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 6, "cs", 6, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("basic-mmio-gpio", 7, "cs", 7, GPIO_ACTIVE_LOW),
+		{ },
+	},
+};
+
 static const struct gpio_led_platform_data gpio_leds_pdata = {
 	.leds = gpio_leds,
 	.num_leds = ARRAY_SIZE(gpio_leds),
@@ -875,6 +882,7 @@ static void __init crag6410_machine_init(void)
 	platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices));
 	platform_device_register_full(&crag6410_mmgpio_devinfo);
 
+	gpiod_add_lookup_table(&crag_leds_table);
 	gpio_led_register_device(-1, &gpio_leds_pdata);
 
 	regulator_has_full_constraints();
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: s3c: use gpio lookup table for LEDs
  2026-04-27 14:35 [PATCH] ARM: s3c: use gpio lookup table for LEDs Arnd Bergmann
@ 2026-04-27 14:38 ` Arnd Bergmann
  2026-04-28  8:08   ` Bartosz Golaszewski
  2026-04-27 20:30 ` Linus Walleij
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2026-04-27 14:38 UTC (permalink / raw)
  To: Arnd Bergmann, Krzysztof Kozlowski
  Cc: Alim Akhtar, Linus Walleij, Charles Keepax, Bartosz Golaszewski,
	patches, linux-arm-kernel, linux-samsung-soc, linux-kernel

On Mon, Apr 27, 2026, at 16:35, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Sorry, I accidentally sent this without a changelog text, this should
have contained

"The crag6410 board is one of the last users of the gpio-led driver
with plain gpio numbers. The driver has several ways to pass this
information without using gpio numbers, using a lookup table is
the easiest way."

      Arnd


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: s3c: use gpio lookup table for LEDs
  2026-04-27 14:35 [PATCH] ARM: s3c: use gpio lookup table for LEDs Arnd Bergmann
  2026-04-27 14:38 ` Arnd Bergmann
@ 2026-04-27 20:30 ` Linus Walleij
  2026-04-28  8:08 ` Bartosz Golaszewski
  2026-05-04 17:48 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2026-04-27 20:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Krzysztof Kozlowski, Arnd Bergmann, Alim Akhtar, Charles Keepax,
	Bartosz Golaszewski, patches, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

On Mon, Apr 27, 2026 at 4:35 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

With comitt message added:
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: s3c: use gpio lookup table for LEDs
  2026-04-27 14:35 [PATCH] ARM: s3c: use gpio lookup table for LEDs Arnd Bergmann
  2026-04-27 14:38 ` Arnd Bergmann
  2026-04-27 20:30 ` Linus Walleij
@ 2026-04-28  8:08 ` Bartosz Golaszewski
  2026-05-04 17:48 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-04-28  8:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Arnd Bergmann, Alim Akhtar, Linus Walleij, Charles Keepax,
	Bartosz Golaszewski, patches, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, Krzysztof Kozlowski

On Mon, 27 Apr 2026 16:35:27 +0200, Arnd Bergmann <arnd@kernel.org> said:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

I think you need a commit message here?

Bart


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: s3c: use gpio lookup table for LEDs
  2026-04-27 14:38 ` Arnd Bergmann
@ 2026-04-28  8:08   ` Bartosz Golaszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2026-04-28  8:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alim Akhtar, Linus Walleij, Charles Keepax, Bartosz Golaszewski,
	patches, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Arnd Bergmann, Krzysztof Kozlowski

On Mon, 27 Apr 2026 16:38:42 +0200, Arnd Bergmann <arnd@arndb.de> said:
> On Mon, Apr 27, 2026, at 16:35, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Sorry, I accidentally sent this without a changelog text, this should
> have contained
>
> "The crag6410 board is one of the last users of the gpio-led driver
> with plain gpio numbers. The driver has several ways to pass this
> information without using gpio numbers, using a lookup table is
> the easiest way."
>
>       Arnd
>

Ah, here it is. You probably need to resend it.

With that:

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Bart


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: s3c: use gpio lookup table for LEDs
  2026-04-27 14:35 [PATCH] ARM: s3c: use gpio lookup table for LEDs Arnd Bergmann
                   ` (2 preceding siblings ...)
  2026-04-28  8:08 ` Bartosz Golaszewski
@ 2026-05-04 17:48 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-05-04 17:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Arnd Bergmann, Alim Akhtar, Linus Walleij, Charles Keepax,
	Bartosz Golaszewski, patches, linux-arm-kernel, linux-samsung-soc,
	linux-kernel


On Mon, 27 Apr 2026 16:35:27 +0200, Arnd Bergmann wrote:
> 


Applied, thanks!

[1/1] ARM: s3c: use gpio lookup table for LEDs
      https://git.kernel.org/krzk/linux/c/b64cbd3f5d96b143fa9f21d84d381b1bb286339c

Best regards,
-- 
Krzysztof Kozlowski <krzk@kernel.org>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-04 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 14:35 [PATCH] ARM: s3c: use gpio lookup table for LEDs Arnd Bergmann
2026-04-27 14:38 ` Arnd Bergmann
2026-04-28  8:08   ` Bartosz Golaszewski
2026-04-27 20:30 ` Linus Walleij
2026-04-28  8:08 ` Bartosz Golaszewski
2026-05-04 17:48 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox