[source] ipq806x: tsens: convert degrees to millicelsius

LEDE Commits lede-commits at lists.infradead.org
Sun Mar 26 23:34:40 PDT 2017


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/9ac4c1dcee7ba101233ac03437382e0831b74577

commit 9ac4c1dcee7ba101233ac03437382e0831b74577
Author: Pavel Kubelun <be.dissent at gmail.com>
AuthorDate: Fri Mar 24 16:12:40 2017 +0300

    ipq806x: tsens: convert degrees to millicelsius
    
    Current driver shows temp in full degrees while other apps await it
    to be in millidegrees.
    
    Initially the driver represents termal data in millidegrees but then
    it gets divided by TSENS_FACTOR. So lets just set it to '1'.
    
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
---
 .../files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi  | 154 ++++++++++-----------
 .../patches-4.9/0063-1-ipq806x-tsens-driver.patch  |   4 +-
 2 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
index dd55754..2c7ba5a 100644
--- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -85,26 +85,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -117,26 +117,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -149,26 +149,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -181,26 +181,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -213,26 +213,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -245,26 +245,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -277,26 +277,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -309,26 +309,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -341,26 +341,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -373,26 +373,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
@@ -405,26 +405,26 @@
 
 			trips {
 				cpu-critical-hi {
-					temperature = <125>;
-					hysteresis = <2>;
+					temperature = <125000>;
+					hysteresis = <2000>;
 					type = "critical_high";
 				};
 
 				cpu-config-hi {
-					temperature = <105>;
-					hysteresis = <2>;
+					temperature = <105000>;
+					hysteresis = <2000>;
 					type = "configurable_hi";
 				};
 
 				cpu-config-lo {
-					temperature = <95>;
-					hysteresis = <2>;
+					temperature = <95000>;
+					hysteresis = <2000>;
 					type = "configurable_lo";
 				};
 
 				cpu-critical-low {
 					temperature = <0>;
-					hysteresis = <2>;
+					hysteresis = <2000>;
 					type = "critical_low";
 				};
 			};
diff --git a/target/linux/ipq806x/patches-4.9/0063-1-ipq806x-tsens-driver.patch b/target/linux/ipq806x/patches-4.9/0063-1-ipq806x-tsens-driver.patch
index d8205c1..691f32c 100644
--- a/target/linux/ipq806x/patches-4.9/0063-1-ipq806x-tsens-driver.patch
+++ b/target/linux/ipq806x/patches-4.9/0063-1-ipq806x-tsens-driver.patch
@@ -109,7 +109,7 @@ index 0000000..c52888f
 +
 +#define THRESHOLD_ADDR		0x3624
 +/* THRESHOLD_ADDR bitmasks */
-+#define THRESHOLD_MAX_CODE		0xff
++#define THRESHOLD_MAX_CODE		0x20000
 +#define THRESHOLD_MIN_CODE		0
 +#define THRESHOLD_MAX_LIMIT_SHIFT	24
 +#define THRESHOLD_MIN_LIMIT_SHIFT	16
@@ -163,7 +163,7 @@ index 0000000..c52888f
 +
 +#define TSENS_8064_SEQ_SENSORS	5
 +#define TSENS_8064_S4_S5_OFFSET	40
-+#define TSENS_FACTOR		1000
++#define TSENS_FACTOR		1
 +
 +/* Trips: from very hot to very cold */
 +enum tsens_trip_type {



More information about the lede-commits mailing list