From a02115cd2d3c77f38fe5f777a69fcb7bba08c489 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 31 Jul 2018 11:12:27 +0100 Subject: drm/i2c: tda998x: add support for writing SPD Add support for writing the SPD infoframe to the TDA998x. Identify us as "Generic" vendor "PC" product, and as "PC general" source device information. Signed-off-by: Russell King --- drivers/gpu/drm/i2c/tda998x_drv.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 4c6906d0766c..175341804a2b 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -855,6 +855,23 @@ static void tda998x_write_aif(struct tda998x_priv *priv, tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, &frame); } +static void tda998x_write_spd(struct tda998x_priv *priv) +{ + union hdmi_infoframe frame; + int ret; + + ret = hdmi_spd_infoframe_init(&frame.spd, "Generic", "PC"); + if (ret < 0) { + dev_err(&priv->hdmi->dev, "failed to fill SPD infoframe: %d\n", + ret); + return; + } + + frame.spd.sdi = HDMI_SPD_SDI_PC; + + tda998x_write_if(priv, DIP_IF_FLAGS_IF3, REG_IF3_HB0, &frame); +} + static void tda998x_write_avi(struct tda998x_priv *priv, const struct drm_display_mode *mode) { @@ -1692,6 +1709,7 @@ static void tda998x_bridge_mode_set(struct drm_bridge *bridge, reg_set(priv, REG_TX33, TX33_HDMI); tda998x_write_avi(priv, adjusted_mode); + tda998x_write_spd(priv); tda998x_write_vsi(priv, adjusted_mode); if (priv->sink_has_audio) -- cgit