summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/Kconfig.tasks20
-rw-r--r--zephyr/shim/include/shimmed_task_id.h3
-rw-r--r--zephyr/shim/include/shimmed_tasks.h4
3 files changed, 27 insertions, 0 deletions
diff --git a/zephyr/Kconfig.tasks b/zephyr/Kconfig.tasks
index 9a2a6d94a0..35f83a85c2 100644
--- a/zephyr/Kconfig.tasks
+++ b/zephyr/Kconfig.tasks
@@ -33,3 +33,23 @@ config TASK_POWERBTN_STACK_SIZE
The stack size of the power button task.
endif # HAS_TASK_POWERBTN
+
+config HAS_TASK_CHARGER
+ bool "Whether or not the charger task should be run."
+ help
+ This turns on the charger task. This deals with monitoring the
+ battery to make sure it is present and is responding properly to
+ requests. If the battery is not full, it enables charging from a
+ suitable power source.
+
+if HAS_TASK_CHARGER
+
+config TASK_CHARGER_STACK_SIZE
+ hex "charger task stack size"
+ default 0x400 # EC uses VENTI_TASK_STACK_SIZE which is 896
+ help
+ The stack size of the charger task.
+
+ See b/176180736 for checking these stack sizes.
+
+endif # HAS_TASK_CHARGER
diff --git a/zephyr/shim/include/shimmed_task_id.h b/zephyr/shim/include/shimmed_task_id.h
index dc7e7f24ff..2918cad216 100644
--- a/zephyr/shim/include/shimmed_task_id.h
+++ b/zephyr/shim/include/shimmed_task_id.h
@@ -19,6 +19,9 @@ typedef uint8_t task_id_t;
*/
#ifndef CONFIG_ZTEST
#define CROS_EC_TASK_LIST \
+ COND_CODE_1(HAS_TASK_CHARGER, \
+ (CROS_EC_TASK(CHARGER, charger_task, 0, \
+ CONFIG_TASK_CHARGER_STACK_SIZE)), ()) \
COND_CODE_1(HAS_TASK_CHIPSET, \
(CROS_EC_TASK(CHIPSET, chipset_task, 0, \
CONFIG_TASK_CHIPSET_STACK_SIZE)), ()) \
diff --git a/zephyr/shim/include/shimmed_tasks.h b/zephyr/shim/include/shimmed_tasks.h
index 3a34e79715..3cb57e866d 100644
--- a/zephyr/shim/include/shimmed_tasks.h
+++ b/zephyr/shim/include/shimmed_tasks.h
@@ -27,4 +27,8 @@
#define HAS_TASK_POWERBTN 1
#endif /* CONFIG_HAS_TASK_POWERBTN */
+#ifdef CONFIG_HAS_TASK_CHARGER
+#define HAS_TASK_CHARGER 1
+#endif /* CONFIG_HAS_TASK_CHARGER */
+
#endif /* __CROS_EC_SHIMMED_TASKS_H */