Commit 667de5c6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more thermal control updates from Rafael Wysocki:
 "These are mostly cleanups on top of the previously merged thermal
  control changes plus some driver fixes and the removal of the Intel
  Menlow thermal driver.

  Specifics:

   - Add compatible DT bindings for imx6sll and imx6ul to fix a dtbs
     check warning (Stefan Wahren)

   - Update the example in the DT bindings to reflect changes with the
     ADC node name for QCom TM and TM5 (Marijn Suijten)

   - Fix comments for the cpuidle_cooling_register() function to match
     the function prototype (Chenggang Wang)

   - Fix inconsistent temperature read and some Mediatek variant board
     reboot by reverting a change and handling the temperature
     differently (AngeloGioacchino Del Regno)

   - Fix a memory leak in the initialization error path for the Mediatek
     driver (Kang Chen)

   - Use of_address_to_resource() in the Mediatek driver (Rob Herring)

   - Fix unit address in the QCom tsens driver DT bindings (Krzysztof
     Kozlowski)

   - Clean up the step-wise thermal governor (Zhang Rui)

   - Introduce thermal_zone_device() for accessing the device field of
     struct thermal_zone_device and two drivers use it (Daniel Lezcano)

   - Clean up the ACPI thermal driver a bit (Daniel Lezcano)

   - Delete the thermal driver for Intel Menlow platforms that is not
     expected to have any users (Rafael Wysocki)"

* tag 'thermal-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: intel: menlow: Get rid of this driver
  ACPI: thermal: Move to dedicated function sysfs extra attr creation
  ACPI: thermal: Use thermal_zone_device()
  thermal: intel: pch_thermal: Use thermal driver device to write a trace
  thermal: core: Encapsulate tz->device field
  thermal: gov_step_wise: Adjust code logic to match comment
  thermal: gov_step_wise: Delete obsolete comment
  dt-bindings: thermal: qcom-tsens: Correct unit address
  thermal/drivers/mediatek: Use of_address_to_resource()
  thermal/drivers/mediatek: Change clk_prepare_enable to devm_clk_get_enabled in mtk_thermal_probe
  thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe
  thermal/drivers/mediatek: Add temperature constraints to validate read
  Revert "thermal/drivers/mediatek: Add delay after thermal banks initialization"
  thermal/drivers/cpuidle_cooling: Delete unmatched comments
  dt-bindings: thermal: Use generic ADC node name in examples
  dt-bindings: imx-thermal: Add imx6sll and imx6ul compatible
parents 89b7fd5d 53389edd
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -12,10 +12,16 @@ maintainers:

properties:
  compatible:
    enum:
    oneOf:
      - enum:
          - fsl,imx6q-tempmon
          - fsl,imx6sx-tempmon
          - fsl,imx7d-tempmon
      - items:
          - enum:
              - fsl,imx6sll-tempmon
              - fsl,imx6ul-tempmon
          - const: fsl,imx6sx-tempmon

  interrupts:
    description: |
+2 −2
Original line number Diff line number Diff line
@@ -124,8 +124,8 @@ examples:
            #size-cells = <0>;
            #io-channel-cells = <1>;

            /* Other propreties are omitted */
            adc-chan@4c {
            /* Other properties are omitted */
            channel@4c {
                reg = <ADC5_XO_THERM_100K_PU>;
            };
        };
+6 −3
Original line number Diff line number Diff line
@@ -178,10 +178,11 @@ examples:
            #io-channel-cells = <1>;

            /* Other properties are omitted */
            conn-therm@4f {
            channel@4f {
                reg = <ADC5_AMUX_THM3_100K_PU>;
                qcom,ratiometric;
                qcom,hw-settle-time = <200>;
                label = "conn_therm";
            };
        };

@@ -217,16 +218,18 @@ examples:
            #io-channel-cells = <1>;

            /* Other properties are omitted */
            xo-therm@44 {
            channel@44 {
                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
                qcom,ratiometric;
                qcom,hw-settle-time = <200>;
                label = "xo_therm";
            };

            conn-therm@147 {
            channel@147 {
                reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
                qcom,ratiometric;
                qcom,hw-settle-time = <200>;
                label = "conn_therm";
            };
        };

+2 −2
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    // Example 1 (new calbiration data: for pre v1 IP):
    thermal-sensor@900000 {
    thermal-sensor@4a9000 {
        compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
        reg = <0x4a9000 0x1000>, /* TM */
              <0x4a8000 0x1000>; /* SROT */
@@ -356,7 +356,7 @@ examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    // Example 1 (legacy: for pre v1 IP):
    tsens1: thermal-sensor@900000 {
    tsens1: thermal-sensor@4a9000 {
           compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
           reg = <0x4a9000 0x1000>, /* TM */
                 <0x4a8000 0x1000>; /* SROT */
+31 −14
Original line number Diff line number Diff line
@@ -786,6 +786,32 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
	.critical = acpi_thermal_zone_device_critical,
};

static int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz)
{
	struct device *tzdev = thermal_zone_device(tz->thermal_zone);
	int ret;

	ret = sysfs_create_link(&tz->device->dev.kobj,
				&tzdev->kobj, "thermal_zone");
	if (ret)
		return ret;

	ret = sysfs_create_link(&tzdev->kobj,
				   &tz->device->dev.kobj, "device");
	if (ret)
		sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");

	return ret;
}

static void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz)
{
	struct device *tzdev = thermal_zone_device(tz->thermal_zone);

	sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
	sysfs_remove_link(&tzdev->kobj, "device");
}

static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
{
	int trips = 0;
@@ -819,21 +845,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
	if (IS_ERR(tz->thermal_zone))
		return -ENODEV;

	result = sysfs_create_link(&tz->device->dev.kobj,
				   &tz->thermal_zone->device.kobj, "thermal_zone");
	result = acpi_thermal_zone_sysfs_add(tz);
	if (result)
		goto unregister_tzd;

	result = sysfs_create_link(&tz->thermal_zone->device.kobj,
				   &tz->device->dev.kobj, "device");
	if (result)
		goto remove_tz_link;

	status =  acpi_bus_attach_private_data(tz->device->handle,
					       tz->thermal_zone);
	if (ACPI_FAILURE(status)) {
		result = -ENODEV;
		goto remove_dev_link;
		goto remove_links;
	}

	result = thermal_zone_device_enable(tz->thermal_zone);
@@ -847,10 +867,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)

acpi_bus_detach:
	acpi_bus_detach_private_data(tz->device->handle);
remove_dev_link:
	sysfs_remove_link(&tz->thermal_zone->device.kobj, "device");
remove_tz_link:
	sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
remove_links:
	acpi_thermal_zone_sysfs_remove(tz);
unregister_tzd:
	thermal_zone_device_unregister(tz->thermal_zone);

@@ -859,8 +877,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)

static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
{
	sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
	sysfs_remove_link(&tz->thermal_zone->device.kobj, "device");
	acpi_thermal_zone_sysfs_remove(tz);
	thermal_zone_device_unregister(tz->thermal_zone);
	tz->thermal_zone = NULL;
	acpi_bus_detach_private_data(tz->device->handle);
Loading