Message ID | 20230111132403.134617-1-linus.walleij@linaro.org |
---|---|
State | New |
Headers | show |
Series | [v2] ARM: OMAP1: Move h2 LEDs to GPIO lookup table | expand |
* Linus Walleij <linus.walleij@linaro.org> [230111 15:24]: > 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? OK thanks, applying into omap-for-v6.3/omap1 branch. Tony
* Tony Lindgren <tony@atomide.com> [230119 09:58]: > * Linus Walleij <linus.walleij@linaro.org> [230111 15:24]: > > 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? > > OK thanks, applying into omap-for-v6.3/omap1 branch. Oh actually this file is getting dropped in Linux next, so not applying. Regards, Tony
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);
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(-)