diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-11-01 11:11:09 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-02 01:07:16 +0000 |
commit | 88503ab4ec8f68c19d36ec4b6d3516848d71404a (patch) | |
tree | 58c3f8a491d9c30f4ec1fbe982421ffcb3ec603c /board | |
parent | 00682eb80fe159c1d037c721f2dd15c1be44bd12 (diff) | |
download | chrome-ec-88503ab4ec8f68c19d36ec4b6d3516848d71404a.tar.gz |
Provide multiple fan support within the EC itself
This adds explicit "int fan" args to the exported functions from
common/fan.c: fan_set_percent_needed() and fan_percent_to_rpm(). Within that
file, multiple fans are handled independently.
This is not complete, though. Host commands and sysjump support still only
handle a single fan, so at the moment multiple fans are treated identically
in those cases.
BUG=chrome-os-partner:23530
BRANCH=none
TEST=manual
All boards build, "make runtests" passes.
On a multi-fan system, the EC command "faninfo" displays multiple results:
> faninfo
Fan 0 Actual: 0 rpm
Fan 0 Target: 0 rpm
Fan 0 Duty: 0%
Fan 0 Status: 0 (not spinning)
Fan 0 Mode: rpm
Fan 0 Auto: yes
Fan 0 Enable: yes
Fan 1 Actual: 0 rpm
Fan 1 Target: 0 rpm
Fan 1 Duty: 0%
Fan 1 Status: 0 (not spinning)
Fan 1 Mode: rpm
Fan 1 Auto: no
Fan 1 Enable: no
>
and the "fanduty", "fanset", and "fanauto" all require the fan number as the
first arg:
> fanduty 0 30
Setting fan 0 duty cycle to 30%
> fanset 1 2000
Setting fan 1 rpm target to 2000
> fanauto 0
> fanauto 1
On single-fan systems, there is no visible change.
Change-Id: Idb8b818122e157960d56779b2a86e5ba433bee1b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175368
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/falco/board.c | 6 | ||||
-rw-r--r-- | board/samus/board.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/board/falco/board.c b/board/falco/board.c index b0a8ece31d..5d90ef3aa6 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -259,10 +259,10 @@ int board_discharge_on_ac(int enable) * And never turn it off. Bah. That'll do wonders for battery life. */ #ifdef CONFIG_FAN_RPM_CUSTOM -int fan_percent_to_rpm(int pct) +int fan_percent_to_rpm(int fan, int pct) { - const int FAN_MAX = 5050; - const int FAN_MIN = 2700; + const int FAN_MAX = fans[fan].rpm_max; + const int FAN_MIN = fans[fan].rpm_min; const int NUM_STEPS = 7; const int m = 100 * 100 / NUM_STEPS; const int m0 = m / 200; diff --git a/board/samus/board.c b/board/samus/board.c index a2e1e14b30..2fccd9d310 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -179,9 +179,9 @@ const struct adc_t adc_channels[] = { {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 4, 0, LM4_AIN(11), 0x06 /* IE0 | END0 */, LM4_GPIO_B, (1<<5)}, - /* FIXME: We don't know what to expect here, but it's an analog input - * that's pulled high. We're using it as a battery presence indicator - * for now. We'll return just 0 - ADC_READ_MAX for now. + /* TODO: We don't know what to expect here, but it's an analog input + * that's pulled high. We're only using it as a battery presence + * indicator for now, so we'll just return 0 - ADC_READ_MAX. */ {"BatteryTemp", LM4_ADC_SEQ2, 1, 1, 0, LM4_AIN(10), 0x06 /* IE0 | END0 */, LM4_GPIO_B, (1<<4)}, |