From: Stefan Wahren <wahrenst@gmx.net>
To: Bough Chen <haibo.chen@nxp.com>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"brgl@bgdev.pl" <brgl@bgdev.pl>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>
Subject: Re: [PATCH] gpio: vf610: add get_direction() support
Date: Mon, 29 Jul 2024 18:27:08 +0200 [thread overview]
Message-ID: <0c8fe963-50c3-44be-b2ba-10a9f99a28ff@gmx.net> (raw)
In-Reply-To: <DU0PR04MB9496B93A0336D50B8545660890A92@DU0PR04MB9496.eurprd04.prod.outlook.com>
Am 23.07.24 um 04:45 schrieb Bough Chen:
>> -----Original Message-----
>> From: Stefan Wahren <wahrenst@gmx.net>
>> Sent: 2024年7月22日 18:32
>> To: Bough Chen <haibo.chen@nxp.com>; linus.walleij@linaro.org;
>> brgl@bgdev.pl
>> Cc: linux-gpio@vger.kernel.org; linux-kernel@vger.kernel.org;
>> imx@lists.linux.dev
>> Subject: Re: [PATCH] gpio: vf610: add get_direction() support
>>
>> Hi Haibo,
>>
>> Am 22.07.24 um 08:28 schrieb haibo.chen@nxp.com:
>>> From: Haibo Chen <haibo.chen@nxp.com>
>>>
>>> For IP which do not contain PDDR, currently use the pinmux API
>>> pinctrl_gpio_direction_input() to config the output/input, pinmux
>>> currently do not support get_direction(). So here add the GPIO
>>> get_direction() support only for the IP which has Port Data Direction
>>> Register (PDDR).
>>>
>>> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
>>> ---
>>> drivers/gpio/gpio-vf610.c | 19 +++++++++++++++++++
>>> 1 file changed, 19 insertions(+)
>>>
>>> diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
>>> index 07e5e6323e86..08ca8377b19c 100644
>>> --- a/drivers/gpio/gpio-vf610.c
>>> +++ b/drivers/gpio/gpio-vf610.c
>>> @@ -151,6 +151,19 @@ static int vf610_gpio_direction_output(struct
>> gpio_chip *chip, unsigned gpio,
>>> return pinctrl_gpio_direction_output(chip, gpio);
>>> }
>>>
>>> +static int vf610_gpio_get_direction(struct gpio_chip *gc, unsigned
>>> +int gpio) {
>>> + struct vf610_gpio_port *port = gpiochip_get_data(gc);
>>> + unsigned long mask = BIT(gpio);
>> thanks for sending this patch. I'm fine with this patch, but could we use u32 to
>> make it clear about the range of the mask?
> Yes, u32 seems more clear here, but I notice all other place use unsigned long, so I keep the same code style.
> I go through the history of this driver, seems no specific explanation about the unsigned long.
I understand, but i don't think there is a reason for using unsigned
long. So maybe this is a good opportunity to clean this up.
Regards
prev parent reply other threads:[~2024-07-29 16:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 6:28 [PATCH] gpio: vf610: add get_direction() support haibo.chen
2024-07-22 10:32 ` Stefan Wahren
2024-07-23 2:45 ` Bough Chen
2024-07-29 16:27 ` Stefan Wahren [this message]
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=0c8fe963-50c3-44be-b2ba-10a9f99a28ff@gmx.net \
--to=wahrenst@gmx.net \
--cc=brgl@bgdev.pl \
--cc=haibo.chen@nxp.com \
--cc=imx@lists.linux.dev \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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