Commit 02be6059 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge tag 'thermal-v6.3-rc1' of...

Merge tag 'thermal-v6.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal-next

Pull thermal control material for 6.3-rc1 from Daniel Lezcano:

"- Fix kerneldoc format errors for Rockchip, Mediatek and Uniphier
   (Randy Dunlap)

 - Add the missing 'qcom,adc-tm7' compatible string in the dt-bindings
   (Krzysztof Kozlowski)

 - Improve the calibration routine by relying on the nvmem to read the
   values and provide a set of fixes for the QCom tsens driver (Dmitry
   Baryshkov)

 - Remove the duplicate interrupt setting routine in the QCom tsens
   driver (Daniel Lezcano)

 - Fix a wrong loop condition in the i.MX SC thermal driver and add the
   iMX8QM sensors (Viorel Suman)

 - Fix header inclusion asm-generic.h by asm.h for the
   qcom-spmi-adc-tm5 driver (Andy Shevchenko)

 - Use the devm_platform_get_and_ioremap_resource() combo function in
   all the drivers where the conversion applies (Ye Xingchen)

 - Replace a literal mask by an existing corresponding macro (Yangtao
   Li)

 - Add support for MT7986 and MT7981 (Daniel Golle)

 - Use thermal_zone_get_crit_temp() for the Armada thermal driver
   (Daniel Lezcano)"

* tag 'thermal-v6.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (35 commits)
  thermal/drivers/armada: Use the thermal_zone_get_crit_temp()
  thermal/drivers/mtk: Add support for MT7986 and MT7981
  thermal/drivers/mtk: Use function pointer for raw_to_mcelsius
  thermal/drivers/sun8i: Convert to use macro
  thermal/drivers/spear: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/kirkwood: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/thermal_mmio: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/rockchip: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/mtk_thermal: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/armada: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/dove: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/bcm2835: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/brcmstb_thermal: Use devm_platform_get_and_ioremap_resource()
  thermal/drivers/qcom-spmi-adc-tm5: Use asm intead of asm-generic
  thermal/drivers/imx_sc_thermal: Add iMX8QM sensors
  thermal/drivers/imx_sc_thermal: Fix the loop condition
  thermal/drivers/qcom: Remove duplicate set next trip point interrupt code
  thermal/drivers/tsens: Drop single-cell code for msm8976/msm8956
  thermal/drivers/tsens: Drop single-cell code for msm8939
  thermal/drivers/tsens: Drop single-cell code for mdm9607
  ...
parents a2c81dc5 8c5ee915
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,7 @@ properties:
    enum:
    enum:
      - qcom,spmi-adc-tm5
      - qcom,spmi-adc-tm5
      - qcom,spmi-adc-tm5-gen2
      - qcom,spmi-adc-tm5-gen2
      - qcom,adc-tm7 # Incomplete / subject to change


  reg:
  reg:
    maxItems: 1
    maxItems: 1
+143 −10
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@ properties:
      - description: v1 of TSENS
      - description: v1 of TSENS
        items:
        items:
          - enum:
          - enum:
              - qcom,msm8956-tsens
              - qcom,msm8976-tsens
              - qcom,msm8976-tsens
              - qcom,qcs404-tsens
              - qcom,qcs404-tsens
          - const: qcom,tsens-v1
          - const: qcom,tsens-v1
@@ -80,18 +81,120 @@ properties:
    maxItems: 2
    maxItems: 2


  nvmem-cells:
  nvmem-cells:
    minItems: 1
    oneOf:
      - minItems: 1
        maxItems: 2
        maxItems: 2
        description:
        description:
          Reference to an nvmem node for the calibration data
          Reference to an nvmem node for the calibration data
      - minItems: 5
        maxItems: 35
        description: |
          Reference to nvmem cells for the calibration mode, two calibration
          bases and two cells per each sensor
        # special case for msm8974 / apq8084
      - maxItems: 51
        description: |
          Reference to nvmem cells for the calibration mode, two calibration
          bases and two cells per each sensor, main and backup copies, plus use_backup cell


  nvmem-cell-names:
  nvmem-cell-names:
    minItems: 1
    oneOf:
      - minItems: 1
        items:
        items:
          - const: calib
          - const: calib
          - enum:
          - enum:
              - calib_backup
              - calib_backup
              - calib_sel
              - calib_sel
      - minItems: 5
        items:
          - const: mode
          - const: base1
          - const: base2
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
          - pattern: '^s[0-9]+_p1$'
          - pattern: '^s[0-9]+_p2$'
        # special case for msm8974 / apq8084
      - items:
          - const: mode
          - const: base1
          - const: base2
          - const: use_backup
          - const: mode_backup
          - const: base1_backup
          - const: base2_backup
          - const: s0_p1
          - const: s0_p2
          - const: s1_p1
          - const: s1_p2
          - const: s2_p1
          - const: s2_p2
          - const: s3_p1
          - const: s3_p2
          - const: s4_p1
          - const: s4_p2
          - const: s5_p1
          - const: s5_p2
          - const: s6_p1
          - const: s6_p2
          - const: s7_p1
          - const: s7_p2
          - const: s8_p1
          - const: s8_p2
          - const: s9_p1
          - const: s9_p2
          - const: s10_p1
          - const: s10_p2
          - const: s0_p1_backup
          - const: s0_p2_backup
          - const: s1_p1_backup
          - const: s1_p2_backup
          - const: s2_p1_backup
          - const: s2_p2_backup
          - const: s3_p1_backup
          - const: s3_p2_backup
          - const: s4_p1_backup
          - const: s4_p2_backup
          - const: s5_p1_backup
          - const: s5_p2_backup
          - const: s6_p1_backup
          - const: s6_p2_backup
          - const: s7_p1_backup
          - const: s7_p2_backup
          - const: s8_p1_backup
          - const: s8_p2_backup
          - const: s9_p1_backup
          - const: s9_p2_backup
          - const: s10_p1_backup
          - const: s10_p2_backup


  "#qcom,sensors":
  "#qcom,sensors":
    description:
    description:
@@ -220,6 +323,36 @@ examples:
          };
          };
    };
    };


  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    // Example 1 (new calbiration data: for pre v1 IP):
    thermal-sensor@900000 {
        compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
        reg = <0x4a9000 0x1000>, /* TM */
              <0x4a8000 0x1000>; /* SROT */

        nvmem-cells = <&tsens_mode>,
                      <&tsens_base1>, <&tsens_base2>,
                      <&tsens_s0_p1>, <&tsens_s0_p2>,
                      <&tsens_s1_p1>, <&tsens_s1_p2>,
                      <&tsens_s2_p1>, <&tsens_s2_p2>,
                      <&tsens_s4_p1>, <&tsens_s4_p2>,
                      <&tsens_s5_p1>, <&tsens_s5_p2>;
        nvmem-cell-names = "mode",
                           "base1", "base2",
                           "s0_p1", "s0_p2",
                           "s1_p1", "s1_p2",
                           "s2_p1", "s2_p2",
                           "s4_p1", "s4_p2",
                           "s5_p1", "s5_p2";

        interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "uplow";

        #qcom,sensors = <5>;
        #thermal-sensor-cells = <1>;
    };

  - |
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    // Example 1 (legacy: for pre v1 IP):
    // Example 1 (legacy: for pre v1 IP):
+16 −26
Original line number Original line Diff line number Diff line
@@ -709,12 +709,10 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
				       struct armada_thermal_priv *priv)
				       struct armada_thermal_priv *priv)
{
{
	struct armada_thermal_data *data = priv->data;
	struct armada_thermal_data *data = priv->data;
	struct resource *res;
	void __iomem *base;
	void __iomem *base;


	/* First memory region points towards the status register */
	/* First memory region points towards the status register */
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
	base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(base))
	if (IS_ERR(base))
		return PTR_ERR(base);
		return PTR_ERR(base);


@@ -784,36 +782,28 @@ static int armada_configure_overheat_int(struct armada_thermal_priv *priv,
					 int sensor_id)
					 int sensor_id)
{
{
	/* Retrieve the critical trip point to enable the overheat interrupt */
	/* Retrieve the critical trip point to enable the overheat interrupt */
	struct thermal_trip trip;
	int temperature;
	int ret;
	int ret;
	int i;

	for (i = 0; i < thermal_zone_get_num_trips(tz); i++) {


		ret = thermal_zone_get_trip(tz, i, &trip);
	ret = thermal_zone_get_crit_temp(tz, &temperature);
	if (ret)
	if (ret)
		return ret;
		return ret;


		if (trip.type != THERMAL_TRIP_CRITICAL)
			continue;

	ret = armada_select_channel(priv, sensor_id);
	ret = armada_select_channel(priv, sensor_id);
	if (ret)
	if (ret)
		return ret;
		return ret;


		armada_set_overheat_thresholds(priv, trip.temperature,
	/*
					       trip.hysteresis);
	 * A critical temperature does not have a hysteresis
	 */
	armada_set_overheat_thresholds(priv, temperature, 0);
	priv->overheat_sensor = tz;
	priv->overheat_sensor = tz;
	priv->interrupt_source = sensor_id;
	priv->interrupt_source = sensor_id;

	armada_enable_overheat_interrupt(priv);
	armada_enable_overheat_interrupt(priv);


	return 0;
	return 0;
}
}


	return -EINVAL;
}

static int armada_thermal_probe(struct platform_device *pdev)
static int armada_thermal_probe(struct platform_device *pdev)
{
{
	struct thermal_zone_device *tz;
	struct thermal_zone_device *tz;
+1 −3
Original line number Original line Diff line number Diff line
@@ -167,7 +167,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
	const struct of_device_id *match;
	const struct of_device_id *match;
	struct thermal_zone_device *tz;
	struct thermal_zone_device *tz;
	struct bcm2835_thermal_data *data;
	struct bcm2835_thermal_data *data;
	struct resource *res;
	int err = 0;
	int err = 0;
	u32 val;
	u32 val;
	unsigned long rate;
	unsigned long rate;
@@ -181,8 +180,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
	if (!match)
	if (!match)
		return -EINVAL;
		return -EINVAL;


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	data->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
	data->regs = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(data->regs)) {
	if (IS_ERR(data->regs)) {
		err = PTR_ERR(data->regs);
		err = PTR_ERR(data->regs);
		return err;
		return err;
+1 −3
Original line number Original line Diff line number Diff line
@@ -321,7 +321,6 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
	const struct thermal_zone_device_ops *of_ops;
	const struct thermal_zone_device_ops *of_ops;
	struct thermal_zone_device *thermal;
	struct thermal_zone_device *thermal;
	struct brcmstb_thermal_priv *priv;
	struct brcmstb_thermal_priv *priv;
	struct resource *res;
	int irq, ret;
	int irq, ret;


	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -332,8 +331,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
	if (!priv->temp_params)
	if (!priv->temp_params)
		return -EINVAL;
		return -EINVAL;


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	priv->tmon_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
	priv->tmon_base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(priv->tmon_base))
	if (IS_ERR(priv->tmon_base))
		return PTR_ERR(priv->tmon_base);
		return PTR_ERR(priv->tmon_base);


Loading