[PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function

Bartosz Golaszewski posted 5 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function
Posted by Bartosz Golaszewski 3 months, 1 week ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Allow pins muxed to the "gpio" function to be requested as GPIOs even if
pinmux_ops say the controller should be strict.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-sm8650.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-sm8650.c b/drivers/pinctrl/qcom/pinctrl-sm8650.c
index 449a0077f4b10666ecd9dfaae8e0057a91e181a6..4ab0e75079cd5dec1d86835dae30c9a09455c7f3 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8650.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8650.c
@@ -1328,7 +1328,7 @@ static const char *const vsense_trigger_mirnat_groups[] = {
 };
 
 static const struct pinfunction sm8650_functions[] = {
-	MSM_PIN_FUNCTION(gpio),
+	MSM_GPIO_PIN_FUNCTION(gpio),
 	MSM_PIN_FUNCTION(aoss_cti),
 	MSM_PIN_FUNCTION(atest_char),
 	MSM_PIN_FUNCTION(atest_usb),

-- 
2.48.1
Re: [PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Wed, Jul 02, 2025 at 10:45:33AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Allow pins muxed to the "gpio" function to be requested as GPIOs even if
> pinmux_ops say the controller should be strict.

This is a strange commit message, shouldn't "gpio" function behave
exactly like that - mark the pin as a GPIO?

> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/pinctrl/qcom/pinctrl-sm8650.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-sm8650.c b/drivers/pinctrl/qcom/pinctrl-sm8650.c
> index 449a0077f4b10666ecd9dfaae8e0057a91e181a6..4ab0e75079cd5dec1d86835dae30c9a09455c7f3 100644
> --- a/drivers/pinctrl/qcom/pinctrl-sm8650.c
> +++ b/drivers/pinctrl/qcom/pinctrl-sm8650.c
> @@ -1328,7 +1328,7 @@ static const char *const vsense_trigger_mirnat_groups[] = {
>  };
>  
>  static const struct pinfunction sm8650_functions[] = {
> -	MSM_PIN_FUNCTION(gpio),
> +	MSM_GPIO_PIN_FUNCTION(gpio),
>  	MSM_PIN_FUNCTION(aoss_cti),
>  	MSM_PIN_FUNCTION(atest_char),
>  	MSM_PIN_FUNCTION(atest_usb),
> 
> -- 
> 2.48.1
> 

-- 
With best wishes
Dmitry
Re: [PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function
Posted by Bartosz Golaszewski 3 months ago
On Thu, Jul 3, 2025 at 12:50 AM Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> wrote:
>
> On Wed, Jul 02, 2025 at 10:45:33AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > Allow pins muxed to the "gpio" function to be requested as GPIOs even if
> > pinmux_ops say the controller should be strict.
>
> This is a strange commit message, shouldn't "gpio" function behave
> exactly like that - mark the pin as a GPIO?
>

They should but they don't. I should maybe rework the commit message
to say: "muxed to the function called `gpio`...". The "gpio" here is
just a name, it could as well be saying "dmitry" or "123456", the
pinctrl core doesn't interpret it in any special way. What I'm doing
here, is marking the associated struct pinfunction object as one that
should allow pinmux core to export this pin as a GPIOLIB GPIO.

Bart
Re: [PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function
Posted by Dmitry Baryshkov 3 months ago
On Thu, Jul 03, 2025 at 10:17:43AM +0200, Bartosz Golaszewski wrote:
> On Thu, Jul 3, 2025 at 12:50 AM Dmitry Baryshkov
> <dmitry.baryshkov@oss.qualcomm.com> wrote:
> >
> > On Wed, Jul 02, 2025 at 10:45:33AM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > Allow pins muxed to the "gpio" function to be requested as GPIOs even if
> > > pinmux_ops say the controller should be strict.
> >
> > This is a strange commit message, shouldn't "gpio" function behave
> > exactly like that - mark the pin as a GPIO?
> >
> 
> They should but they don't. I should maybe rework the commit message
> to say: "muxed to the function called `gpio`...". The "gpio" here is
> just a name, it could as well be saying "dmitry" or "123456", the
> pinctrl core doesn't interpret it in any special way. What I'm doing
> here, is marking the associated struct pinfunction object as one that
> should allow pinmux core to export this pin as a GPIOLIB GPIO.

Ack

-- 
With best wishes
Dmitry
Re: [PATCH RFC 3/5] pinctrl: qcom: sm8650: mark the `gpio` pin function as a non-strict function
Posted by Konrad Dybcio 3 months, 1 week ago
On 7/2/25 10:45 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Allow pins muxed to the "gpio" function to be requested as GPIOs even if
> pinmux_ops say the controller should be strict.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---

fwiw this simple change could be a single 'run sed on all files' if
we decide to go with this approach

Konrad