mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
chip: it83xx: disable sleep while fan control loop ongoing
This change is required for support 'CONFIG_LOW_POWER_S0'. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=1. fanset 5555, EC enter doze mode only and fan control is functional. 2. fanset 0, EC will enter deep doze mode properly. Change-Id: I3780b12ef54713258769616bfed0155c865c0725 Reviewed-on: https://chromium-review.googlesource.com/338750 Commit-Ready: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw> Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user