aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio/da8xx_gpio.c
diff options
context:
space:
mode:
authorchao zeng <chao.zeng@siemens.com>2022-01-07 11:26:24 +0800
committerTom Rini <trini@konsulko.com>2022-01-16 08:31:03 -0500
commitb6e59617c8d876876e99e1516ed2d991f25c3fe6 (patch)
treee09c996be1310b8c3d97e1d054d2d89223ed0dfb /drivers/gpio/da8xx_gpio.c
parentef7be5a07b8c31add141da1f2e9a6788357772de (diff)
downloadu-boot-b6e59617c8d876876e99e1516ed2d991f25c3fe6.zip
u-boot-b6e59617c8d876876e99e1516ed2d991f25c3fe6.tar.gz
u-boot-b6e59617c8d876876e99e1516ed2d991f25c3fe6.tar.bz2
gpio: da8xx_gpio: Fix gpio name with address
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>
Diffstat (limited to 'drivers/gpio/da8xx_gpio.c')
-rw-r--r--drivers/gpio/da8xx_gpio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c
index d106e98..b310f2d 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;
}