diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 22 | ||||
-rw-r--r-- | include/fan.h | 24 | ||||
-rw-r--r-- | include/pwm.h | 3 |
3 files changed, 27 insertions, 22 deletions
diff --git a/include/config.h b/include/config.h index 1d7758d7e1..05f085f180 100644 --- a/include/config.h +++ b/include/config.h @@ -332,27 +332,9 @@ /* Number of cooling fans. Undef if none. */ #undef CONFIG_FANS -/* Fan channel (not PWM channel) for the CPU fan */ -#undef CONFIG_FAN_CH_CPU - -/* Name of active high GPIO to control power to the cooling fan */ -#undef CONFIG_FAN_EN_GPIO - -/* - * GPIO which indicates power-good on the fan power rail. If defined, the - * faninfo console command will display the fan power state. - */ -#undef CONFIG_FAN_PGOOD_GPIO - -/* Fan speeds corresponding to 1% and 100% cooling (0% == off). */ -#undef CONFIG_FAN_RPM_MIN -#undef CONFIG_FAN_RPM_MAX - /* - * Replace the default fan mapping with a board-specific function in board.c: - * - * int fan_percent_to_rpm(int pct); - * + * Replace the default fan_percent_to_rpm() function with a board-specific + * implementation in board.c */ #undef CONFIG_FAN_RPM_CUSTOM 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 */ /** diff --git a/include/pwm.h b/include/pwm.h index cb0f961713..c4ae331b1c 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -6,6 +6,9 @@ #ifndef __CROS_EC_PWM_H #define __CROS_EC_PWM_H +/* The values are defined in board.h */ +enum pwm_channel; + /** * Enable/disable a PWM channel. */ |