[PATCH] ARM: baltos: use GPIO names for TCA6416 chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>

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

Signed-off-by: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux