lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0c8fe963-50c3-44be-b2ba-10a9f99a28ff@gmx.net>
Date: Mon, 29 Jul 2024 18:27:08 +0200
From: Stefan Wahren <wahrenst@....net>
To: Bough Chen <haibo.chen@....com>,
 "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
 "brgl@...ev.pl" <brgl@...ev.pl>
Cc: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: Re: [PATCH] gpio: vf610: add get_direction() support


Am 23.07.24 um 04:45 schrieb Bough Chen:
>> -----Original Message-----
>> From: Stefan Wahren <wahrenst@....net>
>> Sent: 2024年7月22日 18:32
>> To: Bough Chen <haibo.chen@....com>; linus.walleij@...aro.org;
>> brgl@...ev.pl
>> Cc: linux-gpio@...r.kernel.org; linux-kernel@...r.kernel.org;
>> imx@...ts.linux.dev
>> Subject: Re: [PATCH] gpio: vf610: add get_direction() support
>>
>> Hi Haibo,
>>
>> Am 22.07.24 um 08:28 schrieb haibo.chen@....com:
>>> From: Haibo Chen <haibo.chen@....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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ