summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/npcx/fan.c3
-rw-r--r--include/config.h9
-rw-r--r--zephyr/Kconfig.temperature9
-rw-r--r--zephyr/shim/include/config_chip.h5
4 files changed, 25 insertions, 1 deletions
diff --git a/chip/npcx/fan.c b/chip/npcx/fan.c
index bb99c24afd..512705b74b 100644
--- a/chip/npcx/fan.c
+++ b/chip/npcx/fan.c
@@ -299,7 +299,8 @@ enum fan_status fan_smart_control(int ch, int rpm_actual, int rpm_target)
* In this case, don't step the PWM duty too aggressively.
* See b:225208265 for more detail.
*/
- if (rpm_pre[ch] == 0 && rpm_actual == 0) {
+ if (rpm_pre[ch] == 0 && rpm_actual == 0 &&
+ IS_ENABLED(CONFIG_FAN_BYPASS_SLOW_RESPONSE)) {
rpm_diff = RPM_MARGIN(rpm_target) + 1;
} else {
rpm_diff = rpm_target - rpm_actual;
diff --git a/include/config.h b/include/config.h
index 67a3374933..a27c13b12a 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1999,6 +1999,15 @@
*/
#undef CONFIG_FAN_UPDATE_PERIOD
+/*
+ * Enable fan slow response control mechanism.
+ * A specific type of fan needs a longer time to output the TACH
+ * signal to EC after EC outputs the PWM signal to the fan.
+ * During this period, the driver will read two consecutive RPM = 0.
+ * In this case, don't step the PWM duty too aggressively
+ */
+#undef CONFIG_FAN_BYPASS_SLOW_RESPONSE
+
/*****************************************************************************/
/* Flash configuration */
diff --git a/zephyr/Kconfig.temperature b/zephyr/Kconfig.temperature
index bf15a72525..d648caaf59 100644
--- a/zephyr/Kconfig.temperature
+++ b/zephyr/Kconfig.temperature
@@ -100,3 +100,12 @@ config PLATFORM_EC_NUM_FANS
for control through fan APIs.
endif # PLATFORM_EC_FAN
+
+config PLATFORM_EC_FAN_BYPASS_SLOW_RESPONSE
+ bool "Enable fan slow response control mechanism"
+ default n
+ help
+ A specific type of fan needs a longer time to output the TACH
+ signal to EC after EC outputs the PWM signal to the fan.
+ During this period, the driver will read two consecutive RPM = 0.
+ In this case, don't step the PWM duty too aggressively.
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 702c9f3ee0..feba8177af 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -610,6 +610,11 @@ extern struct jump_data mock_jump_data;
#define CONFIG_FANS CONFIG_PLATFORM_EC_NUM_FANS
#endif
+#undef CONFIG_FAN_BYPASS_SLOW_RESPONSE
+#ifdef PLATFORM_EC_FAN_BYPASS_SLOW_RESPONSE
+#define CONFIG_FAN_BYPASS_SLOW_RESPONSE
+#endif
+
#ifdef CONFIG_PLATFORM_EC_I2C
/* Also see shim/include/i2c/i2c.h which defines the ports enum */
#define CONFIG_I2C_CONTROLLER