diff options
-rw-r--r-- | board/morphius/board.c | 18 | ||||
-rw-r--r-- | board/morphius/board.h | 11 | ||||
-rw-r--r-- | board/morphius/gpio.inc | 2 |
3 files changed, 12 insertions, 19 deletions
diff --git a/board/morphius/board.c b/board/morphius/board.c index ac370086d9..fac4f5b795 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -41,7 +41,7 @@ #include "gpio_list.h" - +static bool support_aoz_ppc; #ifdef HAS_TASK_MOTIONSENSE @@ -277,6 +277,7 @@ enum gpio_signal gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V1; static void board_remap_gpio(void) { uint32_t board_ver = 0; + int ppc_id = 0; cbi_get_board_version(&board_ver); @@ -287,6 +288,14 @@ static void board_remap_gpio(void) gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V0; ccprintf("GPIO_EC_PS2_RESET_V0\n"); } + + ioex_get_level(IOEX_PPC_ID, &ppc_id); + + support_aoz_ppc = ((board_ver >= 3) && !ppc_id); + if (support_aoz_ppc) { + ccprintf("DB USBC PPC aoz1380\n"); + ppc_chips[USBC_PORT_C1].drv = &aoz1380_drv; + } } void setup_fw_config(void) @@ -301,11 +310,6 @@ void setup_fw_config(void) setup_mux(); - if (ec_config_has_db_ppc_aoz1380()) { - ccprintf("DB USBC PPC aoz1380"); - ppc_chips[USBC_PORT_C1].drv = &aoz1380_drv; - } - board_remap_gpio(); } DECLARE_HOOK(HOOK_INIT, setup_fw_config, HOOK_PRIO_INIT_I2C + 2); @@ -526,7 +530,7 @@ __override void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: - if (ec_config_has_db_ppc_aoz1380()) + if (support_aoz_ppc) aoz1380_interrupt(USBC_PORT_C1); else nx20p348x_interrupt(USBC_PORT_C1); diff --git a/board/morphius/board.h b/board/morphius/board.h index bb429b0135..2b9bfcf70b 100644 --- a/board/morphius/board.h +++ b/board/morphius/board.h @@ -162,8 +162,6 @@ enum ec_cfg_usb_mb_type { enum ec_cfg_usb_db_type { MORPHIUS_DB_T_OPT1_USBC_HDMI = 0, MORPHIUS_DB_T_OPT3_USBC_HDMI_MSTHUB = 1, - MORPHIUS_DB_PICASSO_AOZ1380 = 2, - MORPHIUS_DB_DALI_AOZ1380 = 3, }; @@ -212,15 +210,6 @@ static inline bool ec_config_has_hdmi_conn_hpd(void) HAS_HDMI_CONN_HPD); } -#define HAS_DB_AOZ1380 \ - (BIT(MORPHIUS_DB_PICASSO_AOZ1380) | BIT(MORPHIUS_DB_DALI_AOZ1380)) - -static inline bool ec_config_has_db_ppc_aoz1380(void) -{ - return !!(BIT(ec_config_get_usb_db()) & - HAS_DB_AOZ1380); -} - #define PORT_TO_HPD(port) ((port == 0) \ ? GPIO_USB_C0_HPD \ : (ec_config_has_usbc1_retimer_ps8802()) \ diff --git a/board/morphius/gpio.inc b/board/morphius/gpio.inc index f3578d5b4a..f8fb0d2c3d 100644 --- a/board/morphius/gpio.inc +++ b/board/morphius/gpio.inc @@ -74,7 +74,7 @@ IOEX(EN_USB_A0_5V, EXPIN(USBC_PORT_C0, 1, 5), GPIO_OUT_LOW) /* A0 5V Source Ena IOEX(USB_A0_CHARGE_EN_L, EXPIN(USBC_PORT_C0, 1, 6), GPIO_OUT_HIGH) /* A0 5V High Current Enable */ IOEX(USB_A1_RETIMER_EN, EXPIN(USBC_PORT_C1, 0, 0), GPIO_OUT_LOW) /* A1 Retimer Enable */ -IOEX(USB_A1_RETIMER_RST_DB, EXPIN(USBC_PORT_C1, 0, 1), GPIO_OUT_LOW) /* A1 Retimer Reset */ +IOEX(PPC_ID, EXPIN(USBC_PORT_C1, 0, 1), GPIO_INPUT | GPIO_PULL_DOWN) /* PPC ID */ IOEX(USB_C1_HPD_IN_DB, EXPIN(USBC_PORT_C1, 0, 2), GPIO_OUT_LOW) /* C1 HPD */ IOEX(HDMI_POWER_EN_DB, EXPIN(USBC_PORT_C1, 0, 3), GPIO_OUT_LOW) /* HDMI retimer power enable */ IOEX(USB_C1_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C1, 0, 4), GPIO_OUT_LOW) /* C1 FastSwitch Control */ |