1 From a060e4d4a34b0fe17384e2d02e65c74fe73ee4c9 Mon Sep 17 00:00:00 2001
2 From: Prajwal Mohan <prajwal.karur.mohan@intel.com>
3 Date: Thu, 6 May 2010 14:29:26 -0700
4 Subject: [PATCH] Graphics changes for Aava Koski DV1 hardware
6 Signed-Off-By: Prajwal Mohan <prajwal.karur.mohan@intel.com>
7 Patch-mainline: 2.6.35?
9 drivers/gpu/drm/mrst/drv/psb_drv.h | 7 +
10 drivers/gpu/drm/mrst/drv/psb_intel_display.c | 75 +-
11 drivers/gpu/drm/mrst/drv/psb_intel_dsi.c | 9 +
12 drivers/gpu/drm/mrst/drv/psb_intel_dsi_aava.c | 1356 ++++++++++----------
13 .../linux_framebuffer_mrst/mrstlfb_displayclass.c | 21 +-
14 5 files changed, 735 insertions(+), 733 deletions(-)
16 diff --git a/drivers/gpu/drm/mrst/drv/psb_drv.h b/drivers/gpu/drm/mrst/drv/psb_drv.h
17 index 2ac7934..56c1e90 100644
18 --- a/drivers/gpu/drm/mrst/drv/psb_drv.h
19 +++ b/drivers/gpu/drm/mrst/drv/psb_drv.h
20 @@ -413,6 +413,8 @@ struct drm_psb_private {
23 /* MRST_DSI private date start */
24 + struct work_struct dsi_work;
29 @@ -430,6 +432,9 @@ struct drm_psb_private {
31 enum mipi_panel_type panel_make;
33 + /* Set if MIPI encoder wants to control plane/pipe */
34 + bool dsi_plane_pipe_control;
37 uint32_t videoModeFormat:2;
39 @@ -610,6 +615,8 @@ struct drm_psb_private {
40 uint32_t saveMIPI_CONTROL_REG;
42 void (*init_drvIC)(struct drm_device *dev);
43 + void (*dsi_prePowerState)(struct drm_device *dev);
44 + void (*dsi_postPowerState)(struct drm_device *dev);
46 /* DPST Register Save */
47 uint32_t saveHISTOGRAM_INT_CONTROL_REG;
48 diff --git a/drivers/gpu/drm/mrst/drv/psb_intel_display.c b/drivers/gpu/drm/mrst/drv/psb_intel_display.c
49 index 10c6dec..72d42eb 100644
50 --- a/drivers/gpu/drm/mrst/drv/psb_intel_display.c
51 +++ b/drivers/gpu/drm/mrst/drv/psb_intel_display.c
52 @@ -2089,6 +2089,7 @@ static void mrst_crtc_dpms(struct drm_crtc *crtc, int mode)
54 struct drm_device *dev = crtc->dev;
55 struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
56 + struct drm_psb_private *dev_priv = dev->dev_private;
57 int pipe = psb_intel_crtc->pipe;
58 int dpll_reg = (pipe == 0) ? MRST_DPLL_A : DPLL_B;
59 int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
60 @@ -2130,18 +2131,22 @@ static void mrst_crtc_dpms(struct drm_crtc *crtc, int mode)
64 - /* Enable the pipe */
65 - temp = REG_READ(pipeconf_reg);
66 - if ((temp & PIPEACONF_ENABLE) == 0)
67 - REG_WRITE(pipeconf_reg, temp | PIPEACONF_ENABLE);
69 - /* Enable the plane */
70 - temp = REG_READ(dspcntr_reg);
71 - if ((temp & DISPLAY_PLANE_ENABLE) == 0) {
72 - REG_WRITE(dspcntr_reg,
73 - temp | DISPLAY_PLANE_ENABLE);
74 - /* Flush the plane changes */
75 - REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
76 + if (dev_priv->iLVDS_enable ||
77 + !dev_priv->dsi_plane_pipe_control) {
78 + /* Enable the pipe */
79 + temp = REG_READ(pipeconf_reg);
80 + if ((temp & PIPEACONF_ENABLE) == 0)
81 + REG_WRITE(pipeconf_reg,
82 + temp | PIPEACONF_ENABLE);
84 + /* Enable the plane */
85 + temp = REG_READ(dspcntr_reg);
86 + if ((temp & DISPLAY_PLANE_ENABLE) == 0) {
87 + REG_WRITE(dspcntr_reg,
88 + temp | DISPLAY_PLANE_ENABLE);
89 + /* Flush the plane changes */
90 + REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
94 psb_intel_crtc_load_lut(crtc);
95 @@ -2158,30 +2163,34 @@ static void mrst_crtc_dpms(struct drm_crtc *crtc, int mode)
96 /* Disable the VGA plane that we never use */
97 REG_WRITE(VGACNTRL, VGA_DISP_DISABLE);
99 - /* Disable display plane */
100 - temp = REG_READ(dspcntr_reg);
101 - if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
102 - REG_WRITE(dspcntr_reg,
103 - temp & ~DISPLAY_PLANE_ENABLE);
104 - /* Flush the plane changes */
105 - REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
106 - REG_READ(dspbase_reg);
108 + if (dev_priv->iLVDS_enable ||
109 + !dev_priv->dsi_plane_pipe_control) {
110 + /* Disable display plane */
111 + temp = REG_READ(dspcntr_reg);
112 + if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
113 + REG_WRITE(dspcntr_reg,
114 + temp & ~DISPLAY_PLANE_ENABLE);
115 + /* Flush the plane changes */
116 + REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
117 + REG_READ(dspbase_reg);
120 - if (!IS_I9XX(dev)) {
121 - /* Wait for vblank for the disable to take effect */
122 - psb_intel_wait_for_vblank(dev);
124 + if (!IS_I9XX(dev)) {
125 + /* Wait for vblank for the disable to take effect */
126 + psb_intel_wait_for_vblank(dev);
129 - /* Next, disable display pipes */
130 - temp = REG_READ(pipeconf_reg);
131 - if ((temp & PIPEACONF_ENABLE) != 0) {
132 - REG_WRITE(pipeconf_reg, temp & ~PIPEACONF_ENABLE);
133 - REG_READ(pipeconf_reg);
135 + /* Next, disable display pipes */
136 + temp = REG_READ(pipeconf_reg);
137 + if ((temp & PIPEACONF_ENABLE) != 0) {
138 + REG_WRITE(pipeconf_reg,
139 + temp & ~PIPEACONF_ENABLE);
140 + REG_READ(pipeconf_reg);
143 - /* Wait for for the pipe disable to take effect. */
144 - mrstWaitForPipeDisable(dev);
145 + /* Wait for for the pipe disable to take effect. */
146 + mrstWaitForPipeDisable(dev);
149 temp = REG_READ(dpll_reg);
150 if ((temp & DPLL_VCO_ENABLE) != 0) {
151 diff --git a/drivers/gpu/drm/mrst/drv/psb_intel_dsi.c b/drivers/gpu/drm/mrst/drv/psb_intel_dsi.c
152 index 3d45df8..eb6cb2a 100644
153 --- a/drivers/gpu/drm/mrst/drv/psb_intel_dsi.c
154 +++ b/drivers/gpu/drm/mrst/drv/psb_intel_dsi.c
156 * jim liu <jim.liu@intel.com>
159 +#define USE_AAVA_VERSION
160 +#ifdef USE_AAVA_VERSION
161 +#include "psb_intel_dsi_aava.c"
164 #include <linux/backlight.h>
165 #include <drm/drmP.h>
167 @@ -2448,3 +2453,7 @@ failed_find:
168 drm_connector_cleanup(connector);
172 +#endif /* USE_AAVA_VERSION */
175 diff --git a/drivers/gpu/drm/mrst/drv/psb_intel_dsi_aava.c b/drivers/gpu/drm/mrst/drv/psb_intel_dsi_aava.c
176 index 6c21480..9e761c6 100644
177 --- a/drivers/gpu/drm/mrst/drv/psb_intel_dsi_aava.c
178 +++ b/drivers/gpu/drm/mrst/drv/psb_intel_dsi_aava.c
181 - * Copyright © 2006-2007 Intel Corporation
183 - * Permission is hereby granted, free of charge, to any person obtaining a
184 - * copy of this software and associated documentation files (the "Software"),
185 - * to deal in the Software without restriction, including without limitation
186 - * the rights to use, copy, modify, merge, publish, distribute, sublicense,
187 - * and/or sell copies of the Software, and to permit persons to whom the
188 - * Software is furnished to do so, subject to the following conditions:
190 - * The above copyright notice and this permission notice (including the next
191 - * paragraph) shall be included in all copies or substantial portions of the
194 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
195 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
196 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
197 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
199 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
200 - * DEALINGS IN THE SOFTWARE.
203 - * jim liu <jim.liu@intel.com>
206 -/* This enables setting backlights on with a delay at startup,
207 - should be removed after resolving issue with backlights going off
208 - after setting them on in initial mrst_dsi_set_power call */
210 #define AAVA_BACKLIGHT_HACK
212 #include <linux/backlight.h>
215 #include <drm/drm_crtc.h>
216 #include <drm/drm_edid.h>
218 #include <asm/ipc_defs.h>
220 -#ifdef AAVA_BACKLIGHT_HACK
221 -#include <linux/workqueue.h>
222 -#endif /* AAVA_BACKLIGHT_HACK */
225 #include "psb_intel_drv.h"
226 #include "psb_intel_reg.h"
227 #include "ospm_power.h"
229 -#define DRM_MODE_ENCODER_MIPI 5
230 +#ifdef AAVA_BACKLIGHT_HACK
231 +#include <linux/workqueue.h>
232 +#endif /* AAVA_BACKLIGHT_HACK */
234 -//#define DBG_PRINTS 1
235 -#define DBG_PRINTS 0
236 +/* Debug trace definitions */
239 -#define NEW_CRAP_SAMPLE_SETTINGS
241 +#define DBG_TRACE(format,args...) printk(KERN_ERR "%s: " format "\n", \
242 + __FUNCTION__ , ## args)
244 +#define DBG_TRACE(format,args...)
247 +#define DBG_ERR(format,args...) printk(KERN_ERR "%s: " format "\n", \
248 + __FUNCTION__ , ## args)
251 +#define BRIGHTNESS_MAX_LEVEL 100
253 +#define DRM_MODE_ENCODER_MIPI 5
257 @@ -84,686 +63,633 @@
258 #define DISP_VSYNC_START (DISP_VBLANK_START + VFP_LINES - 1)
259 #define DISP_VSYNC_END (DISP_VSYNC_START + VSYNC_LINES - 1)
261 -#define BRIGHTNESS_MAX_LEVEL 100
262 +#define MAX_FIFO_WAIT_MS 100
264 static unsigned int dphy_reg = 0x0d0a7f06;
265 static unsigned int mipi_clock = 0x2;
267 #ifdef AAVA_BACKLIGHT_HACK
268 -static void bl_work_handler(struct work_struct *work);
269 -DECLARE_DELAYED_WORK(bl_work, bl_work_handler);
270 +static void dsi_bl_work_handler(struct work_struct *work);
271 +DECLARE_DELAYED_WORK(bl_work, dsi_bl_work_handler);
272 #endif /* AAVA_BACKLIGHT_HACK */
274 // Temporary access from sysfs begin
275 -static struct drm_encoder *orig_encoder;
276 -static void mrst_dsi_prepare(struct drm_encoder *encoder);
277 -static void mrst_dsi_commit(struct drm_encoder *encoder);
278 -static void mrst_dsi_mode_set(struct drm_encoder *encoder,
279 - struct drm_display_mode *mode,
280 - struct drm_display_mode *adjusted_mode);
281 -static void panel_reset(void);
283 -static ssize_t dphy_store(struct class *class, const char *buf, size_t len)
284 +static struct drm_device *test_dev;
285 +// Temporary access from sysfs end
288 +static int dsi_wait_hs_data_fifo(struct drm_device *dev)
291 - unsigned long value;
292 + int fifo_wait_time = 0;
294 - status = strict_strtoul(buf, 16, &value);
296 - printk("!!! dphy_reg = %x, clock = %x\n", dphy_reg, mipi_clock);
297 + while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
298 + HS_DATA_FIFO_FULL) {
299 + if (fifo_wait_time == MAX_FIFO_WAIT_MS) {
300 + DBG_ERR("timeout");
310 +static int dsi_wait_hs_ctrl_fifo(struct drm_device *dev)
312 + int fifo_wait_time = 0;
314 + while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
315 + HS_CTRL_FIFO_FULL) {
316 + if (fifo_wait_time == MAX_FIFO_WAIT_MS) {
317 + DBG_ERR("timeout");
326 -static ssize_t clock_store(struct class *class, const char *buf, size_t len)
327 +static void dsi_set_backlight_state(int state)
330 - unsigned long value;
331 + struct ipc_pmic_reg_data tmp_reg;
333 - status = strict_strtoul(buf, 0, &value);
334 - mipi_clock = value;
335 - printk("!!! dphy_reg = %x, clock = %x\n", dphy_reg, mipi_clock);
336 + DBG_TRACE("%d", state);
340 + tmp_reg.num_entries = 2;
341 + tmp_reg.pmic_reg_data[0].register_address = 0x2a;
342 + tmp_reg.pmic_reg_data[1].register_address = 0x28;
345 + tmp_reg.pmic_reg_data[0].value = 0xaa;
346 + tmp_reg.pmic_reg_data[1].value = 0x30;
348 + tmp_reg.pmic_reg_data[0].value = 0x00;
349 + tmp_reg.pmic_reg_data[1].value = 0x00;
352 + if (ipc_pmic_register_write(&tmp_reg, TRUE))
353 + DBG_ERR("pmic reg write failed");
356 -static ssize_t apply_settings(struct class *class, const char *buf, size_t len)
358 +#ifdef AAVA_BACKLIGHT_HACK
359 +static void dsi_bl_work_handler(struct work_struct *work)
364 + dsi_set_backlight_state(1);
366 +#endif /* AAVA_BACKLIGHT_HACK */
368 - printk("!!! dphy_reg = %x, clock = %x\n", dphy_reg, mipi_clock);
370 - status = strict_strtoul(buf, 0, &value);
372 - mrst_dsi_prepare(orig_encoder);
378 - mrst_dsi_mode_set(orig_encoder, NULL, NULL);
380 - mrst_dsi_commit(orig_encoder);
381 +static void dsi_set_panel_reset_state(int state)
383 + struct ipc_pmic_reg_data tmp_reg = {0};
385 + DBG_TRACE("%d", state);
388 + tmp_reg.num_entries = 1;
389 + tmp_reg.pmic_reg_data[0].register_address = 0xe6;
392 + tmp_reg.pmic_reg_data[0].value = 0x01;
394 + tmp_reg.pmic_reg_data[0].value = 0x09;
396 + if (ipc_pmic_register_write(&tmp_reg, TRUE)) {
397 + DBG_ERR("pmic reg write failed");
403 + /* Minimum active time to trigger reset is 10us */
406 + /* Maximum startup time from reset is 120ms */
410 -// Temporary access from sysfs end
412 -static void panel_init(struct drm_device *dev)
414 +static void dsi_init_panel(struct drm_device *dev)
417 - printk("panel_init\n");
418 -#endif /* DBG_PRINTS */
421 - /* Flip page order */
422 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
423 - HS_DATA_FIFO_FULL);
424 + /* Flip page order to have correct image orientation */
425 + if (dsi_wait_hs_data_fifo(dev) < 0)
427 REG_WRITE(0xb068, 0x00008036);
428 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
429 - HS_CTRL_FIFO_FULL);
430 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
432 REG_WRITE(0xb070, 0x00000229);
434 -#ifdef NEW_CRAP_SAMPLE_SETTINGS
435 - // 0xF0, for new crap displays
436 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
437 - HS_DATA_FIFO_FULL);
438 - REG_WRITE(0xb068, 0x005a5af0);
439 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
440 - HS_CTRL_FIFO_FULL);
441 + /* Write protection key to allow DM bit setting */
442 + if (dsi_wait_hs_data_fifo(dev) < 0)
444 + REG_WRITE(0xb068, 0x005a5af1);
445 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
447 REG_WRITE(0xb070, 0x00000329);
450 - /* Write protection key */
451 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
452 - HS_DATA_FIFO_FULL);
453 - REG_WRITE(0xb068, 0x005a5af1);
454 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
455 - HS_CTRL_FIFO_FULL);
456 + /* Set DM bit to enable video mode */
457 + if (dsi_wait_hs_data_fifo(dev) < 0)
459 + REG_WRITE(0xb068, 0x000100f7);
460 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
462 REG_WRITE(0xb070, 0x00000329);
464 -#ifdef NEW_CRAP_SAMPLE_SETTINGS
465 - // 0xFC, for new crap displays
466 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
467 - HS_DATA_FIFO_FULL);
468 + /* Write protection keys to allow TCON setting */
469 + if (dsi_wait_hs_data_fifo(dev) < 0)
471 + REG_WRITE(0xb068, 0x005a5af0);
472 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
474 + REG_WRITE(0xb070, 0x00000329);
476 + if (dsi_wait_hs_data_fifo(dev) < 0)
478 REG_WRITE(0xb068, 0x005a5afc);
479 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
480 - HS_CTRL_FIFO_FULL);
481 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
483 REG_WRITE(0xb070, 0x00000329);
485 - // 0xB7, for new crap displays
486 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
487 - HS_DATA_FIFO_FULL);
488 -#ifdef DOES_NOT_WORK
489 - /* Suggested by TPO, doesn't work as usual */
490 + /* Write TCON setting */
491 + if (dsi_wait_hs_data_fifo(dev) < 0)
494 + /* Suggested by TPO, doesn't work */
495 REG_WRITE(0xb068, 0x110000b7);
496 REG_WRITE(0xb068, 0x00000044);
498 REG_WRITE(0xb068, 0x770000b7);
499 REG_WRITE(0xb068, 0x00000044);
501 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
502 - HS_CTRL_FIFO_FULL);
503 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
505 REG_WRITE(0xb070, 0x00000529);
508 - // 0xB6, for new crap displays
509 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
510 - HS_DATA_FIFO_FULL);
511 - REG_WRITE(0xb068, 0x000a0ab6);
512 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
513 - HS_CTRL_FIFO_FULL);
514 - REG_WRITE(0xb070, 0x00000329);
516 - // 0xF2, for new crap displays
517 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
518 - HS_DATA_FIFO_FULL);
519 - REG_WRITE(0xb068, 0x081010f2);
520 - REG_WRITE(0xb068, 0x4a070708);
521 - REG_WRITE(0xb068, 0x000000c5);
522 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
523 - HS_CTRL_FIFO_FULL);
524 - REG_WRITE(0xb070, 0x00000929);
525 +static void dsi_set_ptarget_state(struct drm_device *dev, int state)
529 - // 0xF8, for new crap displays
530 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
531 - HS_DATA_FIFO_FULL);
532 - REG_WRITE(0xb068, 0x024003f8);
533 - REG_WRITE(0xb068, 0x01030a04);
534 - REG_WRITE(0xb068, 0x0e020220);
535 - REG_WRITE(0xb068, 0x00000004);
536 + DBG_TRACE("%d", state);
538 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
539 - HS_CTRL_FIFO_FULL);
540 - REG_WRITE(0xb070, 0x00000d29);
542 + REG_WRITE(PP_CONTROL, (REG_READ(PP_CONTROL) | POWER_TARGET_ON));
544 + pp_sts_reg = REG_READ(PP_STATUS);
545 + } while ((pp_sts_reg & (PP_ON | PP_READY)) == PP_READY);
547 + REG_WRITE(PP_CONTROL,
548 + (REG_READ(PP_CONTROL) & ~POWER_TARGET_ON));
550 + pp_sts_reg = REG_READ(PP_STATUS);
551 + } while (pp_sts_reg & PP_ON);
555 - // 0xE2, for new crap displays
556 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
557 - HS_DATA_FIFO_FULL);
558 - REG_WRITE(0xb068, 0x398fc3e2);
559 - REG_WRITE(0xb068, 0x0000916f);
560 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
561 - HS_CTRL_FIFO_FULL);
562 - REG_WRITE(0xb070, 0x00000629);
564 -#ifdef DOES_NOT_WORK
565 - /* Suggested by TPO, doesn't work as usual */
566 - // 0xE3, for new crap displays
567 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
568 - HS_DATA_FIFO_FULL);
569 - REG_WRITE(0xb068, 0x20f684e3);
570 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
571 - HS_CTRL_FIFO_FULL);
572 - REG_WRITE(0xb070, 0x00000429);
573 +static void dsi_send_turn_on_packet(struct drm_device *dev)
579 + REG_WRITE(DPI_CONTROL_REG, DPI_TURN_ON);
581 - // 0xB0, for new crap displays
582 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
583 - HS_DATA_FIFO_FULL);
584 - REG_WRITE(0xb068, 0x000000b0);
585 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
586 - HS_CTRL_FIFO_FULL);
587 - REG_WRITE(0xb070, 0x00000229);
588 + /* Short delay to wait that display turns on */
592 - // 0xF4, for new crap displays
593 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
594 - HS_DATA_FIFO_FULL);
595 - REG_WRITE(0xb068, 0x240242f4);
596 - REG_WRITE(0xb068, 0x78ee2002);
597 - REG_WRITE(0xb068, 0x2a071050);
598 - REG_WRITE(0xb068, 0x507fee10);
599 - REG_WRITE(0xb068, 0x10300710);
600 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
601 - HS_CTRL_FIFO_FULL);
602 - REG_WRITE(0xb070, 0x00001429);
604 - // 0xBA, for new crap displays
605 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
606 - HS_DATA_FIFO_FULL);
607 - REG_WRITE(0xb068, 0x19fe07ba);
608 - REG_WRITE(0xb068, 0x101c0a31);
609 - REG_WRITE(0xb068, 0x00000010);
610 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
611 - HS_CTRL_FIFO_FULL);
612 - REG_WRITE(0xb070, 0x00000929);
613 +static void dsi_send_shutdown_packet(struct drm_device *dev)
617 - // 0xBB, for new crap displays
618 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
619 - HS_DATA_FIFO_FULL);
620 - REG_WRITE(0xb068, 0x28ff07bb);
621 - REG_WRITE(0xb068, 0x24280a31);
622 - REG_WRITE(0xb068, 0x00000034);
623 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
624 - HS_CTRL_FIFO_FULL);
625 - REG_WRITE(0xb070, 0x00000929);
626 + REG_WRITE(DPI_CONTROL_REG, DPI_SHUT_DOWN);
629 - // 0xFB, for new crap displays
630 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
631 - HS_DATA_FIFO_FULL);
632 - REG_WRITE(0xb068, 0x535d05fb);
633 - REG_WRITE(0xb068, 0x1b1a2130);
634 - REG_WRITE(0xb068, 0x221e180e);
635 - REG_WRITE(0xb068, 0x131d2120);
636 - REG_WRITE(0xb068, 0x535d0508);
637 - REG_WRITE(0xb068, 0x1c1a2131);
638 - REG_WRITE(0xb068, 0x231f160d);
639 - REG_WRITE(0xb068, 0x111b2220);
640 - REG_WRITE(0xb068, 0x535c2008);
641 - REG_WRITE(0xb068, 0x1f1d2433);
642 - REG_WRITE(0xb068, 0x2c251a10);
643 - REG_WRITE(0xb068, 0x2c34372d);
644 - REG_WRITE(0xb068, 0x00000023);
645 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
646 - HS_CTRL_FIFO_FULL);
647 - REG_WRITE(0xb070, 0x00003129);
649 - // 0xFA, for new crap displays
650 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
651 - HS_DATA_FIFO_FULL);
652 - REG_WRITE(0xb068, 0x525c0bfa);
653 - REG_WRITE(0xb068, 0x1c1c232f);
654 - REG_WRITE(0xb068, 0x2623190e);
655 - REG_WRITE(0xb068, 0x18212625);
656 - REG_WRITE(0xb068, 0x545d0d0e);
657 - REG_WRITE(0xb068, 0x1e1d2333);
658 - REG_WRITE(0xb068, 0x26231a10);
659 - REG_WRITE(0xb068, 0x1a222725);
660 - REG_WRITE(0xb068, 0x545d280f);
661 - REG_WRITE(0xb068, 0x21202635);
662 - REG_WRITE(0xb068, 0x31292013);
663 - REG_WRITE(0xb068, 0x31393d33);
664 - REG_WRITE(0xb068, 0x00000029);
665 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
666 - HS_CTRL_FIFO_FULL);
667 - REG_WRITE(0xb070, 0x00003129);
669 +static void dsi_set_pipe_plane_enable_state(struct drm_device *dev, int state)
674 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_DATA_FIFO_FULL) ==
675 - HS_DATA_FIFO_FULL);
676 - REG_WRITE(0xb068, 0x000100f7);
677 - while ((REG_READ(GEN_FIFO_STAT_REG) & HS_CTRL_FIFO_FULL) ==
678 - HS_CTRL_FIFO_FULL);
679 - REG_WRITE(0xb070, 0x00000329);
681 + DBG_TRACE("%d", state);
685 + temp_reg = REG_READ(PIPEACONF);
686 + temp_reg |= (PIPEACONF_ENABLE);
687 + REG_WRITE(PIPEACONF, temp_reg);
688 + temp_reg = REG_READ(PIPEACONF);
690 -static void panel_reset_on(void)
692 - struct ipc_pmic_reg_data tmp_reg = {0};
694 - printk("panel_reset_on\n");
695 -#endif /* DBG_PRINTS */
697 - tmp_reg.num_entries = 1;
699 - tmp_reg.pmic_reg_data[0].register_address = 0xe6;
700 - tmp_reg.pmic_reg_data[0].value = 0x01;
702 - tmp_reg.pmic_reg_data[0].register_address = 0xf4;
703 - if (ipc_pmic_register_read(&tmp_reg)) {
704 - printk("panel_reset_on: failed to read pmic reg 0xf4!\n");
707 - tmp_reg.pmic_reg_data[0].value &= 0xbf;
708 -#endif /* AAVA_EV_0_5 */
709 - if (ipc_pmic_register_write(&tmp_reg, TRUE)) {
710 - printk("panel_reset_on: failed to write pmic reg 0xe6!\n");
713 + /* Wait for 20ms for the pipe enable to take effect. */
717 + temp_reg = REG_READ(DSPACNTR);
718 + temp_reg |= (DISPLAY_PLANE_ENABLE);
719 + REG_WRITE(DSPACNTR, temp_reg);
720 + temp_reg = REG_READ(DSPACNTR);
722 -static void panel_reset_off(void)
724 - struct ipc_pmic_reg_data tmp_reg = {0};
726 - printk("panel_reset_off\n");
727 -#endif /* DBG_PRINTS */
729 - tmp_reg.num_entries = 1;
731 - tmp_reg.pmic_reg_data[0].register_address = 0xe6;
732 - tmp_reg.pmic_reg_data[0].value = 0x09;
734 - tmp_reg.pmic_reg_data[0].register_address = 0xf4;
735 - if (ipc_pmic_register_read(&tmp_reg)) {
736 - printk("panel_reset_off: failed to read pmic reg 0xf4!\n");
739 - tmp_reg.pmic_reg_data[0].value |= 0x40;
740 -#endif /* AAVA_EV_0_5 */
741 - if (ipc_pmic_register_write(&tmp_reg, TRUE)) {
742 - printk("panel_reset_off: failed to write pmic reg 0xe6!\n");
743 + /* Flush plane change by read/write/read of BASE reg */
744 + temp_reg = REG_READ(MRST_DSPABASE);
745 + REG_WRITE(MRST_DSPABASE, temp_reg);
746 + temp_reg = REG_READ(MRST_DSPABASE);
748 + /* Wait for 20ms for the plane enable to take effect. */
751 + /* Disable plane */
752 + temp_reg = REG_READ(DSPACNTR);
753 + temp_reg &= ~(DISPLAY_PLANE_ENABLE);
754 + REG_WRITE(DSPACNTR, temp_reg);
755 + temp_reg = REG_READ(DSPACNTR);
757 + /* Flush plane change by read/write/read of BASE reg */
758 + temp_reg = REG_READ(MRST_DSPABASE);
759 + REG_WRITE(MRST_DSPABASE, temp_reg);
760 + temp_reg = REG_READ(MRST_DSPABASE);
762 + /* Wait for 20ms for the plane disable to take effect. */
766 + temp_reg = REG_READ(PIPEACONF);
767 + temp_reg &= ~(PIPEACONF_ENABLE);
768 + REG_WRITE(PIPEACONF, temp_reg);
769 + temp_reg = REG_READ(PIPEACONF);
771 + /* Wait for 20ms for the pipe disable to take effect. */
777 -static void panel_reset(void)
778 +static void dsi_set_device_ready_state(struct drm_device *dev, int state)
781 - printk("panel_reset\n");
782 -#endif /* DBG_PRINTS */
788 + DBG_TRACE("%d", state);
791 + REG_WRITE(DEVICE_READY_REG, 0x00000001);
793 + REG_WRITE(DEVICE_READY_REG, 0x00000000);
797 -static void backlight_state(bool on)
798 +static void dsi_configure_mipi_block(struct drm_device *dev)
800 - struct ipc_pmic_reg_data tmp_reg;
801 + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
802 + u32 color_format = (RGB_888_FMT << FMT_DPI_POS);
806 - printk("backlight_state\n");
807 -#endif /* DBG_PRINTS */
811 - tmp_reg.num_entries = 2;
812 - tmp_reg.pmic_reg_data[0].register_address = 0x2a;
813 - tmp_reg.pmic_reg_data[1].register_address = 0x28;
814 + /* MIPI clock ratio 1:1 */
815 + //REG_WRITE(MIPI_CONTROL_REG, 0x00000018);
816 + //REG_WRITE(0xb080, 0x0b061a02);
820 - printk("backlight_state: ON\n");
821 -#endif /* DBG_PRINTS */
822 - tmp_reg.pmic_reg_data[0].value = 0xaa;
824 - tmp_reg.pmic_reg_data[1].value = 0x30;
826 - tmp_reg.pmic_reg_data[1].value = 0x60;
827 -#endif /* AAVA_EV_0_5 */
830 - printk("backlight_state: OFF\n");
831 -#endif /* DBG_PRINTS */
832 - tmp_reg.pmic_reg_data[0].value = 0x00;
833 - tmp_reg.pmic_reg_data[1].value = 0x00;
835 + /* MIPI clock ratio 2:1 */
836 + //REG_WRITE(MIPI_CONTROL_REG, 0x00000019);
837 + //REG_WRITE(0xb080, 0x3f1f1c04);
839 - if (ipc_pmic_register_write(&tmp_reg, TRUE)) {
840 - printk("backlight_state: failed to write pmic regs 0x2a and 0x28!\n");
843 + /* MIPI clock ratio 3:1 */
844 + //REG_WRITE(MIPI_CONTROL_REG, 0x0000001a);
845 + //REG_WRITE(0xb080, 0x091f7f08);
847 -#ifdef AAVA_BACKLIGHT_HACK
848 -static void bl_work_handler(struct work_struct *work)
850 - backlight_state(true);
851 + /* MIPI clock ratio 4:1 */
852 + REG_WRITE(MIPI_CONTROL_REG, (0x00000018 | mipi_clock));
853 + REG_WRITE(0xb080, dphy_reg);
855 + /* Enable all interrupts */
856 + REG_WRITE(INTR_EN_REG, 0xffffffff);
858 + REG_WRITE(TURN_AROUND_TIMEOUT_REG, 0x0000000A);
859 + REG_WRITE(DEVICE_RESET_REG, 0x000000ff);
860 + REG_WRITE(INIT_COUNT_REG, 0x00000fff);
861 + REG_WRITE(HS_TX_TIMEOUT_REG, 0x90000);
862 + REG_WRITE(LP_RX_TIMEOUT_REG, 0xffff);
863 + REG_WRITE(HIGH_LOW_SWITCH_COUNT_REG, 0x46);
864 + REG_WRITE(EOT_DISABLE_REG, 0x00000000);
865 + REG_WRITE(LP_BYTECLK_REG, 0x00000004);
867 + REG_WRITE(VIDEO_FMT_REG, dev_priv->videoModeFormat);
869 + REG_WRITE(DSI_FUNC_PRG_REG, (dev_priv->laneCount | color_format));
871 + res = dev_priv->HactiveArea | (dev_priv->VactiveArea << RES_V_POS);
872 + REG_WRITE(DPI_RESOLUTION_REG, res);
874 + REG_WRITE(VERT_SYNC_PAD_COUNT_REG, dev_priv->VsyncWidth);
875 + REG_WRITE(VERT_BACK_PORCH_COUNT_REG, dev_priv->VbackPorch);
876 + REG_WRITE(VERT_FRONT_PORCH_COUNT_REG, dev_priv->VfrontPorch);
878 + REG_WRITE(HORIZ_SYNC_PAD_COUNT_REG, dev_priv->HsyncWidth);
879 + REG_WRITE(HORIZ_BACK_PORCH_COUNT_REG, dev_priv->HbackPorch);
880 + REG_WRITE(HORIZ_FRONT_PORCH_COUNT_REG, dev_priv->HfrontPorch);
881 + REG_WRITE(HORIZ_ACTIVE_AREA_COUNT_REG, MIPI_HACT);
883 + /* Enable MIPI Port */
884 + REG_WRITE(MIPI, MIPI_PORT_EN);
886 -#endif /* AAVA_BACKLIGHT_HACK */
890 - * Sets the power state for the panel.
892 -static void mrst_dsi_set_power(struct drm_device *dev,
893 - struct psb_intel_output *output, bool on)
894 +static void dsi_configure_down(struct drm_device *dev)
896 DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
900 - printk("mrst_dsi_set_power\n");
901 -#endif /* DBG_PRINTS */
905 - * The DIS device must be ready before we can change power state.
907 - if (!dev_priv->dsi_device_ready)
910 - printk("mrst_dsi_set_power: !dev_priv->dsi_device_ready!\n");
911 -#endif /* DBG_PRINTS */
912 + if (!dev_priv->dpi_panel_on) {
913 + DBG_TRACE("already off");
918 - * We don't support dual DSI yet. May be in POR in the future.
919 + /* Disable backlight */
920 + dsi_set_backlight_state(0);
922 + /* Disable pipe and plane */
923 + dsi_set_pipe_plane_enable_state(dev, 0);
925 + /* Disable PTARGET */
926 + dsi_set_ptarget_state(dev, 0);
928 + /* Send shutdown command, can only be sent if
929 + * interface is configured
931 - if (dev_priv->dual_display)
934 - printk("mrst_dsi_set_power: dev_priv->dual_display!\n");
935 -#endif /* DBG_PRINTS */
938 + if (dev_priv->dsi_device_ready)
939 + dsi_send_shutdown_packet(dev);
941 - if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
942 - OSPM_UHB_FORCE_POWER_ON))
944 + /* Clear device ready state */
945 + dsi_set_device_ready_state(dev, 0);
949 - printk("mrst_dsi_set_power: on\n");
950 -#endif /* DBG_PRINTS */
951 - if (dev_priv->dpi && !dev_priv->dpi_panel_on) {
953 - printk("mrst_dsi_set_power: dpi\n");
954 -#endif /* DBG_PRINTS */
955 - REG_WRITE(DPI_CONTROL_REG, DPI_TURN_ON);
956 - REG_WRITE(PP_CONTROL,
957 - (REG_READ(PP_CONTROL) | POWER_TARGET_ON));
959 - pp_status = REG_READ(PP_STATUS);
960 - } while ((pp_status & (PP_ON | PP_READY)) == PP_READY);
962 - /* Run TPO display specific initialisations */
963 -// MiKo TBD, this delay may need to be tuned
967 - /* Set backlights on */
968 - backlight_state( true );
969 - dev_priv->dpi_panel_on = true;
973 - printk("mrst_dsi_set_power: off\n");
974 -#endif /* DBG_PRINTS */
975 - if (dev_priv->dpi && dev_priv->dpi_panel_on) {
977 - printk("mrst_dsi_set_power: dpi\n");
978 -#endif /* DBG_PRINTS */
979 - /* Set backlights off */
980 - backlight_state( false );
982 -// MiKo TBD, something clever could be done here to save power, for example:
983 -// -Set display to sleep mode, or
984 -// -Set display to HW reset, or
985 -// -Shutdown the voltages to display
987 - REG_WRITE(PP_CONTROL,
988 - (REG_READ(PP_CONTROL) & ~POWER_TARGET_ON));
990 - pp_status = REG_READ(PP_STATUS);
991 - } while (pp_status & PP_ON);
993 - REG_WRITE(DPI_CONTROL_REG, DPI_SHUT_DOWN);
995 - dev_priv->dpi_panel_on = false;
998 + /* Set panel to reset */
999 + dsi_set_panel_reset_state(1);
1001 - ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1002 + dev_priv->dpi_panel_on = false;
1006 -static void mrst_dsi_dpms(struct drm_encoder *encoder, int mode)
1007 +static void dsi_configure_up(struct drm_device *dev)
1009 - struct drm_device *dev = encoder->dev;
1010 - struct psb_intel_output *output = enc_to_psb_intel_output(encoder);
1011 + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1014 - printk("mrst_dsi_dpms\n");
1015 -#endif /* DBG_PRINTS */
1018 - if (mode == DRM_MODE_DPMS_ON)
1019 - mrst_dsi_set_power(dev, output, true);
1021 - mrst_dsi_set_power(dev, output, false);
1022 + if (dev_priv->dpi_panel_on) {
1023 + DBG_TRACE("already on");
1027 + /* Get panel from reset */
1028 + dsi_set_panel_reset_state(0);
1030 + /* Set device ready state */
1031 + dsi_set_device_ready_state(dev, 1);
1033 + /* Send turn on command */
1034 + dsi_send_turn_on_packet(dev);
1036 + /* Enable PTARGET */
1037 + dsi_set_ptarget_state(dev, 1);
1039 + /* Initialize panel */
1040 + dsi_init_panel(dev);
1042 + /* Enable plane and pipe */
1043 + dsi_set_pipe_plane_enable_state(dev, 1);
1045 + /* Enable backlight */
1046 + dsi_set_backlight_state(1);
1048 + dev_priv->dpi_panel_on = true;
1052 -static void mrst_dsi_save(struct drm_connector *connector)
1053 +static void dsi_init_drv_ic(struct drm_device *dev)
1056 - printk("mrst_dsi_save\n");
1057 -#endif /* DBG_PRINTS */
1063 -static void mrst_dsi_restore(struct drm_connector *connector)
1064 +static void dsi_schedule_work(struct drm_device *dev)
1067 - printk("mrst_dsi_restore\n");
1068 -#endif /* DBG_PRINTS */
1070 + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1074 + schedule_work(&dev_priv->dsi_work);
1078 -static void mrst_dsi_prepare(struct drm_encoder *encoder)
1079 +static void dsi_work_handler(struct work_struct *work)
1081 - struct drm_device *dev = encoder->dev;
1082 - struct psb_intel_output *output = enc_to_psb_intel_output(encoder);
1083 + struct drm_psb_private *dev_priv = container_of(work,
1084 + struct drm_psb_private, dsi_work);
1087 - printk("mrst_dsi_prepare\n");
1088 -#endif /* DBG_PRINTS */
1091 - if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
1092 - OSPM_UHB_FORCE_POWER_ON))
1094 + dsi_configure_up(dev_priv->dev);
1097 - mrst_dsi_set_power(dev, output, false);
1099 - ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1100 +static void dsi_init_mipi_config(DRM_DRIVER_PRIVATE_T *dev_priv)
1104 + /* Fixed values for TPO display */
1105 + dev_priv->pixelClock = 33264;
1106 + dev_priv->HsyncWidth = MIPI_HSPAD;
1107 + dev_priv->HbackPorch = MIPI_HBP;
1108 + dev_priv->HfrontPorch = MIPI_HFP;
1109 + dev_priv->HactiveArea = HSIZE;
1110 + dev_priv->VsyncWidth = MIPI_VSPAD;
1111 + dev_priv->VbackPorch = MIPI_VBP;
1112 + dev_priv->VfrontPorch = MIPI_VFP;
1113 + dev_priv->VactiveArea = VSIZE;
1114 + dev_priv->bpp = 24;
1117 + dev_priv->dpi = true;
1119 + /* Set this true since firmware or kboot has enabled display */
1120 + dev_priv->dpi_panel_on = true;
1122 + /* Set this false to ensure proper initial configuration */
1123 + dev_priv->dsi_device_ready = false;
1126 + dev_priv->laneCount = MIPI_LANES;
1129 + dev_priv->videoModeFormat = BURST_MODE;
1131 + dev_priv->init_drvIC = dsi_init_drv_ic;
1132 + dev_priv->dsi_prePowerState = dsi_configure_down;
1133 + dev_priv->dsi_postPowerState = dsi_schedule_work;
1137 -static void mrst_dsi_commit(struct drm_encoder *encoder)
1138 +static struct drm_display_mode *dsi_get_fixed_display_mode(void)
1140 - struct drm_device *dev = encoder->dev;
1141 - struct psb_intel_output *output = enc_to_psb_intel_output(encoder);
1142 + struct drm_display_mode *mode;
1146 + mode = kzalloc(sizeof(*mode), GFP_KERNEL);
1148 + DBG_ERR("kzalloc failed\n");
1152 + /* Fixed mode for TPO display
1153 + Note: Using defined values for easier match with ITP scripts
1154 + and adding 1 since psb_intel_display.c decreases by 1
1156 + mode->hdisplay = (DISP_HPIX + 1);
1157 + mode->vdisplay = (DISP_VPIX + 1);
1158 + mode->hsync_start = (DISP_HSYNC_START + 1);
1159 + mode->hsync_end = (DISP_HSYNC_END + 1);
1160 + mode->htotal = (DISP_HBLANK_END + 1);
1161 + mode->vsync_start = (DISP_VSYNC_START + 1);
1162 + mode->vsync_end = (DISP_VSYNC_END + 1);
1163 + mode->vtotal = (DISP_VBLANK_END + 1);
1164 + mode->clock = 33264;
1167 - printk("mrst_dsi_commit\n");
1168 -#endif /* DBG_PRINTS */
1169 + drm_mode_set_name(mode);
1170 + drm_mode_set_crtcinfo(mode, 0);
1172 - mrst_dsi_set_power(dev, output, true);
1177 -static void mrst_dsi_mode_set(struct drm_encoder *encoder,
1178 - struct drm_display_mode *mode,
1179 - struct drm_display_mode *adjusted_mode)
1180 +/* Encoder funcs */
1181 +static void dsi_encoder_mode_set(struct drm_encoder *encoder,
1182 + struct drm_display_mode *mode,
1183 + struct drm_display_mode *adjusted_mode)
1185 struct drm_device *dev = encoder->dev;
1186 DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1187 - u32 SupportedFormat = 0;
1188 - u32 resolution = 0;
1189 - uint64_t curValue = DRM_MODE_SCALE_FULLSCREEN;
1190 + uint64_t scale_mode = DRM_MODE_SCALE_FULLSCREEN;
1193 - printk("mrst_dsi_mode_set\n");
1194 -#endif /* DBG_PRINTS */
1197 if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
1198 - OSPM_UHB_FORCE_POWER_ON))
1199 + OSPM_UHB_FORCE_POWER_ON)) {
1200 + DBG_ERR("OSPM_DISPLAY_ISLAND OSPM_UHB_FORCE_POWER_ON failed");
1204 /* Sleep to ensure that the graphics engine is ready
1205 * since its mode_set is called before ours
1209 - switch (dev_priv->bpp)
1212 - SupportedFormat = RGB_888_FMT;
1215 - printk("mrst_dsi_mode_set, invalid bpp!\n");
1219 - if (dev_priv->dpi) {
1220 + /* Only one mode is supported,
1221 + * so configure only if not yet configured
1223 + if (!dev_priv->dsi_device_ready) {
1224 drm_connector_property_get_value(
1225 &enc_to_psb_intel_output(encoder)->base,
1226 dev->mode_config.scaling_mode_property,
1228 - if (curValue == DRM_MODE_SCALE_CENTER) {
1230 + if (scale_mode == DRM_MODE_SCALE_CENTER)
1231 REG_WRITE(PFIT_CONTROL, 0);
1232 - } else if (curValue == DRM_MODE_SCALE_FULLSCREEN) {
1233 + else if (scale_mode == DRM_MODE_SCALE_FULLSCREEN)
1234 REG_WRITE(PFIT_CONTROL, PFIT_ENABLE);
1236 - printk("mrst_dsi_mode_set, scaling not supported!\n");
1238 + DBG_ERR("unsupported scaling");
1239 REG_WRITE(PFIT_CONTROL, 0);
1241 + dsi_configure_mipi_block(dev);
1242 + dev_priv->dsi_device_ready = true;
1245 + ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1248 - /* MIPI clock ratio 1:1 */
1249 - //REG_WRITE(MIPI_CONTROL_REG, 0x00000018);
1250 - //REG_WRITE(0xb080, 0x0b061a02);
1252 - /* MIPI clock ratio 2:1 */
1253 - //REG_WRITE(MIPI_CONTROL_REG, 0x00000019);
1254 - //REG_WRITE(0xb080, 0x3f1f1c04);
1256 - /* MIPI clock ratio 3:1 */
1257 - //REG_WRITE(MIPI_CONTROL_REG, 0x0000001a);
1258 - //REG_WRITE(0xb080, 0x091f7f08);
1259 +static void dsi_encoder_prepare(struct drm_encoder *encoder)
1261 + struct drm_device *dev = encoder->dev;
1263 - /* MIPI clock ratio 4:1 */
1264 - REG_WRITE(MIPI_CONTROL_REG, (0x00000018 | mipi_clock));
1265 - REG_WRITE(0xb080, dphy_reg);
1268 - /* Enable all interrupts */
1269 - REG_WRITE(INTR_EN_REG, 0xffffffff);
1270 + if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
1271 + OSPM_UHB_FORCE_POWER_ON)) {
1272 + DBG_ERR("OSPM_DISPLAY_ISLAND OSPM_UHB_FORCE_POWER_ON failed");
1276 - REG_WRITE(TURN_AROUND_TIMEOUT_REG, 0x0000000A);
1277 - REG_WRITE(DEVICE_RESET_REG, 0x000000ff);
1278 - REG_WRITE(INIT_COUNT_REG, 0x00000fff);
1279 - REG_WRITE(HS_TX_TIMEOUT_REG, 0x90000);
1280 - REG_WRITE(LP_RX_TIMEOUT_REG, 0xffff);
1281 - REG_WRITE(HIGH_LOW_SWITCH_COUNT_REG, 0x46);
1282 - REG_WRITE(EOT_DISABLE_REG, 0x00000000);
1283 - REG_WRITE(LP_BYTECLK_REG, 0x00000004);
1284 + dsi_configure_down(dev);
1286 - REG_WRITE(VIDEO_FMT_REG, dev_priv->videoModeFormat);
1287 + ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1290 - SupportedFormat <<= FMT_DPI_POS;
1291 - REG_WRITE(DSI_FUNC_PRG_REG,
1292 - (dev_priv->laneCount | SupportedFormat));
1294 - resolution = dev_priv->HactiveArea |
1295 - (dev_priv->VactiveArea << RES_V_POS);
1296 - REG_WRITE(DPI_RESOLUTION_REG, resolution);
1297 +static void dsi_encoder_commit(struct drm_encoder *encoder)
1299 + struct drm_device *dev = encoder->dev;
1300 + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1302 - REG_WRITE(VERT_SYNC_PAD_COUNT_REG, dev_priv->VsyncWidth);
1303 - REG_WRITE(VERT_BACK_PORCH_COUNT_REG, dev_priv->VbackPorch);
1304 - REG_WRITE(VERT_FRONT_PORCH_COUNT_REG, dev_priv->VfrontPorch);
1307 - REG_WRITE(HORIZ_SYNC_PAD_COUNT_REG, dev_priv->HsyncWidth);
1308 - REG_WRITE(HORIZ_BACK_PORCH_COUNT_REG, dev_priv->HbackPorch);
1309 - REG_WRITE(HORIZ_FRONT_PORCH_COUNT_REG, dev_priv->HfrontPorch);
1310 - REG_WRITE(HORIZ_ACTIVE_AREA_COUNT_REG, MIPI_HACT);
1311 + if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
1312 + OSPM_UHB_FORCE_POWER_ON)) {
1313 + DBG_ERR("OSPM_DISPLAY_ISLAND OSPM_UHB_FORCE_POWER_ON failed");
1317 - /* Enable MIPI Port */
1318 - REG_WRITE(MIPI, MIPI_PORT_EN);
1319 + if (!work_pending(&dev_priv->dsi_work))
1320 + dsi_configure_up(dev);
1322 - REG_WRITE(DEVICE_READY_REG, 0x00000001);
1323 - REG_WRITE(DPI_CONTROL_REG, 0x00000002); /* Turn On */
1324 + ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1327 - dev_priv->dsi_device_ready = true;
1330 - REG_WRITE(PIPEACONF, dev_priv->pipeconf);
1331 - REG_READ(PIPEACONF);
1332 +static void dsi_encoder_dpms(struct drm_encoder *encoder, int mode)
1334 + struct drm_device *dev = encoder->dev;
1335 + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1337 - /* Wait for 20ms for the pipe enable to take effect. */
1339 + DBG_TRACE("%s", ((mode == DRM_MODE_DPMS_ON) ? "ON" : "OFF"));
1341 - /* Enable plane */
1342 - REG_WRITE(DSPACNTR, dev_priv->dspcntr);
1343 + if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
1344 + OSPM_UHB_FORCE_POWER_ON)) {
1345 + DBG_ERR("OSPM_DISPLAY_ISLAND OSPM_UHB_FORCE_POWER_ON failed");
1349 - /* Wait for 20ms for the plane enable to take effect. */
1351 + if (mode == DRM_MODE_DPMS_ON) {
1352 + if (!work_pending(&dev_priv->dsi_work))
1353 + dsi_configure_up(dev);
1355 + dsi_configure_down(dev);
1357 ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
1362 - * Detect the MIPI connection.
1364 - * This always returns CONNECTOR_STATUS_CONNECTED.
1365 - * This connector should only have
1366 - * been set up if the MIPI was actually connected anyway.
1368 -static enum drm_connector_status mrst_dsi_detect(struct drm_connector
1370 +/* Connector funcs */
1371 +static enum drm_connector_status dsi_connector_detect(struct drm_connector
1375 - printk("mrst_dsi_detect\n");
1376 -#endif /* DBG_PRINTS */
1378 return connector_status_connected;
1383 - * Return the list of MIPI DDB modes if available.
1385 -static int mrst_dsi_get_modes(struct drm_connector *connector)
1386 +static int dsi_connector_get_modes(struct drm_connector *connector)
1388 struct drm_device *dev = connector->dev;
1389 - struct psb_intel_output *psb_intel_output = to_psb_intel_output(connector);
1390 - struct psb_intel_mode_device *mode_dev = psb_intel_output->mode_dev;
1391 + struct psb_intel_output *psb_output = to_psb_intel_output(connector);
1392 + struct psb_intel_mode_device *mode_dev = psb_output->mode_dev;
1393 + struct drm_display_mode *mode;
1397 /* Didn't get an DDB, so
1398 * Set wide sync ranges so we get all modes
1399 @@ -775,8 +701,7 @@ static int mrst_dsi_get_modes(struct drm_connector *connector)
1400 connector->display_info.max_hfreq = 200;
1402 if (mode_dev->panel_fixed_mode != NULL) {
1403 - struct drm_display_mode *mode =
1404 - drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
1405 + mode = drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
1406 drm_mode_probed_add(connector, mode);
1409 @@ -784,180 +709,116 @@ static int mrst_dsi_get_modes(struct drm_connector *connector)
1413 -static const struct drm_encoder_helper_funcs mrst_dsi_helper_funcs = {
1414 - .dpms = mrst_dsi_dpms,
1415 +static void dsi_connector_save(struct drm_connector *connector)
1421 +static void dsi_connector_restore(struct drm_connector *connector)
1427 +static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
1428 + .dpms = dsi_encoder_dpms,
1429 .mode_fixup = psb_intel_lvds_mode_fixup,
1430 - .prepare = mrst_dsi_prepare,
1431 - .mode_set = mrst_dsi_mode_set,
1432 - .commit = mrst_dsi_commit,
1433 + .prepare = dsi_encoder_prepare,
1434 + .mode_set = dsi_encoder_mode_set,
1435 + .commit = dsi_encoder_commit,
1439 -static const struct drm_connector_helper_funcs
1440 - mrst_dsi_connector_helper_funcs = {
1441 - .get_modes = mrst_dsi_get_modes,
1442 - .mode_valid = psb_intel_lvds_mode_valid,
1443 - .best_encoder = psb_intel_best_encoder,
1444 +static const struct drm_connector_helper_funcs connector_helper_funcs = {
1445 + .get_modes = dsi_connector_get_modes,
1446 + .mode_valid = psb_intel_lvds_mode_valid,
1447 + .best_encoder = psb_intel_best_encoder,
1451 -static const struct drm_connector_funcs mrst_dsi_connector_funcs = {
1452 +static const struct drm_connector_funcs connector_funcs = {
1453 .dpms = drm_helper_connector_dpms,
1454 - .save = mrst_dsi_save,
1455 - .restore = mrst_dsi_restore,
1456 - .detect = mrst_dsi_detect,
1457 + .save = dsi_connector_save,
1458 + .restore = dsi_connector_restore,
1459 + .detect = dsi_connector_detect,
1460 .fill_modes = drm_helper_probe_single_connector_modes,
1461 .set_property = psb_intel_lvds_set_property,
1462 .destroy = psb_intel_lvds_destroy,
1466 -/** Returns the panel fixed mode from configuration. */
1467 -struct drm_display_mode *mrst_dsi_get_configuration_mode(struct drm_device *dev)
1469 - struct drm_display_mode *mode;
1471 - mode = kzalloc(sizeof(*mode), GFP_KERNEL);
1475 - /* MiKo, fixed mode for TPO display
1476 - Note: Using defined values for easier match with ITP scripts
1477 - and adding 1 since psb_intel_display.c decreases by 1
1479 - mode->hdisplay = (DISP_HPIX + 1);
1480 - mode->vdisplay = (DISP_VPIX + 1);
1481 - mode->hsync_start = (DISP_HSYNC_START + 1);
1482 - mode->hsync_end = (DISP_HSYNC_END + 1);
1483 - mode->htotal = (DISP_HBLANK_END + 1);
1484 - mode->vsync_start = (DISP_VSYNC_START + 1);
1485 - mode->vsync_end = (DISP_VSYNC_END + 1);
1486 - mode->vtotal = (DISP_VBLANK_END + 1);
1487 - mode->clock = 33264;
1489 - drm_mode_set_name(mode);
1490 - drm_mode_set_crtcinfo(mode, 0);
1496 -/* ************************************************************************* *\
1497 -FUNCTION: mrst_mipi_settings_init
1501 -\* ************************************************************************* */
1502 -static bool mrst_mipi_settings_init(DRM_DRIVER_PRIVATE_T *dev_priv)
1504 - /* MiKo, fixed values for TPO display */
1505 - dev_priv->pixelClock = 33264;
1506 - dev_priv->HsyncWidth = MIPI_HSPAD;
1507 - dev_priv->HbackPorch = MIPI_HBP;
1508 - dev_priv->HfrontPorch = MIPI_HFP;
1509 - dev_priv->HactiveArea = HSIZE;
1510 - dev_priv->VsyncWidth = MIPI_VSPAD;
1511 - dev_priv->VbackPorch = MIPI_VBP;
1512 - dev_priv->VfrontPorch = MIPI_VFP;
1513 - dev_priv->VactiveArea = VSIZE;
1514 - dev_priv->bpp = 24;
1517 - dev_priv->dpi = true;
1519 - /* MiKo, set these true by default to ensure that first mode set is done
1522 - dev_priv->dpi_panel_on = true;
1523 - dev_priv->dsi_device_ready = true;
1526 - dev_priv->laneCount = MIPI_LANES;
1529 - dev_priv->videoModeFormat = BURST_MODE;
1536 - * mrst_dsi_init - setup MIPI connectors on this device
1537 - * @dev: drm device
1539 - * Create the connector, try to figure out what
1540 - * modes we can display on the MIPI panel (if present).
1542 void mrst_dsi_init(struct drm_device *dev,
1543 - struct psb_intel_mode_device *mode_dev)
1544 + struct psb_intel_mode_device *mode_dev)
1546 DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
1547 - struct psb_intel_output *psb_intel_output;
1548 + struct psb_intel_output *psb_output;
1549 struct drm_connector *connector;
1550 struct drm_encoder *encoder;
1553 - printk("mrst_dsi_init\n");
1554 -#endif /* DBG_PRINTS */
1557 - psb_intel_output = kzalloc(sizeof(struct psb_intel_output), GFP_KERNEL);
1558 - if (!psb_intel_output)
1559 + psb_output = kzalloc(sizeof(struct psb_intel_output), GFP_KERNEL);
1560 + if (!psb_output) {
1561 + DBG_ERR("kzalloc failed\n");
1567 #ifdef AAVA_BACKLIGHT_HACK
1568 schedule_delayed_work(&bl_work, 2*HZ);
1569 #endif /* AAVA_BACKLIGHT_HACK */
1571 - psb_intel_output->mode_dev = mode_dev;
1572 - connector = &psb_intel_output->base;
1573 - encoder = &psb_intel_output->enc;
1574 - drm_connector_init(dev,
1575 - &psb_intel_output->base,
1576 - &mrst_dsi_connector_funcs,
1577 - DRM_MODE_CONNECTOR_MIPI);
1579 - drm_encoder_init(dev,
1580 - &psb_intel_output->enc,
1581 - &psb_intel_lvds_enc_funcs,
1582 - DRM_MODE_ENCODER_MIPI);
1584 - drm_mode_connector_attach_encoder(&psb_intel_output->base,
1585 - &psb_intel_output->enc);
1586 - psb_intel_output->type = INTEL_OUTPUT_MIPI;
1588 - drm_encoder_helper_add(encoder, &mrst_dsi_helper_funcs);
1589 - drm_connector_helper_add(connector, &mrst_dsi_connector_helper_funcs);
1590 + psb_output->mode_dev = mode_dev;
1591 + connector = &psb_output->base;
1592 + encoder = &psb_output->enc;
1593 + drm_connector_init(dev, &psb_output->base, &connector_funcs,
1594 + DRM_MODE_CONNECTOR_MIPI);
1596 + drm_encoder_init(dev, &psb_output->enc, &psb_intel_lvds_enc_funcs,
1597 + DRM_MODE_ENCODER_MIPI);
1599 + drm_mode_connector_attach_encoder(&psb_output->base, &psb_output->enc);
1600 + psb_output->type = INTEL_OUTPUT_MIPI;
1602 + drm_encoder_helper_add(encoder, &encoder_helper_funcs);
1603 + drm_connector_helper_add(connector, &connector_helper_funcs);
1604 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1605 connector->interlace_allowed = false;
1606 connector->doublescan_allowed = false;
1608 drm_connector_attach_property(connector,
1609 - dev->mode_config.scaling_mode_property,
1610 - DRM_MODE_SCALE_FULLSCREEN);
1611 - drm_connector_attach_property(connector,
1612 - dev_priv->backlight_property,
1613 - BRIGHTNESS_MAX_LEVEL);
1614 + dev->mode_config.scaling_mode_property,
1615 + DRM_MODE_SCALE_FULLSCREEN);
1616 + drm_connector_attach_property(connector, dev_priv->backlight_property,
1617 + BRIGHTNESS_MAX_LEVEL);
1619 - if (!mrst_mipi_settings_init(dev_priv))
1620 - printk("Can't initialize MIPI settings\n");
1621 + mode_dev->panel_wants_dither = false;
1623 + dsi_init_mipi_config(dev_priv);
1625 /* No config phase */
1626 dev_priv->config_phase = false;
1628 /* Get the fixed mode */
1629 - mode_dev->panel_fixed_mode = mrst_dsi_get_configuration_mode(dev);
1630 - if (mode_dev->panel_fixed_mode) {
1631 + mode_dev->panel_fixed_mode = dsi_get_fixed_display_mode();
1632 + if (mode_dev->panel_fixed_mode)
1633 mode_dev->panel_fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
1635 - printk("Found no modes for MIPI!\n");
1637 + DBG_ERR("Fixed mode not available!\n");
1641 + /* Set this true since we enable/disable plane and pipe */
1642 + dev_priv->dsi_plane_pipe_control = true;
1644 + drm_sysfs_connector_add(connector);
1646 + /* Initialize work queue */
1647 + INIT_WORK(&dev_priv->dsi_work, dsi_work_handler);
1649 // Temporary access from sysfs begin
1650 - orig_encoder = encoder;
1652 // Temporary access from sysfs end
1653 - drm_sysfs_connector_add(connector);
1658 @@ -966,31 +827,140 @@ failed_find:
1663 // Temporary access from sysfs begin
1664 -static struct class_attribute miko_class_attrs[] = {
1665 - __ATTR(dphy, 0644, NULL, dphy_store),
1666 - __ATTR(clock, 0644, NULL, clock_store),
1667 - __ATTR(apply, 0200, NULL, apply_settings),
1668 +static ssize_t dsi_run_test(struct class *class, const char *buf, size_t len)
1670 + struct drm_device *dev = test_dev;
1675 + status = strict_strtoul(buf, 0, &test_id);
1677 + DBG_TRACE("test_id %li", test_id);
1682 + dsi_set_backlight_state(1);
1686 + dsi_set_backlight_state(0);
1690 + dsi_set_panel_reset_state(0);
1694 + dsi_set_panel_reset_state(1);
1697 + /* Set device ready state */
1698 + dsi_set_device_ready_state(dev, 1);
1701 + /* Clear device ready state */
1702 + dsi_set_device_ready_state(dev, 0);
1705 + /* Send turn on command */
1706 + dsi_send_turn_on_packet(dev);
1709 + /* Send shutdown command */
1710 + dsi_send_shutdown_packet(dev);
1713 + /* Enable PTARGET */
1714 + dsi_set_ptarget_state(dev, 1);
1717 + /* Disable PTARGET */
1718 + dsi_set_ptarget_state(dev, 0);
1721 + /* Initialize panel */
1722 + dsi_init_panel(dev);
1725 + /* Enable plane and pipe */
1726 + dsi_set_pipe_plane_enable_state(dev, 1);
1729 + /* Disable plane and pipe */
1730 + dsi_set_pipe_plane_enable_state(dev, 0);
1733 + /* configure up */
1734 + dsi_configure_up(dev);
1737 + /* configure down */
1738 + dsi_configure_down(dev);
1742 + for (i = 0 ; i < (864*40) ; i++) {
1743 + if (dsi_wait_hs_data_fifo(dev) < 0)
1746 + REG_WRITE(0xb068, 0x0f0f0f2c);
1748 + REG_WRITE(0xb068, 0x0f0f0f3c);
1749 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
1751 + REG_WRITE(0xb070, 0x00000429);
1754 + /* Sleep out command */
1755 + if (dsi_wait_hs_data_fifo(dev) < 0)
1757 + REG_WRITE(0xb068, 0x00000011);
1758 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
1760 + REG_WRITE(0xb070, 0x00000129);
1763 + /* Display on command */
1764 + if (dsi_wait_hs_data_fifo(dev) < 0)
1766 + REG_WRITE(0xb068, 0x00000029);
1767 + if (dsi_wait_hs_ctrl_fifo(dev) < 0)
1769 + REG_WRITE(0xb070, 0x00000129);
1779 +static struct class_attribute tpo_class_attrs[] = {
1780 + __ATTR(test, 0200, NULL, dsi_run_test),
1784 -static struct class miko_class = {
1786 +static struct class tpo_class = {
1788 .owner = THIS_MODULE,
1790 - .class_attrs = miko_class_attrs,
1791 + .class_attrs = tpo_class_attrs,
1794 -static int __init miko_sysfs_init(void)
1795 +static int __init tpo_sysfs_init(void)
1800 - status = class_register(&miko_class);
1801 + status = class_register(&tpo_class);
1807 -postcore_initcall(miko_sysfs_init);
1808 +postcore_initcall(tpo_sysfs_init);
1809 // Temporary access from sysfs end
1811 diff --git a/drivers/gpu/drm/mrst/pvr/services4/3rdparty/linux_framebuffer_mrst/mrstlfb_displayclass.c b/drivers/gpu/drm/mrst/pvr/services4/3rdparty/linux_framebuffer_mrst/mrstlfb_displayclass.c
1812 index adca7e2..7831183 100644
1813 --- a/drivers/gpu/drm/mrst/pvr/services4/3rdparty/linux_framebuffer_mrst/mrstlfb_displayclass.c
1814 +++ b/drivers/gpu/drm/mrst/pvr/services4/3rdparty/linux_framebuffer_mrst/mrstlfb_displayclass.c
1815 @@ -1977,6 +1977,9 @@ PVRSRV_ERROR MRSTLFBPrePowerState(IMG_HANDLE hDevHandle,
1816 (eNewPowerState == PVRSRV_DEV_POWER_STATE_ON))
1819 + if (!dev_priv->iLVDS_enable && dev_priv->dsi_prePowerState != NULL)
1820 + dev_priv->dsi_prePowerState(dev);
1822 save_display_registers(dev);
1824 if (dev_priv->iLVDS_enable) {
1825 @@ -1999,14 +2002,15 @@ PVRSRV_ERROR MRSTLFBPrePowerState(IMG_HANDLE hDevHandle,
1827 PSB_WVDC32(0, MRST_DPLL_A);
1829 - PSB_WVDC32(DPI_SHUT_DOWN, DPI_CONTROL_REG);
1830 - PSB_WVDC32(0x0, PIPEACONF);
1831 - PSB_WVDC32(0x2faf0000, BLC_PWM_CTL);
1832 - while (REG_READ(0x70008) & 0x40000000);
1833 - while ((PSB_RVDC32(GEN_FIFO_STAT_REG) & DPI_FIFO_EMPTY)
1834 + if (dev_priv->dsi_prePowerState == NULL) {
1835 + PSB_WVDC32(DPI_SHUT_DOWN, DPI_CONTROL_REG);
1836 + PSB_WVDC32(0x0, PIPEACONF);
1837 + PSB_WVDC32(0x2faf0000, BLC_PWM_CTL);
1838 + while (REG_READ(0x70008) & 0x40000000);
1839 + while ((PSB_RVDC32(GEN_FIFO_STAT_REG) & DPI_FIFO_EMPTY)
1841 - PSB_WVDC32(0, DEVICE_READY_REG);
1843 + PSB_WVDC32(0, DEVICE_READY_REG);
1845 /* turn off mipi panel power */
1846 ret = lnw_ipc_single_cmd(IPC_MSG_PANEL_ON_OFF, IPC_CMD_PANEL_OFF, 0, 0);
1848 @@ -2052,5 +2056,8 @@ PVRSRV_ERROR MRSTLFBPostPowerState(IMG_HANDLE hDevHandle,
1850 restore_display_registers(dev);
1852 + if (!dev_priv->iLVDS_enable && dev_priv->dsi_postPowerState != NULL)
1853 + dev_priv->dsi_postPowerState(dev);