Commit bceee9bb authored by Jyri Sarha's avatar Jyri Sarha Committed by Andrzej Hajda

drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID

Set output mode to HDMI or DVI according to EDID HDMI signature.
Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
Reviewed-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c42838073b83185a5cf9949caab3c70ee093b791.1558964241.git.jsarha@ti.com
parent 9fba099b
...@@ -181,12 +181,16 @@ static int sii902x_get_modes(struct drm_connector *connector) ...@@ -181,12 +181,16 @@ static int sii902x_get_modes(struct drm_connector *connector)
{ {
struct sii902x *sii902x = connector_to_sii902x(connector); struct sii902x *sii902x = connector_to_sii902x(connector);
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
struct edid *edid; struct edid *edid;
int num = 0, ret; int num = 0, ret;
edid = drm_get_edid(connector, sii902x->i2cmux->adapter[0]); edid = drm_get_edid(connector, sii902x->i2cmux->adapter[0]);
drm_connector_update_edid_property(connector, edid); drm_connector_update_edid_property(connector, edid);
if (edid) { if (edid) {
if (drm_detect_hdmi_monitor(edid))
output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
num = drm_add_edid_modes(connector, edid); num = drm_add_edid_modes(connector, edid);
kfree(edid); kfree(edid);
} }
...@@ -196,6 +200,11 @@ static int sii902x_get_modes(struct drm_connector *connector) ...@@ -196,6 +200,11 @@ static int sii902x_get_modes(struct drm_connector *connector)
if (ret) if (ret)
return ret; return ret;
ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
if (ret)
return ret;
return num; return num;
} }
......
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