From: Linus Walleij <linus.walleij@linaro.org> To: arm@kernel.org, soc@kernel.org Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij <linus.walleij@linaro.org>, Nikita Shubin <nikita.shubin@maquefel.me>, Alexander Sverdlin <alexander.sverdlin@gmail.com>, Hartley Sweeten <hsweeten@visionengravers.com>, Lukasz Majewski <lukma@denx.de> Subject: [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs Date: Wed, 11 Jan 2023 14:22:10 +0100 [thread overview] Message-ID: <20230111132210.134478-1-linus.walleij@linaro.org> (raw) This converts the EP93xx to use GPIO descriptors for the LEDs. Cc: Nikita Shubin <nikita.shubin@maquefel.me> Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com> Cc: Hartley Sweeten <hsweeten@visionengravers.com> Cc: Lukasz Majewski <lukma@denx.de> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- ChangeLog v3->v4: - Rebased on v6.2-rc1 - SoC folks: please apply this patch directly for suitable branch. ChangeLog v2->v3: - Collected Alexander's Tested-by ChangeLog v1->v2: - Fix syntax error (doubled left parens) --- arch/arm/mach-ep93xx/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 95e731676cea..71b113976420 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -426,10 +426,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info, static const struct gpio_led ep93xx_led_pins[] __initconst = { { .name = "platform:grled", - .gpio = EP93XX_GPIO_LINE_GRLED, }, { .name = "platform:rdled", - .gpio = EP93XX_GPIO_LINE_RDLED, }, }; @@ -438,6 +436,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = { .leds = ep93xx_led_pins, }; +static struct gpiod_lookup_table ep93xx_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* Use local offsets on gpiochip/port "E" */ + GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("E", 1, NULL, 1, GPIO_ACTIVE_HIGH), + { } + }, +}; + /************************************************************************* * EP93xx pwm peripheral handling *************************************************************************/ @@ -990,6 +998,7 @@ struct device __init *ep93xx_init_devices(void) platform_device_register(&ep93xx_ohci_device); platform_device_register(&ep93xx_wdt_device); + gpiod_add_lookup_table(&ep93xx_leds_gpio_table); gpio_led_register_device(-1, &ep93xx_led_data); return parent; -- 2.34.1
WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org> To: arm@kernel.org, soc@kernel.org Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij <linus.walleij@linaro.org>, Nikita Shubin <nikita.shubin@maquefel.me>, Alexander Sverdlin <alexander.sverdlin@gmail.com>, Hartley Sweeten <hsweeten@visionengravers.com>, Lukasz Majewski <lukma@denx.de> Subject: [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs Date: Wed, 11 Jan 2023 14:22:10 +0100 [thread overview] Message-ID: <20230111132210.134478-1-linus.walleij@linaro.org> (raw) This converts the EP93xx to use GPIO descriptors for the LEDs. Cc: Nikita Shubin <nikita.shubin@maquefel.me> Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com> Cc: Hartley Sweeten <hsweeten@visionengravers.com> Cc: Lukasz Majewski <lukma@denx.de> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- ChangeLog v3->v4: - Rebased on v6.2-rc1 - SoC folks: please apply this patch directly for suitable branch. ChangeLog v2->v3: - Collected Alexander's Tested-by ChangeLog v1->v2: - Fix syntax error (doubled left parens) --- arch/arm/mach-ep93xx/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 95e731676cea..71b113976420 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -426,10 +426,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info, static const struct gpio_led ep93xx_led_pins[] __initconst = { { .name = "platform:grled", - .gpio = EP93XX_GPIO_LINE_GRLED, }, { .name = "platform:rdled", - .gpio = EP93XX_GPIO_LINE_RDLED, }, }; @@ -438,6 +436,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = { .leds = ep93xx_led_pins, }; +static struct gpiod_lookup_table ep93xx_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* Use local offsets on gpiochip/port "E" */ + GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("E", 1, NULL, 1, GPIO_ACTIVE_HIGH), + { } + }, +}; + /************************************************************************* * EP93xx pwm peripheral handling *************************************************************************/ @@ -990,6 +998,7 @@ struct device __init *ep93xx_init_devices(void) platform_device_register(&ep93xx_ohci_device); platform_device_register(&ep93xx_wdt_device); + gpiod_add_lookup_table(&ep93xx_leds_gpio_table); gpio_led_register_device(-1, &ep93xx_led_data); return parent; -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-01-11 13:22 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-11 13:22 Linus Walleij [this message] 2023-01-11 13:22 ` [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs Linus Walleij 2023-01-24 21:31 ` patchwork-bot+linux-soc -- strict thread matches above, loose matches on Subject: below -- 2022-08-30 20:43 Linus Walleij 2022-08-30 20:43 ` Linus Walleij 2022-09-01 17:37 ` kernel test robot 2022-09-01 17:37 ` kernel test robot
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=20230111132210.134478-1-linus.walleij@linaro.org \ --to=linus.walleij@linaro.org \ --cc=alexander.sverdlin@gmail.com \ --cc=arm@kernel.org \ --cc=hsweeten@visionengravers.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=lukma@denx.de \ --cc=nikita.shubin@maquefel.me \ --cc=soc@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.