diff --git a/chip/lm4/pwm.c b/chip/lm4/pwm.c index 1bfeeff6b4..bcb19f49a0 100644 --- a/chip/lm4/pwm.c +++ b/chip/lm4/pwm.c @@ -43,17 +43,6 @@ static void configure_gpios(void) } -int pwm_enable_fan(int enable) -{ - if (enable) - LM4_FAN_FANCTL |= (1 << FAN_CH_CPU); - else - LM4_FAN_FANCTL &= ~(1 << FAN_CH_CPU); - - return EC_SUCCESS; -} - - int pwm_get_fan_rpm(void) { return (LM4_FAN_FANCST(FAN_CH_CPU) & MAX_RPM) * CPU_FAN_SCALE; @@ -101,9 +90,6 @@ static int command_fan_info(int argc, char **argv) ((LM4_FAN_FANCMD(FAN_CH_CPU) >> 16)) * 100 / MAX_PWM); uart_printf(" status: %d\n", (LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03); - uart_printf(" enabled: %s\n", - LM4_FAN_FANCTL & (1 << FAN_CH_CPU) ? "yes" : "no"); - return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(faninfo, command_fan_info); @@ -130,9 +116,9 @@ static int command_fan_set(int argc, char **argv) /* Move the fan to automatic control */ if (LM4_FAN_FANCH(FAN_CH_CPU) & 0x0001) { - pwm_enable_fan(0); - LM4_FAN_FANCH(FAN_CH_CPU) &= ~0x0001; - pwm_enable_fan(1); + LM4_FAN_FANCTL &= ~(1 << FAN_CH_CPU); + LM4_FAN_FANCH(FAN_CH_CPU) &= ~0x0001; + LM4_FAN_FANCTL |= (1 << FAN_CH_CPU); } rv = pwm_set_fan_target_rpm(rpm); @@ -165,9 +151,9 @@ static int command_fan_duty(int argc, char **argv) /* Move the fan to manual control */ if (!(LM4_FAN_FANCH(FAN_CH_CPU) & 0x0001)) { - pwm_enable_fan(0); + LM4_FAN_FANCTL &= ~(1 << FAN_CH_CPU); LM4_FAN_FANCH(FAN_CH_CPU) |= 0x0001; - pwm_enable_fan(1); + LM4_FAN_FANCTL |= (1 << FAN_CH_CPU); } /* Set the duty cycle */ @@ -248,9 +234,8 @@ int pwm_init(void) pwm_set_fan_target_rpm(-1); pwm_set_keyboard_backlight(0); - /* Enable keyboard backlight. Fan will be enabled later by whatever - * controls the fan power supply. */ - LM4_FAN_FANCTL |= (1 << FAN_CH_KBLIGHT); + /* Enable CPU fan and keyboard backlight */ + LM4_FAN_FANCTL |= (1 << FAN_CH_CPU) | (1 << FAN_CH_KBLIGHT); return EC_SUCCESS; } diff --git a/common/x86_power.c b/common/x86_power.c index c4c3452a5b..f1454fe93e 100644 --- a/common/x86_power.c +++ b/common/x86_power.c @@ -9,7 +9,6 @@ #include "clock.h" #include "console.h" #include "gpio.h" -#include "pwm.h" #include "task.h" #include "timer.h" #include "uart.h" @@ -262,9 +261,6 @@ void x86_power_task(void) /* Turn on power rails */ gpio_set_level(GPIO_ENABLE_VS, 1); - /* Enable fan, now that +5VS is turned on */ - pwm_enable_fan(1); - /* Wait for non-core power rails good */ wait_in_signals(IN_PGOOD_ALL_NONCORE); @@ -297,9 +293,6 @@ void x86_power_task(void) /* Assert RCINn */ gpio_set_level(GPIO_PCH_RCINn, 0); - /* Disable fan, since it's powered by +5VS */ - pwm_enable_fan(0); - /* Turn off power rails */ gpio_set_level(GPIO_ENABLE_VS, 0); diff --git a/include/pwm.h b/include/pwm.h index cbf11c5e95..ff76c89744 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -13,10 +13,6 @@ /* Initializes the module. */ int pwm_init(void); -/* Enables/disables the fan. This should be called by whatever function - * enables the power supply to the fan. */ -int pwm_enable_fan(int enable); - /* Gets the current fan RPM. */ int pwm_get_fan_rpm(void);