Commit ef1d7526 authored by Zhang Rui's avatar Zhang Rui
Browse files

Merge branch 'linus' of...

parents d5adbfcd 992edf39
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
* DT bindings for Renesas R-Car Gen3 Thermal Sensor driver

On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
sensors (THS) which are the analog circuits for measuring temperature (Tj)
inside the LSI.

Required properties:
- compatible		: "renesas,<soctype>-thermal",
			  Examples with soctypes are:
			    - "renesas,r8a7795-thermal" (R-Car H3)
			    - "renesas,r8a7796-thermal" (R-Car M3-W)
- reg			: Address ranges of the thermal registers. Each sensor
			  needs one address range. Sorting must be done in
			  increasing order according to datasheet, i.e.
			  TSC1, TSC2, ...
- clocks		: Must contain a reference to the functional clock.
- #thermal-sensor-cells : must be <1>.

Optional properties:

- interrupts           : interrupts routed to the TSC (3 for H3 and M3-W)
- power-domain		: Must contain a reference to the power domain. This
			  property is mandatory if the thermal sensor instance
			  is part of a controllable power domain.

Example:

	tsc: thermal@e6198000 {
		compatible = "renesas,r8a7795-thermal";
		reg = <0 0xe6198000 0 0x68>,
		      <0 0xe61a0000 0 0x5c>,
		      <0 0xe61a8000 0 0x5c>;
		interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
			     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
			     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cpg CPG_MOD 522>;
		power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
		#thermal-sensor-cells = <1>;
		status = "okay";
	};

	thermal-zones {
		sensor_thermal1: sensor-thermal1 {
			polling-delay-passive = <250>;
			polling-delay = <1000>;
			thermal-sensors = <&tsc 0>;

			trips {
				sensor1_crit: sensor1-crit {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};
	};
+116 −0
Original line number Diff line number Diff line
* ZTE zx2967 family Thermal

Required Properties:
- compatible: should be one of the following.
    * zte,zx296718-thermal
- reg: physical base address of the controller and length of memory mapped
    region.
- clocks : Pairs of phandle and specifier referencing the controller's clocks.
- clock-names: "topcrm" for the topcrm clock.
	       "apb" for the apb clock.
- #thermal-sensor-cells: must be 0.

Please note: slope coefficient defined in thermal-zones section need to be
multiplied by 1000.

Example for tempsensor:

	tempsensor: tempsensor@148a000 {
		compatible = "zte,zx296718-thermal";
		reg = <0x0148a000 0x20>;
		clocks = <&topcrm TEMPSENSOR_GATE>, <&audiocrm AUDIO_TS_PCLK>;
		clock-names = "topcrm", "apb";
		#thermal-sensor-cells = <0>;
	};

Example for cooling device:

	cooling_dev: cooling_dev {
		cluster0_cooling_dev: cluster0-cooling-dev {
			#cooling-cells = <2>;
			cpumask = <0xf>;
			capacitance = <1500>;
		};

	cluster1_cooling_dev: cluster1-cooling-dev {
			#cooling-cells = <2>;
			cpumask = <0x30>;
			capacitance = <2000>;
		};
	};

Example for thermal zones:

	thermal-zones {
		zx296718_thermal: zx296718_thermal {
			polling-delay-passive = <500>;
			polling-delay = <1000>;
			sustainable-power = <6500>;

			thermal-sensors = <&tempsensor 0>;
			/*
			 * slope need to be multiplied by 1000.
			 */
			coefficients = <1951 (-922)>;

			trips {
				trip0: switch_on_temperature {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "passive";
				};

				trip1: desired_temperature {
					temperature = <100000>;
					hysteresis = <2000>;
					type = "passive";
				};

				crit: critical_temperature {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&trip0>;
					cooling-device = <&gpu 2 5>;
				};

				map1 {
					trip = <&trip0>;
					cooling-device = <&cluster0_cooling_dev 1 2>;
				};

				map2 {
					trip = <&trip1>;
					cooling-device = <&cluster0_cooling_dev 1 2>;
				};

				map3 {
					trip = <&crit>;
					cooling-device = <&cluster0_cooling_dev 1 2>;
				};

				map4 {
					trip = <&trip0>;
					cooling-device = <&cluster1_cooling_dev 1 2>;
					contribution = <9000>;
				};

				map5 {
					trip = <&trip1>;
					cooling-device = <&cluster1_cooling_dev 1 2>;
					contribution = <4096>;
				};

				map6 {
					trip = <&crit>;
					cooling-device = <&cluster1_cooling_dev 1 2>;
					contribution = <4096>;
				};
			};
		};
	};
+17 −0
Original line number Diff line number Diff line
@@ -245,6 +245,15 @@ config RCAR_THERMAL
	  Enable this to plug the R-Car thermal sensor driver into the Linux
	  thermal framework.

config RCAR_GEN3_THERMAL
	tristate "Renesas R-Car Gen3 thermal driver"
	depends on ARCH_RENESAS || COMPILE_TEST
	depends on HAS_IOMEM
	depends on OF
	help
	  Enable this to plug the R-Car Gen3 thermal sensor driver into the Linux
	  thermal framework.

config KIRKWOOD_THERMAL
	tristate "Temperature sensor on Marvell Kirkwood SoCs"
	depends on MACH_KIRKWOOD || COMPILE_TEST
@@ -436,4 +445,12 @@ depends on (ARCH_QCOM && OF) || COMPILE_TEST
source "drivers/thermal/qcom/Kconfig"
endmenu

config ZX2967_THERMAL
	tristate "Thermal sensors on zx2967 SoC"
	depends on ARCH_ZX || COMPILE_TEST
	help
	  Enable the zx2967 thermal sensors driver, which supports
	  the primitive temperature sensor embedded in zx2967 SoCs.
	  This sensor generates the real time die temperature.

endif
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ obj-$(CONFIG_QCOM_SPMI_TEMP_ALARM) += qcom-spmi-temp-alarm.o
obj-$(CONFIG_SPEAR_THERMAL)	+= spear_thermal.o
obj-$(CONFIG_ROCKCHIP_THERMAL)	+= rockchip_thermal.o
obj-$(CONFIG_RCAR_THERMAL)	+= rcar_thermal.o
obj-$(CONFIG_RCAR_GEN3_THERMAL)	+= rcar_gen3_thermal.o
obj-$(CONFIG_KIRKWOOD_THERMAL)  += kirkwood_thermal.o
obj-y				+= samsung/
obj-$(CONFIG_DOVE_THERMAL)  	+= dove_thermal.o
@@ -56,3 +57,4 @@ obj-$(CONFIG_TEGRA_SOCTHERM) += tegra/
obj-$(CONFIG_HISI_THERMAL)     += hisi_thermal.o
obj-$(CONFIG_MTK_THERMAL)	+= mtk_thermal.o
obj-$(CONFIG_GENERIC_ADC_THERMAL)	+= thermal-generic-adc.o
obj-$(CONFIG_ZX2967_THERMAL)	+= zx2967_thermal.o
+4 −0
Original line number Diff line number Diff line
@@ -489,6 +489,10 @@ static int imx_thermal_probe(struct platform_device *pdev)
	data->tempmon = map;

	data->socdata = of_device_get_match_data(&pdev->dev);
	if (!data->socdata) {
		dev_err(&pdev->dev, "no device match found\n");
		return -ENODEV;
	}

	/* make sure the IRQ flag is clear before enabling irq on i.MX6SX */
	if (data->socdata->version == TEMPMON_IMX6SX) {
Loading