summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Kiselev <[email protected]>2024-09-20 12:05:23 +0300
committerLeo Yu-Chi Liang <[email protected]>2024-10-28 16:11:33 +0800
commit370806854eda1cf77e317f283938c4ae6337c401 (patch)
tree8eb8a0fa32e71da3c0ec33195c066b5132df948f
parentfaf82cc695ce31ee30037f005b1c4e16b6b0a8f6 (diff)
gpio: dw: Add ngpios DT-property support
Starting with Linux commit 7569486d79ae ("gpio: dwapb: Add ngpios DT-property support") the "snps,nr-gpios" property was marked as deprecated. And since all newly added dw-apb-gpio nodes are described using generic "ngpios" property, it's time to add support for it. Signed-off-by: Maksim Kiselev <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
-rw-r--r--drivers/gpio/dwapb_gpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
index 7a6eae9ba18..04639a4cb68 100644
--- a/drivers/gpio/dwapb_gpio.c
+++ b/drivers/gpio/dwapb_gpio.c
@@ -177,7 +177,9 @@ static int gpio_dwapb_bind(struct udevice *dev)
plat->base = (void *)base;
plat->bank = bank;
- plat->pins = ofnode_read_u32_default(node, "snps,nr-gpios", 0);
+
+ if (ofnode_read_u32(node, "ngpios", &plat->pins))
+ plat->pins = ofnode_read_u32_default(node, "snps,nr-gpios", 0);
if (ofnode_read_string_index(node, "bank-name", 0,
&plat->name)) {