diff options
Diffstat (limited to 'chip/lm4/fan.c')
-rw-r--r-- | chip/lm4/fan.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chip/lm4/fan.c b/chip/lm4/fan.c index 663bcdab1d..98e19e767e 100644 --- a/chip/lm4/fan.c +++ b/chip/lm4/fan.c @@ -52,7 +52,7 @@ static void fan_set_enabled(int enable) static int fan_get_rpm_mode(void) { - return (LM4_FAN_FANCH(FAN_CH_CPU) & 0x0001) ? 0 : 1; + return (LM4_FAN_FANCH(CONFIG_FAN_CH_CPU) & 0x0001) ? 0 : 1; } static void fan_set_rpm_mode(int rpm_mode) @@ -63,24 +63,24 @@ static void fan_set_rpm_mode(int rpm_mode) if (!was_rpm && rpm_mode) { /* Enable RPM control */ fan_set_enabled(0); - LM4_FAN_FANCH(FAN_CH_CPU) &= ~0x0001; + LM4_FAN_FANCH(CONFIG_FAN_CH_CPU) &= ~0x0001; fan_set_enabled(was_enabled); } else if (was_rpm && !rpm_mode) { /* Disable RPM mode */ fan_set_enabled(0); - LM4_FAN_FANCH(FAN_CH_CPU) |= 0x0001; + LM4_FAN_FANCH(CONFIG_FAN_CH_CPU) |= 0x0001; fan_set_enabled(was_enabled); } } static int fan_get_rpm_actual(void) { - return (LM4_FAN_FANCST(FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE; + return (LM4_FAN_FANCST(CONFIG_FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE; } static int fan_get_rpm_target(void) { - return (LM4_FAN_FANCMD(FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE; + return (LM4_FAN_FANCMD(CONFIG_FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE; } static void fan_set_rpm_target(int rpm) @@ -93,12 +93,12 @@ static void fan_set_rpm_target(int rpm) if (rpm < 0 || rpm > MAX_RPM) rpm = MAX_RPM; - LM4_FAN_FANCMD(FAN_CH_CPU) = rpm; + LM4_FAN_FANCMD(CONFIG_FAN_CH_CPU) = rpm; } static int fan_get_status(void) { - return (LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03; + return (LM4_FAN_FANSTS >> (2 * CONFIG_FAN_CH_CPU)) & 0x03; } static const char * const human_status[] = { "not spinning", "changing", "locked", "frustrated" @@ -114,7 +114,8 @@ static int fan_is_stalled(void) return 0; /* Check for stall condition */ - return (((LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03) == 0) ? 1 : 0; + return (((LM4_FAN_FANSTS >> (2 * CONFIG_FAN_CH_CPU)) & 0x03) == 0) ? + 1 : 0; } /*****************************************************************************/ |