Lines Matching defs:instance

31  *       equals lower limit, deactivate the thermal instance
35 * deactivate the thermal instance
37 static unsigned long get_target_state(struct thermal_instance *instance,
40 struct thermal_cooling_device *cdev = instance->cdev;
45 * We keep this instance the way it is by default.
50 next_target = instance->target;
53 if (!instance->initialized) {
55 next_target = (cur_state + 1) >= instance->upper ?
56 instance->upper :
57 ((cur_state + 1) < instance->lower ?
58 instance->lower : (cur_state + 1));
69 next_target = cur_state < instance->upper ?
70 (cur_state + 1) : instance->upper;
71 if (next_target < instance->lower)
72 next_target = instance->lower;
77 next_target = instance->upper;
80 if (cur_state <= instance->lower) {
86 if (next_target > instance->upper)
87 next_target = instance->upper;
92 if (cur_state == instance->lower) {
96 next_target = instance->lower;
109 * If value is +1, activate a passive instance.
110 * If value is -1, deactivate a passive instance.
121 struct thermal_instance *instance;
145 list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
146 if (instance->trip != trip)
149 old_target = instance->target;
150 instance->target = get_target_state(instance, trend, throttle);
151 dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
152 old_target, (int)instance->target);
154 if (instance->initialized && old_target == instance->target)
157 /* Activate a passive thermal instance */
159 instance->target != THERMAL_NO_TARGET)
161 /* Deactivate a passive thermal instance */
163 instance->target == THERMAL_NO_TARGET)
166 instance->initialized = true;
167 mutex_lock(&instance->cdev->lock);
168 instance->cdev->updated = false; /* cdev needs update */
169 mutex_unlock(&instance->cdev->lock);
188 struct thermal_instance *instance;
197 list_for_each_entry(instance, &tz->thermal_instances, tz_node)
198 thermal_cdev_update(instance->cdev);