Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: simple: Support delays in panel functions

For most of the panels, we need to provide delays during various stages
of panel power up and power down. Add a structure to hold those delay
values and use them in corresponding functions.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Ajay Kumar and committed by
Thierry Reding
f673c37e 613a633e

+30
+30
drivers/gpu/drm/panel/panel-simple.c
··· 43 43 unsigned int width; 44 44 unsigned int height; 45 45 } size; 46 + 47 + /** 48 + * @prepare: the time (in milliseconds) that it takes for the panel to 49 + * become ready and start receiving video data 50 + * @enable: the time (in milliseconds) that it takes for the panel to 51 + * display the first valid frame after starting to receive 52 + * video data 53 + * @disable: the time (in milliseconds) that it takes for the panel to 54 + * turn the display off (no content is visible) 55 + * @unprepare: the time (in milliseconds) that it takes for the panel 56 + * to power itself down completely 57 + */ 58 + struct { 59 + unsigned int prepare; 60 + unsigned int enable; 61 + unsigned int disable; 62 + unsigned int unprepare; 63 + } delay; 46 64 }; 47 65 48 66 struct panel_simple { ··· 127 109 backlight_update_status(p->backlight); 128 110 } 129 111 112 + if (p->desc->delay.disable) 113 + msleep(p->desc->delay.disable); 114 + 130 115 p->enabled = false; 131 116 132 117 return 0; ··· 146 125 gpiod_set_value_cansleep(p->enable_gpio, 0); 147 126 148 127 regulator_disable(p->supply); 128 + 129 + if (p->desc->delay.unprepare) 130 + msleep(p->desc->delay.unprepare); 149 131 150 132 p->prepared = false; 151 133 ··· 172 148 if (p->enable_gpio) 173 149 gpiod_set_value_cansleep(p->enable_gpio, 1); 174 150 151 + if (p->desc->delay.prepare) 152 + msleep(p->desc->delay.prepare); 153 + 175 154 p->prepared = true; 176 155 177 156 return 0; ··· 186 159 187 160 if (p->enabled) 188 161 return 0; 162 + 163 + if (p->desc->delay.enable) 164 + msleep(p->desc->delay.enable); 189 165 190 166 if (p->backlight) { 191 167 p->backlight->props.power = FB_BLANK_UNBLANK;