Lines Matching refs:instance

30 static unsigned long get_target_state(struct thermal_instance *instance,  in get_target_state()  argument
33 struct thermal_cooling_device *cdev = instance->cdev; in get_target_state()
43 next_target = instance->target; in get_target_state()
46 if (!instance->initialized) { in get_target_state()
48 next_target = clamp((cur_state + 1), instance->lower, instance->upper); in get_target_state()
58 next_target = clamp((cur_state + 1), instance->lower, instance->upper); in get_target_state()
61 if (cur_state <= instance->lower) in get_target_state()
64 next_target = clamp((cur_state - 1), instance->lower, instance->upper); in get_target_state()
86 struct thermal_instance *instance; in thermal_zone_trip_update() local
100 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update()
101 if (instance->trip != trip) in thermal_zone_trip_update()
104 old_target = instance->target; in thermal_zone_trip_update()
105 instance->target = get_target_state(instance, trend, throttle); in thermal_zone_trip_update()
106 dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n", in thermal_zone_trip_update()
107 old_target, (int)instance->target); in thermal_zone_trip_update()
109 if (instance->initialized && old_target == instance->target) in thermal_zone_trip_update()
114 instance->target != THERMAL_NO_TARGET) in thermal_zone_trip_update()
118 instance->target == THERMAL_NO_TARGET) in thermal_zone_trip_update()
121 instance->initialized = true; in thermal_zone_trip_update()
122 mutex_lock(&instance->cdev->lock); in thermal_zone_trip_update()
123 instance->cdev->updated = false; /* cdev needs update */ in thermal_zone_trip_update()
124 mutex_unlock(&instance->cdev->lock); in thermal_zone_trip_update()
141 struct thermal_instance *instance; in step_wise_throttle() local
147 list_for_each_entry(instance, &tz->thermal_instances, tz_node) in step_wise_throttle()
148 thermal_cdev_update(instance->cdev); in step_wise_throttle()