summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-04-28 15:49:24 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-05 23:29:28 +0000
commit212ef472cc13372a0a70351f24fc0e1bbf29de8f (patch)
tree34aaeacf121458b0473830ced021a148f3539838 /include
parent73d4d92b07937932794d0e37d923300e4cb72481 (diff)
downloadchrome-ec-212ef472cc13372a0a70351f24fc0e1bbf29de8f.tar.gz
chargesplash: State machine implementation
This is much of the legwork required for go/cros-charging-splash, at least the portion of connecting the charger from chipset off state. What remains is: - Examining battery state and charger supply to make better decisions about when we can show the splash. - Consider assertion of PROCHOT during bootup of a low power charger, or after display initialization before the power button is pressed. The next CL adds a simple text-based UI on top of this. BUG=b:228370390 BRANCH=none TEST=connect charger and boot to splash on brya (using ghost image) (with full CL stack) TEST=provided integration tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ic114e975109a338ffaa3be977094020251fc36e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575089 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/config.h15
-rw-r--r--include/ec_commands.h33
2 files changed, 48 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index f7a507655b..6252a63e7a 100644
--- a/include/config.h
+++ b/include/config.h
@@ -918,6 +918,11 @@
/* Compile input current ramping support using software control */
#undef CONFIG_CHARGE_RAMP_SW
+/* Enable EC support for charging splashscreen */
+#undef CONFIG_CHARGESPLASH
+#undef CONFIG_CHARGESPLASH_PERIOD
+#undef CONFIG_CHARGESPLASH_MAX_REQUESTS_PER_PERIOD
+
/*****************************************************************************/
/* Charger config */
@@ -6647,6 +6652,16 @@
#endif /* CONFIG_USB_PD_DISCHARGE_GPIO */
#endif /* CONFIG_USB_PD_DISCHARGE */
+/* Chargesplash defaults */
+#ifdef CONFIG_CHARGESPLASH
+#ifndef CONFIG_CHARGESPLASH_PERIOD
+#define CONFIG_CHARGESPLASH_PERIOD 900
+#endif
+#ifndef CONFIG_CHARGESPLASH_MAX_REQUESTS_PER_PERIOD
+#define CONFIG_CHARGESPLASH_MAX_REQUESTS_PER_PERIOD 5
+#endif
+#endif
+
/* EC Codec Wake-on-Voice related definitions */
#ifdef CONFIG_AUDIO_CODEC_WOV
#define CONFIG_SHA256
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 2c13ba7391..b8d6ff3328 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -4720,6 +4720,39 @@ struct ec_params_dedicated_charger_limit {
uint16_t voltage_lim; /* in mV */
} __ec_align2;
+/*
+ * Get and set charging splashscreen variables
+ */
+#define EC_CMD_CHARGESPLASH 0x00A4
+
+enum ec_chargesplash_cmd {
+ /* Get the current state variables */
+ EC_CHARGESPLASH_GET_STATE = 0,
+
+ /* Indicate initialization of the display loop */
+ EC_CHARGESPLASH_DISPLAY_READY,
+
+ /* Manually put the EC into the requested state */
+ EC_CHARGESPLASH_REQUEST,
+
+ /* Reset all state variables */
+ EC_CHARGESPLASH_RESET,
+
+ /* Manually trigger a lockout */
+ EC_CHARGESPLASH_LOCKOUT,
+};
+
+struct __ec_align1 ec_params_chargesplash {
+ /* enum ec_chargesplash_cmd */
+ uint8_t cmd;
+};
+
+struct __ec_align1 ec_response_chargesplash {
+ uint8_t requested;
+ uint8_t display_initialized;
+ uint8_t locked_out;
+};
+
/*****************************************************************************/
/* Hibernate/Deep Sleep Commands */