diff options
Diffstat (limited to 'baseboard/octopus')
-rw-r--r-- | baseboard/octopus/baseboard.c | 14 | ||||
-rw-r--r-- | baseboard/octopus/baseboard.h | 8 | ||||
-rw-r--r-- | baseboard/octopus/variant_usbc_ec_tcpcs.c | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c index 164e28b480..0f012d1352 100644 --- a/baseboard/octopus/baseboard.c +++ b/baseboard/octopus/baseboard.c @@ -298,6 +298,20 @@ int board_set_active_charge_port(int port) return EC_SUCCESS; } +void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, + int charge_mv) +{ + /* + * Empirically, the charger seems to draw a little more current that + * it is set to, so we reduce our limit by 5%. + */ +#if defined(CONFIG_CHARGER_BQ25710) || defined(CONFIG_CHARGER_ISL9238) + charge_ma = (charge_ma * 95) / 100; +#endif + charge_set_input_current_limit( + MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv); +} + void board_hibernate(void) { int port; diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h index 42093ab771..724540d0f0 100644 --- a/baseboard/octopus/baseboard.h +++ b/baseboard/octopus/baseboard.h @@ -125,8 +125,6 @@ */ #undef CONFIG_EXTPOWER_DEBOUNCE_MS #define CONFIG_EXTPOWER_DEBOUNCE_MS 200 -/* Charger seems to overdraw by about 5% */ -#define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 5 #elif defined(VARIANT_OCTOPUS_CHARGER_BQ25703) #define CONFIG_CHARGER_BQ25703 #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 @@ -135,8 +133,6 @@ */ #undef CONFIG_EXTPOWER_DEBOUNCE_MS #define CONFIG_EXTPOWER_DEBOUNCE_MS 50 -/* Charger seems to overdraw by about 5% */ -#define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 5 #elif defined(CONFIG_CHARGER_RUNTIME_CONFIG) #define CONFIG_CHARGER_ISL9238 #define CONFIG_CHARGER_BQ25710 @@ -154,9 +150,7 @@ #define CONFIG_CHARGE_MANAGER #define CONFIG_CHARGE_RAMP_HW #define CONFIG_CHARGER -/* Allow low-current USB charging */ -#define CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT 512 -#define CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT 512 +#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */ #define CONFIG_CHARGER_SENSE_RESISTOR 10 #define CONFIG_CHARGER_DISCHARGE_ON_AC #define CONFIG_USB_CHARGER diff --git a/baseboard/octopus/variant_usbc_ec_tcpcs.c b/baseboard/octopus/variant_usbc_ec_tcpcs.c index a93dfe3535..983887bc08 100644 --- a/baseboard/octopus/variant_usbc_ec_tcpcs.c +++ b/baseboard/octopus/variant_usbc_ec_tcpcs.c @@ -10,10 +10,10 @@ #include "console.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/it83xx_pd.h" +#include "driver/usb_mux/it5205.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" #include "driver/tcpm/tcpm.h" -#include "driver/usb_mux/it5205.h" #include "gpio.h" #include "hooks.h" #include "system.h" |