thermal: max77620: Add DT binding doc for thermal driver
Subsystems (2)
PATCH v5 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
@@ -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 · 6 lines
2.1.4 -- 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
PATCH v5 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
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
@@ -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
@@ -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 · 6 lines
2.1.4 -- 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
kbuild test robot
build botRe: [PATCH V5 2/2] thermal: max77620: Add thermal driver for reporting junction temp
reproduce:
Hi Laxman,
[auto build test WARNING on thermal/next]
[also build test WARNING on next-20160823]
[cannot apply to v4.8-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Laxman-Dewangan/thermal-max77620-Add-DT-binding-doc-for-thermal-driver/20160823-151342 base: https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git next config: x86_64-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/thermal/max77620_thermal.c: In function 'max77620_thermal_probe':
>> drivers/thermal/max77620_thermal.c:95:5: warning: 'mtherm' is used uninitialized in this function [-Wuninitialized]
if (!mtherm)
^vim +/mtherm +95 drivers/thermal/max77620_thermal.c
79
80 if (irq == mtherm->irq_tjalarm1)
81 dev_warn(mtherm->dev, "Junction Temp Alarm1(120C) occurred\n");
82 else if (irq == mtherm->irq_tjalarm2)
83 dev_crit(mtherm->dev, "Junction Temp Alarm2(140C) occurred\n");
84
85 thermal_zone_device_update(mtherm->tz_device);
86
87 return IRQ_HANDLED;
88 }
89
90 static int max77620_thermal_probe(struct platform_device *pdev)
91 {
92 struct max77620_therm_info *mtherm;
93 int ret;
94
> 95 if (!mtherm)
96 return -ENOMEM;
97
98 mtherm->irq_tjalarm1 = platform_get_irq(pdev, 0);
99 mtherm->irq_tjalarm2 = platform_get_irq(pdev, 1); 100 if ((mtherm->irq_tjalarm1 < 0) || (mtherm->irq_tjalarm2 < 0)) {
101 dev_err(&pdev->dev, "Alarm irq number not available\n");
102 return -EINVAL;
103 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation