aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel/panel-simple.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-11-13 04:58:49 -0500
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-11-13 04:59:10 -0500
commit0ea0397a3a12f9720d6acb78a48da796a54e81aa (patch)
treee2078363019cb2fde493844d7f25293412c4b6df /drivers/gpu/drm/panel/panel-simple.c
parent913240696ec64a2af2de250b1591cc45b5cea2f6 (diff)
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
Merge remote-tracking branch 'drm/drm-next' into drm-misc-next
drm-next is forwarded to v4.20-rc1, and we need this to make a patch series apply. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/panel/panel-simple.c')
-rw-r--r--drivers/gpu/drm/panel/panel-simple.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 07d576d99475..5fbee837b0db 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -56,6 +56,8 @@ struct panel_desc {
56 /** 56 /**
57 * @prepare: the time (in milliseconds) that it takes for the panel to 57 * @prepare: the time (in milliseconds) that it takes for the panel to
58 * become ready and start receiving video data 58 * become ready and start receiving video data
59 * @hpd_absent_delay: Add this to the prepare delay if we know Hot
60 * Plug Detect isn't used.
59 * @enable: the time (in milliseconds) that it takes for the panel to 61 * @enable: the time (in milliseconds) that it takes for the panel to
60 * display the first valid frame after starting to receive 62 * display the first valid frame after starting to receive
61 * video data 63 * video data
@@ -66,6 +68,7 @@ struct panel_desc {
66 */ 68 */
67 struct { 69 struct {
68 unsigned int prepare; 70 unsigned int prepare;
71 unsigned int hpd_absent_delay;
69 unsigned int enable; 72 unsigned int enable;
70 unsigned int disable; 73 unsigned int disable;
71 unsigned int unprepare; 74 unsigned int unprepare;
@@ -79,6 +82,7 @@ struct panel_simple {
79 struct drm_panel base; 82 struct drm_panel base;
80 bool prepared; 83 bool prepared;
81 bool enabled; 84 bool enabled;
85 bool no_hpd;
82 86
83 const struct panel_desc *desc; 87 const struct panel_desc *desc;
84 88
@@ -202,6 +206,7 @@ static int panel_simple_unprepare(struct drm_panel *panel)
202static int panel_simple_prepare(struct drm_panel *panel) 206static int panel_simple_prepare(struct drm_panel *panel)
203{ 207{
204 struct panel_simple *p = to_panel_simple(panel); 208 struct panel_simple *p = to_panel_simple(panel);
209 unsigned int delay;
205 int err; 210 int err;
206 211
207 if (p->prepared) 212 if (p->prepared)
@@ -215,8 +220,11 @@ static int panel_simple_prepare(struct drm_panel *panel)
215 220
216 gpiod_set_value_cansleep(p->enable_gpio, 1); 221 gpiod_set_value_cansleep(p->enable_gpio, 1);
217 222
218 if (p->desc->delay.prepare) 223 delay = p->desc->delay.prepare;
219 msleep(p->desc->delay.prepare); 224 if (p->no_hpd)
225 delay += p->desc->delay.hpd_absent_delay;
226 if (delay)
227 msleep(delay);
220 228
221 p->prepared = true; 229 p->prepared = true;
222 230
@@ -305,6 +313,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
305 panel->prepared = false; 313 panel->prepared = false;
306 panel->desc = desc; 314 panel->desc = desc;
307 315
316 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
317
308 panel->supply = devm_regulator_get(dev, "power"); 318 panel->supply = devm_regulator_get(dev, "power");
309 if (IS_ERR(panel->supply)) 319 if (IS_ERR(panel->supply))
310 return PTR_ERR(panel->supply); 320 return PTR_ERR(panel->supply);
@@ -1464,7 +1474,7 @@ static const struct panel_desc innolux_n156bge_l21 = {
1464 }, 1474 },
1465}; 1475};
1466 1476
1467static const struct drm_display_mode innolux_tv123wam_mode = { 1477static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
1468 .clock = 206016, 1478 .clock = 206016,
1469 .hdisplay = 2160, 1479 .hdisplay = 2160,
1470 .hsync_start = 2160 + 48, 1480 .hsync_start = 2160 + 48,
@@ -1478,15 +1488,16 @@ static const struct drm_display_mode innolux_tv123wam_mode = {
1478 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, 1488 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1479}; 1489};
1480 1490
1481static const struct panel_desc innolux_tv123wam = { 1491static const struct panel_desc innolux_p120zdg_bf1 = {
1482 .modes = &innolux_tv123wam_mode, 1492 .modes = &innolux_p120zdg_bf1_mode,
1483 .num_modes = 1, 1493 .num_modes = 1,
1484 .bpc = 8, 1494 .bpc = 8,
1485 .size = { 1495 .size = {
1486 .width = 259, 1496 .width = 254,
1487 .height = 173, 1497 .height = 169,
1488 }, 1498 },
1489 .delay = { 1499 .delay = {
1500 .hpd_absent_delay = 200,
1490 .unprepare = 500, 1501 .unprepare = 500,
1491 }, 1502 },
1492}; 1503};
@@ -2588,8 +2599,8 @@ static const struct of_device_id platform_of_match[] = {
2588 .compatible = "innolux,n156bge-l21", 2599 .compatible = "innolux,n156bge-l21",
2589 .data = &innolux_n156bge_l21, 2600 .data = &innolux_n156bge_l21,
2590 }, { 2601 }, {
2591 .compatible = "innolux,tv123wam", 2602 .compatible = "innolux,p120zdg-bf1",
2592 .data = &innolux_tv123wam, 2603 .data = &innolux_p120zdg_bf1,
2593 }, { 2604 }, {
2594 .compatible = "innolux,zj070na-01p", 2605 .compatible = "innolux,zj070na-01p",
2595 .data = &innolux_zj070na_01p, 2606 .data = &innolux_zj070na_01p,