diff --git a/board/it8380dev/board.c b/board/it8380dev/board.c index 5b4f7dcbab..d7bf4388ab 100644 --- a/board/it8380dev/board.c +++ b/board/it8380dev/board.c @@ -176,11 +176,6 @@ BUILD_ASSERT(ARRAY_SIZE(pnpcfg_settings) == EC2I_SETTING_COUNT); /* Initialize board. */ static void board_init(void) { - /* - * Default no low power idle for EVB, - * use console command "sleepmask" to enable it if necessary. - */ - disable_sleep(SLEEP_MASK_FORCE_NO_DSLEEP); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/chip/it83xx/fan.c b/chip/it83xx/fan.c index 4c5b157935..f61fbaa6f7 100644 --- a/chip/it83xx/fan.c +++ b/chip/it83xx/fan.c @@ -9,13 +9,14 @@ #include "fan.h" #include "gpio.h" #include "hooks.h" -#include "registers.h" -#include "util.h" -#include "pwm.h" -#include "task.h" -#include "math_util.h" #include "hwtimer_chip.h" +#include "math_util.h" +#include "pwm.h" #include "pwm_chip.h" +#include "registers.h" +#include "system.h" +#include "task.h" +#include "util.h" #define TACH_EC_FREQ 8000000 #define FAN_CTRL_BASED_MS 10 @@ -118,6 +119,7 @@ void fan_set_enabled(int ch, int enabled) if (tach_ch < TACH_CH_COUNT) fan_info_data[tach_ch].fan_sts = FAN_STATUS_CHANGING; + disable_sleep(SLEEP_MASK_FAN); /* enable timer interrupt for fan control */ ext_timer_start(FAN_CTRL_EXT_TIMER, 1); /* disable */ @@ -140,8 +142,10 @@ void fan_set_enabled(int ch, int enabled) if (!enabled) { /* disable timer interrupt if all fan off. */ - if (fan_all_disabled()) + if (fan_all_disabled()) { ext_timer_stop(FAN_CTRL_EXT_TIMER, 1); + enable_sleep(SLEEP_MASK_FAN); + } } }