linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: single: config: enable the pin's input
@ 2021-05-14 16:38 Dario Binacchi
  2021-05-18  6:08 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Binacchi @ 2021-05-14 16:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Haojian Zhuang, Linus Walleij, Tony Lindgren,
	linux-arm-kernel, linux-gpio, linux-omap

It enables / disables the input buffer. As explained in the description
of 'enum pin_config_param' this does not affect the pin's ability to
drive output.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
---

 drivers/pinctrl/pinctrl-single.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 2c9c9835f375..4e7cdb9ee855 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -534,6 +534,7 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
 		case PIN_CONFIG_DRIVE_STRENGTH:
 		case PIN_CONFIG_SLEW_RATE:
 		case PIN_CONFIG_MODE_LOW_POWER:
+		case PIN_CONFIG_INPUT_ENABLE:
 		default:
 			*config = data;
 			break;
@@ -572,6 +573,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
 			case PIN_CONFIG_DRIVE_STRENGTH:
 			case PIN_CONFIG_SLEW_RATE:
 			case PIN_CONFIG_MODE_LOW_POWER:
+			case PIN_CONFIG_INPUT_ENABLE:
 				shift = ffs(func->conf[i].mask) - 1;
 				data &= ~func->conf[i].mask;
 				data |= (arg << shift) & func->conf[i].mask;
@@ -918,6 +920,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
 	static const struct pcs_conf_type prop2[] = {
 		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
 		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
+		{ "pinctrl-single,input-enable", PIN_CONFIG_INPUT_ENABLE, },
 		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
 		{ "pinctrl-single,low-power-mode", PIN_CONFIG_MODE_LOW_POWER, },
 	};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pinctrl: single: config: enable the pin's input
  2021-05-14 16:38 [PATCH] pinctrl: single: config: enable the pin's input Dario Binacchi
@ 2021-05-18  6:08 ` Tony Lindgren
  2021-05-18  9:01   ` Dario Binacchi
  2021-05-18 20:19   ` Dario Binacchi
  0 siblings, 2 replies; 4+ messages in thread
From: Tony Lindgren @ 2021-05-18  6:08 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: linux-kernel, Haojian Zhuang, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-omap

* Dario Binacchi <dariobin@libero.it> [210514 16:38]:
> It enables / disables the input buffer. As explained in the description
> of 'enum pin_config_param' this does not affect the pin's ability to
> drive output.
> 
> Signed-off-by: Dario Binacchi <dariobin@libero.it>
> ---
> 
>  drivers/pinctrl/pinctrl-single.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 2c9c9835f375..4e7cdb9ee855 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -534,6 +534,7 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
>  		case PIN_CONFIG_DRIVE_STRENGTH:
>  		case PIN_CONFIG_SLEW_RATE:
>  		case PIN_CONFIG_MODE_LOW_POWER:
> +		case PIN_CONFIG_INPUT_ENABLE:
>  		default:
>  			*config = data;
>  			break;
> @@ -572,6 +573,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
>  			case PIN_CONFIG_DRIVE_STRENGTH:
>  			case PIN_CONFIG_SLEW_RATE:
>  			case PIN_CONFIG_MODE_LOW_POWER:
> +			case PIN_CONFIG_INPUT_ENABLE:
>  				shift = ffs(func->conf[i].mask) - 1;
>  				data &= ~func->conf[i].mask;
>  				data |= (arg << shift) & func->conf[i].mask;
> @@ -918,6 +920,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
>  	static const struct pcs_conf_type prop2[] = {
>  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
>  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
> +		{ "pinctrl-single,input-enable", PIN_CONFIG_INPUT_ENABLE, },
>  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
>  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_MODE_LOW_POWER, },
>  	};

Looks OK to me if this works for Linus W. You need another patch to
update the binding though:

Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml

Or if there is such a patch floating around, I was not in Cc :)

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pinctrl: single: config: enable the pin's input
  2021-05-18  6:08 ` Tony Lindgren
@ 2021-05-18  9:01   ` Dario Binacchi
  2021-05-18 20:19   ` Dario Binacchi
  1 sibling, 0 replies; 4+ messages in thread
From: Dario Binacchi @ 2021-05-18  9:01 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-kernel, Haojian Zhuang, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-omap

Hi Tony,

> Il 18/05/2021 08:08 Tony Lindgren <tony@atomide.com> ha scritto:
> 
>  
> * Dario Binacchi <dariobin@libero.it> [210514 16:38]:
> > It enables / disables the input buffer. As explained in the description
> > of 'enum pin_config_param' this does not affect the pin's ability to
> > drive output.
> > 
> > Signed-off-by: Dario Binacchi <dariobin@libero.it>
> > ---
> > 
> >  drivers/pinctrl/pinctrl-single.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> > index 2c9c9835f375..4e7cdb9ee855 100644
> > --- a/drivers/pinctrl/pinctrl-single.c
> > +++ b/drivers/pinctrl/pinctrl-single.c
> > @@ -534,6 +534,7 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
> >  		case PIN_CONFIG_DRIVE_STRENGTH:
> >  		case PIN_CONFIG_SLEW_RATE:
> >  		case PIN_CONFIG_MODE_LOW_POWER:
> > +		case PIN_CONFIG_INPUT_ENABLE:
> >  		default:
> >  			*config = data;
> >  			break;
> > @@ -572,6 +573,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
> >  			case PIN_CONFIG_DRIVE_STRENGTH:
> >  			case PIN_CONFIG_SLEW_RATE:
> >  			case PIN_CONFIG_MODE_LOW_POWER:
> > +			case PIN_CONFIG_INPUT_ENABLE:
> >  				shift = ffs(func->conf[i].mask) - 1;
> >  				data &= ~func->conf[i].mask;
> >  				data |= (arg << shift) & func->conf[i].mask;
> > @@ -918,6 +920,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
> >  	static const struct pcs_conf_type prop2[] = {
> >  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
> >  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
> > +		{ "pinctrl-single,input-enable", PIN_CONFIG_INPUT_ENABLE, },
> >  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
> >  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_MODE_LOW_POWER, },
> >  	};
> 
> Looks OK to me if this works for Linus W. You need another patch to
> update the binding though:
> 
> Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml
> 
> Or if there is such a patch floating around, I was not in Cc :)

I'll add a documentation patch and CC you.

Thanks and regards,
Dario

> 
> Regards,
> 
> Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pinctrl: single: config: enable the pin's input
  2021-05-18  6:08 ` Tony Lindgren
  2021-05-18  9:01   ` Dario Binacchi
@ 2021-05-18 20:19   ` Dario Binacchi
  1 sibling, 0 replies; 4+ messages in thread
From: Dario Binacchi @ 2021-05-18 20:19 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-kernel, Haojian Zhuang, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-omap

Hi Tony,

> Il 18/05/2021 08:08 Tony Lindgren <tony@atomide.com> ha scritto:
> 
>  
> * Dario Binacchi <dariobin@libero.it> [210514 16:38]:
> > It enables / disables the input buffer. As explained in the description
> > of 'enum pin_config_param' this does not affect the pin's ability to
> > drive output.
> > 
> > Signed-off-by: Dario Binacchi <dariobin@libero.it>
> > ---
> > 
> >  drivers/pinctrl/pinctrl-single.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> > index 2c9c9835f375..4e7cdb9ee855 100644
> > --- a/drivers/pinctrl/pinctrl-single.c
> > +++ b/drivers/pinctrl/pinctrl-single.c
> > @@ -534,6 +534,7 @@ static int pcs_pinconf_get(struct pinctrl_dev *pctldev,
> >  		case PIN_CONFIG_DRIVE_STRENGTH:
> >  		case PIN_CONFIG_SLEW_RATE:
> >  		case PIN_CONFIG_MODE_LOW_POWER:
> > +		case PIN_CONFIG_INPUT_ENABLE:
> >  		default:
> >  			*config = data;
> >  			break;
> > @@ -572,6 +573,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
> >  			case PIN_CONFIG_DRIVE_STRENGTH:
> >  			case PIN_CONFIG_SLEW_RATE:
> >  			case PIN_CONFIG_MODE_LOW_POWER:
> > +			case PIN_CONFIG_INPUT_ENABLE:
> >  				shift = ffs(func->conf[i].mask) - 1;
> >  				data &= ~func->conf[i].mask;
> >  				data |= (arg << shift) & func->conf[i].mask;
> > @@ -918,6 +920,7 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
> >  	static const struct pcs_conf_type prop2[] = {
> >  		{ "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, },
> >  		{ "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, },
> > +		{ "pinctrl-single,input-enable", PIN_CONFIG_INPUT_ENABLE, },
> >  		{ "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, },
> >  		{ "pinctrl-single,low-power-mode", PIN_CONFIG_MODE_LOW_POWER, },
> >  	};
> 
> Looks OK to me if this works for Linus W. You need another patch to
> update the binding though:
> 
> Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml

I think the Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml file 
does not need to be updated. 
The 'input-enable' property is already documented.

Thanks and regards,
Dario
> 
> Or if there is such a patch floating around, I was not in Cc :)
> 
> Regards,
> 
> Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-18 20:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 16:38 [PATCH] pinctrl: single: config: enable the pin's input Dario Binacchi
2021-05-18  6:08 ` Tony Lindgren
2021-05-18  9:01   ` Dario Binacchi
2021-05-18 20:19   ` Dario Binacchi

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).