return total_min_power;
}
-static u64 calc_power_budget(struct thermal_zone_device *tz, int desire_temp)
+static u32 calc_power_budget(struct _thermal_zone *zone, int control_temp)
{
s64 temp_diff;
s64 power_budget;
+ struct thermal_zone_device *tz = zone->tz;
/* temperature is represented in milidegress */
- temp_diff = desire_temp - tz->temperature;
+ temp_diff = control_temp - tz->temperature;
power_budget = temp_diff;
return NULL;
}
-static int inject_more_idle(struct _thermal_zone *zone)
+static int inject_more_idle(struct _thermal_zone *zone, u32 power_budget)
{
return 0;
struct thermal_cooling_device *cdev = NULL;
struct thermal_instance *inst = NULL;
u32 dev_power;
+ u32 power_budget;
+ int control_temp = 0;
struct _thermal_zone *zone;
int ret;
if (!zone)
return -EINVAL;
+
if (zone->single_cooling_dev) {
- /* ret = calc_power_budget(tz); */
- ret = inject_more_idle(zone);
+ power_budget = calc_power_budget(zone, control_temp);
+ /* only deadline tasks can ask for over-speed with idlers */
+ ret = inject_more_idle(zone, power_budget);
if (ret) {
throttle_single_cdev(zone);
power_actor_set_power(cdev, inst, dev_power);