summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2022-05-20 14:26:42 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-26 10:31:35 +0000
commitf56eaff6760b6d3c9addc434854532bd3e2421b4 (patch)
tree56ed22031d76682e586e7a191535bec5d8100500 /board
parent49a61320d388fe2a7838fad4c04f2724ae7c35d1 (diff)
downloadchrome-ec-f56eaff6760b6d3c9addc434854532bd3e2421b4.tar.gz
zephyr: drop ioex_init for Zephyr ioex drivers
The ioex_init function has to reconfigure the ioexpander chip. For the Zephyr ioexpander driver, which is treated as a normal GPIO driver, means we have to configure every single pin from the ioexpander chip. Use the gpio_reset_port function for that purpose instead of ioex_init which bases on the ioex_config array(takes an index of the array as argument). This change allows reconfiguring ioexpnader pins e.g. after the ioexpander chip reset which is done during TCPC init for Brya board. BUG=b:231086773, b:208181774 TEST=zmake testall && Make sure PD works on ports 0 and 2 on Brya BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I8c446a4b35b03b9ed9574c6572a0daa80a9a7dee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3655999 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'board')
-rw-r--r--board/brya/usbc_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/brya/usbc_config.c b/board/brya/usbc_config.c
index ba5b2d4b48..cac3b80e7c 100644
--- a/board/brya/usbc_config.c
+++ b/board/brya/usbc_config.c
@@ -390,6 +390,7 @@ static void board_tcpc_init(void)
* C0/C2 TCPC, so they must be set up after the TCPC has
* been taken out of reset.
*/
+#ifndef CONFIG_ZEPHYR
if (get_board_id() == 1) {
ioex_init(IOEX_ID_1_C0_NCT38XX);
ioex_init(IOEX_ID_1_C2_NCT38XX);
@@ -397,6 +398,10 @@ static void board_tcpc_init(void)
ioex_init(IOEX_C0_NCT38XX);
ioex_init(IOEX_C2_NCT38XX);
}
+#else
+ gpio_reset_port(DEVICE_DT_GET(DT_NODELABEL(ioex_port1)));
+ gpio_reset_port(DEVICE_DT_GET(DT_NODELABEL(ioex_port2)));
+#endif
/* Enable PPC interrupts. */
gpio_enable_interrupt(GPIO_USB_C0_PPC_INT_ODL);