summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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";
+};