summaryrefslogtreecommitdiff
path: root/include/fan.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-10-30 10:38:31 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-30 23:10:10 +0000
commite48a9d9c2143695cdd7a35ab06d6a6d5820efd9b (patch)
treee7a3a92ac80fadf61dd1b7df16e62c9f48fcd9c0 /include/fan.h
parent034e96c128d0e1ee7c100c47456c2159a133288c (diff)
downloadchrome-ec-e48a9d9c2143695cdd7a35ab06d6a6d5820efd9b.tar.gz
Separate fan_t from pwm_t
There is a logical difference between PWM controls for things like backlights and fan controls for actual fans. This change separates them into two different data structures, for better abstraction. BUG=chrome-os-partner:23530 BRANCH=none TEST=manual make runtests, make all boards, test on Link and Falco. Change-Id: Ib63f2d1518fcc2ee367f81bf5d803360c1aa5c76 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175151
Diffstat (limited to 'include/fan.h')
-rw-r--r--include/fan.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/fan.h b/include/fan.h
index 781bfc9951..4c41f2c175 100644
--- a/include/fan.h
+++ b/include/fan.h
@@ -8,13 +8,33 @@
#ifndef __CROS_EC_FAN_H
#define __CROS_EC_FAN_H
+/* Characteristic of each physical fan */
+struct fan_t {
+ unsigned int flags;
+ int rpm_min;
+ int rpm_max;
+ /* Hardware channel number (the meaning is chip-specific) */
+ int ch;
+ /* Active-high power_good input GPIO, or -1 if none */
+ int pgood_gpio;
+ /* Active-high power_enable output GPIO, or -1 if none */
+ int enable_gpio;
+};
+
+/* Values for the flags field */
+#define FAN_USE_RPM_MODE (1 << 0)
+
+/* The list of fans is instantiated in board.c. */
+extern const struct fan_t fans[];
+
+
/**
* Set the amount of active cooling needed. The thermal control task will call
* this frequently, and the fan control logic will attempt to provide it.
*
* @param pct Percentage of cooling effort needed (0 - 100)
*/
-void fan_set_percent_needed(int pct);
+void fan_set_percent_needed(int pct); /* HEY: need fan arg */
/**
* This function translates the percentage of cooling needed into a target RPM.
@@ -24,7 +44,7 @@ void fan_set_percent_needed(int pct);
* @param pct Percentage of cooling effort needed (always in [0,100])
* Return Target RPM for fan
*/
-int fan_percent_to_rpm(int pct);
+int fan_percent_to_rpm(int pct); /* HEY: need fan arg */
/**