diff options
-rw-r--r-- | baseboard/cherry/baseboard.c | 218 | ||||
-rw-r--r-- | baseboard/cherry/baseboard.h | 23 | ||||
-rw-r--r-- | baseboard/cherry/usb_pd_policy.c | 44 | ||||
-rw-r--r-- | board/cherry/ec.tasklist | 2 | ||||
-rw-r--r-- | board/cherry/gpio.inc | 6 | ||||
-rw-r--r-- | driver/tcpm/rt1718s.h | 4 |
6 files changed, 221 insertions, 76 deletions
diff --git a/baseboard/cherry/baseboard.c b/baseboard/cherry/baseboard.c index 5301c0724c..fb90dfe5ff 100644 --- a/baseboard/cherry/baseboard.c +++ b/baseboard/cherry/baseboard.c @@ -22,11 +22,13 @@ #include "driver/bc12/mt6360.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" +#include "driver/ppc/rt1718s.h" #include "driver/ppc/syv682x.h" +#include "driver/retimer/ps8802.h" #include "driver/tcpm/it83xx_pd.h" +#include "driver/tcpm/rt1718s.h" #include "driver/temp_sensor/thermistor.h" -#include "driver/usb_mux/it5205.h" -#include "driver/usb_mux/ps8743.h" +#include "driver/usb_mux/anx3443.h" #include "extpower.h" #include "gpio.h" #include "hooks.h" @@ -94,10 +96,16 @@ __override void board_hibernate_late(void) static void board_tcpc_init(void) { gpio_enable_interrupt(GPIO_USB_C0_PPC_INT_ODL); + gpio_enable_interrupt(GPIO_USB_C1_INT_ODL); } /* Must be done after I2C */ DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1); +void rt1718s_tcpc_interrupt(enum gpio_signal signal) +{ + schedule_deferred_pd_interrupt(1); +} + /* ADC channels. Must be in the exactly same order as in enum adc_channel. */ const struct adc_t adc_channels[] = { /* Convert to mV (3000mV/1024). */ @@ -130,7 +138,9 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = { .frs_en = GPIO_USB_C0_FRS_EN, }, { - /* TODO: enable rt1718s */ + .i2c_port = I2C_PORT_PPC1, + .i2c_addr_flags = RT1718S_I2C_ADDR_FLAGS, + .drv = &rt1718s_ppc_drv, }, }; unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); @@ -143,31 +153,26 @@ const struct mt6360_config_t mt6360_config = { const struct pi3usb9201_config_t pi3usb9201_bc12_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = { - /* [0]: unused */ - [1] = { - .i2c_port = 4, + [0] = { + .i2c_port = I2C_PORT_USB0, .i2c_addr_flags = PI3USB9201_I2C_ADDR_3_FLAGS, } + /* [1]: unused */ }; struct bc12_config bc12_ports[CONFIG_USB_PD_PORT_MAX_COUNT] = { - { .drv = &mt6360_drv }, { .drv = &pi3usb9201_drv }, + { .drv = &rt1718s_bc12_drv }, }; static void bc12_interrupt(enum gpio_signal signal) { - if (signal == GPIO_USB_C0_BC12_INT_ODL) - task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_BC12); - else - task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_BC12); + task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_BC12); } static void ppc_interrupt(enum gpio_signal signal) { - if (signal == GPIO_USB_C0_PPC_INT_ODL) - /* C0: PPC interrupt */ - syv682x_interrupt(0); + syv682x_interrupt(0); } /* PWM */ @@ -206,7 +211,6 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); - /* Called on AP S3 -> S0 transition */ static void board_chipset_resume(void) { @@ -243,55 +247,71 @@ __maybe_unused void usb_a0_interrupt(enum gpio_signal signal) /* USB Mux */ -void board_usb_mux_init(void) -{ - ps8743_tune_usb_eq(&usb_muxes[1], - PS8743_USB_EQ_TX_12_8_DB, - PS8743_USB_EQ_RX_12_8_DB); -} -DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); +const struct usb_mux usbc0_virtual_mux = { + .usb_port = 0, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, +}; + +const struct usb_mux usbc1_virtual_mux = { + .usb_port = 1, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, +}; -static int board_ps8743_mux_set(const struct usb_mux *me, +static int board_ps8802_mux_set(const struct usb_mux *me, mux_state_t mux_state) { - int rv = EC_SUCCESS; - int reg = 0; + /* Make sure the PS8802 is awake */ + RETURN_ERROR(ps8802_i2c_wake(me)); + + /* USB specific config */ + if (mux_state & USB_PD_MUX_USB_ENABLED) { + /* Boost the USB gain */ + RETURN_ERROR(ps8802_i2c_field_update16(me, + PS8802_REG_PAGE2, + PS8802_REG2_USB_SSEQ_LEVEL, + PS8802_USBEQ_LEVEL_UP_MASK, + PS8802_USBEQ_LEVEL_UP_19DB)); + } - rv = ps8743_read(me, PS8743_REG_MODE, ®); - if (rv) - return rv; + /* DP specific config */ + if (mux_state & USB_PD_MUX_DP_ENABLED) { + /* Boost the DP gain */ + RETURN_ERROR(ps8802_i2c_field_update8(me, + PS8802_REG_PAGE2, + PS8802_REG2_DPEQ_LEVEL, + PS8802_DPEQ_LEVEL_UP_MASK, + PS8802_DPEQ_LEVEL_UP_19DB)); + } - /* Disable FLIP pin, enable I2C control. */ - reg |= PS8743_MODE_FLIP_REG_CONTROL; - /* Disable CE_USB pin, enable I2C control. */ - reg |= PS8743_MODE_USB_REG_CONTROL; - /* Disable CE_DP pin, enable I2C control. */ - reg |= PS8743_MODE_DP_REG_CONTROL; + return EC_SUCCESS; +} - /* - * DP specific config - * - * Enable/Disable IN_HPD on the DB. - */ +static int board_anx3443_mux_set(const struct usb_mux *me, + mux_state_t mux_state) +{ gpio_set_level(GPIO_USB_C1_DP_IN_HPD, mux_state & USB_PD_MUX_DP_ENABLED); - - return ps8743_write(me, PS8743_REG_MODE, reg); + return EC_SUCCESS; } const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { .usb_port = 0, .i2c_port = I2C_PORT_USB_MUX0, - .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS, - .driver = &it5205_usb_mux_driver, + .i2c_addr_flags = PS8802_I2C_ADDR_FLAGS, + .driver = &ps8802_usb_mux_driver, + .next_mux = &usbc0_virtual_mux, + .board_set = &board_ps8802_mux_set, }, { .usb_port = 1, .i2c_port = I2C_PORT_USB_MUX1, - .i2c_addr_flags = PS8743_I2C_ADDR0_FLAG, - .driver = &ps8743_usb_mux_driver, - .board_set = &board_ps8743_mux_set, + .i2c_addr_flags = ANX3443_I2C_ADDR0_FLAGS, + .driver = &anx3443_usb_mux_driver, + .next_mux = &usbc1_virtual_mux, + .board_set = &board_anx3443_mux_set, }, }; @@ -342,46 +362,100 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { .flags = 0, }, { - .bus_type = EC_BUS_TYPE_EMBEDDED, - /* TCPC is embedded within EC so no i2c config needed */ - .drv = &it8xxx2_tcpm_drv, - /* Alert is active-low, push-pull */ - .flags = 0, + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = I2C_PORT_USB1, + .addr_flags = RT1718S_I2C_ADDR_FLAGS, + }, + .drv = &rt1718s_tcpm_drv, }, }; +/* TODO: implement IOEX interface */ +int rt1718s_gpio_ctrl(enum rt1718s_gpio_state state) +{ + const int port = 1; + + switch (state) { + case RT1718S_GPIO_DISABLED: + /* gpio1 high, gpio2 low */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO1_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0xFF)); + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO2_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0x00)); + break; + case RT1718S_GPIO_ENABLE_SINK: + /* gpio1/2 low */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO1_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0x00)); + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO2_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0x00)); + break; + case RT1718S_GPIO_ENABLE_SOURCE: + /* gpio1/2 high */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO1_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0xFF)); + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO2_CTRL, + RT1718S_GPIOX_CTRL_GPIOX_O, 0xFF)); + break; + } + + return EC_SUCCESS; +} + +__override int board_rt1718s_init(int port) +{ + /* set GPIO1 is push pull, as output, output low. */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO1_CTRL, + RT1718S_GPIOX_OD_N | RT1718S_GPIOX_OE | + RT1718S_GPIOX_CTRL_GPIOX_O, + RT1718S_GPIOX_OD_N | RT1718S_GPIOX_OE)); + /* set GPIO2 is push pull, as output, output low. */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_GPIO2_CTRL, + RT1718S_GPIOX_OD_N | RT1718S_GPIOX_OE | + RT1718S_GPIOX_CTRL_GPIOX_O, + RT1718S_GPIOX_OD_N | RT1718S_GPIOX_OE)); + + /* Turn on SBU switch */ + RETURN_ERROR(rt1718s_update_bits8(port, RT1718S_RT2_SBU_CTRL_01, + RT1718S_RT2_SBU_CTRL_01_SBU_VIEN | + RT1718S_RT2_SBU_CTRL_01_SBU2_SWEN | + RT1718S_RT2_SBU_CTRL_01_SBU1_SWEN, + 0xFF)); + + return EC_SUCCESS; +} + const struct cc_para_t *board_get_cc_tuning_parameter(enum usbpd_port port) { - const static struct cc_para_t - cc_parameter[CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT] = { - { - .rising_time = IT83XX_TX_PRE_DRIVING_TIME_1_UNIT, - .falling_time = IT83XX_TX_PRE_DRIVING_TIME_2_UNIT, - }, - { - .rising_time = IT83XX_TX_PRE_DRIVING_TIME_1_UNIT, - .falling_time = IT83XX_TX_PRE_DRIVING_TIME_2_UNIT, - }, + const static struct cc_para_t cc_parameter = { + .rising_time = IT83XX_TX_PRE_DRIVING_TIME_1_UNIT, + .falling_time = IT83XX_TX_PRE_DRIVING_TIME_2_UNIT, }; - return &cc_parameter[port]; + if (port == USBPD_PORT_A) + return &cc_parameter; + return NULL; } uint16_t tcpc_get_alert_status(void) { /* - * C0 & C1: TCPC is embedded in the EC and processes interrupts in the + * C0 TCPC is embedded in the EC and processes interrupts in the * chip code (it83xx/intc.c) */ + if (!gpio_get_level(GPIO_USB_C1_INT_ODL)) + return PD_STATUS_TCPC_ALERT_1; return 0; } void board_reset_pd_mcu(void) { /* - * C0 & C1: TCPC is embedded in the EC and processes interrupts in the - * chip code (it83xx/intc.c) + * C0: The internal TCPC on ITE EC does not have a reset signal, + * but it will get reset when the EC gets reset. */ + /* C1: Add code if TCPC chips need a reset */ } void board_set_charge_limit(int port, int supplier, int charge_ma, @@ -450,6 +524,18 @@ int board_set_active_charge_port(int port) return EC_ERROR_UNKNOWN; } + /* + * RT1718S gpio control: + * If new charge port is port 1, enable sink path. + * If new charge port is not port 1, and port 1 is not sourcing, + * turn off both paths. + * Otherwise: port 1 is sourcing, don't change. + */ + if (port == 1) + RETURN_ERROR(rt1718s_gpio_ctrl(RT1718S_GPIO_ENABLE_SINK)); + else if (port != 1 && !ppc_is_sourcing_vbus(1)) + RETURN_ERROR(rt1718s_gpio_ctrl(RT1718S_GPIO_DISABLED)); + return EC_SUCCESS; } @@ -525,4 +611,4 @@ static void baseboard_init(void) { gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL); } -DECLARE_HOOK(HOOK_INIT, baseboard_init, HOOK_PRIO_DEFAULT-1); +DECLARE_HOOK(HOOK_INIT, baseboard_init, HOOK_PRIO_DEFAULT - 1); diff --git a/baseboard/cherry/baseboard.h b/baseboard/cherry/baseboard.h index 95cf2fe0bc..e3575c517c 100644 --- a/baseboard/cherry/baseboard.h +++ b/baseboard/cherry/baseboard.h @@ -96,6 +96,8 @@ #define I2C_PORT_ACCEL IT83XX_I2C_CH_B #define I2C_PORT_PPC0 IT83XX_I2C_CH_C #define I2C_PORT_PPC1 IT83XX_I2C_CH_E +#define I2C_PORT_USB0 IT83XX_I2C_CH_C +#define I2C_PORT_USB1 IT83XX_I2C_CH_E #define I2C_PORT_USB_MUX0 IT83XX_I2C_CH_C #define I2C_PORT_USB_MUX1 IT83XX_I2C_CH_E #define I2C_PORT_VIRTUAL_BATTERY I2C_PORT_BATTERY @@ -105,20 +107,23 @@ #define CONFIG_LED_COMMON /* PD / USB-C / PPC */ +#define CONFIG_USB_PD_DEBUG_LEVEL 3 #define CONFIG_CMD_PPC_DUMP #define CONFIG_HOSTCMD_PD_CONTROL #define CONFIG_IT83XX_TUNE_CC_PHY #define CONFIG_USBC_PPC #define CONFIG_USBC_PPC_DEDICATED_INT #define CONFIG_USBC_PPC_POLARITY +#define CONFIG_USBC_PPC_RT1718S #define CONFIG_USBC_PPC_SYV682X #define CONFIG_USBC_PPC_VCONN #define CONFIG_USBC_SS_MUX #define CONFIG_USBC_VCONN #define CONFIG_USBC_VCONN_SWAP #define CONFIG_USB_DRP_ACC_TRYSRC -#define CONFIG_USB_MUX_IT5205 /* C0 */ -#define CONFIG_USB_MUX_PS8743 /* C1 */ +#define CONFIG_USBC_RETIMER_PS8802 /* C0 */ +#define CONFIG_USB_MUX_ANX3443 /* C1 */ +#define CONFIG_USB_MUX_VIRTUAL #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USB_PD_DECODE_SOP @@ -127,12 +132,15 @@ #define CONFIG_USB_PD_DP_HPD_GPIO #define CONFIG_USB_PD_DP_HPD_GPIO_CUSTOM #define CONFIG_USB_PD_DUAL_ROLE -#define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 2 +#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE +#define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 1 #define CONFIG_USB_PD_LOGGING #define CONFIG_USB_PD_PORT_MAX_COUNT 2 +#define CONFIG_USB_PD_PPC #define CONFIG_USB_PD_REV30 #define CONFIG_USB_PD_TCPC_LOW_POWER #define CONFIG_USB_PD_TCPM_ITE_ON_CHIP +#define CONFIG_USB_PD_TCPM_RT1718S #define CONFIG_USB_PD_TCPM_TCPCI #define CONFIG_USB_PD_TCPMV2 #define CONFIG_USB_PD_TRY_SRC @@ -217,6 +225,15 @@ enum pwm_channel { }; void board_reset_pd_mcu(void); +void rt1718s_tcpc_interrupt(enum gpio_signal signal); + +enum rt1718s_gpio_state { + RT1718S_GPIO_DISABLED, + RT1718S_GPIO_ENABLE_SINK, + RT1718S_GPIO_ENABLE_SOURCE, +}; + +int rt1718s_gpio_ctrl(enum rt1718s_gpio_state state); #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BASEBOARD_H */ diff --git a/baseboard/cherry/usb_pd_policy.c b/baseboard/cherry/usb_pd_policy.c index db15e93567..5ef026b95a 100644 --- a/baseboard/cherry/usb_pd_policy.c +++ b/baseboard/cherry/usb_pd_policy.c @@ -2,8 +2,12 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ +#include "adc.h" +#include "atomic.h" #include "charge_manager.h" #include "chipset.h" +#include "driver/tcpm/rt1718s.h" +#include "driver/tcpm/tcpci.h" #include "timer.h" #include "usb_dp_alt_mode.h" #include "usb_mux.h" @@ -42,7 +46,7 @@ void svdm_set_hpd_gpio(int port, int en) static void aux_switch_port(int port) { if (port != AUX_PORT_NONE) - gpio_set_level_verbose(CC_USBPD, GPIO_DP_PATH_SEL, port); + gpio_set_level_verbose(CC_USBPD, GPIO_DP_PATH_SEL, !port); aux_port = port; } @@ -166,7 +170,33 @@ __override void svdm_exit_dp_mode(int port) int pd_snk_is_vbus_provided(int port) { - return ppc_is_vbus_present(port); + static atomic_t vbus_prev[CONFIG_USB_PD_PORT_MAX_COUNT]; + int vbus; + + /* + * Use ppc_is_vbus_present for all ports on Cherry, and + * port 1 on other devices. + */ + if (IS_ENABLED(BOARD_CHERRY) || port == 1) + return ppc_is_vbus_present(port); + + /* b/181203590: use ADC for port 0 (syv682x) */ + vbus = (adc_read_channel(ADC_VBUS) >= PD_V_SINK_DISCONNECT_MAX); + +#ifdef CONFIG_USB_CHARGER + /* + * There's no PPC to inform VBUS change for usb_charger, so inform + * the usb_charger now. + */ + if (!!(vbus_prev[port] != vbus)) + usb_charger_vbus_change(port, vbus); + + if (vbus) + atomic_or(&vbus_prev[port], 1); + else + atomic_clear(&vbus_prev[port]); +#endif + return vbus; } void pd_power_supply_reset(int port) @@ -182,6 +212,9 @@ void pd_power_supply_reset(int port) if (prev_en) pd_set_vbus_discharge(port, 1); + if (port == 1) + rt1718s_gpio_ctrl(RT1718S_GPIO_DISABLED); + /* Notify host of power info change. */ pd_send_host_event(PD_EVENT_POWER_CHANGE); } @@ -208,6 +241,12 @@ int pd_set_power_supply_ready(int port) if (rv) return rv; + if (port == 1) { + rv = rt1718s_gpio_ctrl(RT1718S_GPIO_ENABLE_SOURCE); + if (rv) + return rv; + } + /* Notify host of power info change. */ pd_send_host_event(PD_EVENT_POWER_CHANGE); @@ -218,4 +257,3 @@ int board_vbus_source_enabled(int port) { return ppc_is_sourcing_vbus(port); } - diff --git a/board/cherry/ec.tasklist b/board/cherry/ec.tasklist index 75dbb1a828..fa829ffe1a 100644 --- a/board/cherry/ec.tasklist +++ b/board/cherry/ec.tasklist @@ -13,10 +13,10 @@ TASK_ALWAYS(USB_CHG_P0, usb_charger_task, 0, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P1, usb_charger_task, 1, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \ - TASK_NOTEST(PDCMD, pd_command_task, NULL, 1024) \ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, 1024) \ TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, 1280) \ TASK_ALWAYS(PD_C1, pd_task, NULL, 1280) \ + TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, 1024) \ diff --git a/board/cherry/gpio.inc b/board/cherry/gpio.inc index caa8739d7d..895ec70f8c 100644 --- a/board/cherry/gpio.inc +++ b/board/cherry/gpio.inc @@ -38,8 +38,7 @@ GPIO_INT(USB_C0_BC12_INT_ODL,PIN(J, 4), GPIO_INT_FALLING, bc12_interrupt) #else /* TOMATO */ GPIO_INT(USB_C0_BC12_INT_ODL,PIN(I, 5), GPIO_INT_FALLING, bc12_interrupt) #endif -/* TODO: rt1718s interrupt, not implemented */ -GPIO(USB_C1_INT_ODL, PIN(B, 2), GPIO_INPUT | GPIO_INT_FALLING) +GPIO_INT(USB_C1_INT_ODL, PIN(B, 2), GPIO_INT_FALLING, rt1718s_tcpc_interrupt) /* TODO: not used in other devices? */ GPIO(LID_ACCEL_INT_L, PIN(M, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V) @@ -78,7 +77,8 @@ GPIO(EC_INT_L, PIN(E, 6), GPIO_ODR_HIGH | GPIO_SEL_1P8V) /* EC_AP_ /* USB and USBC Signals */ GPIO(DP_PATH_SEL, PIN(G, 0), GPIO_OUT_HIGH) -GPIO(DP_DEMUX_EN, PIN(G, 1), GPIO_OUT_LOW) +/* TODO: Turn off in S3 */ +GPIO(DP_DEMUX_EN, PIN(G, 1), GPIO_OUT_HIGH) GPIO(EC_AP_DP_HPD_ODL, PIN(J, 0), GPIO_ODR_HIGH) GPIO(EN_PP5000_USB_A0_VBUS_X,PIN(B, 7), GPIO_OUT_LOW) GPIO(USB_C0_DP_IN_HPD, PIN(H, 4), GPIO_OUT_LOW) diff --git a/driver/tcpm/rt1718s.h b/driver/tcpm/rt1718s.h index 7e42426ae3..23370f3f56 100644 --- a/driver/tcpm/rt1718s.h +++ b/driver/tcpm/rt1718s.h @@ -70,8 +70,12 @@ #define RT1718S_ENA_SRC_VBUS_CTRL 0xE1 #define RT1718S_FAULT_OC1_VBUS_CTRL 0xE3 #define RT1718S_GPIO2_VBUS_CTRL 0xEB + #define RT1718S_GPIO1_CTRL 0xED #define RT1718S_GPIO2_CTRL 0xEE +#define RT1718S_GPIOX_OD_N BIT(3) +#define RT1718S_GPIOX_OE BIT(2) +#define RT1718S_GPIOX_CTRL_GPIOX_O BIT(1) #define RT1718S_UNLOCK_PW_2 0xF0 #define RT1718S_UNLOCK_PW_1 0xF1 |