Skip to content

Commit da73a94

Browse files
Philippe Schenkersuperna9999
authored andcommitted
drm/bridge: lt8912b: add vsync hsync
Currently the bridge driver does not take care whether or not the display needs positive/negative vertical/horizontal syncs. Pass these two flags to the bridge from the EDID that was read out from the display. Fixes: 30e2ae9 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Philippe Schenker <[email protected]> Acked-by: Adrien Grassein <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d8a79c0 commit da73a94

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/gpu/drm/bridge/lontium-lt8912b.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
268268
u32 hactive, h_total, hpw, hfp, hbp;
269269
u32 vactive, v_total, vpw, vfp, vbp;
270270
u8 settle = 0x08;
271-
int ret;
271+
int ret, hsync_activehigh, vsync_activehigh;
272272

273273
if (!lt)
274274
return -EINVAL;
@@ -278,12 +278,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
278278
hpw = lt->mode.hsync_len;
279279
hbp = lt->mode.hback_porch;
280280
h_total = hactive + hfp + hpw + hbp;
281+
hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
281282

282283
vactive = lt->mode.vactive;
283284
vfp = lt->mode.vfront_porch;
284285
vpw = lt->mode.vsync_len;
285286
vbp = lt->mode.vback_porch;
286287
v_total = vactive + vfp + vpw + vbp;
288+
vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
287289

288290
if (vactive <= 600)
289291
settle = 0x04;
@@ -317,6 +319,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
317319
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
318320
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
319321

322+
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
323+
vsync_activehigh ? BIT(0) : 0);
324+
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
325+
hsync_activehigh ? BIT(1) : 0);
326+
320327
return ret;
321328
}
322329

0 commit comments

Comments
 (0)