From: "Heiko Stübner" <heiko@sntech.de>
To: Linus Walleij <linus.walleij@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Alexey Klimov <alexey.klimov@linaro.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Sean Wang <sean.wang@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Paul Cercueil <paul@crapouillou.net>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v2 09/12] pinctrl: allow to mark pin functions as requestable GPIOs
Date: Mon, 14 Jul 2025 13:29:01 +0200 [thread overview]
Message-ID: <5911205.31r3eYUQgx@diego> (raw)
In-Reply-To: <20250709-pinctrl-gpio-pinfuncs-v2-9-b6135149c0d9@linaro.org>
Am Mittwoch, 9. Juli 2025, 16:39:05 Mitteleuropäische Sommerzeit schrieb Bartosz Golaszewski:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.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@linaro.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
next prev parent reply other threads:[~2025-07-14 11:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 14:38 [PATCH v2 00/12] pinctrl: introduce the concept of a GPIO pin function category Bartosz Golaszewski
2025-07-09 14:38 ` [PATCH v2 01/12] pinctrl: pinmux: open-code PINCTRL_FUNCTION_DESC() Bartosz Golaszewski
2025-07-10 20:37 ` Bjorn Andersson
2025-07-09 14:38 ` [PATCH v2 02/12] pinctrl: provide pinmux_generic_add_pinfunction() Bartosz Golaszewski
2025-07-09 14:38 ` [PATCH v2 03/12] pinctrl: equilibrium: use pinmux_generic_add_pinfunction() Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 04/12] pinctrl: airoha: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 05/12] pinctrl: mediatek: moore: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 06/12] pinctrl: keembay: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 07/12] pinctrl: ingenic: " Bartosz Golaszewski
2025-07-09 21:25 ` Paul Cercueil
2025-07-09 14:39 ` [PATCH v2 08/12] pinctrl: qcom: use generic pin function helpers Bartosz Golaszewski
2025-07-10 12:25 ` Konrad Dybcio
2025-07-10 13:38 ` Bartosz Golaszewski
2025-07-11 12:19 ` Konrad Dybcio
2025-07-11 18:37 ` Linus Walleij
2025-07-13 8:43 ` Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 09/12] pinctrl: allow to mark pin functions as requestable GPIOs Bartosz Golaszewski
2025-07-14 11:29 ` Heiko Stübner [this message]
2025-07-09 14:39 ` [PATCH v2 10/12] pinctrl: qcom: add infrastructure for marking pin functions as GPIOs Bartosz Golaszewski
2025-07-09 18:04 ` Konrad Dybcio
2025-07-09 14:39 ` [PATCH v2 11/12] pinctrl: qcom: mark the `gpio` and `egpio` pins function as non-strict functions Bartosz Golaszewski
2025-07-09 18:03 ` Konrad Dybcio
2025-07-09 14:39 ` [PATCH v2 12/12] pinctrl: qcom: make the pinmuxing strict Bartosz Golaszewski
2025-07-10 12:26 ` Konrad Dybcio
2025-07-19 16:02 ` [PATCH v2 00/12] pinctrl: introduce the concept of a GPIO pin function category Linus Walleij
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=5911205.31r3eYUQgx@diego \
--to=heiko@sntech.de \
--cc=alexey.klimov@linaro.org \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=konradybcio@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=paul@crapouillou.net \
--cc=sean.wang@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;
as well as URLs for NNTP newsgroup(s).