diff options
author | Patryk Duda <pdk@semihalf.com> | 2021-03-18 13:45:17 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-29 16:29:26 +0000 |
commit | f4b27032e1c508b693bba1f2d6572ad14d42f319 (patch) | |
tree | d69d14be564e34efbb81417f9ada83122b7a3c44 /board/nocturne | |
parent | 6f00183c755fe7c9e77adffb308626443e0b274a (diff) | |
download | chrome-ec-f4b27032e1c508b693bba1f2d6572ad14d42f319.tar.gz |
Use generic voltage reduce function instead of provided by board
This patch switches implementation of input voltage reduction to generic
one. It removes reduce_input_voltage_when_full() function from board
code and defines CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV
with appropriate voltage.
Affected boards:
- Ampton
- Asurada
- Cherry
- Dratini
- Jinlon
- Liara
- Nocturne
BUG=b:182546058
BRANCH=none
TEST=Compile firmware for affected boards.
TEST=Flash EC ToT on one of affected boards. Charge battery to full.
Shutdown board and check if voltage is reduced. Power on board,
check if previous voltage is restored.
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I8f285e75c11f84f4711d5e6a4008174b6fb639cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2773219
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/nocturne')
-rw-r--r-- | board/nocturne/battery.c | 26 | ||||
-rw-r--r-- | board/nocturne/board.h | 1 |
2 files changed, 1 insertions, 26 deletions
diff --git a/board/nocturne/battery.c b/board/nocturne/battery.c index 67c5346063..ff3f16fa33 100644 --- a/board/nocturne/battery.c +++ b/board/nocturne/battery.c @@ -99,32 +99,6 @@ enum battery_disconnect_state battery_get_disconnect_state(void) return BATTERY_DISCONNECTED; } -static void reduce_input_voltage_when_full(void) -{ - struct batt_params batt; - int max_pd_voltage_mv; - int active_chg_port; - - active_chg_port = charge_manager_get_active_charge_port(); - if (active_chg_port == CHARGE_PORT_NONE) - return; - - battery_get_params(&batt); - if (!(batt.flags & BATT_FLAG_BAD_STATUS)) { - /* Lower our input voltage to 9V when battery is full. */ - if ((batt.status & STATUS_FULLY_CHARGED) && - chipset_in_state(CHIPSET_STATE_ANY_OFF)) - max_pd_voltage_mv = 9000; - else - max_pd_voltage_mv = PD_MAX_VOLTAGE_MV; - - if (pd_get_max_voltage() != max_pd_voltage_mv) - pd_set_external_voltage_limit(active_chg_port, - max_pd_voltage_mv); - } -} -DECLARE_HOOK(HOOK_SECOND, reduce_input_voltage_when_full, HOOK_PRIO_DEFAULT); - enum ec_status charger_profile_override_get_param(uint32_t param, uint32_t *value) { diff --git a/board/nocturne/board.h b/board/nocturne/board.h index cd840629d0..046b41d7db 100644 --- a/board/nocturne/board.h +++ b/board/nocturne/board.h @@ -60,6 +60,7 @@ #define CONFIG_BATTERY_SMART #define CONFIG_BATTERY_REVIVE_DISCONNECT #define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L +#define CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV 9000 /* Buttons / Switches */ #define CONFIG_BASE_ATTACHED_SWITCH |