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

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

Merge "drivers: thermal: Add support to modify passive/polling delay to of_thermal"

parents 78d46777 f68eb1a3
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
@@ -503,6 +503,26 @@ static bool of_thermal_is_wakeable(struct thermal_zone_device *tz)
	return data->is_wakeable;
	return data->is_wakeable;
}
}


static int of_thermal_set_polling_delay(struct thermal_zone_device *tz,
				    int delay)
{
	struct __thermal_zone *data = tz->devdata;

	data->polling_delay = delay;

	return 0;
}

static int of_thermal_set_passive_delay(struct thermal_zone_device *tz,
				    int delay)
{
	struct __thermal_zone *data = tz->devdata;

	data->passive_delay = delay;

	return 0;
}

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)
{
{
@@ -630,6 +650,8 @@ static struct thermal_zone_device_ops of_thermal_ops = {
	.unbind = of_thermal_unbind,
	.unbind = of_thermal_unbind,


	.is_wakeable = of_thermal_is_wakeable,
	.is_wakeable = of_thermal_is_wakeable,
	.set_polling_delay = of_thermal_set_polling_delay,
	.set_passive_delay = of_thermal_set_passive_delay,
};
};


static struct thermal_zone_of_device_ops of_virt_ops = {
static struct thermal_zone_of_device_ops of_virt_ops = {
+4 −0
Original line number Original line Diff line number Diff line
@@ -391,6 +391,8 @@ polling_delay_store(struct device *dev, struct device_attribute *attr,


	mutex_lock(&tz->lock);
	mutex_lock(&tz->lock);
	tz->polling_delay = delay;
	tz->polling_delay = delay;
	if (tz->ops->set_polling_delay)
		tz->ops->set_polling_delay(tz, delay);
	mutex_unlock(&tz->lock);
	mutex_unlock(&tz->lock);
	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);


@@ -418,6 +420,8 @@ passive_delay_store(struct device *dev, struct device_attribute *attr,


	mutex_lock(&tz->lock);
	mutex_lock(&tz->lock);
	tz->passive_delay = delay;
	tz->passive_delay = delay;
	if (tz->ops->set_passive_delay)
		tz->ops->set_passive_delay(tz, delay);
	mutex_unlock(&tz->lock);
	mutex_unlock(&tz->lock);
	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);


+2 −0
Original line number Original line Diff line number Diff line
@@ -129,6 +129,8 @@ struct thermal_zone_device_ops {
	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 *);
	bool (*is_wakeable)(struct thermal_zone_device *);
	int (*set_polling_delay)(struct thermal_zone_device *, int);
	int (*set_passive_delay)(struct thermal_zone_device *, int);
};
};


struct thermal_cooling_device_ops {
struct thermal_cooling_device_ops {