public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] gpio: da8xx_gpio: Fix gpio name with address
@ 2022-01-07  3:26 chaochao2021666
  2022-01-17 18:37 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: chaochao2021666 @ 2022-01-07  3:26 UTC (permalink / raw)
  To: sjg; +Cc: chao.zeng, baocheng.su, jan.kiszka, u-boot

From: chao zeng <chao.zeng@siemens.com>

The GPIO bank numbers do not appear in the device tree,
so make the gpio name based on the address
(ie gpio@42110000_25 vs 25)

Signed-off-by: chao zeng <chao.zeng@siemens.com>
---
 drivers/gpio/da8xx_gpio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c
index d106e9846d..b310f2dbf6 100644
--- a/drivers/gpio/da8xx_gpio.c
+++ b/drivers/gpio/da8xx_gpio.c
@@ -545,12 +545,20 @@ static int davinci_gpio_of_to_plat(struct udevice *dev)
 {
 	struct davinci_gpio_plat *plat = dev_get_plat(dev);
 	fdt_addr_t addr;
+	char name[18], *str;
 
 	addr = dev_read_addr(dev);
 	if (addr == FDT_ADDR_T_NONE)
 		return -EINVAL;
 
 	plat->base = addr;
+
+	sprintf(name, "gpio@%4x_", (unsigned int)plat->base);
+	str = strdup(name);
+	if (!str)
+		return -ENOMEM;
+	plat->port_name = str;
+
 	return 0;
 }
 
-- 
2.34.1


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

* Re: [PATCH] gpio: da8xx_gpio: Fix gpio name with address
  2022-01-07  3:26 [PATCH] gpio: da8xx_gpio: Fix gpio name with address chaochao2021666
@ 2022-01-17 18:37 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-01-17 18:37 UTC (permalink / raw)
  To: chaochao2021666; +Cc: sjg, chao.zeng, baocheng.su, jan.kiszka, u-boot

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On Fri, Jan 07, 2022 at 11:26:24AM +0800, chaochao2021666@163.com wrote:

> From: chao zeng <chao.zeng@siemens.com>
> 
> The GPIO bank numbers do not appear in the device tree,
> so make the gpio name based on the address
> (ie gpio@42110000_25 vs 25)
> 
> Signed-off-by: chao zeng <chao.zeng@siemens.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-01-17 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-07  3:26 [PATCH] gpio: da8xx_gpio: Fix gpio name with address chaochao2021666
2022-01-17 18:37 ` Tom Rini

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