diff options
author | Peter Marheine <pmarheine@chromium.org> | 2020-11-05 13:25:01 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-10 07:27:48 +0000 |
commit | 6bc9bb622a31845277d5513fa80fb6766ee68f6c (patch) | |
tree | c3137f9eda02fa7de48c6d222d82f239677ed396 /include/ec_commands.h | |
parent | f445f83ecbe4fb9196debf1b0eee5a3c84fd1013 (diff) | |
download | chrome-ec-6bc9bb622a31845277d5513fa80fb6766ee68f6c.tar.gz |
Add EC_CMD_BATTERY_GET_STATIC v1 for zork
Some zork variants have battery model names that differ only beyond
the 7th character, which cannot be differentiated with the current
limitation of 8 characters per battery string. Introduce a new hostcmd
version that allows longer battery strings and enable it on Zork.
Because allowing longer strings through the host memory map is more
difficult and not required (because getting the full longer string
is mostly only useful for servicing), the host memory map is unchanged.
ectool is updated to use hostcmd (rather than memory map) if the new
command version is available, in order to take advantage of it.
BUG=b:171854783
TEST=ectool battery prints longer strings when supported by the EC;
a hacked EC on morphius can return 11 characters of text.
An EC running older firmware still works with a new ectool.
BRANCH=zork
Change-Id: I63d20d4f690b6945cb1d423aafaf55dafc039211
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2519243
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r-- | include/ec_commands.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 50e5268165..0feb3dbfd7 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -6955,6 +6955,28 @@ struct ec_response_battery_static_info { uint32_t cycle_count; } __ec_align4; +/** + * struct ec_response_battery_static_info_v1 - hostcmd v1 battery static info + * Equivalent to struct ec_response_battery_static_info, but with longer + * strings. + * @design_capacity: battery design capacity (in mAh) + * @design_voltage: battery design voltage (in mV) + * @cycle_count: battery cycle count + * @manufacturer_ext: battery manufacturer string + * @model_ext: battery model string + * @serial_ext: battery serial number string + * @type_ext: battery type string + */ +struct ec_response_battery_static_info_v1 { + uint16_t design_capacity; + uint16_t design_voltage; + uint32_t cycle_count; + char manufacturer_ext[12]; + char model_ext[12]; + char serial_ext[12]; + char type_ext[12]; +} __ec_align4; + /* * Get battery dynamic information, i.e. information that is likely to change * every time it is read. |