Prevent issuing warning when fan is off

LM4 reports fan stalled when fan speed is set to 0. Need to check this
before issuing warning.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:7497
TEST=Did not see fan stall warning when fan speed is 0.

Change-Id: I8eecca8516b5442d4943d9195d04acc5b4041085
This commit is contained in:
Vic Yang
2012-04-30 21:33:37 +08:00
parent 31190cf215
commit 0a7701be57

View File

@@ -132,7 +132,8 @@ static void update_lpc_mapped_memory(void)
static void check_fan_failure(void)
{
if ((LM4_FAN_FANCTL & (1 << FAN_CH_CPU)) &&
if (pwm_get_fan_target_rpm() != 0 &&
(LM4_FAN_FANCTL & (1 << FAN_CH_CPU)) &&
((LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03) == 0) {
/* Fan enabled but stalled. Issues warning.
* As we have thermal shutdown protection, issuing warning