diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2021-03-02 14:46:32 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-08 17:31:52 +0000 |
commit | cfbbbb93b44799c61f5591b9658d650136ab5ac4 (patch) | |
tree | 40c0a2598c3c8b46f3fb187812d399e5fa3fc2a6 /zephyr/Kconfig.temperature | |
parent | 1a7ba0f3822829ad69d860ee41bb4ae756c4756d (diff) | |
download | chrome-ec-cfbbbb93b44799c61f5591b9658d650136ab5ac4.tar.gz |
zephyr: add shim fan
Add fan support to Zephyr. The fan is controlled with PWM and the fan
speed is measured with the tachometer. Fan properties are defied in the
dts file. The struct fan_t fans[] array and enum fan_channel are
generated automatically according to named-fans node in the device tree.
The implementation is based on the npxc driver, but it is
platform-independent. It assumes that there are PWM channel to control
the fan and the tachometer sensor to measure RPM (in RPM mode). If it is
not the case in the future, the shim may be split per chip.
Enable fan related console commands - fanduty, fanset, faninfo, fanauto
and host commands - EC_CMD_PWM_GET_FAN_TARGET_RPM,
EC_CMD_PWM_SET_FAN_TARGET_RPM, EC_CMD_PWM_SET_FAN_DUTY,
EC_CMD_THERMAL_AUTO_FAN_CTRL.
BUG=b:174851463
BRANCH=none
TEST=build Zephyr
TEST=Run "fanset"/"fanduty" commands and check with "faninfo" if the fan
follows the command. Then run "fanauto" and verify that the fan controls
the temperature correctly.
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I52255848e271fb5b204cd1eb8a797e2fbc81130d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2729375
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.temperature')
-rw-r--r-- | zephyr/Kconfig.temperature | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/zephyr/Kconfig.temperature b/zephyr/Kconfig.temperature index d949c60c84..3aa6e17509 100644 --- a/zephyr/Kconfig.temperature +++ b/zephyr/Kconfig.temperature @@ -66,3 +66,15 @@ config PLATFORM_EC_STEINHART_HART_3V3_51K1_47K_4050B -47 kilohm thermistor reference resistance at 25 C -4050 B-constant (thermistor sensitivity) endif # PLATFORM_EC_TEMP_SENSOR + +config PLATFORM_EC_FAN + bool "Fan support" + depends on PLATFORM_EC_PWM + help + Enables support for fans. Allows periodic thermal task to + automatically set the fan speed (control temperature). + Once enabled fanduty, fanset, faninfo, fanauto consol command and + EC_CMD_PWM_GET_FAN_TARGET_RPM, EC_CMD_PWM_SET_FAN_TARGET_RPM, + EC_CMD_PWM_SET_FAN_DUTY, EC_CMD_THERMAL_AUTO_FAN_CTRL are + available. Also enables a periodic task (1s) to verify fan is + running (is not stalled). |