mb/google/bluey: Condition slow charging enablement on charger presence

Update the logic to properly condition the slow battery charging feature.

Previously, enable_slow_battery_charging() was called solely if the
system was in a low-power boot state (is_low_power_boot()).

This commit adds an explicit check for
`google_chromeec_is_charger_present()` to ensure that the slow charging
feature is only enabled when a charger is physically connected.

TEST=Able to build and boot google/quenbi.

Change-Id: I24b6626343a25a4fab3f5d77c1d114e797781be7
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90335
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2025-12-02 13:19:53 +00:00 committed by Matt DeVillier
commit 0599f3e1bd

View file

@ -59,8 +59,8 @@ void lb_add_boot_mode(struct lb_header *header)
mode->size = sizeof(*mode);
mode->boot_mode = get_boot_mode();
/* Enable charging only during off-mode or low-battery mode */
if (is_low_power_boot())
/* Enable charging only during off-mode or low-battery mode and charger present */
if (is_low_power_boot() && google_chromeec_is_charger_present())
enable_slow_battery_charging();
}