From: David Picard <david.picard@clermont.in2p3.fr>
To: Sascha Hauer <s.hauer@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>
Cc: David Picard <david.picard@clermont.in2p3.fr>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 07/11] gpio: dw: support numbering via aliases
Date: Wed, 17 Sep 2025 17:22:10 +0200 [thread overview]
Message-ID: <20250917-boards-enclustra-sa2-add-support-v1-7-2de8f69107a1@clermont.in2p3.fr> (raw)
In-Reply-To: <20250917-boards-enclustra-sa2-add-support-v1-0-2de8f69107a1@clermont.in2p3.fr>
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
This device driver is OF-only, so reflect that in the Kconfig and have
it parse aliases if available to derive its id.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/gpio/Kconfig | 1 +
drivers/gpio/gpio-dw.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 7caa1aa96eb3c65982f7ecea3af07c8388bf7349..17d5587ea8cf46b1c356d5c11e1ea2c35ba8f269 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -201,6 +201,7 @@ config GPIO_TEGRA
config GPIO_DESIGNWARE
tristate "Synopsys DesignWare GPIO driver"
+ depends on OF_GPIO
help
Say Y or M here to build support for the Synopsys DesignWare APB
GPIO block.
diff --git a/drivers/gpio/gpio-dw.c b/drivers/gpio/gpio-dw.c
index e6eba6b423f5e997960ea39aff641718a8b0af42..98668c0a2d548e8dbac6e88180da25d28ae108e4 100644
--- a/drivers/gpio/gpio-dw.c
+++ b/drivers/gpio/gpio-dw.c
@@ -114,6 +114,8 @@ static int dw_gpio_add_port(struct device *dev, struct device_node *node,
chip = xzalloc(sizeof(*chip));
chip->chip.ops = &dw_gpio_ops;
+
+ dev->id = of_alias_get_id(dev->device_node, "gpio");
if (dev->id < 0)
chip->chip.base = DEVICE_ID_DYNAMIC;
else
@@ -181,7 +183,7 @@ MODULE_DEVICE_TABLE(of, dwgpio_match);
static struct driver dwgpio_driver = {
.name = "dw-apb-gpio",
.probe = dw_gpio_probe,
- .of_compatible = DRV_OF_COMPAT(dwgpio_match),
+ .of_compatible = dwgpio_match,
};
postcore_platform_driver(dwgpio_driver);
--
2.43.0
next prev parent reply other threads:[~2025-09-17 15:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 15:22 [PATCH 00/11] ARM: boards: add support for Enclustra Mercury SA2 David Picard
2025-09-17 15:22 ` [PATCH 01/11] Add handoff files David Picard
2025-09-17 15:22 ` [PATCH 02/11] Add Enclustra Mercury+ SA2 module David Picard
2025-09-18 6:21 ` Sascha Hauer
2025-09-17 15:22 ` [PATCH 03/11] Add Enclustra devicetree files David Picard
2025-09-17 15:22 ` [PATCH 04/11] ARM: dts: socfpga: use upstream SA2 device tree David Picard
2025-09-18 6:32 ` Sascha Hauer
2025-09-18 10:09 ` David Picard
2025-09-18 10:20 ` Ahmad Fatoum
2025-09-17 15:22 ` [PATCH 05/11] ARM: dts: socfpga: adapt " David Picard
2025-09-17 15:22 ` [PATCH 06/11] boards: enclustra-sa2: read MAC address from EEPROM David Picard
2025-09-17 17:06 ` Alexander Shiyan
2025-09-18 6:18 ` Sascha Hauer
2025-09-18 14:01 ` David Picard
2025-09-18 14:12 ` Sascha Hauer
2025-09-18 15:07 ` David Picard
2025-09-22 13:15 ` Sascha Hauer
2025-09-23 9:07 ` David Picard
2025-09-23 9:40 ` Sascha Hauer
2025-09-23 11:50 ` David Picard
2025-09-23 15:31 ` David Picard
2025-09-17 15:22 ` David Picard [this message]
2025-09-18 6:35 ` [PATCH 07/11] gpio: dw: support numbering via aliases Sascha Hauer
2025-09-17 15:22 ` [PATCH 08/11] gpio: dw: make deep probe compatible David Picard
2025-09-17 15:22 ` [PATCH 09/11] boards: enclustra-sa2: enable bridges David Picard
2025-09-18 6:37 ` Sascha Hauer
2025-09-17 15:22 ` [PATCH 10/11] boards: enclustra-sa2: configure SI5338 David Picard
2025-09-18 7:09 ` Sascha Hauer
2025-09-18 13:23 ` David Picard
2025-09-17 15:22 ` [PATCH 11/11] boards: enclustra-sa2: enable SI5338 David Picard
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=20250917-boards-enclustra-sa2-add-support-v1-7-2de8f69107a1@clermont.in2p3.fr \
--to=david.picard@clermont.in2p3.fr \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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