diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/atlas/board.c | 12 | ||||
-rw-r--r-- | board/cheza/board.c | 11 | ||||
-rw-r--r-- | board/coral/board.c | 9 | ||||
-rw-r--r-- | board/elm/board.c | 10 | ||||
-rw-r--r-- | board/eve/board.c | 9 | ||||
-rw-r--r-- | board/flapjack/board.c | 11 | ||||
-rw-r--r-- | board/glkrvp/board.c | 13 | ||||
-rw-r--r-- | board/glkrvp_ite/board.c | 13 | ||||
-rw-r--r-- | board/hammer/board.c | 14 | ||||
-rw-r--r-- | board/jerry/board.c | 12 | ||||
-rw-r--r-- | board/jslrvp_ite/board.c | 13 | ||||
-rw-r--r-- | board/nami/board.c | 11 | ||||
-rw-r--r-- | board/nautilus/board.c | 11 | ||||
-rw-r--r-- | board/nocturne/board.c | 11 | ||||
-rw-r--r-- | board/oak/board.c | 20 | ||||
-rw-r--r-- | board/poppy/board.c | 12 | ||||
-rw-r--r-- | board/rammus/board.c | 12 | ||||
-rw-r--r-- | board/reef/board.c | 9 | ||||
-rw-r--r-- | board/reef_it8320/board.c | 9 | ||||
-rw-r--r-- | board/reef_mchp/board.c | 9 | ||||
-rw-r--r-- | board/samus/board.c | 11 | ||||
-rw-r--r-- | board/scarlet/board.c | 11 | ||||
-rw-r--r-- | board/strago/board.c | 10 | ||||
-rw-r--r-- | board/tglrvpu_ite/board.c | 13 | ||||
-rw-r--r-- | board/trogdor/board.c | 12 | ||||
-rw-r--r-- | board/waddledoo/board.c | 2 | ||||
-rw-r--r-- | board/waddledoo/board.h | 1 |
27 files changed, 289 insertions, 2 deletions
diff --git a/board/atlas/board.c b/board/atlas/board.c index 76fd2c1b22..f39ca52243 100644 --- a/board/atlas/board.c +++ b/board/atlas/board.c @@ -15,6 +15,7 @@ #include "console.h" #include "driver/als_opt3001.h" #include "driver/pmic_bd99992gw.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" #include "driver/tcpm/tcpm.h" @@ -151,6 +152,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* TCPC mux configuration */ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { { diff --git a/board/cheza/board.c b/board/cheza/board.c index 1742b9d4a2..232f6cfc3d 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -14,6 +14,7 @@ #include "extpower.h" #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" +#include "driver/charger/isl923x.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx74xx.h" #include "driver/tcpm/ps8xxx.h" @@ -276,6 +277,16 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* * Port-0 USB mux driver. * diff --git a/board/coral/board.c b/board/coral/board.c index 426926fd7f..2c970cc1a7 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -240,6 +240,15 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = BD9995X_ADDR_FLAGS, + .drv = &bd9995x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + uint16_t tcpc_get_alert_status(void) { uint16_t status = 0; diff --git a/board/elm/board.c b/board/elm/board.c index 1c54b71862..266dc92aa4 100644 --- a/board/elm/board.c +++ b/board/elm/board.c @@ -17,6 +17,7 @@ #include "console.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/anx7688.h" #include "driver/tcpm/tcpci.h" #include "driver/temp_sensor/tmp432.h" @@ -168,6 +169,15 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /** * Reset PD MCU * ANX7688 needs a reset pulse of 50ms after power enable. diff --git a/board/eve/board.c b/board/eve/board.c index a3d6e47460..baca40c095 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -232,6 +232,15 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = BD9995X_ADDR_FLAGS, + .drv = &bd9995x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /** * Power on (or off) a single TCPC. * minimum on/off delays are included. diff --git a/board/flapjack/board.c b/board/flapjack/board.c index cb191c3578..0035bc01dd 100644 --- a/board/flapjack/board.c +++ b/board/flapjack/board.c @@ -245,6 +245,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/******************************************************************************/ +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = RT946X_ADDR_FLAGS, + .drv = &rt946x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { {GPIO_AP_IN_SLEEP_L, POWER_SIGNAL_ACTIVE_LOW, "AP_IN_S3_L"}, diff --git a/board/glkrvp/board.c b/board/glkrvp/board.c index 8ab22336ce..fc54697fb4 100644 --- a/board/glkrvp/board.c +++ b/board/glkrvp/board.c @@ -6,8 +6,10 @@ /* Intel GLK-RVP board-specific configuration */ #include "button.h" +#include "charger.h" #include "chipset.h" #include "console.h" +#include "driver/charger/isl923x.h" #include "extpower.h" #include "gpio.h" #include "hooks.h" @@ -53,6 +55,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* Wake-up pins for hibernate */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/board/glkrvp_ite/board.c b/board/glkrvp_ite/board.c index 64f067527d..cb2da54a0d 100644 --- a/board/glkrvp_ite/board.c +++ b/board/glkrvp_ite/board.c @@ -7,7 +7,9 @@ #include "button.h" #include "chipset.h" +#include "charger.h" #include "console.h" +#include "driver/charger/isl923x.h" #include "ec2i_chip.h" #include "extpower.h" #include "gpio.h" @@ -42,6 +44,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* Wake-up pins for hibernate */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/board/hammer/board.c b/board/hammer/board.c index 65588dda05..9b26322e49 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -4,8 +4,10 @@ */ /* Hammer board configuration */ +#include "charger.h" #include "clock.h" #include "common.h" +#include "driver/charger/isl923x.h" #include "driver/led/lm3630a.h" #include "ec_version.h" #include "ec_ec_comm_slave.h" @@ -98,6 +100,18 @@ const struct i2c_port_t i2c_ports[] = { const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); #endif +#ifdef CONFIG_CHARGER_ISL9238 +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); +#endif + #ifdef HAS_BACKLIGHT /* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ const struct pwm_t pwm_channels[] = { diff --git a/board/jerry/board.c b/board/jerry/board.c index 130d46b4a8..c99c6ac8a3 100644 --- a/board/jerry/board.c +++ b/board/jerry/board.c @@ -5,8 +5,10 @@ /* Veyron board-specific configuration */ #include "battery.h" +#include "battery_smart.h" #include "chipset.h" #include "common.h" +#include "driver/charger/bq24715.h" #include "extpower.h" #include "gpio.h" #include "i2c.h" @@ -45,6 +47,16 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); +/* Charger chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = CHARGER_ADDR_FLAGS, + .drv = &bq24715_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + void board_config_pre_init(void) { /* enable SYSCFG clock */ diff --git a/board/jslrvp_ite/board.c b/board/jslrvp_ite/board.c index 4e7ece9799..ccf4a5cd41 100644 --- a/board/jslrvp_ite/board.c +++ b/board/jslrvp_ite/board.c @@ -6,6 +6,8 @@ /* Intel Jasperlake RVP with ITE EC board specific configuration */ #include "button.h" +#include "charger.h" +#include "driver/charger/isl923x.h" #include "extpower.h" #include "i2c.h" #include "intc.h" @@ -88,6 +90,17 @@ const struct i2c_port_t i2c_ports[] = { BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_CHAN_COUNT); const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* * Returns board information (board id[7:0] and Fab id[15:8]) on success * -1 on error. diff --git a/board/nami/board.c b/board/nami/board.c index c244a8f91b..150def9d21 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -23,6 +23,7 @@ #include "driver/accel_bma2x2.h" #include "driver/accel_kionix.h" #include "driver/baro_bmp280.h" +#include "driver/charger/isl923x.h" #include "driver/led/lm3509.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" @@ -282,6 +283,16 @@ struct pi3usb9281_config pi3usb9281_chips[] = { BUILD_ASSERT(ARRAY_SIZE(pi3usb9281_chips) == CONFIG_BC12_DETECT_PI3USB9281_CHIP_COUNT); +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + void board_reset_pd_mcu(void) { if (oem == PROJECT_AKALI && board_version < 0x0200) { diff --git a/board/nautilus/board.c b/board/nautilus/board.c index 854d590202..774d92b6be 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -20,6 +20,7 @@ #include "driver/accelgyro_bmi160.h" #include "driver/accel_bma2x2.h" #include "driver/baro_bmp280.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" #include "driver/tcpm/tcpm.h" @@ -193,6 +194,16 @@ const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = { GPIO_USB1_ENABLE, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + void board_reset_pd_mcu(void) { /* Assert reset */ diff --git a/board/nocturne/board.c b/board/nocturne/board.c index dd19e7a293..afe0b3186d 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -16,6 +16,7 @@ #include "compile_time_macros.h" #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" +#include "driver/charger/isl923x.h" #include "driver/ppc/sn5s330.h" #include "driver/sync.h" #include "driver/tcpm/ps8xxx.h" @@ -329,6 +330,16 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + void board_chipset_startup(void) { gpio_set_level(GPIO_EN_5V, 1); diff --git a/board/oak/board.c b/board/oak/board.c index da4c6cbb7a..f830aa646b 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -20,6 +20,7 @@ #include "driver/accel_kx022.h" #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/tcpci.h" #include "driver/temp_sensor/tmp432.h" #include "driver/usb_mux/pi3usb3x532.h" @@ -150,6 +151,25 @@ struct pi3usb9281_config pi3usb9281_chips[] = { BUILD_ASSERT(ARRAY_SIZE(pi3usb9281_chips) == CONFIG_BC12_DETECT_PI3USB9281_CHIP_COUNT); +#if BOARD_REV == OAK_REV1 +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = I2C_ADDR_CHARGER_FLAGS, + .drv = &bq2477x_drv, + }, +}; +#else +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; +#endif /* OAK_REV1 */ +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* * Temperature sensors data; must be in same order as enum temp_sensor_id. * Sensor index and name must match those present in coreboot: diff --git a/board/poppy/board.c b/board/poppy/board.c index 9faf9575b6..274af0ed0c 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -20,6 +20,7 @@ #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" #include "driver/baro_bmp280.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/anx74xx.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" @@ -231,6 +232,17 @@ struct pi3usb9281_config pi3usb9281_chips[] = { BUILD_ASSERT(ARRAY_SIZE(pi3usb9281_chips) == CONFIG_BC12_DETECT_PI3USB9281_CHIP_COUNT); +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + + /** * Power on (or off) a single TCPC. * minimum on/off delays are included. diff --git a/board/rammus/board.c b/board/rammus/board.c index 5782ab4943..9e7384e0fd 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -20,6 +20,7 @@ #include "cros_board_info.h" #include "driver/accelgyro_bmi160.h" #include "driver/accel_bma2x2.h" +#include "driver/charger/isl923x.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" #include "driver/tcpm/tcpm.h" @@ -145,6 +146,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* TCPC mux configuration */ struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USB_PD_PORT_PS8751] = { diff --git a/board/reef/board.c b/board/reef/board.c index dd16d6e26c..0534680743 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -245,6 +245,15 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = BD9995X_ADDR_FLAGS, + .drv = &bd9995x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + uint16_t tcpc_get_alert_status(void) { uint16_t status = 0; diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c index a6ac274f93..513861b9d8 100644 --- a/board/reef_it8320/board.c +++ b/board/reef_it8320/board.c @@ -198,6 +198,15 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = BD9995X_ADDR_FLAGS, + .drv = &bd9995x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* Called by APL power state machine when transitioning from G3 to S5 */ void chipset_pre_init_callback(void) { diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index d06e8f719c..270b310a8a 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -242,6 +242,15 @@ const uint32_t i2c_ctrl_slave_addrs[I2C_CONTROLLER_COUNT] = { 0, 0, 0, 0, }; +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = BD9995X_ADDR_FLAGS, + .drv = &bd9995x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* Return the two slave addresses the specified * controller will respond to when controller * is acting as a slave. diff --git a/board/samus/board.c b/board/samus/board.c index cb77dee2f9..2ed4616c9f 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -18,6 +18,7 @@ #include "driver/accel_kxcj9.h" #include "driver/accelgyro_lsm6ds0.h" #include "driver/als_isl29035.h" +#include "driver/charger/bq24773.h" #include "driver/temp_sensor/tmp006.h" #include "extpower.h" #include "fan.h" @@ -132,6 +133,16 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = I2C_ADDR_CHARGER_FLAGS, + .drv = &bq2477x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + #define TEMP_U40_REG_ADDR_FLAGS (0x40 | I2C_FLAG_BIG_ENDIAN) #define TEMP_U41_REG_ADDR_FLAGS (0x44 | I2C_FLAG_BIG_ENDIAN) #define TEMP_U42_REG_ADDR_FLAGS (0x41 | I2C_FLAG_BIG_ENDIAN) diff --git a/board/scarlet/board.c b/board/scarlet/board.c index aece3503ae..5f20812a23 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -81,6 +81,17 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/******************************************************************************/ +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = RT946X_ADDR_FLAGS, + .drv = &rt946x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { {GPIO_PP1250_S3_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP1250_S3_PWR_GOOD"}, diff --git a/board/strago/board.c b/board/strago/board.c index a45f0b4774..26e8eafab1 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -15,6 +15,7 @@ #include "driver/accel_kionix.h" #include "driver/accel_kxcj9.h" #include "driver/als_isl29035.h" +#include "driver/charger/bq24773.h" #include "driver/tcpm/tcpci.h" #include "driver/temp_sensor/tmp432.h" #include "driver/usb_mux/pi3usb3x532.h" @@ -176,6 +177,15 @@ struct als_t als[] = { }; BUILD_ASSERT(ARRAY_SIZE(als) == ALS_COUNT); +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = I2C_ADDR_CHARGER_FLAGS, + .drv = &bq2477x_drv, + }, +}; +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /** * Reset PD MCU */ diff --git a/board/tglrvpu_ite/board.c b/board/tglrvpu_ite/board.c index 93a7d18984..c46772aaaa 100644 --- a/board/tglrvpu_ite/board.c +++ b/board/tglrvpu_ite/board.c @@ -6,6 +6,8 @@ /* Intel TGL-U-RVP-ITE board-specific configuration */ #include "button.h" +#include "charger.h" +#include "driver/charger/isl9241.h" #include "extpower.h" #include "i2c.h" #include "intc.h" @@ -106,6 +108,17 @@ const struct i2c_port_t i2c_ports[] = { BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_CHAN_COUNT); const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +/* Charger Chips */ +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL9241_ADDR_FLAGS, + .drv = &isl9241_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* * Returns board information (board id[7:0] and Fab id[15:8]) on success * -1 on error. diff --git a/board/trogdor/board.c b/board/trogdor/board.c index e5b7831950..120a840459 100644 --- a/board/trogdor/board.c +++ b/board/trogdor/board.c @@ -9,9 +9,11 @@ #include "button.h" #include "charge_manager.h" #include "charge_state.h" +#include "charger.h" #include "chipset.h" #include "extpower.h" #include "driver/accelgyro_bmi160.h" +#include "driver/charger/isl923x.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" @@ -299,6 +301,16 @@ struct pi3usb9281_config pi3usb9281_chips[] = { BUILD_ASSERT(ARRAY_SIZE(pi3usb9281_chips) == CONFIG_BC12_DETECT_PI3USB9281_CHIP_COUNT); +const struct charger_config_t chg_chips[] = { + { + .i2c_port = I2C_PORT_CHARGER, + .i2c_addr_flags = ISL923X_ADDR_FLAGS, + .drv = &isl923x_drv, + }, +}; + +const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); + /* Initialize board. */ static void board_init(void) { diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c index eb9354cedf..59b3cc0552 100644 --- a/board/waddledoo/board.c +++ b/board/waddledoo/board.c @@ -275,7 +275,7 @@ int pd_snk_is_vbus_provided(int port) return regval & TCPC_REG_POWER_STATUS_VBUS_PRES; } -struct charger_config_t chg_chips[] = { +const struct charger_config_t chg_chips[] = { { .i2c_port = I2C_PORT_USB_C0, .i2c_addr_flags = ISL923X_ADDR_FLAGS, diff --git a/board/waddledoo/board.h b/board/waddledoo/board.h index 05db45882e..5307d5687c 100644 --- a/board/waddledoo/board.h +++ b/board/waddledoo/board.h @@ -14,7 +14,6 @@ /* Charger */ #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_CHARGER_RAA489000 -#define CONFIG_CHARGER_RUNTIME_CONFIG #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 #define CONFIG_CHARGER_SENSE_RESISTOR 10 |