diff options
author | Ajay Kumar <ajaykumar.rs@samsung.com> | 2014-07-31 13:42:11 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-08-06 10:44:14 -0400 |
commit | f673c37ec453ee7fe12cd55d90301cf843ab97f6 (patch) | |
tree | 4cd77a3f79012ea69c4a0fd63da22427f5a083c9 | |
parent | 613a633e7a567593efc03dc2357b6d25cd365c10 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/panel/panel-simple.c | 30 |
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 806beae77938..7798bdc9da54 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c | |||
@@ -43,6 +43,24 @@ struct panel_desc { | |||
43 | unsigned int width; | 43 | unsigned int width; |
44 | unsigned int height; | 44 | unsigned int height; |
45 | } size; | 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 | struct panel_simple { | 66 | struct panel_simple { |
@@ -109,6 +127,9 @@ static int panel_simple_disable(struct drm_panel *panel) | |||
109 | backlight_update_status(p->backlight); | 127 | backlight_update_status(p->backlight); |
110 | } | 128 | } |
111 | 129 | ||
130 | if (p->desc->delay.disable) | ||
131 | msleep(p->desc->delay.disable); | ||
132 | |||
112 | p->enabled = false; | 133 | p->enabled = false; |
113 | 134 | ||
114 | return 0; | 135 | return 0; |
@@ -126,6 +147,9 @@ static int panel_simple_unprepare(struct drm_panel *panel) | |||
126 | 147 | ||
127 | regulator_disable(p->supply); | 148 | regulator_disable(p->supply); |
128 | 149 | ||
150 | if (p->desc->delay.unprepare) | ||
151 | msleep(p->desc->delay.unprepare); | ||
152 | |||
129 | p->prepared = false; | 153 | p->prepared = false; |
130 | 154 | ||
131 | return 0; | 155 | return 0; |
@@ -148,6 +172,9 @@ static int panel_simple_prepare(struct drm_panel *panel) | |||
148 | if (p->enable_gpio) | 172 | if (p->enable_gpio) |
149 | gpiod_set_value_cansleep(p->enable_gpio, 1); | 173 | gpiod_set_value_cansleep(p->enable_gpio, 1); |
150 | 174 | ||
175 | if (p->desc->delay.prepare) | ||
176 | msleep(p->desc->delay.prepare); | ||
177 | |||
151 | p->prepared = true; | 178 | p->prepared = true; |
152 | 179 | ||
153 | return 0; | 180 | return 0; |
@@ -160,6 +187,9 @@ static int panel_simple_enable(struct drm_panel *panel) | |||
160 | if (p->enabled) | 187 | if (p->enabled) |
161 | return 0; | 188 | return 0; |
162 | 189 | ||
190 | if (p->desc->delay.enable) | ||
191 | msleep(p->desc->delay.enable); | ||
192 | |||
163 | if (p->backlight) { | 193 | if (p->backlight) { |
164 | p->backlight->props.power = FB_BLANK_UNBLANK; | 194 | p->backlight->props.power = FB_BLANK_UNBLANK; |
165 | backlight_update_status(p->backlight); | 195 | backlight_update_status(p->backlight); |