summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangganxiang <wangganxiang@huaqin.corp-partner.google.com>2023-05-12 14:26:41 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-16 08:08:26 +0000
commitc1f50b036ae55fb0aa7e070f3e731e066eb09cf8 (patch)
tree9da6e03b4f9e8b72903acf942d82b367a973a04a
parentc1a1532a2ba081c7da1e430ee6b4798fd99cc63e (diff)
downloadchrome-ec-c1f50b036ae55fb0aa7e070f3e731e066eb09cf8.tar.gz
starmie: Config the thermal sensor setting
Add thermistor 1V9-100K-100K-4250B for ambient temperature. BUG=b:277309876 TEST=zmake build starmie Use ectool temps all to check can read thermistor temperature. Change-Id: Ia0786b2495f2b4f0d6d29d74cf176b9f61cff01a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4525658 Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
-rw-r--r--zephyr/include/cros/thermistor/thermistor.dtsi81
-rw-r--r--zephyr/program/corsola/starmie/project.overlay43
2 files changed, 124 insertions, 0 deletions
diff --git a/zephyr/include/cros/thermistor/thermistor.dtsi b/zephyr/include/cros/thermistor/thermistor.dtsi
index fb86c4f79a..42eb07f483 100644
--- a/zephyr/include/cros/thermistor/thermistor.dtsi
+++ b/zephyr/include/cros/thermistor/thermistor.dtsi
@@ -386,4 +386,85 @@
sample-index = <12>;
};
};
+
+ /omit-if-no-ref/ thermistor_1V8_100K_100K_4250B:
+ thermistor-1V9-100K-100K-4250B {
+ status = "disabled";
+ compatible = "cros-ec,thermistor";
+ scaling-factor = <7>;
+ num-pairs = <13>;
+ steinhart-reference-mv = <1800>;
+ steinhart-reference-res = <100000>;
+
+ /*
+ * Data derived from Steinhart-Hart equation in a resistor
+ * divider circuit with Vdd=1800mV, R = 100Kohm, and thermistor
+ * (B = 4250, T0 = 357 K, nominal resistance (R0) = 100Kohm).
+ */
+ sample-datum-0 {
+ milivolt = <(1406 / 7)>;
+ temp = <0>;
+ sample-index = <0>;
+ };
+ sample-datum-1 {
+ milivolt = <(1219 / 7)>;
+ temp = <10>;
+ sample-index = <1>;
+ };
+ sample-datum-2 {
+ milivolt = <(1007 / 7)>;
+ temp = <20>;
+ sample-index = <2>;
+ };
+ sample-datum-3 {
+ milivolt = <(796 / 7)>;
+ temp = <30>;
+ sample-index = <3>;
+ };
+ sample-datum-4 {
+ milivolt = <(606 / 7)>;
+ temp = <40>;
+ sample-index = <4>;
+ };
+ sample-datum-5 {
+ milivolt = <( 449 / 7)>;
+ temp = <50>;
+ sample-index = <5>;
+ };
+ sample-datum-6 {
+ milivolt = <( 327 / 7)>;
+ temp = <60>;
+ sample-index = <6>;
+ };
+ sample-datum-7 {
+ milivolt = <( 237 / 7)>;
+ temp = <70>;
+ sample-index = <7>;
+ };
+ sample-datum-8 {
+ milivolt = <( 172 / 7)>;
+ temp = <80>;
+ sample-index = <8>;
+ };
+ sample-datum-9 {
+ milivolt = <( 147 / 7)>;
+ temp = <85>;
+ sample-index = <9>;
+ };
+ sample-datum-10 {
+ milivolt = <( 125 / 7)>;
+ temp = <90>;
+ sample-index = <10>;
+ };
+ sample-datum-11 {
+ milivolt = <( 107 / 7)>;
+ temp = <95>;
+ sample-index = <11>;
+ };
+ sample-datum-12 {
+ milivolt = <( 92 / 7)>;
+ temp = <100>;
+ sample-index = <12>;
+ };
+ };
};
diff --git a/zephyr/program/corsola/starmie/project.overlay b/zephyr/program/corsola/starmie/project.overlay
index a4d69867a5..de79d92cdb 100644
--- a/zephyr/program/corsola/starmie/project.overlay
+++ b/zephyr/program/corsola/starmie/project.overlay
@@ -222,6 +222,39 @@
power-gpio-pin = <&pmic_ec_resetb>;
};
};
+
+ named-adc-channels {
+ adc_temp_sensor_1: adc-temp-sensor-1 {
+ enum-name = "ADC_TEMP_SENSOR_1";
+ io-channels = <&adc0 6>;
+ };
+ adc_temp_sensor_2: adc-temp-sensor-2 {
+ enum-name = "ADC_TEMP_SENSOR_2";
+ io-channels = <&adc0 7>;
+ };
+ };
+
+ temp_sensor_1_thermistor: sensor-1-thermistor {
+ compatible = "cros-ec,temp-sensor-thermistor";
+ thermistor = <&thermistor_1V8_100K_100K_4250B>;
+ adc = <&adc_temp_sensor_1>;
+ };
+
+ temp_sensor_2_thermistor: sensor-2-thermistor {
+ compatible = "cros-ec,temp-sensor-thermistor";
+ thermistor = <&thermistor_1V8_100K_100K_4250B>;
+ adc = <&adc_temp_sensor_2>;
+ };
+
+ named-temp-sensors {
+ compatible = "cros-ec,temp-sensors";
+ temp_sensor_1 {
+ sensor = <&temp_sensor_1_thermistor>;
+ };
+ temp_sensor_2 {
+ sensor = <&temp_sensor_2_thermistor>;
+ };
+ };
};
&i2c0{
@@ -236,3 +269,13 @@
reg = <0x10>;
};
};
+
+&adc0{
+ status = "okay";
+ pinctrl-0 = <&adc0_ch6_gpi6_default>;
+ pinctrl-names = "default";
+};
+
+&thermistor_1V8_100K_100K_4250B{
+ status = "okay";
+};