diff options
author | Vincent Abriou <vincent.abriou@st.com> | 2016-02-10 11:21:37 +0100 |
---|---|---|
committer | Vincent Abriou <vincent.abriou@st.com> | 2016-02-26 10:06:20 +0100 |
commit | ffc4a6a17ff615db70e9712f3e8f74145767651b (patch) | |
tree | 150278c7d63b7b71448ac225ab9771d3f4b79125 /drivers/gpu/drm/sti/sti_hdmi.c | |
parent | 5671cefbf280bb75341a783c5f6050e0fde8e83f (diff) | |
download | linux-ffc4a6a17ff615db70e9712f3e8f74145767651b.tar.gz linux-ffc4a6a17ff615db70e9712f3e8f74145767651b.tar.bz2 linux-ffc4a6a17ff615db70e9712f3e8f74145767651b.zip |
drm/sti: add hdmi_mode property for HDMI connector
Configures the framer of the HDMI connection.
By default starts in HDMI mode and can be swtich to DVI.
Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/sti/sti_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/sti/sti_hdmi.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 1f37dc4f3b85..69a2286ce2f6 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -129,6 +129,7 @@ struct sti_hdmi_connector { struct drm_encoder *encoder; struct sti_hdmi *hdmi; struct drm_property *colorspace_property; + struct drm_property *hdmi_mode_property; }; #define to_sti_hdmi_connector(x) \ @@ -229,8 +230,10 @@ static void hdmi_config(struct sti_hdmi *hdmi) /* Clear overrun and underrun fifo */ conf = HDMI_CFG_FIFO_OVERRUN_CLR | HDMI_CFG_FIFO_UNDERRUN_CLR; - /* Enable HDMI mode not DVI */ - conf |= HDMI_CFG_HDMI_NOT_DVI | HDMI_CFG_ESS_NOT_OESS; + /* Select encryption type and the framing mode */ + conf |= HDMI_CFG_ESS_NOT_OESS; + if (hdmi->hdmi_mode == HDMI_MODE_HDMI) + conf |= HDMI_CFG_HDMI_NOT_DVI; /* Enable sink term detection */ conf |= HDMI_CFG_SINK_TERM_DET_EN; @@ -791,6 +794,19 @@ static void sti_hdmi_connector_init_property(struct drm_device *drm_dev, } hdmi_connector->colorspace_property = prop; drm_object_attach_property(&connector->base, prop, hdmi->colorspace); + + /* hdmi_mode property */ + hdmi->hdmi_mode = DEFAULT_HDMI_MODE; + prop = drm_property_create_enum(drm_dev, 0, "hdmi_mode", + hdmi_mode_names, + ARRAY_SIZE(hdmi_mode_names)); + if (!prop) { + DRM_ERROR("fails to create colorspace property\n"); + return; + } + hdmi_connector->hdmi_mode_property = prop; + drm_object_attach_property(&connector->base, prop, hdmi->hdmi_mode); + } static int @@ -808,6 +824,11 @@ sti_hdmi_connector_set_property(struct drm_connector *connector, return 0; } + if (property == hdmi_connector->hdmi_mode_property) { + hdmi->hdmi_mode = val; + return 0; + } + DRM_ERROR("failed to set hdmi connector property\n"); return -EINVAL; } @@ -827,6 +848,11 @@ sti_hdmi_connector_get_property(struct drm_connector *connector, return 0; } + if (property == hdmi_connector->hdmi_mode_property) { + *val = hdmi->hdmi_mode; + return 0; + } + DRM_ERROR("failed to get hdmi connector property\n"); return -EINVAL; } |