Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9b42eeb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull thermal management updates from Zhang Rui:
 "We have a lot of SOC changes and a few thermal core fixes this time.

  The biggest change is about exynos thermal driver restructure.  The
  patch set adds TMU (Thermal management Unit) driver support for
  exynos5440 platform.  There are 3 instances of the TMU controllers so
  necessary cleanup/re-structure is done to handle multiple thermal
  zone.

  The next biggest change is the introduction of the imx thermal driver.
  It adds the imx thermal support using Temperature Monitor (TEMPMON)
  block found on some Freescale i.MX SoCs.  The driver uses syscon
  regmap interface to access TEMPMON control registers and calibration
  data, and supports cpufreq as the cooling device.

  Highlights:

   - restructure exynos thermal driver.

   - introduce new imx thermal driver.

   - fix a bug in thermal core, which powers on the fans unexpectedly
     after resume from suspend"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (46 commits)
  drivers: thermal: add check when unregistering cpu cooling
  thermal: thermal_core: allow binding with limits on bind_params
  drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional
  drivers: thermal: parent virtual hwmon with thermal zone
  thermal: hwmon: move hwmon support to single file
  thermal: exynos: Clean up non-DT remnants
  thermal: exynos: Fix potential NULL pointer dereference
  thermal: exynos: Fix typos in Kconfig
  thermal: ti-soc-thermal: Ensure to compute thermal trend
  thermal: ti-soc-thermal: Set the bandgap mask counter delay value
  thermal: ti-soc-thermal: Initialize counter_delay field for TI DRA752 sensors
  thermal: step_wise: return instance->target by default
  thermal: step_wise: cdev only needs update on a new target state
  Thermal/cpu_cooling: Return directly for the cpu out of allowed_cpus in the cpufreq_thermal_notifier()
  thermal: exynos_tmu: fix wrong error check for mapped memory
  thermal: imx: implement thermal alarm interrupt handling
  thermal: imx: dynamic passive and SoC specific critical trip points
  Documentation: thermal: Explain the exynos thermal driver model
  ARM: dts: thermal: exynos: Add documentation for Exynos SoC thermal bindings
  thermal: exynos: Support for TMU regulator defined at device tree
  ...
parents 7b7a2f0a 50e66c7e
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
* Exynos Thermal Management Unit (TMU)

** Required properties:

- compatible : One of the following:
	       "samsung,exynos4412-tmu"
	       "samsung,exynos4210-tmu"
	       "samsung,exynos5250-tmu"
	       "samsung,exynos5440-tmu"
- interrupt-parent : The phandle for the interrupt controller
- reg : Address range of the thermal registers. For soc's which has multiple
	instances of TMU and some registers are shared across all TMU's like
	interrupt related then 2 set of register has to supplied. First set
	belongs	to each instance of TMU and second set belongs to common TMU
	registers.
- interrupts : Should contain interrupt for thermal system
- clocks : The main clock for TMU device
- clock-names : Thermal system clock name
- vtmu-supply: This entry is optional and provides the regulator node supplying
		voltage to TMU. If needed this entry can be placed inside
		board/platform specific dts file.

Example 1):

	tmu@100C0000 {
		compatible = "samsung,exynos4412-tmu";
		interrupt-parent = <&combiner>;
		reg = <0x100C0000 0x100>;
		interrupts = <2 4>;
		clocks = <&clock 383>;
		clock-names = "tmu_apbif";
		status = "disabled";
		vtmu-supply = <&tmu_regulator_node>;
	};

Example 2):

	tmuctrl_0: tmuctrl@160118 {
		compatible = "samsung,exynos5440-tmu";
		reg = <0x160118 0x230>, <0x160368 0x10>;
		interrupts = <0 58 0>;
		clocks = <&clock 21>;
		clock-names = "tmu_apbif";
	};

Note: For multi-instance tmu each instance should have an alias correctly
numbered in "aliases" node.

Example:

aliases {
	tmuctrl0 = &tmuctrl_0;
	tmuctrl1 = &tmuctrl_1;
	tmuctrl2 = &tmuctrl_2;
};
+17 −0
Original line number Diff line number Diff line
* Temperature Monitor (TEMPMON) on Freescale i.MX SoCs

Required properties:
- compatible : "fsl,imx6q-thermal"
- fsl,tempmon : phandle pointer to system controller that contains TEMPMON
  control registers, e.g. ANATOP on imx6q.
- fsl,tempmon-data : phandle pointer to fuse controller that contains TEMPMON
  calibration data, e.g. OCOTP on imx6q.  The details about calibration data
  can be found in SoC Reference Manual.

Example:

tempmon {
	compatible = "fsl,imx6q-tempmon";
	fsl,tempmon = <&anatop>;
	fsl,tempmon-data = <&ocotp>;
};
+34 −9
Original line number Diff line number Diff line
Kernel driver exynos4_tmu
Kernel driver exynos_tmu
=================

Supported chips:
* ARM SAMSUNG EXYNOS4 series of SoC
  Prefix: 'exynos4-tmu'
* ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
  Datasheet: Not publicly available

Authors: Donggeun Kim <dg77.kim@samsung.com>
Authors: Amit Daniel <amit.daniel@samsung.com>

Description
-----------
TMU controller Description:
---------------------------

This driver allows to read temperature inside SAMSUNG EXYNOS4 series of SoC.
This driver allows to read temperature inside SAMSUNG EXYNOS4/5 series of SoC.

The chip only exposes the measured 8-bit temperature code value
through a register.
@@ -34,9 +34,9 @@ The three equations are:
  TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO register)
       Temperature code measured at 85 degree Celsius which is unchanged

TMU(Thermal Management Unit) in EXYNOS4 generates interrupt
TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
when temperature exceeds pre-defined levels.
The maximum number of configurable threshold is four.
The maximum number of configurable threshold is five.
The threshold levels are defined as follows:
  Level_0: current temperature > trigger_level_0 + threshold
  Level_1: current temperature > trigger_level_1 + threshold
@@ -47,6 +47,31 @@ The threshold levels are defined as follows:
  through the corresponding registers.

When an interrupt occurs, this driver notify kernel thermal framework
with the function exynos4_report_trigger.
with the function exynos_report_trigger.
Although an interrupt condition for level_0 can be set,
it can be used to synchronize the cooling action.

TMU driver description:
-----------------------

The exynos thermal driver is structured as,

					Kernel Core thermal framework
				(thermal_core.c, step_wise.c, cpu_cooling.c)
								^
								|
								|
TMU configuration data -------> TMU Driver  <------> Exynos Core thermal wrapper
(exynos_tmu_data.c)	      (exynos_tmu.c)	   (exynos_thermal_common.c)
(exynos_tmu_data.h)	      (exynos_tmu.h)	   (exynos_thermal_common.h)

a) TMU configuration data: This consist of TMU register offsets/bitfields
		described through structure exynos_tmu_registers. Also several
		other platform data (struct exynos_tmu_platform_data) members
		are used to configure the TMU.
b) TMU driver: This component initialises the TMU controller and sets different
		thresholds. It invokes core thermal implementation with the call
		exynos_report_trigger.
c) Exynos Core thermal wrapper: This provides 3 wrapper function to use the
		Kernel core thermal framework. They are exynos_unregister_thermal,
		exynos_register_thermal and exynos_report_trigger.
+12 −0
Original line number Diff line number Diff line
@@ -134,6 +134,13 @@ temperature) and throttle appropriate devices.
               this thermal zone and cdev, for a particular trip point.
               If nth bit is set, then the cdev and thermal zone are bound
               for trip point n.
    .limits: This is an array of cooling state limits. Must have exactly
         2 * thermal_zone.number_of_trip_points. It is an array consisting
         of tuples <lower-state upper-state> of state limits. Each trip
         will be associated with one state limit tuple when binding.
         A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
         on all trips. These limits are used when binding a cdev to a
         trip point.
    .match: This call back returns success(0) if the 'tz and cdev' need to
	    be bound, as per platform data.
1.4.2 struct thermal_zone_params
@@ -142,6 +149,11 @@ temperature) and throttle appropriate devices.
    This is an optional feature where some platforms can choose not to
    provide this data.
    .governor_name: Name of the thermal governor used for this zone
    .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface
               is required. when no_hwmon == false, a hwmon sysfs interface
               will be created. when no_hwmon == true, nothing will be done.
               In case the thermal_zone_params is NULL, the hwmon interface
               will be created (for backward compatibility).
    .num_tbps: Number of thermal_bind_params entries for this zone
    .tbp: thermal_bind_params entries

+25 −8
Original line number Diff line number Diff line
@@ -17,8 +17,17 @@ if THERMAL

config THERMAL_HWMON
	bool
	prompt "Expose thermal sensors as hwmon device"
	depends on HWMON=y || HWMON=THERMAL
	default y
	help
	  In case a sensor is registered with the thermal
	  framework, this option will also register it
	  as a hwmon. The sensor will then have the common
	  hwmon sysfs interface.

	  Say 'Y' here if you want all thermal sensors to
	  have hwmon sysfs interface too.

choice
	prompt "Default Thermal governor"
@@ -91,6 +100,17 @@ config THERMAL_EMULATION
	  because userland can easily disable the thermal policy by simply
	  flooding this sysfs node with low temperature values.

config IMX_THERMAL
	tristate "Temperature sensor driver for Freescale i.MX SoCs"
	depends on CPU_THERMAL
	depends on MFD_SYSCON
	depends on OF
	help
	  Support for Temperature Monitor (TEMPMON) found on Freescale i.MX SoCs.
	  It supports one critical trip point and one passive trip point.  The
	  cpufreq is used as the cooling device to throttle CPUs when the
	  passive trip is crossed.

config SPEAR_THERMAL
	bool "SPEAr thermal sensor driver"
	depends on PLAT_SPEAR
@@ -114,14 +134,6 @@ config KIRKWOOD_THERMAL
	  Support for the Kirkwood thermal sensor driver into the Linux thermal
	  framework. Only kirkwood 88F6282 and 88F6283 have this sensor.

config EXYNOS_THERMAL
	tristate "Temperature sensor on Samsung EXYNOS"
	depends on (ARCH_EXYNOS4 || ARCH_EXYNOS5)
	depends on CPU_THERMAL
	help
	  If you say yes here you get support for TMU (Thermal Management
	  Unit) on SAMSUNG EXYNOS series of SoC.

config DOVE_THERMAL
	tristate "Temperature sensor on Marvell Dove SoCs"
	depends on ARCH_DOVE
@@ -184,4 +196,9 @@ menu "Texas Instruments thermal drivers"
source "drivers/thermal/ti-soc-thermal/Kconfig"
endmenu

menu "Samsung thermal drivers"
depends on PLAT_SAMSUNG
source "drivers/thermal/samsung/Kconfig"
endmenu

endif
Loading