Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions drivers/thermal/x86_pkg_temp_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,25 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal, int trip,
return 0;
}

static int sys_set_emul_temp(struct thermal_zone_device *tz, int temp)
{
if(temp > 110000 || temp < -40000){
printk(KERN_ERROR "invalid emul_temperature %d\n", temp);
}else{
tz->emul_temperature = temp;
printk(KERN_ERROR "emul_temperature %d\n", temp);
}

return 0;
}

/* Thermal zone callback registry */
static struct thermal_zone_device_ops tzone_ops = {
.get_temp = sys_get_curr_temp,
.get_trip_temp = sys_get_trip_temp,
.get_trip_type = sys_get_trip_type,
.set_trip_temp = sys_set_trip_temp,
.set_emul_temp = sys_set_emul_temp,
};

static bool pkg_thermal_rate_control(void)
Expand Down