Lines Matching refs: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()
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()
121 struct thermal_instance *instance; in thermal_zone_trip_update() local
140 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update()
141 if (instance->trip != trip) in thermal_zone_trip_update()
144 old_target = instance->target; in thermal_zone_trip_update()
145 instance->target = get_target_state(instance, trend, throttle); in thermal_zone_trip_update()
146 dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n", in thermal_zone_trip_update()
147 old_target, (int)instance->target); in thermal_zone_trip_update()
149 if (instance->initialized && old_target == instance->target) in thermal_zone_trip_update()
154 instance->target != THERMAL_NO_TARGET) in thermal_zone_trip_update()
158 instance->target == THERMAL_NO_TARGET) in thermal_zone_trip_update()
161 instance->initialized = true; in thermal_zone_trip_update()
162 mutex_lock(&instance->cdev->lock); in thermal_zone_trip_update()
163 instance->cdev->updated = false; /* cdev needs update */ in thermal_zone_trip_update()
164 mutex_unlock(&instance->cdev->lock); in thermal_zone_trip_update()
183 struct thermal_instance *instance; in step_wise_throttle() local
189 list_for_each_entry(instance, &tz->thermal_instances, tz_node) in step_wise_throttle()
190 thermal_cdev_update(instance->cdev); in step_wise_throttle()