diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-04-26 16:33:03 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-04-28 16:11:22 +0000 |
commit | 8580047dfab84c3ecc1b3fed07c0f8b20f49c014 (patch) | |
tree | 99ecb98eb879f50ab26131b2a6c5cb76b8b86ad1 /src | |
parent | 68de80838cb5e5add22daeebb0409233961177c3 (diff) | |
download | coreboot-8580047dfab84c3ecc1b3fed07c0f8b20f49c014.tar.xz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/dell/optiplex_9010/sch5545_ec.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mainboard/dell/optiplex_9010/sch5545_ec.c b/src/mainboard/dell/optiplex_9010/sch5545_ec.c index db13495aad..9e25f18faa 100644 --- a/src/mainboard/dell/optiplex_9010/sch5545_ec.c +++ b/src/mainboard/dell/optiplex_9010/sch5545_ec.c @@ -656,20 +656,17 @@ void sch5545_ec_hwm_init(void *unused) ec_read_write_reg(EC_HWM_LDN, 0x02fc, &val_2fc, WRITE_OP); - int fan_speed_full = get_int_option("fan_full_speed", -1); - 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"); - } - + unsigned int fan_speed_full = get_int_option("fan_full_speed", 0); 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); val |= 0x60; ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, WRITE_OP); ec_read_write_reg(EC_HWM_LDN, 0x0081, &val, READ_OP); val |= 0x60; 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); |