summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel
diff options
context:
space:
mode:
authorAjay Kumar <ajaykumar.rs@samsung.com>2014-07-31 23:12:11 +0530
committerThierry Reding <treding@nvidia.com>2014-08-06 16:44:14 +0200
commitf673c37ec453ee7fe12cd55d90301cf843ab97f6 (patch)
tree4cd77a3f79012ea69c4a0fd63da22427f5a083c9 /drivers/gpu/drm/panel
parent613a633e7a567593efc03dc2357b6d25cd365c10 (diff)
downloadop-kernel-dev-f673c37ec453ee7fe12cd55d90301cf843ab97f6.zip
op-kernel-dev-f673c37ec453ee7fe12cd55d90301cf843ab97f6.tar.gz
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>
Diffstat (limited to 'drivers/gpu/drm/panel')
-rw-r--r--drivers/gpu/drm/panel/panel-simple.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 806beae..7798bdc 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -43,6 +43,24 @@ struct panel_desc {
unsigned int width;
unsigned int height;
} size;
+
+ /**
+ * @prepare: the time (in milliseconds) that it takes for the panel to
+ * become ready and start receiving video data
+ * @enable: the time (in milliseconds) that it takes for the panel to
+ * display the first valid frame after starting to receive
+ * video data
+ * @disable: the time (in milliseconds) that it takes for the panel to
+ * turn the display off (no content is visible)
+ * @unprepare: the time (in milliseconds) that it takes for the panel
+ * to power itself down completely
+ */
+ struct {
+ unsigned int prepare;
+ unsigned int enable;
+ unsigned int disable;
+ unsigned int unprepare;
+ } delay;
};
struct panel_simple {
@@ -109,6 +127,9 @@ static int panel_simple_disable(struct drm_panel *panel)
backlight_update_status(p->backlight);
}
+ if (p->desc->delay.disable)
+ msleep(p->desc->delay.disable);
+
p->enabled = false;
return 0;
@@ -126,6 +147,9 @@ static int panel_simple_unprepare(struct drm_panel *panel)
regulator_disable(p->supply);
+ if (p->desc->delay.unprepare)
+ msleep(p->desc->delay.unprepare);
+
p->prepared = false;
return 0;
@@ -148,6 +172,9 @@ static int panel_simple_prepare(struct drm_panel *panel)
if (p->enable_gpio)
gpiod_set_value_cansleep(p->enable_gpio, 1);
+ if (p->desc->delay.prepare)
+ msleep(p->desc->delay.prepare);
+
p->prepared = true;
return 0;
@@ -160,6 +187,9 @@ static int panel_simple_enable(struct drm_panel *panel)
if (p->enabled)
return 0;
+ if (p->desc->delay.enable)
+ msleep(p->desc->delay.enable);
+
if (p->backlight) {
p->backlight->props.power = FB_BLANK_UNBLANK;
backlight_update_status(p->backlight);
OpenPOWER on IntegriCloud