aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-11-13 07:35:15 -0500
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-01 19:27:28 -0500
commit5cca30ebe089be23bc2588c4b76af69e89b3b639 (patch)
tree2998202c77d0bc3e6bed5de4d0d1a6a7790e7a35
parente8355e0dc48c966477e6b427e7043ea71698776a (diff)
drm/rcar-du: Add LVDS_LANES quirk
LVDS lanes 1 and 3 are switched in ES1 hardware (R8A7790). The problem has been fixed in newer revisions, add a quirk to make the workaround selectable. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_drv.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_drv.h1
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c15
3 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index a0ffacb4b80b..4eee02f89965 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -250,7 +250,7 @@ static const struct rcar_du_device_info rcar_du_r8a7779_info = {
250 250
251static const struct rcar_du_device_info rcar_du_r8a7790_info = { 251static const struct rcar_du_device_info rcar_du_r8a7790_info = {
252 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8, 252 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8,
253 .quirks = RCAR_DU_QUIRK_ALIGN_128B, 253 .quirks = RCAR_DU_QUIRK_ALIGN_128B | RCAR_DU_QUIRK_LVDS_LANES,
254 .num_crtcs = 3, 254 .num_crtcs = 3,
255 .routes = { 255 .routes = {
256 /* R8A7790 has one RGB output, two LVDS outputs and one 256 /* R8A7790 has one RGB output, two LVDS outputs and one
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
index 7ca98f352479..e31b735d3f25 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
@@ -31,6 +31,7 @@ struct rcar_du_lvdsenc;
31#define RCAR_DU_FEATURE_DEFR8 (1 << 1) /* Has DEFR8 register */ 31#define RCAR_DU_FEATURE_DEFR8 (1 << 1) /* Has DEFR8 register */
32 32
33#define RCAR_DU_QUIRK_ALIGN_128B (1 << 0) /* Align pitches to 128 bytes */ 33#define RCAR_DU_QUIRK_ALIGN_128B (1 << 0) /* Align pitches to 128 bytes */
34#define RCAR_DU_QUIRK_LVDS_LANES (1 << 1) /* LVDS lanes 1 and 3 inverted */
34 35
35/* 36/*
36 * struct rcar_du_output_routing - Output routing specification 37 * struct rcar_du_output_routing - Output routing specification
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
index fe1f6f59f539..df30a075d793 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
@@ -44,6 +44,7 @@ static int rcar_du_lvdsenc_start(struct rcar_du_lvdsenc *lvds,
44 const struct drm_display_mode *mode = &rcrtc->crtc.mode; 44 const struct drm_display_mode *mode = &rcrtc->crtc.mode;
45 unsigned int freq = mode->clock; 45 unsigned int freq = mode->clock;
46 u32 lvdcr0; 46 u32 lvdcr0;
47 u32 lvdhcr;
47 u32 pllcr; 48 u32 pllcr;
48 int ret; 49 int ret;
49 50
@@ -72,15 +73,19 @@ static int rcar_du_lvdsenc_start(struct rcar_du_lvdsenc *lvds,
72 * VSYNC -> CTRL1 73 * VSYNC -> CTRL1
73 * DISP -> CTRL2 74 * DISP -> CTRL2
74 * 0 -> CTRL3 75 * 0 -> CTRL3
75 *
76 * Channels 1 and 3 are switched on ES1.
77 */ 76 */
78 rcar_lvds_write(lvds, LVDCTRCR, LVDCTRCR_CTR3SEL_ZERO | 77 rcar_lvds_write(lvds, LVDCTRCR, LVDCTRCR_CTR3SEL_ZERO |
79 LVDCTRCR_CTR2SEL_DISP | LVDCTRCR_CTR1SEL_VSYNC | 78 LVDCTRCR_CTR2SEL_DISP | LVDCTRCR_CTR1SEL_VSYNC |
80 LVDCTRCR_CTR0SEL_HSYNC); 79 LVDCTRCR_CTR0SEL_HSYNC);
81 rcar_lvds_write(lvds, LVDCHCR, 80
82 LVDCHCR_CHSEL_CH(0, 0) | LVDCHCR_CHSEL_CH(1, 3) | 81 if (rcar_du_needs(lvds->dev, RCAR_DU_QUIRK_LVDS_LANES))
83 LVDCHCR_CHSEL_CH(2, 2) | LVDCHCR_CHSEL_CH(3, 1)); 82 lvdhcr = LVDCHCR_CHSEL_CH(0, 0) | LVDCHCR_CHSEL_CH(1, 3)
83 | LVDCHCR_CHSEL_CH(2, 2) | LVDCHCR_CHSEL_CH(3, 1);
84 else
85 lvdhcr = LVDCHCR_CHSEL_CH(0, 0) | LVDCHCR_CHSEL_CH(1, 1)
86 | LVDCHCR_CHSEL_CH(2, 2) | LVDCHCR_CHSEL_CH(3, 3);
87
88 rcar_lvds_write(lvds, LVDCHCR, lvdhcr);
84 89
85 /* Select the input, hardcode mode 0, enable LVDS operation and turn 90 /* Select the input, hardcode mode 0, enable LVDS operation and turn
86 * bias circuitry on. 91 * bias circuitry on.