Attention is currently required from: Felix Held. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52511 )
Change subject: superio/nuvoton/npcd378: Fix `psu_fan_lvl` option ......................................................................
superio/nuvoton/npcd378: Fix `psu_fan_lvl` option
If the option is successfully read from CMOS, the code overwrites its value with 3. Fix this issue and use the new get_int_option() function.
Change-Id: I287a348da6ece78376d9c38e96128041752b032e Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/superio/nuvoton/npcd378/superio.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/52511/1
diff --git a/src/superio/nuvoton/npcd378/superio.c b/src/superio/nuvoton/npcd378/superio.c index 801592d..6a56ac8 100644 --- a/src/superio/nuvoton/npcd378/superio.c +++ b/src/superio/nuvoton/npcd378/superio.c @@ -50,7 +50,6 @@ static void npcd378_init(struct device *dev) { struct resource *res; - uint8_t pwm, fan_lvl;
if (!dev->enabled) return; @@ -69,10 +68,11 @@
npcd378_hwm_write_start(res->base);
- if (!get_option(&fan_lvl, "psu_fan_lvl") || fan_lvl > 7) + int fan_lvl = get_int_option("psu_fan_lvl", -1); + if (fan_lvl < 0 || fan_lvl > 7) fan_lvl = 3;
- pwm = NPCD378_HWM_PSU_FAN_MIN + + uint8_t pwm = NPCD378_HWM_PSU_FAN_MIN + (NPCD378_HWM_PSU_FAN_MAX - NPCD378_HWM_PSU_FAN_MIN) * fan_lvl / 7;