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: <5911205.31r3eYUQgx@diego>
Date: Mon, 14 Jul 2025 13:29:01 +0200
From: Heiko StĂĽbner <heiko@...ech.de>
To: Linus Walleij <linus.walleij@...aro.org>,
 Bjorn Andersson <andersson@...nel.org>,
 Konrad Dybcio <konradybcio@...nel.org>,
 Alexey Klimov <alexey.klimov@...aro.org>,
 Lorenzo Bianconi <lorenzo@...nel.org>, Sean Wang <sean.wang@...nel.org>,
 Matthias Brugger <matthias.bgg@...il.com>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 Paul Cercueil <paul@...pouillou.net>, Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-arm-msm@...r.kernel.org, linux-mediatek@...ts.infradead.org,
 linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
 Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject:
 Re: [PATCH v2 09/12] pinctrl: allow to mark pin functions as requestable
 GPIOs

Am Mittwoch, 9. Juli 2025, 16:39:05 Mitteleuropäische Sommerzeit schrieb Bartosz Golaszewski:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> 
> The name of the pin function has no real meaning to pinctrl core and is
> there only for human readability of device properties. Some pins are
> muxed as GPIOs but for "strict" pinmuxers it's impossible to request
> them as GPIOs if they're bound to a devide - even if their function name
> explicitly says "gpio". Add a new field to struct pinfunction that
> allows to pass additional flags to pinctrl core. While we could go with
> a boolean "is_gpio" field, a flags field is more future-proof.
> 
> If the PINFUNCTION_FLAG_GPIO is set for a given function, the pin muxed
> to it can be requested as GPIO even on strict pin controllers. Add a new
> callback to struct pinmux_ops - function_is_gpio() - that allows pinmux
> core to inspect a function and see if it's a GPIO one. Provide a generic
> implementation of this callback.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> ---

[...]

> diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h
> index d6f7b58d6ad0cce421aad80463529c9ccc65d68e..6db6c3e1ccc2249d4b4204e6fc19bf7b4397cc81 100644
> --- a/include/linux/pinctrl/pinmux.h
> +++ b/include/linux/pinctrl/pinmux.h
> @@ -66,6 +66,8 @@ struct pinmux_ops {
>  				    unsigned int selector,
>  				    const char * const **groups,
>  				    unsigned int *num_groups);
> +	bool (*function_is_gpio) (struct pinctrl_dev *pctldev,
> +				  unsigned int selector);

hmm, I think using the set_mux function arguments here might make this
usable by more drivers? Aka func_selector + group_selector ?

While the generic pinmux might not need that, when pinmuxings are
arranged in functions + pingroups in them, this would be helpful.


Heiko




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ