Commit e3e7f178 authored by Philippe Schenker's avatar Philippe Schenker Committed by Robert Foss

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: 30e2ae94 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: default avatarPhilippe Schenker <philippe.schenker@toradex.com>
Acked-by: default avatarAdrien Grassein <adrien.grassein@gmail.com>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220922124306.34729-2-dev@pschenker.ch
parent 7b4d8db6
...@@ -276,7 +276,7 @@ static int lt8912_video_setup(struct lt8912 *lt) ...@@ -276,7 +276,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
u32 hactive, h_total, hpw, hfp, hbp; u32 hactive, h_total, hpw, hfp, hbp;
u32 vactive, v_total, vpw, vfp, vbp; u32 vactive, v_total, vpw, vfp, vbp;
u8 settle = 0x08; u8 settle = 0x08;
int ret; int ret, hsync_activehigh, vsync_activehigh;
if (!lt) if (!lt)
return -EINVAL; return -EINVAL;
...@@ -286,12 +286,14 @@ static int lt8912_video_setup(struct lt8912 *lt) ...@@ -286,12 +286,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
hpw = lt->mode.hsync_len; hpw = lt->mode.hsync_len;
hbp = lt->mode.hback_porch; hbp = lt->mode.hback_porch;
h_total = hactive + hfp + hpw + hbp; h_total = hactive + hfp + hpw + hbp;
hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
vactive = lt->mode.vactive; vactive = lt->mode.vactive;
vfp = lt->mode.vfront_porch; vfp = lt->mode.vfront_porch;
vpw = lt->mode.vsync_len; vpw = lt->mode.vsync_len;
vbp = lt->mode.vback_porch; vbp = lt->mode.vback_porch;
v_total = vactive + vfp + vpw + vbp; v_total = vactive + vfp + vpw + vbp;
vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
if (vactive <= 600) if (vactive <= 600)
settle = 0x04; settle = 0x04;
...@@ -325,6 +327,11 @@ static int lt8912_video_setup(struct lt8912 *lt) ...@@ -325,6 +327,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff); ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8); ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
vsync_activehigh ? BIT(0) : 0);
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
hsync_activehigh ? BIT(1) : 0);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment