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 <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91343 Reviewed-by: Caveh Jalali <caveh@chromium.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
d19e5d2550
commit
ed10b36edf
1 changed files with 2 additions and 7 deletions
|
|
@ -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[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue