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