diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-04-30 10:08:45 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-01 11:03:00 -0700 |
commit | 70a785ad2ab3b1f855d0eddf6366a10d71c5f77c (patch) | |
tree | 41676c263fa00e40724829914502e54699febe42 /common | |
parent | 15bd8639ef6df248b4474808bd21d80b0c19bac4 (diff) | |
download | chrome-ec-70a785ad2ab3b1f855d0eddf6366a10d71c5f77c.tar.gz |
battery: Consolidate battery_manufacturer_name
Currently, the battery_manufacturer_name API is implemented individually
by each chip.
This patch consolidate the definitions. It also allows a board to
return custom manufacturer names.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/129599895
BRANCH=none
TEST=buildall
Change-Id: Ib0f60c9be71fea31658ab284a915d73341b9145e
Reviewed-on: https://chromium-review.googlesource.com/1590039
Commit-Ready: YH Lin <yueherngl@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: YH Lin <yueherngl@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/battery.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/battery.c b/common/battery.c index a23b8c2505..0f528e97c6 100644 --- a/common/battery.c +++ b/common/battery.c @@ -608,3 +608,14 @@ void battery_compensate_params(struct batt_params *batt) /* Rounding (instead of truncating) */ batt->display_charge = (numer + denom / 2) / denom; } + +__attribute__((weak)) int get_battery_manufacturer_name(char *dest, int size) +{ + strzcpy(dest, "<unkn>", size); + return EC_SUCCESS; +} + +int battery_manufacturer_name(char *dest, int size) +{ + return get_battery_manufacturer_name(dest, size); +} |