From: yegorslists@googlemail.com
To: barebox@lists.infradead.org
Cc: sha@pengutronix.de
Subject: [PATCH] ARM: baltos: use GPIO names for TCA6416 chip
Date: Wed, 6 Jul 2022 10:06:39 +0200 [thread overview]
Message-ID: <20220706080639.13588-1-yegorslists@googlemail.com> (raw)
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
next reply other threads:[~2022-07-06 8:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 8:06 yegorslists [this message]
2022-07-11 10:46 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220706080639.13588-1-yegorslists@googlemail.com \
--to=yegorslists@googlemail.com \
--cc=barebox@lists.infradead.org \
--cc=sha@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox