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] [thread-next>] [day] [month] [year] [list]
Message-ID: <69918f77-c0d6-4151-b725-e5051f0f6680@linaro.org>
Date: Tue, 12 Nov 2024 14:28:34 +0100
From: Neil Armstrong <neil.armstrong@...aro.org>
To: xianwei.zhao@...ogic.com, Linus Walleij <linus.walleij@...aro.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Kevin Hilman <khilman@...libre.com>,
 Jerome Brunet <jbrunet@...libre.com>,
 Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
 Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-amlogic@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 3/5] pinctrl: meson: add interface of of_xlate

On 12/11/2024 11:26, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@...ogic.com>
> 
> Amlogic pinctrl software framework use system API of_gpio_simple_xlate
> which only support linear one-to-one correspondence to translate gpiospec
> to the GPIO number and flags before. It can not meet the non-linear needs.
> Add the interface satisfies the underlying driver to implement the
> transformation to meet the needs of various scenarios.
> 
> Signed-off-by: Xianwei Zhao <xianwei.zhao@...ogic.com>
> ---
>   drivers/pinctrl/meson/pinctrl-meson.c | 4 ++++
>   drivers/pinctrl/meson/pinctrl-meson.h | 4 ++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 253a0cc57e39..fc0c0bef38c0 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -620,6 +620,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
>   	pc->chip.base = -1;
>   	pc->chip.ngpio = pc->data->num_pins;
>   	pc->chip.can_sleep = false;
> +	if (pc->data->of_xlate) {
> +		pc->chip.of_gpio_n_cells = pc->data->of_gpio_n_cells;
> +		pc->chip.of_xlate = pc->data->of_xlate;
> +	}
>   
>   	ret = gpiochip_add_data(&pc->chip, pc);
>   	if (ret) {
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
> index 7883ea31a001..cbb3f22552b9 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.h
> +++ b/drivers/pinctrl/meson/pinctrl-meson.h
> @@ -120,6 +120,10 @@ struct meson_pinctrl_data {
>   	const struct pinmux_ops *pmx_ops;
>   	const void *pmx_data;
>   	int (*parse_dt)(struct meson_pinctrl *pc);
> +	int (*of_xlate)(struct gpio_chip *gc,
> +			const struct of_phandle_args *gpiospec,
> +			u32 *flags);
> +	int of_gpio_n_cells;
>   };
>   
>   struct meson_pinctrl {
> 

Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ