Skip to contentSkip to conversation

thermal: max77620: Add DT binding doc for thermal driver

PATCH In review Laxman Dewangan 1 participant 3 messages Aug 23, 2016 – Sep 1, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/2 thermal: max77620: Add DT binding doc for thermal driver

Maxim Semiconductor MAX77620 supports alarm interrupts when its die temperature crosses 120C and 140C. These threshold temperatures are not configurable.

Add DT binding document to details out the DT property related to MAX77620 thermal functionality.

---
Changes from V4:
- Rename the file to max77620_thermal.txt
- Collected ack from Rob.

---
 .../bindings/thermal/max77620_thermal.txt          | 70 ++++++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/max77620_thermal.txt
Documentation/devicetree/bindings/thermal/max77620_thermal.txt new file +70 -0
new file mode 100644
index 0000000..323a3b3
@@ -0,0 +1,70 @@
+Thermal driver for MAX77620 Power management IC from Maxim Semiconductor.
+
+Maxim Semiconductor MAX77620 supports alarm interrupts when its
+die temperature crosses 120C and 140C. These threshold temperatures
+are not configurable. Device does not provide the real temperature
+of die other than just indicating whether temperature is above or
+below threshold level.
+
+Required properties:
+-------------------
+#thermal-sensor-cells:	Please refer <devicetree/bindings/thermal/thermal.txt>
+			for more details.
+			The value must be 0.
+
+For more details, please refer generic thermal DT binding document
+<devicetree/bindings/thermal/thermal.txt>.
+
+Please refer <devicetree/bindings/mfd/max77620.txt> for mfd DT binding
+document for the MAX77620.
+
+Example:
+--------
+#include <dt-bindings/mfd/max77620.h>
+#include <dt-bindings/thermal/thermal.h>
+...
+
+i2c@7000d000 {
+	spmic: max77620@3c {
+		compatible = "maxim,max77620";
+		:::::
+		#thermal-sensor-cells = <0>;
+		:::
+	};
+};
+
+cool_dev: cool-dev {
+	compatible = "cooling-dev";
+	#cooling-cells = <2>;
+};
+
+thermal-zones {
+	PMIC-Die {
+		polling-delay = <0>;
+		polling-delay-passive = <0>;
+		thermal-sensors = <&spmic>;
+
+		trips {
+			pmic_die_warn_temp_thresh: hot-die {
+				temperature = <120000>;
+				type = "hot";
+				hysteresis = <0>;
+			};
+
+			pmic_die_cirt_temp_thresh: cirtical-die {
+				temperature = <140000>;
+				type = "critical";
+				hysteresis = <0>;
+			};
+		};
+
+		cooling-maps {
+			map0 {
+				trip = <&pmic_die_warn_temp_thresh>;
+				cooling-device = <&cool_dev THERMAL_NO_LIMIT
+						  THERMAL_NO_LIMIT>;
+				contribution = <100>;
+			};
+		};
+	};
+};
Signature · 1 line
2.1.4
#1 lore raw

PATCH v6 2/2 thermal: max77620: Add thermal driver for reporting junction temp

Maxim Semiconductor Max77620 supports alarm interrupts when its die temperature crosses 120C and 140C. These threshold temperatures are not configurable.

Add thermal driver to register PMIC die temperature as thermal zone sensor and capture the die temperature warning interrupts to notifying the client.

---
The patch was sent earlier but dependent mfd header file was not available on tree and hence it was not applied.
The mfd patches are in rc-4.7 and hence resending again this patch.

Changes from V3:
- Added comment on the function get_temp() that absolute temp can not be available.

Changes from V4:
- Rename the file thermal-max77620 to max77620_thermal.c

Changes from V5:
- Allocate memory before using it. It was by mistake on V5 due to moving line.

---
 drivers/thermal/Kconfig            |  10 +++
 drivers/thermal/Makefile           |   1 +
 drivers/thermal/max77620_thermal.c | 165 +++++++++++++++++++++++++++++++++++++
 3 files changed, 176 insertions(+)
 create mode 100644 drivers/thermal/max77620_thermal.c
drivers/thermal/Kconfig +10 -0
index 5cba072..626c465 100644
@@ -196,6 +196,16 @@ config IMX_THERMAL
 	  cpufreq is used as the cooling device to throttle CPUs when the
 	  passive trip is crossed.
 
+config MAX77620_THERMAL
+	tristate "Temperature sensor driver for Maxim MAX77620 PMIC"
+	depends on MFD_MAX77620
+	depends on OF
+	help
+	  Support for die junction temperature warning alarm for Maxim
+	  Semiconductor PMIC MAX77620 device. Device generates two alarm
+	  interrupts when PMIC die temperature cross the threshold of
+	  120 degC and 140 degC.
+
 config QORIQ_THERMAL
 	tristate "QorIQ Thermal Monitoring Unit"
 	depends on THERMAL_OF
drivers/thermal/Makefile +1 -0
index d091134..dac6d4f 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_DB8500_THERMAL)	+= db8500_thermal.o
 obj-$(CONFIG_ARMADA_THERMAL)	+= armada_thermal.o
 obj-$(CONFIG_TANGO_THERMAL)	+= tango_thermal.o
 obj-$(CONFIG_IMX_THERMAL)	+= imx_thermal.o
+obj-$(CONFIG_MAX77620_THERMAL)	+= max77620_thermal.o
 obj-$(CONFIG_QORIQ_THERMAL)	+= qoriq_thermal.o
 obj-$(CONFIG_DB8500_CPUFREQ_COOLING)	+= db8500_cpufreq_cooling.o
 obj-$(CONFIG_INTEL_POWERCLAMP)	+= intel_powerclamp.o
drivers/thermal/max77620_thermal.c new file +165 -0

165 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw
In reply to Laxman Dewangan

Hi Zhang,

Quoted 10 lines · Laxman Dewangan

Maxim Semiconductor MAX77620 supports alarm interrupts when its die temperature crosses 120C and 140C. These threshold temperatures are not configurable.

Add DT binding document to details out the DT property related to MAX77620 thermal functionality.

Are you queuing thermal patches? If yes then please consider this also if it is fine.

Thanks,
Laxman
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html