mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: baltos: use GPIO names for TCA6416 chip
@ 2022-07-06  8:06 yegorslists
  2022-07-11 10:46 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: yegorslists @ 2022-07-06  8:06 UTC (permalink / raw)
  To: barebox; +Cc: sha

From: Yegor Yefremov <yegorslists@googlemail.com>

Switch to gpio_find_by_name() method to get the required GPIO lines.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 arch/arm/boards/vscom-baltos/board.c   | 13 +++++++++----
 arch/arm/dts/am335x-baltos-minimal.dts |  4 ++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/vscom-baltos/board.c b/arch/arm/boards/vscom-baltos/board.c
index 83c7dbc8b0..9229df09d4 100644
--- a/arch/arm/boards/vscom-baltos/board.c
+++ b/arch/arm/boards/vscom-baltos/board.c
@@ -140,10 +140,15 @@ static int baltos_read_eeprom(void)
 
 	/* configure output signals of the external GPIO controller */
 	if (hw_param.SystemId == 210 || hw_param.SystemId == 211) {
-		gpio_direction_output(132, 0);
-		gpio_direction_output(133, 0);
-		gpio_direction_output(134, 0);
-		gpio_direction_output(135, 0);
+		int outs[4];
+		outs[0] = gpio_find_by_name("GP_OUT0");
+		outs[1] = gpio_find_by_name("GP_OUT1");
+		outs[2] = gpio_find_by_name("GP_OUT2");
+		outs[3] = gpio_find_by_name("GP_OUT3");
+		gpio_direction_output(outs[0], 0);
+		gpio_direction_output(outs[1], 0);
+		gpio_direction_output(outs[2], 0);
+		gpio_direction_output(outs[3], 0);
 	}
 
 	dip = get_dip_switch(hw_param.SystemId, hw_param.HwRev);
diff --git a/arch/arm/dts/am335x-baltos-minimal.dts b/arch/arm/dts/am335x-baltos-minimal.dts
index e55a2d7cbb..1544e2cc29 100644
--- a/arch/arm/dts/am335x-baltos-minimal.dts
+++ b/arch/arm/dts/am335x-baltos-minimal.dts
@@ -285,6 +285,10 @@
 		interrupts = <20 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&tca6416_pins>;
+		gpio-line-names = "GP_IN0", "GP_IN1", "GP_IN2", "GP_IN3",
+				  "GP_OUT0", "GP_OUT1", "GP_OUT2", "GP_OUT3",
+				  "ModeA0", "ModeA1", "ModeA2", "ModeA3",
+				  "ModeB0", "ModeB1", "ModeB2", "ModeB3";
 	};
 };
 
-- 
2.17.0




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

* Re: [PATCH] ARM: baltos: use GPIO names for TCA6416 chip
  2022-07-06  8:06 [PATCH] ARM: baltos: use GPIO names for TCA6416 chip yegorslists
@ 2022-07-11 10:46 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-07-11 10:46 UTC (permalink / raw)
  To: yegorslists; +Cc: barebox

On Wed, Jul 06, 2022 at 10:06:39AM +0200, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Switch to gpio_find_by_name() method to get the required GPIO lines.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  arch/arm/boards/vscom-baltos/board.c   | 13 +++++++++----
>  arch/arm/dts/am335x-baltos-minimal.dts |  4 ++++
>  2 files changed, 13 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/boards/vscom-baltos/board.c b/arch/arm/boards/vscom-baltos/board.c
> index 83c7dbc8b0..9229df09d4 100644
> --- a/arch/arm/boards/vscom-baltos/board.c
> +++ b/arch/arm/boards/vscom-baltos/board.c
> @@ -140,10 +140,15 @@ static int baltos_read_eeprom(void)
>  
>  	/* configure output signals of the external GPIO controller */
>  	if (hw_param.SystemId == 210 || hw_param.SystemId == 211) {
> -		gpio_direction_output(132, 0);
> -		gpio_direction_output(133, 0);
> -		gpio_direction_output(134, 0);
> -		gpio_direction_output(135, 0);
> +		int outs[4];
> +		outs[0] = gpio_find_by_name("GP_OUT0");
> +		outs[1] = gpio_find_by_name("GP_OUT1");
> +		outs[2] = gpio_find_by_name("GP_OUT2");
> +		outs[3] = gpio_find_by_name("GP_OUT3");
> +		gpio_direction_output(outs[0], 0);
> +		gpio_direction_output(outs[1], 0);
> +		gpio_direction_output(outs[2], 0);
> +		gpio_direction_output(outs[3], 0);
>  	}
>  
>  	dip = get_dip_switch(hw_param.SystemId, hw_param.HwRev);
> diff --git a/arch/arm/dts/am335x-baltos-minimal.dts b/arch/arm/dts/am335x-baltos-minimal.dts
> index e55a2d7cbb..1544e2cc29 100644
> --- a/arch/arm/dts/am335x-baltos-minimal.dts
> +++ b/arch/arm/dts/am335x-baltos-minimal.dts
> @@ -285,6 +285,10 @@
>  		interrupts = <20 GPIO_ACTIVE_LOW>;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&tca6416_pins>;
> +		gpio-line-names = "GP_IN0", "GP_IN1", "GP_IN2", "GP_IN3",
> +				  "GP_OUT0", "GP_OUT1", "GP_OUT2", "GP_OUT3",
> +				  "ModeA0", "ModeA1", "ModeA2", "ModeA3",
> +				  "ModeB0", "ModeB1", "ModeB2", "ModeB3";
>  	};
>  };
>  
> -- 
> 2.17.0
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2022-07-11 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  8:06 [PATCH] ARM: baltos: use GPIO names for TCA6416 chip yegorslists
2022-07-11 10:46 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox