mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v1 2/2] pinctrl: stm32: extract and set GPIO offset from devicetree
Date: Wed, 29 May 2024 06:53:11 +0200	[thread overview]
Message-ID: <20240529045311.3227151-2-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20240529045311.3227151-1-o.rempel@pengutronix.de>

Update pinctrl-stm32 driver to read gpio_offset from the devicetree
and set it in gpiolib. This enables correct handling of GPIO banks
on stm32mp151aad3, which have non-zero starting indices for some
banks.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/pinctrl/pinctrl-stm32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinctrl-stm32.c b/drivers/pinctrl/pinctrl-stm32.c
index 63a01b6ec6..4a4b03ac0e 100644
--- a/drivers/pinctrl/pinctrl-stm32.c
+++ b/drivers/pinctrl/pinctrl-stm32.c
@@ -319,6 +319,7 @@ static int stm32_gpiochip_add(struct stm32_gpio_bank *bank,
 	bank->base = IOMEM(iores->start);
 
 	bank->chip.base = be32_to_cpu(gpio_ranges[PINCTRL_OFFSET]);
+	bank->chip.gpio_offset = be32_to_cpu(gpio_ranges[GPIOCTRL_OFFSET]);
 	bank->chip.ops  = &stm32_gpio_ops;
 	bank->chip.dev  = dev;
 
-- 
2.39.2




  reply	other threads:[~2024-05-29  4:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  4:53 [PATCH v1 1/2] gpiolib: extend support for non-zero offset GPIO banks Oleksij Rempel
2024-05-29  4:53 ` Oleksij Rempel [this message]
2024-05-29  6:19 ` Sascha Hauer

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=20240529045311.3227151-2-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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