diff options
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/regs-hdmi.h | 6 |
2 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index ad53c4808bdb..5ca0a9f1f43a 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -60,6 +60,7 @@ struct hdmi_context { | |||
60 | bool hpd; | 60 | bool hpd; |
61 | bool powered; | 61 | bool powered; |
62 | bool is_v13; | 62 | bool is_v13; |
63 | bool dvi_mode; | ||
63 | struct mutex hdmi_mutex; | 64 | struct mutex hdmi_mutex; |
64 | 65 | ||
65 | struct resource *regs_res; | 66 | struct resource *regs_res; |
@@ -1211,10 +1212,12 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector, | |||
1211 | 1212 | ||
1212 | raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter); | 1213 | raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter); |
1213 | if (raw_edid) { | 1214 | if (raw_edid) { |
1215 | hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid); | ||
1214 | memcpy(edid, raw_edid, min((1 + raw_edid->extensions) | 1216 | memcpy(edid, raw_edid, min((1 + raw_edid->extensions) |
1215 | * EDID_LENGTH, len)); | 1217 | * EDID_LENGTH, len)); |
1216 | DRM_DEBUG_KMS("width[%d] x height[%d]\n", | 1218 | DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n", |
1217 | raw_edid->width_cm, raw_edid->height_cm); | 1219 | (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), |
1220 | raw_edid->width_cm, raw_edid->height_cm); | ||
1218 | } else { | 1221 | } else { |
1219 | return -ENODEV; | 1222 | return -ENODEV; |
1220 | } | 1223 | } |
@@ -1437,10 +1440,7 @@ static void hdmi_audio_init(struct hdmi_context *hdata) | |||
1437 | 1440 | ||
1438 | static void hdmi_audio_control(struct hdmi_context *hdata, bool onoff) | 1441 | static void hdmi_audio_control(struct hdmi_context *hdata, bool onoff) |
1439 | { | 1442 | { |
1440 | u32 mod; | 1443 | if (hdata->dvi_mode) |
1441 | |||
1442 | mod = hdmi_reg_read(hdata, HDMI_MODE_SEL); | ||
1443 | if (mod & HDMI_DVI_MODE_EN) | ||
1444 | return; | 1444 | return; |
1445 | 1445 | ||
1446 | hdmi_reg_writeb(hdata, HDMI_AUI_CON, onoff ? 2 : 0); | 1446 | hdmi_reg_writeb(hdata, HDMI_AUI_CON, onoff ? 2 : 0); |
@@ -1479,6 +1479,14 @@ static void hdmi_conf_init(struct hdmi_context *hdata) | |||
1479 | /* disable bluescreen */ | 1479 | /* disable bluescreen */ |
1480 | hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_BLUE_SCR_EN); | 1480 | hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_BLUE_SCR_EN); |
1481 | 1481 | ||
1482 | if (hdata->dvi_mode) { | ||
1483 | /* choose DVI mode */ | ||
1484 | hdmi_reg_writemask(hdata, HDMI_MODE_SEL, | ||
1485 | HDMI_MODE_DVI_EN, HDMI_MODE_MASK); | ||
1486 | hdmi_reg_writeb(hdata, HDMI_CON_2, | ||
1487 | HDMI_VID_PREAMBLE_DIS | HDMI_GUARD_BAND_DIS); | ||
1488 | } | ||
1489 | |||
1482 | if (hdata->is_v13) { | 1490 | if (hdata->is_v13) { |
1483 | /* choose bluescreen (fecal) color */ | 1491 | /* choose bluescreen (fecal) color */ |
1484 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); | 1492 | hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); |
diff --git a/drivers/gpu/drm/exynos/regs-hdmi.h b/drivers/gpu/drm/exynos/regs-hdmi.h index 3c04bea842ce..9cc7c5e9718c 100644 --- a/drivers/gpu/drm/exynos/regs-hdmi.h +++ b/drivers/gpu/drm/exynos/regs-hdmi.h | |||
@@ -138,14 +138,16 @@ | |||
138 | #define HDMI_ASP_MASK (1 << 2) | 138 | #define HDMI_ASP_MASK (1 << 2) |
139 | #define HDMI_EN (1 << 0) | 139 | #define HDMI_EN (1 << 0) |
140 | 140 | ||
141 | /* HDMI_CON_2 */ | ||
142 | #define HDMI_VID_PREAMBLE_DIS (1 << 5) | ||
143 | #define HDMI_GUARD_BAND_DIS (1 << 1) | ||
144 | |||
141 | /* HDMI_PHY_STATUS */ | 145 | /* HDMI_PHY_STATUS */ |
142 | #define HDMI_PHY_STATUS_READY (1 << 0) | 146 | #define HDMI_PHY_STATUS_READY (1 << 0) |
143 | 147 | ||
144 | /* HDMI_MODE_SEL */ | 148 | /* HDMI_MODE_SEL */ |
145 | #define HDMI_MODE_HDMI_EN (1 << 1) | 149 | #define HDMI_MODE_HDMI_EN (1 << 1) |
146 | #define HDMI_MODE_DVI_EN (1 << 0) | 150 | #define HDMI_MODE_DVI_EN (1 << 0) |
147 | #define HDMI_DVI_MODE_EN (1) | ||
148 | #define HDMI_DVI_MODE_DIS (0) | ||
149 | #define HDMI_MODE_MASK (3 << 0) | 151 | #define HDMI_MODE_MASK (3 << 0) |
150 | 152 | ||
151 | /* HDMI_TG_CMD */ | 153 | /* HDMI_TG_CMD */ |