summaryrefslogtreecommitdiff
path: root/zephyr/program/rex/src/usbc_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/program/rex/src/usbc_config.c')
-rw-r--r--zephyr/program/rex/src/usbc_config.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/zephyr/program/rex/src/usbc_config.c b/zephyr/program/rex/src/usbc_config.c
index fceb6e0197..e12991d820 100644
--- a/zephyr/program/rex/src/usbc_config.c
+++ b/zephyr/program/rex/src/usbc_config.c
@@ -123,25 +123,22 @@ uint16_t tcpc_get_alert_status(void)
{
uint16_t status = 0;
const struct gpio_dt_spec *tcpc_c0_rst_l;
- const struct gpio_dt_spec *tcpc_c0_int_l;
const struct gpio_dt_spec *tcpc_c1_rst_l;
- const struct gpio_dt_spec *tcpc_c1_int_l;
tcpc_c0_rst_l = GPIO_DT_FROM_NODELABEL(gpio_usb_c0_tcpc_rst_odl);
- tcpc_c0_int_l = GPIO_DT_FROM_NODELABEL(gpio_usb_c0_tcpc_int_odl);
-
tcpc_c1_rst_l = GPIO_DT_FROM_NODELABEL(gpio_usb_c1_rt_rst_r_odl);
- tcpc_c1_int_l = GPIO_DT_FROM_NODELABEL(gpio_usb_c1_tcpc_int_odl);
/*
* Check which port has the ALERT line set and ignore if that TCPC has
* its reset line active.
*/
- if (!gpio_pin_get_dt(tcpc_c0_int_l) && gpio_pin_get_dt(tcpc_c0_rst_l)) {
+ if (gpio_pin_get_dt(&tcpc_config[0].irq_gpio) &&
+ gpio_pin_get_dt(tcpc_c0_rst_l)) {
status |= PD_STATUS_TCPC_ALERT_0;
}
- if (!gpio_pin_get_dt(tcpc_c1_int_l) && gpio_pin_get_dt(tcpc_c1_rst_l)) {
+ if (gpio_pin_get_dt(&tcpc_config[1].irq_gpio) &&
+ gpio_pin_get_dt(tcpc_c1_rst_l)) {
status |= PD_STATUS_TCPC_ALERT_1;
}