Skip to content

Commit

Permalink
drm/exynos: enable dvi mode for dvi monitor
Browse files Browse the repository at this point in the history
Hdmi monitor and dvi monitor can be distinguished with edid.
This patch enables dvi mode if dvi monitor is connected and does
not enable audio feature for dvi mode because dvi has no audio
feature.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Seung-Woo Kim authored and Inki Dae committed May 17, 2012
1 parent 8379e48 commit 872d20d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
20 changes: 14 additions & 6 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct hdmi_context {
bool hpd;
bool powered;
bool is_v13;
bool dvi_mode;
struct mutex hdmi_mutex;

struct resource *regs_res;
Expand Down Expand Up @@ -1211,10 +1212,12 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector,

raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter);
if (raw_edid) {
hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid);
memcpy(edid, raw_edid, min((1 + raw_edid->extensions)
* EDID_LENGTH, len));
DRM_DEBUG_KMS("width[%d] x height[%d]\n",
raw_edid->width_cm, raw_edid->height_cm);
DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n",
(hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
raw_edid->width_cm, raw_edid->height_cm);
} else {
return -ENODEV;
}
Expand Down Expand Up @@ -1437,10 +1440,7 @@ static void hdmi_audio_init(struct hdmi_context *hdata)

static void hdmi_audio_control(struct hdmi_context *hdata, bool onoff)
{
u32 mod;

mod = hdmi_reg_read(hdata, HDMI_MODE_SEL);
if (mod & HDMI_DVI_MODE_EN)
if (hdata->dvi_mode)
return;

hdmi_reg_writeb(hdata, HDMI_AUI_CON, onoff ? 2 : 0);
Expand Down Expand Up @@ -1479,6 +1479,14 @@ static void hdmi_conf_init(struct hdmi_context *hdata)
/* disable bluescreen */
hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_BLUE_SCR_EN);

if (hdata->dvi_mode) {
/* choose DVI mode */
hdmi_reg_writemask(hdata, HDMI_MODE_SEL,
HDMI_MODE_DVI_EN, HDMI_MODE_MASK);
hdmi_reg_writeb(hdata, HDMI_CON_2,
HDMI_VID_PREAMBLE_DIS | HDMI_GUARD_BAND_DIS);
}

if (hdata->is_v13) {
/* choose bluescreen (fecal) color */
hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12);
Expand Down
6 changes: 4 additions & 2 deletions drivers/gpu/drm/exynos/regs-hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@
#define HDMI_ASP_MASK (1 << 2)
#define HDMI_EN (1 << 0)

/* HDMI_CON_2 */
#define HDMI_VID_PREAMBLE_DIS (1 << 5)
#define HDMI_GUARD_BAND_DIS (1 << 1)

/* HDMI_PHY_STATUS */
#define HDMI_PHY_STATUS_READY (1 << 0)

/* HDMI_MODE_SEL */
#define HDMI_MODE_HDMI_EN (1 << 1)
#define HDMI_MODE_DVI_EN (1 << 0)
#define HDMI_DVI_MODE_EN (1)
#define HDMI_DVI_MODE_DIS (0)
#define HDMI_MODE_MASK (3 << 0)

/* HDMI_TG_CMD */
Expand Down

0 comments on commit 872d20d

Please sign in to comment.