summaryrefslogtreecommitdiff
path: root/chip/lm4/fan.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-10-21 14:21:45 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-22 02:23:39 +0000
commit8cd9856cf8ef193ea094cf91c67e9aff25b2b521 (patch)
tree966a17e7cb8edf8fd6ae8ad6b410fd4b124759e1 /chip/lm4/fan.c
parent7eaa290c35a1ca5571854c7d31a5a125af665b65 (diff)
downloadchrome-ec-8cd9856cf8ef193ea094cf91c67e9aff25b2b521.tar.gz
samus: change fan RPM values, enable fast-start
Updating the fan speeds according to the manufacturer's specs. The fan vendor recommends that the minimum fan speed be a 20% duty cycle. Since the built-in fan controller has a tach-based feedback loop, I'm using the RPM value instead of the duty cycle (20% is 2286 RPM, according to the vendor). The vendor also wants a 30% duty cycle to start turning, but the built-in fan controller provides support for fast-start too. The controller's minimum fast-start duty cycle is 50%, but it also has a programmable number of revolutions that it will wait before backing off. Holding my ear down close to the fans while they start and stop, it seems that the minimum 2 revolution start period is sufficient and provides the least noise. Of course, since I've never had any problems starting the fans directly at 1000 RPM this noise is a little more noticeable than that. It's quite possible that the built-in controller is smart enough to make 1000 RPM work by bumping the duty cycle up until the fans turn even if the fans don't like it. BUG=chrome-os-partner:32892 BRANCH=ToT,samus TEST=manual Listen closely and run the EC console "faninfo" command to see the fans start and stop as the system boots and idles. Change-Id: I47c9e7cef3f9f4bd815a13032fe10234decd62ed Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/224830 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/lm4/fan.c')
-rw-r--r--chip/lm4/fan.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/chip/lm4/fan.c b/chip/lm4/fan.c
index 8ec25bc1f8..1180d51906 100644
--- a/chip/lm4/fan.c
+++ b/chip/lm4/fan.c
@@ -132,7 +132,9 @@ int fan_is_stalled(int ch)
void fan_channel_setup(int ch, unsigned int flags)
{
- if (flags & FAN_USE_RPM_MODE) {
+ uint32_t init;
+
+ if (flags & FAN_USE_RPM_MODE)
/*
* Configure automatic/feedback mode:
* 0x8000 = bit 15 = auto-restart
@@ -146,8 +148,8 @@ void fan_channel_setup(int ch, unsigned int flags)
* (see note at top of file)
* 0x0000 = bit 0 = automatic control
*/
- LM4_FAN_FANCH(ch) = 0x802c;
- } else {
+ init = 0x802c;
+ else
/*
* Configure drive-only mode:
* 0x0000 = bit 15 = no auto-restart
@@ -159,8 +161,17 @@ void fan_channel_setup(int ch, unsigned int flags)
* 0x0000 = bits 3:2 = 1 pulses per revolution
* 0x0001 = bit 0 = manual control
*/
- LM4_FAN_FANCH(ch) = 0x0001;
- }
+ init = 0x0001;
+
+ if (flags & FAN_USE_FAST_START)
+ /*
+ * Configure fast-start mode
+ * 0x0000 = bits 10:8 = start period (2<<0) edges
+ * 0x0040 = bits 7:6 = fast start at 50% duty
+ */
+ init |= 0x0040;
+
+ LM4_FAN_FANCH(ch) = init;
}
static void fan_init(void)