summaryrefslogtreecommitdiff
path: root/common/battery_v2.c
Commit message (Collapse)AuthorAgeFilesLines
* smart_battery: Store battery info in struct battery_static_infoDaisuke Nojiri2021-10-261-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, static battery info is stored in a host command response struct (e.g. ec_response_battery_static_info_v1). It can contain only up to 8 (v0) or 12 (v1) byte strings. This patch adds struct battery_static_info, which has the full size string fields to store static battery info. This will make a host using virtual_battery.c see full size strings under /sysfs/power_supply/sbs-*. ACPI and host programs speaking EC_CMD_BATTERY_GET_STATIC will not be affected. BUG=b:198722643, b:203031618 BRANCH=None TEST=Coachz. Run ectool battery. TEST=Run cat /sys/class/power_supply/sbs-12-000b/manufacturer and and verify the string is longer than 8 chars. Change-Id: Id847d66c7c846885113f6afb05a9de1788bf92ae Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180272 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Battery: Move battery code to battery_v1.c and v2.cDaisuke Nojiri2021-10-261-0/+368
BUG=b:198722643, b:203031618 BRANCH=None TEST=buildall Change-Id: I595da56412f4d30684b00d1138f7e2339c7f5204 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3227372 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>