diff options
author | Ting Shen <phoenixshen@google.com> | 2019-12-02 15:27:57 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-23 10:00:26 +0000 |
commit | 924f9f66d91427c3519a8580ae097af53824be3b (patch) | |
tree | 79ed89d4d3e6a65b9de313362e8147faa90eaf7f /include/battery.h | |
parent | 29ef57b1bc1b5dd7713f6ab42edb4646f2be756d (diff) | |
download | chrome-ec-924f9f66d91427c3519a8580ae097af53824be3b.tar.gz |
kodama: overwrite bad battery params to known good value
Kodama's bitbang driver fails randomly, and there's no way to notify
kernel side that bitbang read failed (batt->flags does not propagate
into kernel).
Thus, if any value in batt_params is bad, replace it with a cached
good value, to make sure we never send random numbers to kernel side.
BUG=b:144195782
TEST=Modify smart battery driver to make sb_read has 50% fail rate,
and monitor /sys/class/power_supply/sbs*/*, make sure the bad values
does not observable in kernel.
BRANCH=kukui
Change-Id: Idf4691eb743f1ef785593b308b8f07a34e5ea642
Signed-off-by: Ting Shen <phoenixshen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1943637
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r-- | include/battery.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h index 7052e2d663..a41cd9da40 100644 --- a/include/battery.h +++ b/include/battery.h @@ -445,4 +445,9 @@ extern struct i2c_stress_test_dev battery_i2c_stress_test_dev; */ void battery_compensate_params(struct batt_params *batt); +/** + * board-specific battery_compensate_params + */ +__override_proto void board_battery_compensate_params(struct batt_params *batt); + #endif /* __CROS_EC_BATTERY_H */ |