mb/dell/optiplex_9010: Always log chosen fan mode

Always print the chosen fan mode, not only when get_int_option() returns
the fallback value. Callers of get_int_option() should not try to handle
option-related errors, and simply proceed using the fallback value.

This change is needed to update the option API to use unsigned integers.
The CMOS option system does not support negative numbers.

Change-Id: Ic8adbe557b48a46f785d82fddb16383678705e87
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52670
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Angel Pons 2021-04-26 16:33:03 +02:00 committed by Felix Held
parent 68de80838c
commit 8580047dfa
1 changed files with 4 additions and 7 deletions

View File

@ -656,20 +656,17 @@ void sch5545_ec_hwm_init(void *unused)
ec_read_write_reg(EC_HWM_LDN, 0x02fc, &val_2fc, WRITE_OP); ec_read_write_reg(EC_HWM_LDN, 0x02fc, &val_2fc, WRITE_OP);
int fan_speed_full = get_int_option("fan_full_speed", -1); unsigned int fan_speed_full = get_int_option("fan_full_speed", 0);
if (fan_speed_full < 0) {
fan_speed_full = 0;
printk(BIOS_INFO, "fan_full_speed CMOS option not found. "
"Fans will be set up for automatic control\n");
}
if (fan_speed_full) { if (fan_speed_full) {
printk(BIOS_INFO, "Will set up fans to run at full speed\n");
ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, READ_OP); ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, READ_OP);
val |= 0x60; val |= 0x60;
ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, WRITE_OP); ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, WRITE_OP);
ec_read_write_reg(EC_HWM_LDN, 0x0081, &val, READ_OP); ec_read_write_reg(EC_HWM_LDN, 0x0081, &val, READ_OP);
val |= 0x60; val |= 0x60;
ec_read_write_reg(EC_HWM_LDN, 0x0081, &val, WRITE_OP); ec_read_write_reg(EC_HWM_LDN, 0x0081, &val, WRITE_OP);
} else {
printk(BIOS_INFO, "Will set up fans for automatic control\n");
} }
ec_read_write_reg(EC_HWM_LDN, 0x00b8, &val, READ_OP); ec_read_write_reg(EC_HWM_LDN, 0x00b8, &val, READ_OP);