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

Commit 583e957f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 6aa7d9ee 11175e36
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -196,6 +196,10 @@ Optional property:
			timing closures and other low temperature operating
			timing closures and other low temperature operating
			issues.
			issues.


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


	/* trip data */
	/* trip data */
	int ntrips;
	int ntrips;
@@ -512,6 +514,13 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
	return -EINVAL;
	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,
static int of_thermal_aggregate_trip_types(struct thermal_zone_device *tz,
		unsigned int trip_type_mask, int *low, int *high)
		unsigned int trip_type_mask, int *low, int *high)
{
{
@@ -637,6 +646,8 @@ static struct thermal_zone_device_ops of_thermal_ops = {


	.bind = of_thermal_bind,
	.bind = of_thermal_bind,
	.unbind = of_thermal_unbind,
	.unbind = of_thermal_unbind,

	.is_wakeable = of_thermal_is_wakeable,
};
};


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


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

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


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


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


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


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


struct thermal_cooling_device_ops {
struct thermal_cooling_device_ops {