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

Commit 0e70f466 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Zhang Rui
Browse files

thermal: Enhance thermal_zone_device_update for events



Added one additional parameter to thermal_zone_device_update() to provide
caller with an optional capability to specify reason.
Currently this event is used by user space governor to trigger different
processing based on event code. Also it saves an additional call to read
temperature when the event is received.
The following events are cuurently defined:
- Unspecified event
- New temperature sample
- Trip point violated
- Trip point changed
- thermal device up and down
- thermal device power capability changed

Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 040a3ead
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -520,7 +520,8 @@ static void acpi_thermal_check(void *data)
	if (!tz->tz_enabled)
		return;

	thermal_zone_device_update(tz->thermal_zone);
	thermal_zone_device_update(tz->thermal_zone,
				   THERMAL_EVENT_UNSPECIFIED);
}

/* sys I/F for generic thermal sysfs support */
+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ static inline void acerhdf_enable_kernelmode(void)
	kernelmode = 1;

	thz_dev->polling_delay = interval*1000;
	thermal_zone_device_update(thz_dev);
	thermal_zone_device_update(thz_dev, THERMAL_EVENT_UNSPECIFIED);
	pr_notice("kernel mode fan control ON\n");
}

+2 −1
Original line number Diff line number Diff line
@@ -495,7 +495,8 @@ static irqreturn_t max8973_thermal_irq(int irq, void *data)
{
	struct max8973_chip *mchip = data;

	thermal_zone_device_update(mchip->tz_device);
	thermal_zone_device_update(mchip->tz_device,
				   THERMAL_EVENT_UNSPECIFIED);

	return IRQ_HANDLED;
}
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ static void db8500_thermal_work(struct work_struct *work)
	if (cur_mode == THERMAL_DEVICE_DISABLED)
		return;

	thermal_zone_device_update(pzone->therm_dev);
	thermal_zone_device_update(pzone->therm_dev, THERMAL_EVENT_UNSPECIFIED);
	dev_dbg(&pzone->therm_dev->device, "thermal work finished.\n");
}

+2 −1
Original line number Diff line number Diff line
@@ -237,7 +237,8 @@ static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev)
		if (!data->sensors[i].tzd)
			continue;

		thermal_zone_device_update(data->sensors[i].tzd);
		thermal_zone_device_update(data->sensors[i].tzd,
					   THERMAL_EVENT_UNSPECIFIED);
	}

	return IRQ_HANDLED;
Loading