linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] AT91 PIO4 push-pull enable
@ 2023-05-17 11:54 Ryan.Wanner
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Ryan.Wanner @ 2023-05-17 11:54 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio,
	Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

This patch set enables push-pull pin configuation for PIO4 IP as well as
updating the DT binding.

Removing the integer argument for open-drain allows the driver to
process drive configuration from gpiolib as the integer argument is
discarded.

Ryan Wanner (3):
  pinctrl: at91-pio4: Enable Push-Pull configuration
  dt-bindings: pinctrl: at91-pio4: Add push-pull support
  ARM: dts: at91: Return to boolean properties

 .../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt  |  3 ++-
 arch/arm/boot/dts/at91-kizbox3-hs.dts             |  2 +-
 arch/arm/boot/dts/at91-kizbox3_common.dtsi        |  2 +-
 drivers/pinctrl/pinctrl-at91-pio4.c               | 15 +++++++++++----
 4 files changed, 15 insertions(+), 7 deletions(-)

-- 
2.39.2


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

* [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-17 11:54 [PATCH 0/3] AT91 PIO4 push-pull enable Ryan.Wanner
@ 2023-05-17 11:54 ` Ryan.Wanner
  2023-05-18  5:40   ` Claudiu.Beznea
                     ` (3 more replies)
  2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
  2023-05-17 11:54 ` [PATCH 3/3] ARM: dts: at91: Return to boolean properties Ryan.Wanner
  2 siblings, 4 replies; 15+ messages in thread
From: Ryan.Wanner @ 2023-05-17 11:54 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio,
	Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

Enable push-pull configuration. Remove integer value argument from
open-drain configuration as it is discarded when pinconf function is
called from gpiolib. Add push-pull do debug and get functions.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 drivers/pinctrl/pinctrl-at91-pio4.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index 2fe40acb6a3e..3c39d62bbc3c 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
 			return -EINVAL;
 		arg = 1;
 		break;
+	case PIN_CONFIG_DRIVE_PUSH_PULL:
+		if (res & ATMEL_PIO_OPD_MASK)
+			return -EINVAL;
+		arg = 1;
+		break;
 	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
 		if (!(res & ATMEL_PIO_SCHMITT_MASK))
 			return -EINVAL;
@@ -827,10 +832,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
 			conf &= (~ATMEL_PIO_PUEN_MASK);
 			break;
 		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
-			if (arg == 0)
-				conf &= (~ATMEL_PIO_OPD_MASK);
-			else
-				conf |= ATMEL_PIO_OPD_MASK;
+			conf |= ATMEL_PIO_OPD_MASK;
+			break;
+		case PIN_CONFIG_DRIVE_PUSH_PULL:
+			conf &= (~ATMEL_PIO_OPD_MASK);
 			break;
 		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
 			if (arg == 0)
@@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
 		seq_printf(s, "%s ", "debounce");
 	if (conf & ATMEL_PIO_OPD_MASK)
 		seq_printf(s, "%s ", "open-drain");
+	if (!(conf & ATMEL_PIO_OPD_MASK))
+		seq_printf(s, "%s ", "push-pull");
 	if (conf & ATMEL_PIO_SCHMITT_MASK)
 		seq_printf(s, "%s ", "schmitt");
 	if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))
-- 
2.39.2


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

* [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support
  2023-05-17 11:54 [PATCH 0/3] AT91 PIO4 push-pull enable Ryan.Wanner
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
@ 2023-05-17 11:54 ` Ryan.Wanner
  2023-05-17 17:38   ` Conor Dooley
                     ` (2 more replies)
  2023-05-17 11:54 ` [PATCH 3/3] ARM: dts: at91: Return to boolean properties Ryan.Wanner
  2 siblings, 3 replies; 15+ messages in thread
From: Ryan.Wanner @ 2023-05-17 11:54 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio,
	Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

Add generic push-pull support for pio4 driver.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 .../devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
index e2b861ce16d8..774c3c269c40 100644
--- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
@@ -37,7 +37,8 @@ right representation of the pin.
 Optional properties:
 - GENERIC_PINCONFIG: generic pinconfig options to use:
 	- bias-disable, bias-pull-down, bias-pull-up, drive-open-drain,
-	  input-schmitt-enable, input-debounce, output-low, output-high.
+	 drive-push-pull input-schmitt-enable, input-debounce, output-low,
+	 output-high.
 	- for microchip,sama7g5-pinctrl only:
 		- slew-rate: 0 - disabled, 1 - enabled (default)
 - atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for
-- 
2.39.2


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

* [PATCH 3/3] ARM: dts: at91: Return to boolean properties
  2023-05-17 11:54 [PATCH 0/3] AT91 PIO4 push-pull enable Ryan.Wanner
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
  2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
@ 2023-05-17 11:54 ` Ryan.Wanner
  2023-05-22  9:22   ` Nicolas Ferre
  2 siblings, 1 reply; 15+ messages in thread
From: Ryan.Wanner @ 2023-05-17 11:54 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio,
	Ryan Wanner

From: Ryan Wanner <Ryan.Wanner@microchip.com>

Returning back to commit 0dc23d1a8e17
("arm: dts: at91: Fix boolean properties with values") as pinctrl driver no
longer expects an integer value and expects a simple boolean property.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
 arch/arm/boot/dts/at91-kizbox3-hs.dts      | 2 +-
 arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3-hs.dts b/arch/arm/boot/dts/at91-kizbox3-hs.dts
index 7075df6549e9..fec7269088d1 100644
--- a/arch/arm/boot/dts/at91-kizbox3-hs.dts
+++ b/arch/arm/boot/dts/at91-kizbox3-hs.dts
@@ -225,7 +225,7 @@ pinctrl_pio_zbe_rst: gpio_zbe_rst {
 		pinctrl_pio_io_reset: gpio_io_reset {
 			pinmux = <PIN_PB30__GPIO>;
 			bias-disable;
-			drive-open-drain = <1>;
+			drive-open-drain;
 			output-low;
 		};
 		pinctrl_pio_input: gpio_input {
diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index abe27adfa4d6..465664628419 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -211,7 +211,7 @@ pinctrl_flx4_default: flx4_i2c6_default {
 		pinmux = <PIN_PD12__FLEXCOM4_IO0>, //DATA
 		<PIN_PD13__FLEXCOM4_IO1>; //CLK
 		bias-disable;
-		drive-open-drain = <1>;
+		drive-open-drain;
 	};
 
 	pinctrl_pwm0 {
-- 
2.39.2


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

* Re: [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support
  2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
@ 2023-05-17 17:38   ` Conor Dooley
  2023-05-17 17:50     ` Conor Dooley
  2023-05-22  9:18   ` Nicolas Ferre
  2023-05-24  8:50   ` Linus Walleij
  2 siblings, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2023-05-17 17:38 UTC (permalink / raw)
  To: Ryan.Wanner
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches, devicetree, linux-arm-kernel, linux-kernel,
	linux-gpio

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Wed, May 17, 2023 at 01:54:05PM +0200, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Add generic push-pull support for pio4 driver.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support
  2023-05-17 17:38   ` Conor Dooley
@ 2023-05-17 17:50     ` Conor Dooley
  0 siblings, 0 replies; 15+ messages in thread
From: Conor Dooley @ 2023-05-17 17:50 UTC (permalink / raw)
  To: Ryan.Wanner
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches, devicetree, linux-arm-kernel, linux-kernel,
	linux-gpio

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Wed, May 17, 2023 at 06:38:28PM +0100, Conor Dooley wrote:
> On Wed, May 17, 2023 at 01:54:05PM +0200, Ryan.Wanner@microchip.com wrote:
> > From: Ryan Wanner <Ryan.Wanner@microchip.com>
> > 
> > Add generic push-pull support for pio4 driver.
> > 
> > Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Whoops, incorrect vim macro, should have been:
Acked-by: Conor Dooley <conor.dooley@microchip.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
@ 2023-05-18  5:40   ` Claudiu.Beznea
  2023-05-18  5:54     ` Claudiu.Beznea
  2023-05-22  9:18   ` Nicolas Ferre
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Claudiu.Beznea @ 2023-05-18  5:40 UTC (permalink / raw)
  To: Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Nicolas.Ferre, alexandre.belloni, linus.walleij,
	Ludovic.Desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 17.05.2023 14:54, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Enable push-pull configuration. Remove integer value argument from
> open-drain configuration as it is discarded when pinconf function is
> called from gpiolib.

AFAICT it is still taken into account when passed tough drive-open-drain DT
property but at the moment there are no device trees using this property.

> Add push-pull do debug and get functions.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
> ---
>  drivers/pinctrl/pinctrl-at91-pio4.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index 2fe40acb6a3e..3c39d62bbc3c 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
>  			return -EINVAL;
>  		arg = 1;
>  		break;
> +	case PIN_CONFIG_DRIVE_PUSH_PULL:
> +		if (res & ATMEL_PIO_OPD_MASK)
> +			return -EINVAL;
> +		arg = 1;
> +		break;
>  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>  		if (!(res & ATMEL_PIO_SCHMITT_MASK))
>  			return -EINVAL;
> @@ -827,10 +832,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
>  			conf &= (~ATMEL_PIO_PUEN_MASK);
>  			break;
>  		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> -			if (arg == 0)
> -				conf &= (~ATMEL_PIO_OPD_MASK);
> -			else
> -				conf |= ATMEL_PIO_OPD_MASK;
> +			conf |= ATMEL_PIO_OPD_MASK;
> +			break;
> +		case PIN_CONFIG_DRIVE_PUSH_PULL:
> +			conf &= (~ATMEL_PIO_OPD_MASK);
>  			break;
>  		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>  			if (arg == 0)
> @@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
>  		seq_printf(s, "%s ", "debounce");
>  	if (conf & ATMEL_PIO_OPD_MASK)
>  		seq_printf(s, "%s ", "open-drain");
> +	if (!(conf & ATMEL_PIO_OPD_MASK))

else would fit better here.

> +		seq_printf(s, "%s ", "push-pull");
>  	if (conf & ATMEL_PIO_SCHMITT_MASK)
>  		seq_printf(s, "%s ", "schmitt");
>  	if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))


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

* Re: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-18  5:40   ` Claudiu.Beznea
@ 2023-05-18  5:54     ` Claudiu.Beznea
  0 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2023-05-18  5:54 UTC (permalink / raw)
  To: Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Nicolas.Ferre, alexandre.belloni, linus.walleij,
	Ludovic.Desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 18.05.2023 08:40, Claudiu Beznea - M18063 wrote:
> On 17.05.2023 14:54, Ryan.Wanner@microchip.com wrote:
>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>
>> Enable push-pull configuration. Remove integer value argument from
>> open-drain configuration as it is discarded when pinconf function is
>> called from gpiolib.
> 
> AFAICT it is still taken into account when passed tough drive-open-drain DT
> property but at the moment there are no device trees using this property.

ah, ignore this as I've just saw your question about this here:
https://lore.kernel.org/all/120117b6-feda-e7aa-4f09-a126a0747388@microchip.com/

> 
>> Add push-pull do debug and get functions.
>>
>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>> ---
>>  drivers/pinctrl/pinctrl-at91-pio4.c | 15 +++++++++++----
>>  1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
>> index 2fe40acb6a3e..3c39d62bbc3c 100644
>> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
>> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
>> @@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
>>  			return -EINVAL;
>>  		arg = 1;
>>  		break;
>> +	case PIN_CONFIG_DRIVE_PUSH_PULL:
>> +		if (res & ATMEL_PIO_OPD_MASK)
>> +			return -EINVAL;
>> +		arg = 1;
>> +		break;
>>  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>>  		if (!(res & ATMEL_PIO_SCHMITT_MASK))
>>  			return -EINVAL;
>> @@ -827,10 +832,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
>>  			conf &= (~ATMEL_PIO_PUEN_MASK);
>>  			break;
>>  		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
>> -			if (arg == 0)
>> -				conf &= (~ATMEL_PIO_OPD_MASK);
>> -			else
>> -				conf |= ATMEL_PIO_OPD_MASK;
>> +			conf |= ATMEL_PIO_OPD_MASK;
>> +			break;
>> +		case PIN_CONFIG_DRIVE_PUSH_PULL:
>> +			conf &= (~ATMEL_PIO_OPD_MASK);
>>  			break;
>>  		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>>  			if (arg == 0)
>> @@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
>>  		seq_printf(s, "%s ", "debounce");
>>  	if (conf & ATMEL_PIO_OPD_MASK)
>>  		seq_printf(s, "%s ", "open-drain");
>> +	if (!(conf & ATMEL_PIO_OPD_MASK))
> 
> else would fit better here.
> 
>> +		seq_printf(s, "%s ", "push-pull");
>>  	if (conf & ATMEL_PIO_SCHMITT_MASK)
>>  		seq_printf(s, "%s ", "schmitt");
>>  	if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))
> 


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

* Re: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
  2023-05-18  5:40   ` Claudiu.Beznea
@ 2023-05-22  9:18   ` Nicolas Ferre
  2023-05-23 16:27   ` andy.shevchenko
  2023-05-24  8:50   ` Linus Walleij
  3 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2023-05-22  9:18 UTC (permalink / raw)
  To: Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 17/05/2023 at 13:54, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Enable push-pull configuration. Remove integer value argument from
> open-drain configuration as it is discarded when pinconf function is
> called from gpiolib. Add push-pull do debug and get functions.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

Looks good to me:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks,
   Nicolas

> ---
>   drivers/pinctrl/pinctrl-at91-pio4.c | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index 2fe40acb6a3e..3c39d62bbc3c 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
>   			return -EINVAL;
>   		arg = 1;
>   		break;
> +	case PIN_CONFIG_DRIVE_PUSH_PULL:
> +		if (res & ATMEL_PIO_OPD_MASK)
> +			return -EINVAL;
> +		arg = 1;
> +		break;
>   	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>   		if (!(res & ATMEL_PIO_SCHMITT_MASK))
>   			return -EINVAL;
> @@ -827,10 +832,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
>   			conf &= (~ATMEL_PIO_PUEN_MASK);
>   			break;
>   		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> -			if (arg == 0)
> -				conf &= (~ATMEL_PIO_OPD_MASK);
> -			else
> -				conf |= ATMEL_PIO_OPD_MASK;
> +			conf |= ATMEL_PIO_OPD_MASK;
> +			break;
> +		case PIN_CONFIG_DRIVE_PUSH_PULL:
> +			conf &= (~ATMEL_PIO_OPD_MASK);
>   			break;
>   		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
>   			if (arg == 0)
> @@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
>   		seq_printf(s, "%s ", "debounce");
>   	if (conf & ATMEL_PIO_OPD_MASK)
>   		seq_printf(s, "%s ", "open-drain");
> +	if (!(conf & ATMEL_PIO_OPD_MASK))
> +		seq_printf(s, "%s ", "push-pull");
>   	if (conf & ATMEL_PIO_SCHMITT_MASK)
>   		seq_printf(s, "%s ", "schmitt");
>   	if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))

-- 
Nicolas Ferre


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

* Re: [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support
  2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
  2023-05-17 17:38   ` Conor Dooley
@ 2023-05-22  9:18   ` Nicolas Ferre
  2023-05-24  8:50   ` Linus Walleij
  2 siblings, 0 replies; 15+ messages in thread
From: Nicolas Ferre @ 2023-05-22  9:18 UTC (permalink / raw)
  To: Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 17/05/2023 at 13:54, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Add generic push-pull support for pio4 driver.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   .../devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt    | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
> index e2b861ce16d8..774c3c269c40 100644
> --- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
> @@ -37,7 +37,8 @@ right representation of the pin.
>   Optional properties:
>   - GENERIC_PINCONFIG: generic pinconfig options to use:
>   	- bias-disable, bias-pull-down, bias-pull-up, drive-open-drain,
> -	  input-schmitt-enable, input-debounce, output-low, output-high.
> +	 drive-push-pull input-schmitt-enable, input-debounce, output-low,
> +	 output-high.
>   	- for microchip,sama7g5-pinctrl only:
>   		- slew-rate: 0 - disabled, 1 - enabled (default)
>   - atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for

-- 
Nicolas Ferre


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

* Re: [PATCH 3/3] ARM: dts: at91: Return to boolean properties
  2023-05-17 11:54 ` [PATCH 3/3] ARM: dts: at91: Return to boolean properties Ryan.Wanner
@ 2023-05-22  9:22   ` Nicolas Ferre
  2023-05-23  5:05     ` Claudiu.Beznea
  0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Ferre @ 2023-05-22  9:22 UTC (permalink / raw)
  To: Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 17/05/2023 at 13:54, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Returning back to commit 0dc23d1a8e17
> ("arm: dts: at91: Fix boolean properties with values") as pinctrl driver no
> longer expects an integer value and expects a simple boolean property.
> 
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

Okay:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks for fixing this as well. Best regards,
   Nicolas

> ---
>   arch/arm/boot/dts/at91-kizbox3-hs.dts      | 2 +-
>   arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/at91-kizbox3-hs.dts b/arch/arm/boot/dts/at91-kizbox3-hs.dts
> index 7075df6549e9..fec7269088d1 100644
> --- a/arch/arm/boot/dts/at91-kizbox3-hs.dts
> +++ b/arch/arm/boot/dts/at91-kizbox3-hs.dts
> @@ -225,7 +225,7 @@ pinctrl_pio_zbe_rst: gpio_zbe_rst {
>   		pinctrl_pio_io_reset: gpio_io_reset {
>   			pinmux = <PIN_PB30__GPIO>;
>   			bias-disable;
> -			drive-open-drain = <1>;
> +			drive-open-drain;
>   			output-low;
>   		};
>   		pinctrl_pio_input: gpio_input {
> diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
> index abe27adfa4d6..465664628419 100644
> --- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
> +++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
> @@ -211,7 +211,7 @@ pinctrl_flx4_default: flx4_i2c6_default {
>   		pinmux = <PIN_PD12__FLEXCOM4_IO0>, //DATA
>   		<PIN_PD13__FLEXCOM4_IO1>; //CLK
>   		bias-disable;
> -		drive-open-drain = <1>;
> +		drive-open-drain;
>   	};
>   
>   	pinctrl_pwm0 {

-- 
Nicolas Ferre


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

* Re: [PATCH 3/3] ARM: dts: at91: Return to boolean properties
  2023-05-22  9:22   ` Nicolas Ferre
@ 2023-05-23  5:05     ` Claudiu.Beznea
  0 siblings, 0 replies; 15+ messages in thread
From: Claudiu.Beznea @ 2023-05-23  5:05 UTC (permalink / raw)
  To: Nicolas.Ferre, Ryan.Wanner, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, alexandre.belloni, linus.walleij, Ludovic.Desroches
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-gpio

On 22.05.2023 12:22, Nicolas Ferre wrote:
> On 17/05/2023 at 13:54, Ryan.Wanner@microchip.com wrote:
>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>
>> Returning back to commit 0dc23d1a8e17
>> ("arm: dts: at91: Fix boolean properties with values") as pinctrl driver no
>> longer expects an integer value and expects a simple boolean property.
>>
>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Okay:
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Applied to at91-dt, thanks!

> 
> Thanks for fixing this as well. Best regards,
>   Nicolas
> 
>> ---
>>   arch/arm/boot/dts/at91-kizbox3-hs.dts      | 2 +-
>>   arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/at91-kizbox3-hs.dts
>> b/arch/arm/boot/dts/at91-kizbox3-hs.dts
>> index 7075df6549e9..fec7269088d1 100644
>> --- a/arch/arm/boot/dts/at91-kizbox3-hs.dts
>> +++ b/arch/arm/boot/dts/at91-kizbox3-hs.dts
>> @@ -225,7 +225,7 @@ pinctrl_pio_zbe_rst: gpio_zbe_rst {
>>           pinctrl_pio_io_reset: gpio_io_reset {
>>               pinmux = <PIN_PB30__GPIO>;
>>               bias-disable;
>> -            drive-open-drain = <1>;
>> +            drive-open-drain;
>>               output-low;
>>           };
>>           pinctrl_pio_input: gpio_input {
>> diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
>> b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
>> index abe27adfa4d6..465664628419 100644
>> --- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
>> +++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
>> @@ -211,7 +211,7 @@ pinctrl_flx4_default: flx4_i2c6_default {
>>           pinmux = <PIN_PD12__FLEXCOM4_IO0>, //DATA
>>           <PIN_PD13__FLEXCOM4_IO1>; //CLK
>>           bias-disable;
>> -        drive-open-drain = <1>;
>> +        drive-open-drain;
>>       };
>>         pinctrl_pwm0 {
> 


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

* Re: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
  2023-05-18  5:40   ` Claudiu.Beznea
  2023-05-22  9:18   ` Nicolas Ferre
@ 2023-05-23 16:27   ` andy.shevchenko
  2023-05-24  8:50   ` Linus Walleij
  3 siblings, 0 replies; 15+ messages in thread
From: andy.shevchenko @ 2023-05-23 16:27 UTC (permalink / raw)
  To: Ryan.Wanner
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linus.walleij,
	ludovic.desroches, devicetree, linux-arm-kernel, linux-kernel,
	linux-gpio

Wed, May 17, 2023 at 01:54:04PM +0200, Ryan.Wanner@microchip.com kirjoitti:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
> 
> Enable push-pull configuration. Remove integer value argument from
> open-drain configuration as it is discarded when pinconf function is
> called from gpiolib. Add push-pull do debug and get functions.

Right, thank you for fixing this!
Other comments below.

...

> +		case PIN_CONFIG_DRIVE_PUSH_PULL:
> +			conf &= (~ATMEL_PIO_OPD_MASK);

Parentheses are redundant.

>  			break;

...

>  	if (conf & ATMEL_PIO_OPD_MASK)
>  		seq_printf(s, "%s ", "open-drain");
> +	if (!(conf & ATMEL_PIO_OPD_MASK))
> +		seq_printf(s, "%s ", "push-pull");

As commented already by others, the else would be better.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration
  2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
                     ` (2 preceding siblings ...)
  2023-05-23 16:27   ` andy.shevchenko
@ 2023-05-24  8:50   ` Linus Walleij
  3 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2023-05-24  8:50 UTC (permalink / raw)
  To: Ryan.Wanner
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, ludovic.desroches, devicetree,
	linux-arm-kernel, linux-kernel, linux-gpio

On Wed, May 17, 2023 at 1:54 PM <Ryan.Wanner@microchip.com> wrote:

> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>
> Enable push-pull configuration. Remove integer value argument from
> open-drain configuration as it is discarded when pinconf function is
> called from gpiolib. Add push-pull do debug and get functions.
>
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

I fixed up the two style issues pointed out by Andy and applied.
No need to resend.

Yours,
Linus Walleij

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

* Re: [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support
  2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
  2023-05-17 17:38   ` Conor Dooley
  2023-05-22  9:18   ` Nicolas Ferre
@ 2023-05-24  8:50   ` Linus Walleij
  2 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2023-05-24  8:50 UTC (permalink / raw)
  To: Ryan.Wanner
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, ludovic.desroches, devicetree,
	linux-arm-kernel, linux-kernel, linux-gpio

On Wed, May 17, 2023 at 1:54 PM <Ryan.Wanner@microchip.com> wrote:

> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>
> Add generic push-pull support for pio4 driver.
>
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2023-05-24  8:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 11:54 [PATCH 0/3] AT91 PIO4 push-pull enable Ryan.Wanner
2023-05-17 11:54 ` [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Ryan.Wanner
2023-05-18  5:40   ` Claudiu.Beznea
2023-05-18  5:54     ` Claudiu.Beznea
2023-05-22  9:18   ` Nicolas Ferre
2023-05-23 16:27   ` andy.shevchenko
2023-05-24  8:50   ` Linus Walleij
2023-05-17 11:54 ` [PATCH 2/3] dt-bindings: pinctrl: at91-pio4: Add push-pull support Ryan.Wanner
2023-05-17 17:38   ` Conor Dooley
2023-05-17 17:50     ` Conor Dooley
2023-05-22  9:18   ` Nicolas Ferre
2023-05-24  8:50   ` Linus Walleij
2023-05-17 11:54 ` [PATCH 3/3] ARM: dts: at91: Return to boolean properties Ryan.Wanner
2023-05-22  9:22   ` Nicolas Ferre
2023-05-23  5:05     ` Claudiu.Beznea

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