[PATCH 2/2] ARM: baltos: use GPIO name for mPCIe power enable pin

yegorslists at googlemail.com yegorslists at googlemail.com
Wed Aug 3 02:31:10 PDT 2022


From: Yegor Yefremov <yegorslists at googlemail.com>

Switch to gpio_find_by_name() method to get the required input line.

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

diff --git a/arch/arm/boards/vscom-baltos/board.c b/arch/arm/boards/vscom-baltos/board.c
index 30553d1838..b9ce356264 100644
--- a/arch/arm/boards/vscom-baltos/board.c
+++ b/arch/arm/boards/vscom-baltos/board.c
@@ -98,6 +98,7 @@ static int baltos_read_eeprom(void)
 	int rc;
 	unsigned char mac_addr[6];
 	uint8_t dip;
+	int mpcie_pwr_pin;
 
 	if (!of_machine_is_compatible("vscom,onrisc"))
 		return 0;
@@ -145,7 +146,8 @@ static int baltos_read_eeprom(void)
 	globalvar_add_simple("board.id", var_buf);
 
 	/* enable mPCIe slot */
-	gpio_direction_output(100, 1);
+	mpcie_pwr_pin = gpio_find_by_name("3G_PWR_EN");
+	gpio_direction_output(mpcie_pwr_pin, 1);
 
 	/* configure output signals of the external GPIO controller */
 	if (hw_param.SystemId == 210 || hw_param.SystemId == 211) {
diff --git a/arch/arm/dts/am335x-baltos-minimal.dts b/arch/arm/dts/am335x-baltos-minimal.dts
index e9d57696d1..28a550aa84 100644
--- a/arch/arm/dts/am335x-baltos-minimal.dts
+++ b/arch/arm/dts/am335x-baltos-minimal.dts
@@ -540,7 +540,7 @@
 		"NC",
 		"NC",
 		"NC",
-		"NC",
+		"3G_PWR_EN",
 		"NC",
 		"NC",
 		"NC",
-- 
2.17.0




More information about the barebox mailing list