diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-10-30 10:38:31 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-30 23:10:10 +0000 |
commit | e48a9d9c2143695cdd7a35ab06d6a6d5820efd9b (patch) | |
tree | e7a3a92ac80fadf61dd1b7df16e62c9f48fcd9c0 /board/peppy | |
parent | 034e96c128d0e1ee7c100c47456c2159a133288c (diff) | |
download | chrome-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 'board/peppy')
-rw-r--r-- | board/peppy/board.c | 17 | ||||
-rw-r--r-- | board/peppy/board.h | 13 |
2 files changed, 11 insertions, 19 deletions
diff --git a/board/peppy/board.c b/board/peppy/board.c index 6e3db562a6..e6205e521b 100644 --- a/board/peppy/board.c +++ b/board/peppy/board.c @@ -12,6 +12,7 @@ #include "common.h" #include "driver/temp_sensor/g781.h" #include "extpower.h" +#include "fan.h" #include "gpio.h" #include "host_command.h" #include "i2c.h" @@ -20,8 +21,6 @@ #include "lid_switch.h" #include "peci.h" #include "power_button.h" -#include "pwm.h" -#include "pwm_chip.h" #include "registers.h" #include "switch.h" #include "temp_sensor.h" @@ -183,11 +182,17 @@ const struct adc_t adc_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); -/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ -const struct pwm_t pwm_channels[] = { - {CONFIG_FAN_CH_CPU, PWM_CONFIG_HAS_RPM_MODE}, +/* Physical fans. These are logically separate from pwm_channels. */ +const struct fan_t fans[] = { + {.flags = FAN_USE_RPM_MODE, + .rpm_min = 1000, + .rpm_max = 5050, + .ch = 2, + .pgood_gpio = GPIO_PP5000_PGOOD, + .enable_gpio = GPIO_PP5000_FAN_EN, + }, }; -BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); +BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { diff --git a/board/peppy/board.h b/board/peppy/board.h index 4ccc7ba465..61b79b320d 100644 --- a/board/peppy/board.h +++ b/board/peppy/board.h @@ -23,18 +23,12 @@ #define CONFIG_CMD_GSV #define CONFIG_EXTPOWER_GPIO #define CONFIG_FANS 1 -#define CONFIG_FAN_CH_CPU 2 -#define CONFIG_FAN_EN_GPIO GPIO_PP5000_FAN_EN -#define CONFIG_FAN_PGOOD_GPIO GPIO_PP5000_PGOOD -#define CONFIG_FAN_RPM_MIN 1000 -#define CONFIG_FAN_RPM_MAX 5050 #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_PROTOCOL_8042 #define CONFIG_LED_COMMON #define CONFIG_LOW_POWER_IDLE #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 -#define CONFIG_PWM #define CONFIG_SWITCH_DEDICATED_RECOVERY #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_G781 @@ -170,13 +164,6 @@ enum adc_channel { ADC_CH_COUNT }; -enum pwm_channel { - PWM_CH_FAN, - - /* Number of PWM channels */ - PWM_CH_COUNT -}; - enum temp_sensor_id { /* CPU die temperature via PECI */ TEMP_SENSOR_CPU_PECI = 0, |