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

Commit 9c532d17 authored by Zhang Rui's avatar Zhang Rui
Browse files

Merge branch 'for_3.12/exynos' of...

Merge branch 'for_3.12/exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal into exynos
parents 584d88b2 beb70b2d
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;
};
+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.
+5 −8
Original line number Diff line number Diff line
@@ -114,14 +114,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 +176,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
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ thermal_sys-$(CONFIG_CPU_THERMAL) += cpu_cooling.o
obj-$(CONFIG_SPEAR_THERMAL)	+= spear_thermal.o
obj-$(CONFIG_RCAR_THERMAL)	+= rcar_thermal.o
obj-$(CONFIG_KIRKWOOD_THERMAL)  += kirkwood_thermal.o
obj-$(CONFIG_EXYNOS_THERMAL)	+= exynos_thermal.o
obj-y				+= samsung/
obj-$(CONFIG_DOVE_THERMAL)  	+= dove_thermal.o
obj-$(CONFIG_DB8500_THERMAL)	+= db8500_thermal.o
obj-$(CONFIG_ARMADA_THERMAL)	+= armada_thermal.o
+18 −0
Original line number Diff line number Diff line
config EXYNOS_THERMAL
	tristate "Exynos thermal management unit driver"
	depends on ARCH_HAS_BANDGAP
	help
	  If you say yes here you get support for the TMU (Thermal Management
	  Unit) driver for SAMSUNG EXYNOS series of soc. This driver initialises
	  the TMU, reports temperature and handles cooling action if defined.
	  This driver uses the exynos core thermal API's and TMU configuration
	  data from the supported soc's.

config EXYNOS_THERMAL_CORE
	bool "Core thermal framework support for EXYNOS SOC's"
	depends on EXYNOS_THERMAL
	help
	  If you say yes here you get support for EXYNOS TMU
	  (Thermal Management Unit) common registration/unregistration
	  functions to the core thermal layer and also to use the generic
	  cpu cooling API's.
Loading