summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-04-23 11:37:14 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-01 03:08:48 +0000
commitb9719752392ddfdc6319a79932a05c4bc794b997 (patch)
treee11d2d82b32c1cb2be4c6ad168924913492e7116 /include/ec_commands.h
parent7499e5b0472f142cb3cec7af8d35903ed96f74a5 (diff)
downloadchrome-ec-b9719752392ddfdc6319a79932a05c4bc794b997.tar.gz
Battery: Add command to export display SoC
Currently, CrOS EC passes the battery remaining capacity (mAh) and the full capacity (mAh) through ACPI to the AP so that the host can calculate the battery SoC. The host further manipulates the SoC to get the display SoC, which is used to determine user visible behaviors. To get consistent behaviors in all power states, this change enables the EC to send the display SoC to the host via EC_CMD_DISPLAY_SOC command. The Powerd's part is I5bd1371f2569d21d55df1b50a3d709b98bbf0325. BUG=b:174433637, b:181506409, b:80270446, b:109954565 BRANCH=dedede, trogdor, nami, hatch TEST=Storo, CoachZ Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Idc6992625d992a73be141987d02ed220508d3b74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2853142 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index df690e65ac..8b30342b87 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -6903,6 +6903,16 @@ struct ec_response_pchg_update {
uint32_t block_size;
} __ec_align4;
+
+#define EC_CMD_DISPLAY_SOC 0x0137
+
+struct ec_response_display_soc {
+ int16_t display_soc; /* Display charge in 10ths of a % (1000=100.0%) */
+ int16_t full_factor; /* Full factor in 10ths of a % (1000=100.0%) */
+ int16_t shutdown_soc; /* Shutdown SoC in 10ths of a % (1000=100.0%) */
+} __ec_align2;
+
+
/*****************************************************************************/
/* The command range 0x200-0x2FF is reserved for Rotor. */