Skip to content
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
20 changes: 18 additions & 2 deletions drivers/gpu/drm/rockchip/rockchip_ebc.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ static int temp_override = 0;
module_param(temp_override, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(temp_override, "Values > 0 override the temperature");

static int temp_offset = 0;
module_param(temp_offset, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(temp_offset, "Values > 0 is subtracted from the temperature to compensate for the pcb sensor being hotter than the display");

static int panel_temp = 0;
module_param(panel_temp, int, S_IRUGO);
MODULE_PARM_DESC(panel_temp, "The currently used value for the panel temperature");


DEFINE_DRM_GEM_FOPS(rockchip_ebc_fops);

Expand Down Expand Up @@ -1085,8 +1093,16 @@ static void rockchip_ebc_refresh(struct rockchip_ebc *ebc,

if (temp_override > 0){
printk(KERN_INFO "rockchip-ebc: override temperature from %i to %i\n", temp_override, temperature);
temperature = temp_override;
}
temperature = temp_override;
} else if (temp_offset > 0){
//int old_val = temperature;
if (temperature > temp_offset)
temperature -= temp_offset;
else
temperature = 0;
//printk(KERN_INFO "rockchip-ebc: temp offset from %i to %i\n", old_val, temperature);
}
panel_temp = temperature;

ret = drm_epd_lut_set_temperature(&ebc->lut, temperature);
if (ret < 0)
Expand Down