diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-07-15 14:16:14 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-21 00:39:46 +0000 |
commit | 0b48d88cc8cf085ece95dc9ebf66b8a07eb72696 (patch) | |
tree | cbfa39cde42ebe43d48c61068b3382da6bcf4aeb /include/battery.h | |
parent | 565fa5f2fd66c8eb64bb8c009a865380029e6666 (diff) | |
download | chrome-ec-0b48d88cc8cf085ece95dc9ebf66b8a07eb72696.tar.gz |
battery: Expose battery_manufacture_date() as API
The newer kernels request this data.
Add the battery_manufacture_date() as a new API.
Checked the TRMs of the following batteries. They don't have any way to
query the manufacture date, so return EC_ERROR_UNIMPLEMENTED.
* bq27541
* bq27621_g1
* max17055
* mm8013
BRANCH=None
BUG=b:160784792
TEST=Hacked to print the manufacture date, on both battery present and not.
Change-Id: I1deefb64f6cc594828d6c10c42fa7107dadd7559
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2300689
Commit-Queue: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r-- | include/battery.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/battery.h b/include/battery.h index 85970ea4f2..96fa900d4f 100644 --- a/include/battery.h +++ b/include/battery.h @@ -303,6 +303,16 @@ int battery_status(int *status); int battery_cycle_count(int *count); /** + * Read battery manufacture date. + * + * @param year Destination for year + * @param month Destination for month + * @param day Destination for day + * @return non-zero if error. + */ +int battery_manufacture_date(int *year, int *month, int *day); + +/** * Read battery serial number. * * @param serial Destination for serial number. |