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

Commit f8774b59 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: thermal: Add post suspend evaluate flag to thermal zone devicetree"

parents e8667822 a915ed47
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -175,6 +175,10 @@ Optional property:
			2000mW, while on a 10'' tablet is around
			4500mW.

- wake-capable-sensor:	Set to true if thermal zone sensor is wake up capable
  Type: bool		and cooling devices binded to this thermal zone are not
  Size: none		affected during suspend.

Note: The delay properties are bound to the maximum dT/dt (temperature
derivative over time) in two situations for a thermal zone:
(i)  - when passive cooling is activated (polling-delay-passive); and
+14 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ struct __sensor_param {
 * @slope: slope of the temperature adjustment curve
 * @offset: offset of the temperature adjustment curve
 * @default_disable: Keep the thermal zone disabled by default
 * @is_wakeable: Ignore post suspend thermal zone re-evaluation
 * @tzd: thermal zone device pointer for this sensor
 * @ntrips: number of trip points
 * @trips: an array of trip points (0..ntrips - 1)
@@ -81,6 +82,7 @@ struct __thermal_zone {
	int offset;
	struct thermal_zone_device *tzd;
	bool default_disable;
	bool is_wakeable;

	/* trip data */
	int ntrips;
@@ -494,6 +496,13 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
	return -EINVAL;
}

static bool of_thermal_is_wakeable(struct thermal_zone_device *tz)
{
	struct __thermal_zone *data = tz->devdata;

	return data->is_wakeable;
}

static int of_thermal_aggregate_trip_types(struct thermal_zone_device *tz,
		unsigned int trip_type_mask, int *low, int *high)
{
@@ -619,6 +628,8 @@ static struct thermal_zone_device_ops of_thermal_ops = {

	.bind = of_thermal_bind,
	.unbind = of_thermal_unbind,

	.is_wakeable = of_thermal_is_wakeable,
};

static struct thermal_zone_of_device_ops of_virt_ops = {
@@ -1237,6 +1248,9 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)

	tz->default_disable = of_property_read_bool(np,
					"disable-thermal-zone");

	tz->is_wakeable = of_property_read_bool(np,
					"wake-capable-sensor");
	/*
	 * REVIST: for now, the thermal framework supports only
	 * one sensor per thermal zone. Thus, we are considering
+7 −2
Original line number Diff line number Diff line
@@ -489,7 +489,8 @@ void thermal_zone_device_update_temp(struct thermal_zone_device *tz,
{
	int count;

	if (atomic_read(&in_suspend))
	if (atomic_read(&in_suspend) && (!tz->ops->is_wakeable ||
		!(tz->ops->is_wakeable(tz))))
		return;

	trace_thermal_device_update(tz, event);
@@ -509,7 +510,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
{
	int count;

	if (atomic_read(&in_suspend))
	if (atomic_read(&in_suspend) && (!tz->ops->is_wakeable ||
		!(tz->ops->is_wakeable(tz))))
		return;

	if (!tz->ops->get_temp)
@@ -1600,6 +1602,9 @@ static int thermal_pm_notify(struct notifier_block *nb,
	case PM_POST_SUSPEND:
		atomic_set(&in_suspend, 0);
		list_for_each_entry(tz, &thermal_tz_list, node) {
			if (tz->ops->is_wakeable &&
				tz->ops->is_wakeable(tz))
				continue;
			thermal_zone_device_init(tz);
			thermal_zone_device_update(tz,
						   THERMAL_EVENT_UNSPECIFIED);
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ struct thermal_zone_device_ops {
			  enum thermal_trend *);
	int (*notify) (struct thermal_zone_device *, int,
		       enum thermal_trip_type);
	bool (*is_wakeable)(struct thermal_zone_device *);
};

struct thermal_cooling_device_ops {