diff options
Diffstat (limited to 'include/config.h')
-rw-r--r-- | include/config.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h index 91d4b5ba89..faa1f5ed3c 100644 --- a/include/config.h +++ b/include/config.h @@ -498,6 +498,22 @@ * Some batteries don't update full capacity timely or don't update it at all. * On such systems, compensation is required to guarantee remaining_capacity * will be equal to full_capacity eventually. This used to be done in ACPI. + * + * When CONFIG_BATTERY_EXPORT_DISPLAY_SOC is enabled, CONFIG_BATT_FULL_FACTOR + * has no effect. Also CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE is used by Powerd + * as the threshold for low battery shutdown. For example, if we have: + * + * CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 3 + * CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2, + * BATTERY_LEVEL_SHUTDOWN = 1 + * + * the battery range is divided as follows (assuming system is powered only by + * internal battery): + * + * 0% ------------------- 1% ------------------- 2% ------------------- 3% + * EC refuses to boot -> + * Powerd shuts down system -> + * EC shuts down system -> */ #define CONFIG_BATT_FULL_FACTOR 98 #define CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE 4 @@ -505,10 +521,32 @@ /* * Powerd's full_factor. The value comes from: * src/platform2/power_manager/default_prefs/power_supply_full_factor + * + * When CONFIG_BATTERY_EXPORT_DISPLAY_SOC is enabled, this value is exported + * to the host (i.e. Powerd). It's used to calculate the ETA for full charge. */ #define CONFIG_BATT_HOST_FULL_FACTOR 97 /* + * This option enables EC to be the origin of the display SoC and allows the + * host (i.e. Powerd) to retrieve it through EC_CMD_DISPLAY_SOC. + * + * The display SoC is computed from the remaining capacity, the last full + * charge, CONFIG_BATT_FULL_FACTOR, CONFIG_BATT_HOST_FULL_FACTOR, and + * CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE. + * + * If this option is disabled, the EC and the host will individually compute + * the display SoC, which may result in inconsistent behaviors since the numbers + * do not necessarily match. As such, this option is going to be enabled by + * default and the old behavior (#undef CONFIG_BATTERY_EXPORT_DISPLAY_SOC) will + * be deprecated. + * + * TODO: Define CONFIG_BATTERY_EXPORT_DISPLAY_SOC by default and remove + * CONFIG_BATTERY_EXPORT_DISPLAY_SOC and CONFIG_BATT_FULL_FACTOR. + */ +#undef CONFIG_BATTERY_EXPORT_DISPLAY_SOC + +/* * Expose some data when it is needed. * For example, battery disconnect state */ |