Commit 83e8de89 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files
Pull thermal core and ARM thermal driver updates for v5.16 from
Daniel Lezcano:

 - Constify a variable in thermal mmio driver (Rikard Falkeborn)

 - Add the current temperature in the netlink message when crossing a
   trip point in order to prevent useless back and forth reading from
   userspace (Daniel Lezcano)

 - Add support for the 'HC' variant on PM8998 pmic in order to support
   vadc channels on recent QCom boards (Bjorn Andersson)

 - Add support of calibration values from hardware when they are fused
   (Niklas Söderlund)

 - Fix NULL pointer dereference from the thermal_release callback when
   an error occured in the thermal_zone_device_register() function
   (Yuanzheng Song)

 - Fix use after free call in the __thermal_cooling_device_register()
   function in the error path (Ziyang Xuan)

 - Fix compilation error for the LMh driver when CONFIG_QCOM_SCM is not
   set (Jackie Liu)

 - Add a timeout when reading a register which can block forever under
   certain circumstances in the tsens driver (Ansuel Smith)

 - Add DT binding for the reset lines and use them in the rockchip
   sensor driver (Johan Jonker)

 - Add new uniphier NX1 SoC temperature sensor (Kunihiko Hayashi)

 - Save and restore the TCC value in the int340x driver (Antoine
   Tenart)

 - Deprecate the cooling device state sysfs file writable and the user
   space governor (Daniel Lezcano)

* tag 'thermal-v5.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
  thermal/core: Deprecate changing cooling device state from userspace
  thermal/core: Make the userspace governor deprecated
  thermal/drivers/int340x: Improve the tcc offset saving for suspend/resume
  thermal/drivers/uniphier: Add compatible string for NX1 SoC
  dt-bindings: thermal: uniphier: Add binding for NX1 SoC
  thermal/drivers/rockchip_thermal: Allow more resets for tsadc node
  dt-bindings: thermal: remove redundant comments from rockchip-thermal.yaml
  dt-bindings: thermal: allow more resets for tsadc node in rockchip-thermal.yaml
  thermal/drivers/tsens: Add timeout to get_temp_tsens_valid
  thermal/drivers/qcom/lmh: make QCOM_LMH depends on QCOM_SCM
  thermal/core: fix a UAF bug in __thermal_cooling_device_register()
  thermal/core: Fix null pointer dereference in thermal_release()
  thermal: rcar_gen3_thermal: Read calibration from hardware
  thermal: rcar_gen3_thermal: Store thcode and ptat in priv data
  thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant
  dt-bindings: thermal: qcom: add HC variant of adc-thermal monitor bindings
  thermal/drivers/netlink: Add the temperature when crossing a trip point
  thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_ops
parents 3906fe9b a67a46af
Loading
Loading
Loading
Loading
+149 −0
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring
maintainers:
  - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

properties:
  compatible:
    const: qcom,spmi-adc-tm-hc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1
    description:
      Number of cells required to uniquely identify the thermal sensors. Since
      we have multiple sensors this is set to 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  qcom,avg-samples:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Number of samples to be used for measurement.
    enum:
      - 1
      - 2
      - 4
      - 8
      - 16
    default: 1

  qcom,decimation:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: This parameter is used to decrease ADC sampling rate.
            Quicker measurements can be made by reducing decimation ratio.
    enum:
      - 256
      - 512
      - 1024
    default: 1024

patternProperties:
  "^([-a-z0-9]*)@[0-7]$":
    type: object
    description:
      Represent one thermal sensor.

    properties:
      reg:
        description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
        minimum: 0
        maximum: 7

      io-channels:
        description:
          From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor

      qcom,ratiometric:
        $ref: /schemas/types.yaml#/definitions/flag
        description:
          Channel calibration type.
          If this property is specified VADC will use the VDD reference
          (1.875V) and GND for channel calibration. If property is not found,
          channel will be calibrated with 0V and 1.25V reference channels,
          also known as absolute calibration.

      qcom,hw-settle-time-us:
        description: Time between AMUX getting configured and the ADC starting conversion.
        enum: [0, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 6000, 8000, 10000]

      qcom,pre-scaling:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        description: Used for scaling the channel input signal before the
          signal is fed to VADC. The configuration for this node is to know the
          pre-determined ratio and use it for post scaling. It is a pair of
          integers, denoting the numerator and denominator of the fraction by
          which input signal is multiplied. For example, <1 3> indicates the
          signal is scaled down to 1/3 of its value before ADC measurement.  If
          property is not found default value depending on chip will be used.
        items:
          - const: 1
          - enum: [ 1, 3, 4, 6, 20, 8, 10 ]

    required:
      - reg
      - io-channels

    additionalProperties:
      false

required:
  - compatible
  - reg
  - interrupts
  - "#address-cells"
  - "#size-cells"
  - "#thermal-sensor-cells"

additionalProperties: false

examples:
  - |
    #include <dt-bindings/iio/qcom,spmi-vadc.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spmi_bus {
        #address-cells = <1>;
        #size-cells = <0>;
        pm8998_adc: adc@3100 {
            reg = <0x3100>;
            compatible = "qcom,spmi-adc-rev2";
            #address-cells = <1>;
            #size-cells = <0>;
            #io-channel-cells = <1>;

            /* Other propreties are omitted */
            adc-chan@4c {
                reg = <ADC5_XO_THERM_100K_PU>;
            };
        };

        pm8998_adc_tm: adc-tm@3400 {
            compatible = "qcom,spmi-adc-tm-hc";
            reg = <0x3400>;
            interrupts = <0x2 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
            #thermal-sensor-cells = <1>;
            #address-cells = <1>;
            #size-cells = <0>;

            thermistor@1 {
                reg = <1>;
                io-channels = <&pm8998_adc ADC5_XO_THERM_100K_PU>;
                qcom,ratiometric;
                qcom,hw-settle-time-us = <200>;
            };
        };
    };
...
+13 −10
Original line number Original line Diff line number Diff line
@@ -12,14 +12,14 @@ maintainers:
properties:
properties:
  compatible:
  compatible:
    enum:
    enum:
      - rockchip,px30-tsadc # PX30 SoCs
      - rockchip,px30-tsadc
      - rockchip,rv1108-tsadc # RV1108 SoCs
      - rockchip,rk3228-tsadc
      - rockchip,rk3228-tsadc # RK3228 SoCs
      - rockchip,rk3288-tsadc
      - rockchip,rk3288-tsadc # RK3288 SoCs
      - rockchip,rk3328-tsadc
      - rockchip,rk3328-tsadc # RK3328 SoCs
      - rockchip,rk3368-tsadc
      - rockchip,rk3368-tsadc # RK3368 SoCs
      - rockchip,rk3399-tsadc
      - rockchip,rk3399-tsadc # RK3399 SoCs
      - rockchip,rk3568-tsadc
      - rockchip,rk3568-tsadc # RK3568 SoCs
      - rockchip,rv1108-tsadc


  reg:
  reg:
    maxItems: 1
    maxItems: 1
@@ -37,11 +37,15 @@ properties:
      - const: apb_pclk
      - const: apb_pclk


  resets:
  resets:
    maxItems: 1
    minItems: 1
    maxItems: 3


  reset-names:
  reset-names:
    minItems: 1
    items:
    items:
      - const: tsadc-apb
      - const: tsadc-apb
      - const: tsadc
      - const: tsadc-phy


  "#thermal-sensor-cells":
  "#thermal-sensor-cells":
    const: 1
    const: 1
@@ -71,7 +75,6 @@ required:
  - clocks
  - clocks
  - clock-names
  - clock-names
  - resets
  - resets
  - reset-names
  - "#thermal-sensor-cells"
  - "#thermal-sensor-cells"


additionalProperties: false
additionalProperties: false
+1 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ properties:
      - socionext,uniphier-pxs2-thermal
      - socionext,uniphier-pxs2-thermal
      - socionext,uniphier-ld20-thermal
      - socionext,uniphier-ld20-thermal
      - socionext,uniphier-pxs3-thermal
      - socionext,uniphier-pxs3-thermal
      - socionext,uniphier-nx1-thermal


  interrupts:
  interrupts:
    maxItems: 1
    maxItems: 1
+9 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,14 @@


#include "thermal_core.h"
#include "thermal_core.h"


static int user_space_bind(struct thermal_zone_device *tz)
{
	pr_warn("Userspace governor deprecated: use thermal netlink "	\
		"notification instead\n");

	return 0;
}

/**
/**
 * notify_user_space - Notifies user space about thermal events
 * notify_user_space - Notifies user space about thermal events
 * @tz: thermal_zone_device
 * @tz: thermal_zone_device
@@ -43,5 +51,6 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip)
static struct thermal_governor thermal_gov_user_space = {
static struct thermal_governor thermal_gov_user_space = {
	.name		= "user_space",
	.name		= "user_space",
	.throttle	= notify_user_space,
	.throttle	= notify_user_space,
	.bind_to_tz	= user_space_bind,
};
};
THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);
THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);
+7 −1
Original line number Original line Diff line number Diff line
@@ -44,15 +44,21 @@ static int int3401_remove(struct platform_device *pdev)
}
}


#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_PM_SLEEP
static int int3401_thermal_suspend(struct device *dev)
{
	return proc_thermal_suspend(dev);
}
static int int3401_thermal_resume(struct device *dev)
static int int3401_thermal_resume(struct device *dev)
{
{
	return proc_thermal_resume(dev);
	return proc_thermal_resume(dev);
}
}
#else
#else
#define int3401_thermal_suspend NULL
#define int3401_thermal_resume NULL
#define int3401_thermal_resume NULL
#endif
#endif


static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, NULL, int3401_thermal_resume);
static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend,
			 int3401_thermal_resume);


static struct platform_driver int3401_driver = {
static struct platform_driver int3401_driver = {
	.probe = int3401_add,
	.probe = int3401_add,
Loading