coreboot/src
Subrata Banik 5ef70e5f22 ec/google/chromeec: Add API to check if battery is critically low
This patch adds a new API `google_chromeec_is_below_critical_threshold()
` to check if the battery level is below the critical threshold.

The API uses the existing `ec_cmd_battery_get_dynamic()` command to
retrieve the battery flags and checks the `EC_BATT_FLAG_LEVEL_CRITICAL`
flag to determine if the battery level is critical.

This API can be used by other components to query the battery critical
status and take necessary actions, for example, while the system is
booting with low battery fuel with and/or without an AC
charger attached.

This addresses the need to implement a low battery charger icon and
detect when the system is booting with low battery fuel. The existing
`google_chromeec_is_battery_present_and_above_critical_threshold()`
API is not suitable for this purpose because any negative decision
(like battery not present and/or battery is critically low) implemented
around this existing API will also render the lower battery indicator
when the system is booting into battery cut-off mode. Ideally, we do not
wish to render any icon and simply allow boot to the OS during system
battery cut-off boot.

BUG=b:377798581
TEST=Able to read the battery status correctly while booting
google/fatcat.

Change-Id: Id1fc1df374fb4c663becc371c69b285d8b9957ff
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85759
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
2024-12-30 04:09:12 +00:00
..
acpi acpi/acpigen: generate Create*Field() from name string directly 2024-12-10 02:58:29 +00:00
arch arch/x86: Disable DEBUG_STACK_OVERFLOW_BREAKPOINTS_IN_ALL_STAGES 2024-12-17 08:37:10 +00:00
commonlib commonlib: Refactor CSE sync eventLog 2024-12-23 01:57:13 +00:00
console console/i2c_smbus: Allow to send data w/o register offset 2024-07-11 00:06:22 +00:00
cpu cpu/qemu: Enable IDT_IN_EVERY_STAGE 2024-12-17 17:37:54 +00:00
device arch/x86: Rename breakpoint removal function 2024-12-10 08:48:00 +00:00
drivers drivers/mipi: Add support for KD_KD110N11_51IE panel 2024-12-24 14:05:24 +00:00
ec ec/google/chromeec: Add API to check if battery is critically low 2024-12-30 04:09:12 +00:00
include drivers/option: Add forms in cbtables 2024-12-18 18:16:51 +00:00
lib drivers/option: Add forms in cbtables 2024-12-18 18:16:51 +00:00
mainboard mb/google/rex/var/kanix: Add Synaptics touchpad 2024-12-27 02:46:11 +00:00
northbridge haswell NRI: Post-process selected timings 2024-12-10 09:38:00 +00:00
sbom
security drivers/pc80/tpm: Remove flag TPM_RDRESP_NEED_DELAY 2024-10-14 15:26:11 +00:00
soc soc/mediatek/mt8196: Add MT6685 Clock IC driver 2024-12-29 01:38:41 +00:00
southbridge Treewide: Remove unused header files 2024-11-30 04:44:06 +00:00
superio superio/ite: Add support for IT8625E 2024-11-21 15:49:12 +00:00
vendorcode vc/intel/fsp/mtl: Update MTL fsp header files from 3471_91 to 4122_21 2024-12-17 06:16:07 +00:00
Kconfig Add initial experimental LTO support 2024-08-24 12:50:38 +00:00