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

Commit baf51c43 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull thermal updates from Zhang Rui:

 - Implement generic devfreq cooling mechanism through frequency
   reduction for devices using devfreq.  From Ørjan Eide and Javi
   Merino.

 - Introduce OMAP3 support on TI SoC thermal driver.  From Pavel Mack
   and Eduardo Valentin.

 - A bounch of small fixes on devfreq_cooling, Exynos, IMX, Armada, and
   Rockchip thermal drivers.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (24 commits)
  thermal: exynos: Directly return 0 instead of using local ret variable
  thermal: exynos: Remove unneeded semicolon
  thermal: exynos: Use IS_ERR() because regulator cannot be NULL
  thermal: exynos: Fix first temperature read after registering sensor
  thermal: exynos: Fix unbalanced regulator disable on probe failure
  devfreq_cooling: return on allocation failure
  thermal: rockchip: support the sleep pinctrl state to avoid glitches in s2r
  dt-bindings: rockchip-thermal: Add the pinctrl states in this document
  thermal: devfreq_cooling: Make power a u64
  thermal: devfreq_cooling: use a thermal_cooling_device for register and unregister
  thermal: underflow bug in imx_set_trip_temp()
  thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula
  thermal: imx: register irq handler later in probe
  thermal: rockhip: fix setting thermal shutdown polarity
  thermal: rockchip: fix handling of invalid readings
  devfreq_cooling: add trace information
  thermal: Add devfreq cooling
  PM / OPP: get the voltage for all OPPs
  tools/thermal: tmon: use pkg-config also for CFLAGS
  linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
  ...
parents c5a37883 7c5b2759
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@ Required properties:
- resets : Must contain an entry for each entry in reset-names.
	   See ../reset/reset.txt for details.
- reset-names : Must include the name "tsadc-apb".
- pinctrl-names : The pin control state names;
- pinctrl-0 : The "init" pinctrl state, it will be set before device probe.
- pinctrl-1 : The "default" pinctrl state, it will be set after reset the
	      TSADC controller.
- pinctrl-2 : The "sleep" pinctrl state, it will be in for suspend.
- #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description.
- rockchip,hw-tshut-temp : The hardware-controlled shutdown temperature value.
- rockchip,hw-tshut-mode : The hardware-controlled shutdown mode 0:CRU 1:GPIO.
@@ -27,8 +32,10 @@ tsadc: tsadc@ff280000 {
	clock-names = "tsadc", "apb_pclk";
	resets = <&cru SRST_TSADC>;
	reset-names = "tsadc-apb";
	pinctrl-names = "default";
	pinctrl-0 = <&otp_out>;
	pinctrl-names = "init", "default", "sleep";
	pinctrl-0 = <&otp_gpio>;
	pinctrl-1 = <&otp_out>;
	pinctrl-2 = <&otp_gpio>;
	#thermal-sensor-cells = <1>;
	rockchip,hw-tshut-temp = <95000>;
	rockchip,hw-tshut-mode = <0>;
+14 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ to the silicon temperature.

Required properties:
- compatible : Should be:
  - "ti,omap34xx-bandgap" : for OMAP34xx bandgap
  - "ti,omap36xx-bandgap" : for OMAP36xx bandgap
  - "ti,omap4430-bandgap" : for OMAP4430 bandgap
  - "ti,omap4460-bandgap" : for OMAP4460 bandgap
  - "ti,omap4470-bandgap" : for OMAP4470 bandgap
@@ -25,6 +27,18 @@ to each bandgap version, because the mapping may change from
soc to soc, apart of depending on available features.

Example:
OMAP34xx:
bandgap {
	reg = <0x48002524 0x4>;
	compatible = "ti,omap34xx-bandgap";
};

OMAP36xx:
bandgap {
	reg = <0x48002524 0x4>;
	compatible = "ti,omap36xx-bandgap";
};

OMAP4430:
bandgap {
	reg = <0x4a002260 0x4 0x4a00232C 0x4>;
+6 −6
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
			if (crt == -1) {
				tz->trips.critical.flags.valid = 0;
			} else if (crt > 0) {
				unsigned long crt_k = CELSIUS_TO_KELVIN(crt);
				unsigned long crt_k = CELSIUS_TO_DECI_KELVIN(crt);
				/*
				 * Allow override critical threshold
				 */
@@ -351,7 +351,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
		if (psv == -1) {
			status = AE_SUPPORT;
		} else if (psv > 0) {
			tmp = CELSIUS_TO_KELVIN(psv);
			tmp = CELSIUS_TO_DECI_KELVIN(psv);
			status = AE_OK;
		} else {
			status = acpi_evaluate_integer(tz->device->handle,
@@ -431,7 +431,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
					break;
				if (i == 1)
					tz->trips.active[0].temperature =
						CELSIUS_TO_KELVIN(act);
						CELSIUS_TO_DECI_KELVIN(act);
				else
					/*
					 * Don't allow override higher than
@@ -439,9 +439,9 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
					 */
					tz->trips.active[i - 1].temperature =
						(tz->trips.active[i - 2].temperature <
						CELSIUS_TO_KELVIN(act) ?
						CELSIUS_TO_DECI_KELVIN(act) ?
						tz->trips.active[i - 2].temperature :
						CELSIUS_TO_KELVIN(act));
						CELSIUS_TO_DECI_KELVIN(act));
				break;
			} else {
				tz->trips.active[i].temperature = tmp;
@@ -1105,7 +1105,7 @@ static int acpi_thermal_add(struct acpi_device *device)
	INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);

	pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
		acpi_device_bid(device), KELVIN_TO_CELSIUS(tz->temperature));
		acpi_device_bid(device), DECI_KELVIN_TO_CELSIUS(tz->temperature));
	goto end;

free_memory:
+2 −2
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ struct device_opp *_find_device_opp(struct device *dev)
}

/**
 * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an available opp
 * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
 * @opp:	opp for which voltage has to be returned for
 *
 * Return: voltage in micro volt corresponding to the opp, else
@@ -122,7 +122,7 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
	opp_rcu_lockdep_assert();

	tmp_opp = rcu_dereference(opp);
	if (IS_ERR_OR_NULL(tmp_opp) || !tmp_opp->available)
	if (IS_ERR_OR_NULL(tmp_opp))
		pr_err("%s: Invalid parameters\n", __func__);
	else
		v = tmp_opp->u_volt;
+1 −1
Original line number Diff line number Diff line
@@ -1320,7 +1320,7 @@ static ssize_t asus_hwmon_temp1(struct device *dev,
	if (err < 0)
		return err;

	value = KELVIN_TO_CELSIUS((value & 0xFFFF)) * 1000;
	value = DECI_KELVIN_TO_CELSIUS((value & 0xFFFF)) * 1000;

	return sprintf(buf, "%d\n", value);
}
Loading