U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bigunclemax@gmail.com
Cc: bigunclemax@gmail.com, Wei Fu <wefu@redhat.com>,
	Yixun Lan <dlan@gentoo.org>, Tom Rini <trini@konsulko.com>,
	Simon Glass <sjg@chromium.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	u-boot@lists.denx.de
Subject: [PATCH v1 1/2] gpio: dw: Add ngpios DT-property support
Date: Fri, 20 Sep 2024 12:05:23 +0300	[thread overview]
Message-ID: <20240920090532.280504-2-bigunclemax@gmail.com> (raw)
In-Reply-To: <20240920090532.280504-1-bigunclemax@gmail.com>

From: Maksim Kiselev <bigunclemax@gmail.com>

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 <bigunclemax@gmail.com>
---
 drivers/gpio/dwapb_gpio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
index 7a6eae9ba1..04639a4cb6 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)) {
-- 
2.45.2


  reply	other threads:[~2024-09-20  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20  9:05 [PATCH v1 0/2] riscv: add GPIO support for the LicheePi4A bigunclemax
2024-09-20  9:05 ` bigunclemax [this message]
2024-09-24  3:23   ` [PATCH v1 1/2] gpio: dw: Add ngpios DT-property support Leo Liang
2024-09-20  9:05 ` [PATCH v1 2/2] configs: th1520_lpi4a: Enable CMD_GPIO, DM_GPIO and DWAPB_GPIO driver bigunclemax
2024-09-24  3:25   ` Leo Liang

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=20240920090532.280504-2-bigunclemax@gmail.com \
    --to=bigunclemax@gmail.com \
    --cc=dlan@gentoo.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=wefu@redhat.com \
    /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