public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: haibo.chen@nxp.com
To: linus.walleij@linaro.org, brgl@bgdev.pl
Cc: wahrenst@gmx.net, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	haibo.chen@nxp.com
Subject: [PATCH v2 1/2] gpio: gpio-vf610: use u32 mask to handle 32 number gpios
Date: Thu,  1 Aug 2024 17:30:27 +0800	[thread overview]
Message-ID: <20240801093028.732338-2-haibo.chen@nxp.com> (raw)
In-Reply-To: <20240801093028.732338-1-haibo.chen@nxp.com>

From: Haibo Chen <haibo.chen@nxp.com>

This gpio controller support up to 32 pins per port. And all the
register width is 32 bit. So here use u32 to replace the original
unsigned long.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/gpio/gpio-vf610.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 07e5e6323e86..db68d8541597 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -97,7 +97,7 @@ static inline u32 vf610_gpio_readl(void __iomem *reg)
 static int vf610_gpio_get(struct gpio_chip *gc, unsigned int gpio)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(gc);
-	unsigned long mask = BIT(gpio);
+	u32 mask = BIT(gpio);
 	unsigned long offset = GPIO_PDIR;
 
 	if (port->sdata->have_paddr) {
@@ -112,16 +112,16 @@ static int vf610_gpio_get(struct gpio_chip *gc, unsigned int gpio)
 static void vf610_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(gc);
-	unsigned long mask = BIT(gpio);
+	u32 mask = BIT(gpio);
 	unsigned long offset = val ? GPIO_PSOR : GPIO_PCOR;
 
 	vf610_gpio_writel(mask, port->gpio_base + offset);
 }
 
-static int vf610_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
+static int vf610_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(chip);
-	unsigned long mask = BIT(gpio);
+	u32 mask = BIT(gpio);
 	u32 val;
 
 	if (port->sdata->have_paddr) {
@@ -133,11 +133,11 @@ static int vf610_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
 	return pinctrl_gpio_direction_input(chip, gpio);
 }
 
-static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
+static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
 				       int value)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(chip);
-	unsigned long mask = BIT(gpio);
+	u32 mask = BIT(gpio);
 	u32 val;
 
 	vf610_gpio_set(chip, gpio, value);
-- 
2.34.1


  reply	other threads:[~2024-08-01  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01  9:30 [PATCH v2 0/2] few small change for gpio-vf610 haibo.chen
2024-08-01  9:30 ` haibo.chen [this message]
2024-08-02 13:22   ` [PATCH v2 1/2] gpio: gpio-vf610: use u32 mask to handle 32 number gpios Stefan Wahren
2024-08-05  4:38   ` Stefan Wahren
2024-08-01  9:30 ` [PATCH v2 2/2] gpio: vf610: add get_direction() support haibo.chen
2024-08-02 13:22   ` Stefan Wahren
2024-08-05  2:08     ` Bough Chen
2024-08-05  9:51 ` [PATCH v2 0/2] few small change for gpio-vf610 Bartosz Golaszewski

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=20240801093028.732338-2-haibo.chen@nxp.com \
    --to=haibo.chen@nxp.com \
    --cc=brgl@bgdev.pl \
    --cc=imx@lists.linux.dev \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wahrenst@gmx.net \
    /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