summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i2c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-10-23 11:32:42 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2016-11-18 00:00:40 +0000
commit896a4130b8e60cbdc92cfdc5b56da1fc2a03f4ad (patch)
tree09469dc42941348cbef7274a41c0230bb43148c9 /drivers/gpu/drm/i2c
parent2cae8e028ecb44003f607584e014c15a2f415e8a (diff)
downloadop-kernel-dev-896a4130b8e60cbdc92cfdc5b56da1fc2a03f4ad.zip
op-kernel-dev-896a4130b8e60cbdc92cfdc5b56da1fc2a03f4ad.tar.gz
drm/i2c: tda998x: only configure infoframes and audio if supported
The CEA 861B specification indicates the situations when we are able to send each infoframe based on the version of the EDID's CEA extension. Update the tda998x driver to follow the CEA specification wrt sending of infoframes. Since we only support the generation of AVI version 2, this limits us to CEA extension version 3, so we treat CEA extension version 2 as CEA 861 (no infoframes, no audio.) Tested-by: Robin Murphy <robin.murphy@arm.com> Tested-by: Jon Medhurst <tixy@linaro.org> Acked-by: Jon Medhurst <tixy@linaro.org> Tested-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index dd183ce..c78c966 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -43,7 +43,7 @@ struct tda998x_priv {
u16 rev;
u8 current_page;
int dpms;
- bool is_hdmi_sink;
+ bool supports_infoframes;
u8 vip_cntrl_0;
u8 vip_cntrl_1;
u8 vip_cntrl_2;
@@ -1068,8 +1068,20 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder,
priv->tmds_clock = adjusted_mode->clock;
- /* Only setup the info frames if the sink is HDMI */
- if (priv->is_hdmi_sink) {
+ /* CEA-861B section 6 says that:
+ * CEA version 1 (CEA-861) has no support for infoframes.
+ * CEA version 2 (CEA-861A) supports version 1 AVI infoframes,
+ * and optional basic audio.
+ * CEA version 3 (CEA-861B) supports version 1 and 2 AVI infoframes,
+ * and optional digital audio, with audio infoframes.
+ *
+ * Since we only support generation of version 2 AVI infoframes,
+ * ignore CEA version 2 and below (iow, behave as if we're a
+ * CEA-861 source.)
+ */
+ priv->supports_infoframes = priv->connector.display_info.cea_rev >= 3;
+
+ if (priv->supports_infoframes) {
/* We need to turn HDMI HDCP stuff on to get audio through */
reg &= ~TBG_CNTRL_1_DWIN_DIS;
reg_write(priv, REG_TBG_CNTRL_1, reg);
@@ -1180,7 +1192,6 @@ static int tda998x_connector_get_modes(struct drm_connector *connector)
drm_mode_connector_update_edid_property(connector, edid);
n = drm_add_edid_modes(connector, edid);
- priv->is_hdmi_sink = drm_detect_hdmi_monitor(edid);
drm_edid_to_eld(connector, edid);
kfree(edid);
@@ -1263,7 +1274,10 @@ static int tda998x_audio_hw_params(struct device *dev, void *data,
}
mutex_lock(&priv->audio_mutex);
- ret = tda998x_configure_audio(priv, &audio);
+ if (priv->supports_infoframes)
+ ret = tda998x_configure_audio(priv, &audio);
+ else
+ ret = 0;
if (ret == 0)
priv->audio_params = audio;
OpenPOWER on IntegriCloud