summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-07-09 14:07:17 -0600
committerCommit Bot <commit-bot@chromium.org>2021-07-10 17:36:32 +0000
commit70450d035a077efc0b2d33a29f33a186ed6cf830 (patch)
treea8f6a22392dc44d6c50dbd1ed95a022f1dc3f36a /zephyr
parent8e26cd5144b2f7bad3c374b36bd5b2f0c4b0ae4f (diff)
downloadchrome-ec-70450d035a077efc0b2d33a29f33a186ed6cf830.tar.gz
zephyr: Add CONFIG_PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY_MS
Create Kconfig options to set the CONFIG_PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY_MS delay. BUG=b:193195946 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I13ab0d35c4b39d472bfb3274744ccd969d3fbfad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015865 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/Kconfig.temperature19
-rw-r--r--zephyr/shim/include/config_chip.h6
2 files changed, 25 insertions, 0 deletions
diff --git a/zephyr/Kconfig.temperature b/zephyr/Kconfig.temperature
index 19ce5e3146..c103e1a561 100644
--- a/zephyr/Kconfig.temperature
+++ b/zephyr/Kconfig.temperature
@@ -81,6 +81,25 @@ config PLATFORM_EC_STEINHART_HART_3V3_51K1_47K_4050B
-4050 B-constant (thermistor sensitivity)
endif # PLATFORM_EC_TEMP_SENSOR
+
+config PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY
+ bool "Enable a delay before reading temperature seensors"
+ help
+ Enables a delay on the first read of temperature sensors after
+ the EC powers on. This allows for setting of any power rails that
+ control the temperature sensors on the platform.
+
+if PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY
+
+config PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY_MS
+ int "Temperature sensor read delay time"
+ default 500
+ help
+ Sets the delay time, in milliseconds, before the first the EC will
+ read any temperature sensors and perform any thermal management.
+
+endif # PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY
+
config PLATFORM_EC_FAN
bool "Fan support"
depends on PLATFORM_EC_PWM
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 81f822f966..5a7419599d 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -1692,4 +1692,10 @@
#define CONSOLE_CMD_MFALLOW
#endif
+#undef CONFIG_TEMP_SENSOR_FIRST_READ_DELAY_MS
+#ifdef CONFIG_PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY
+#define CONFIG_TEMP_SENSOR_FIRST_READ_DELAY_MS \
+ CONFIG_PLATFORM_EC_TEMP_SENSOR_FIRST_READ_DELAY_MS
+#endif
+
#endif /* __CROS_EC_CONFIG_CHIP_H */