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

Commit c56f5c03 authored by Durgadoss R's avatar Durgadoss R Committed by Len Brown
Browse files

Thermal: Make Thermal trip points writeable



Some of the thermal drivers using the Generic Thermal Framework
require (all/some) trip points to be writeable. This patch makes
the trip point temperatures writeable on a per-trip point basis,
and modifies the required function call in thermal.c. This patch
also updates the Documentation to reflect the new change.

Signed-off-by: default avatarDurgadoss R <durgadoss.r@intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 28a33cbc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ temperature) and throttle appropriate devices.

1.1 thermal zone device interface
1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name,
		int trips, void *devdata, struct thermal_zone_device_ops *ops)
		int trips, int mask, void *devdata,
		struct thermal_zone_device_ops *ops)

    This interface function adds a new thermal zone device (sensor) to
    /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
@@ -40,6 +41,7 @@ temperature) and throttle appropriate devices.

    name: the thermal zone name.
    trips: the total number of trip points this thermal zone supports.
    mask: Bit string: If 'n'th bit is set, then trip point 'n' is writeable.
    devdata: device private data
    ops: thermal zone device call-backs.
	.bind: bind the thermal zone device with a thermal cooling device.
+2 −2
Original line number Diff line number Diff line
@@ -845,7 +845,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)

	if (tz->trips.passive.flags.valid)
		tz->thermal_zone =
			thermal_zone_device_register("acpitz", trips, tz,
			thermal_zone_device_register("acpitz", trips, 0, tz,
						     &acpi_thermal_zone_ops,
						     tz->trips.passive.tc1,
						     tz->trips.passive.tc2,
@@ -853,7 +853,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
						     tz->polling_frequency*100);
	else
		tz->thermal_zone =
			thermal_zone_device_register("acpitz", trips, tz,
			thermal_zone_device_register("acpitz", trips, 0, tz,
						     &acpi_thermal_zone_ops,
						     0, 0, 0,
						     tz->polling_frequency*100);
+1 −1
Original line number Diff line number Diff line
@@ -660,7 +660,7 @@ static int acerhdf_register_thermal(void)
	if (IS_ERR(cl_dev))
		return -EINVAL;

	thz_dev = thermal_zone_device_register("acerhdf", 1, NULL,
	thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL,
					      &acerhdf_dev_ops, 0, 0, 0,
					      (kernelmode) ? interval*1000 : 0);
	if (IS_ERR(thz_dev))
+1 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ static int mid_thermal_probe(struct platform_device *pdev)
			goto err;
		}
		pinfo->tzd[i] = thermal_zone_device_register(name[i],
				0, td_info, &tzd_ops, 0, 0, 0, 0);
				0, 0, td_info, &tzd_ops, 0, 0, 0, 0);
		if (IS_ERR(pinfo->tzd[i])) {
			kfree(td_info);
			ret = PTR_ERR(pinfo->tzd[i]);
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
	stdev->flags = pdata->thermal_flags;
	writel_relaxed(stdev->flags, stdev->thermal_base);

	spear_thermal = thermal_zone_device_register("spear_thermal", 0,
	spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0,
				stdev, &ops, 0, 0, 0, 0);
	if (IS_ERR(spear_thermal)) {
		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Loading