From ed10b36edf956adc965941a97e33e6f64f2aa6f6 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 18 Feb 2026 21:09:46 +0100 Subject: [PATCH] ec/google/chromeec: Replace CFR enums with booleans Boolean options are intended to represent generic "Enable"/"Disable" options, but without enum options' extra bloat in the CFR structures. In this case, the callback function already treated the option as if it were a boolean option, which likely only worked by chance. Change-Id: I7e53c791d48bd5ce5271505c59856bf7ff18e6d0 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/91343 Reviewed-by: Caveh Jalali Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/cfr.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ec/google/chromeec/cfr.h b/src/ec/google/chromeec/cfr.h index 2972bd5424..07ca0e9b68 100644 --- a/src/ec/google/chromeec/cfr.h +++ b/src/ec/google/chromeec/cfr.h @@ -14,20 +14,15 @@ static void update_fan_control(struct sm_object *new) { if (!CONFIG(EC_GOOGLE_CHROMEEC_AUTO_FAN_CTRL) && !google_chromeec_has_fan()) { new->sm_bool.flags = CFR_OPTFLAG_SUPPRESS; - new->sm_bool.default_value = 0; + new->sm_bool.default_value = false; } } -static const struct sm_object auto_fan_control = SM_DECLARE_ENUM({ +static const struct sm_object auto_fan_control = SM_DECLARE_BOOL({ .opt_name = "auto_fan_control", .ui_name = "Automatic Fan Control", .ui_helptext = "Enable or disable automatic fan control.", .default_value = CONFIG(EC_GOOGLE_CHROMEEC_AUTO_FAN_CTRL), - .values = (struct sm_enum_value[]) { - { "Enabled", 1 }, - { "Disabled", 0 }, - SM_ENUM_VALUE_END, - }, }, WITH_CALLBACK(update_fan_control)); static const struct sm_enum_value ec_backlight_values[] = {