Lines Matching defs:instance
28 * equals lower limit, deactivate the thermal instance
30 static unsigned long get_target_state(struct thermal_instance *instance,
33 struct thermal_cooling_device *cdev = instance->cdev;
38 * We keep this instance the way it is by default.
43 next_target = instance->target;
46 if (!instance->initialized) {
48 next_target = clamp((cur_state + 1), instance->lower, instance->upper);
58 next_target = clamp((cur_state + 1), instance->lower, instance->upper);
61 if (cur_state <= instance->lower)
64 next_target = clamp((cur_state - 1), instance->lower, instance->upper);
75 * If value is +1, activate a passive instance.
76 * If value is -1, deactivate a passive instance.
86 struct thermal_instance *instance;
100 list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
101 if (instance->trip != trip)
104 old_target = instance->target;
105 instance->target = get_target_state(instance, trend, throttle);
106 dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
107 old_target, (int)instance->target);
109 if (instance->initialized && old_target == instance->target)
112 /* Activate a passive thermal instance */
114 instance->target != THERMAL_NO_TARGET)
116 /* Deactivate a passive thermal instance */
118 instance->target == THERMAL_NO_TARGET)
121 instance->initialized = true;
122 mutex_lock(&instance->cdev->lock);
123 instance->cdev->updated = false; /* cdev needs update */
124 mutex_unlock(&instance->cdev->lock);
141 struct thermal_instance *instance;
147 list_for_each_entry(instance, &tz->thermal_instances, tz_node)
148 thermal_cdev_update(instance->cdev);