diff options
-rw-r--r-- | baseboard/hatch/baseboard.c | 13 | ||||
-rw-r--r-- | baseboard/hatch/baseboard.h | 1 | ||||
-rw-r--r-- | board/hatch/board.c | 13 | ||||
-rw-r--r-- | board/hatch/board.h | 3 | ||||
-rw-r--r-- | board/kohaku/board.c | 15 | ||||
-rw-r--r-- | board/kohaku/board.h | 3 | ||||
-rw-r--r-- | board/kohaku/gpio.inc | 4 |
7 files changed, 38 insertions, 14 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 737e280eeb..debdd015c3 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -10,7 +10,6 @@ #include "charge_state_v2.h" #include "chipset.h" #include "console.h" -#include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" #include "driver/tcpm/ps8xxx.h" @@ -158,18 +157,6 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { }; unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); -const struct pi3usb2901_config_t pi3usb2901_bc12_chips[] = { - [USB_PD_PORT_TCPC_0] = { - .i2c_port = I2C_PORT_PPC0, - .i2c_addr = PI3USB9201_I2C_ADDR_3, - }, - - [USB_PD_PORT_TCPC_1] = { - .i2c_port = I2C_PORT_TCPC1, - .i2c_addr = PI3USB9201_I2C_ADDR_3, - }, -}; - /* Power Delivery and charging functions */ void baseboard_tcpc_init(void) { diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h index dc05188075..7ffe1cc9c8 100644 --- a/baseboard/hatch/baseboard.h +++ b/baseboard/hatch/baseboard.h @@ -119,7 +119,6 @@ /* BC 1.2 */ #define CONFIG_USB_CHARGER -#define CONFIG_BC12_DETECT_PI3USB9201 /* Common Sensor Defines */ #define CONFIG_TABLET_MODE diff --git a/board/hatch/board.c b/board/hatch/board.c index 4149445231..bd126051ef 100644 --- a/board/hatch/board.c +++ b/board/hatch/board.c @@ -13,6 +13,7 @@ #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" +#include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" #include "driver/tcpm/ps8xxx.h" @@ -150,6 +151,18 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { } }; +const struct pi3usb2901_config_t pi3usb2901_bc12_chips[] = { + [USB_PD_PORT_TCPC_0] = { + .i2c_port = I2C_PORT_PPC0, + .i2c_addr = PI3USB9201_I2C_ADDR_3, + }, + + [USB_PD_PORT_TCPC_1] = { + .i2c_port = I2C_PORT_TCPC1, + .i2c_addr = PI3USB9201_I2C_ADDR_3, + }, +}; + /******************************************************************************/ /* Sensors */ /* Base Sensor mutex */ diff --git a/board/hatch/board.h b/board/hatch/board.h index ae8ceec43a..869372096d 100644 --- a/board/hatch/board.h +++ b/board/hatch/board.h @@ -64,6 +64,9 @@ #define CONFIG_USB_PORT_POWER_SMART_CDP_SDP_ONLY #define GPIO_USB1_ILIM_SEL GPIO_EN_USB_A_LOW_PWR_OD +/* BC 1.2 */ +#define CONFIG_BC12_DETECT_PI3USB9201 + /* Volume Button feature */ #define CONFIG_VOLUME_BUTTONS #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL diff --git a/board/kohaku/board.c b/board/kohaku/board.c index 6511ee31f6..69fce0a932 100644 --- a/board/kohaku/board.c +++ b/board/kohaku/board.c @@ -14,6 +14,7 @@ #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" #include "driver/ppc/sn5s330.h" +#include "driver/bc12/max14637.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" #include "ec_commands.h" @@ -135,6 +136,20 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { } }; +/* BC 1.2 chip Configuration */ +const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = { + { + .chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON, + .chg_det_pin = GPIO_USB_C0_BC12_CHG_DET_L, + .flags = MAX14637_FLAGS_CHG_DET_ACTIVE_LOW, + }, + { + .chip_enable_pin = GPIO_USB_C1_BC12_VBUS_ON, + .chg_det_pin = GPIO_USB_C1_BC12_CHG_DET_L, + .flags = MAX14637_FLAGS_CHG_DET_ACTIVE_LOW, + }, +}; + /******************************************************************************/ /* Sensors */ /* Base Sensor mutex */ diff --git a/board/kohaku/board.h b/board/kohaku/board.h index 9a1d7a17cc..ba04cdbb0f 100644 --- a/board/kohaku/board.h +++ b/board/kohaku/board.h @@ -56,6 +56,9 @@ #define BOARD_TCPC_C1_RESET_HOLD_DELAY PS8XXX_RESET_DELAY_MS #define BOARD_TCPC_C1_RESET_POST_DELAY 0 +/* BC 1.2 */ +#define CONFIG_BC12_DETECT_MAX14637 + /* Volume Button feature */ #define CONFIG_VOLUME_BUTTONS #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL diff --git a/board/kohaku/gpio.inc b/board/kohaku/gpio.inc index c8e1c1bd51..534d10bdd4 100644 --- a/board/kohaku/gpio.inc +++ b/board/kohaku/gpio.inc @@ -59,6 +59,10 @@ GPIO(EC_INT_L, PIN(7, 0), GPIO_OUT_HIGH) GPIO(USB_C_OC_ODL, PIN(B, 1), GPIO_ODR_HIGH) GPIO(USB_C0_TCPC_RST, PIN(9, 7), GPIO_OUT_LOW) GPIO(USB_C1_TCPC_RST_ODL, PIN(3, 2), GPIO_ODR_HIGH) +GPIO(USB_C0_BC12_CHG_DET_L, PIN(0, 6), GPIO_INPUT) +GPIO(USB_C1_BC12_CHG_DET_L, PIN(3, 5), GPIO_INPUT) +GPIO(USB_C0_BC12_VBUS_ON, PIN(9, 4), GPIO_OUT_LOW) +GPIO(USB_C1_BC12_VBUS_ON, PIN(C, 6), GPIO_OUT_LOW) /* Misc Signals */ GPIO(EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT) |