aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-03-30 11:20:44 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-03-30 11:20:44 -0400
commit8c7a075da9f7980cc95ffcd7e6621d4a87f20f40 (patch)
treeb1bb1dfe8c5afee86e56b505e459f910935a3a00
parent07259f8b9fbd30fcef595e872deeea5ffab934ed (diff)
drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()
Make use of the DRM HDMI AVI infoframe helper to construct the AVI infoframe, rather than coding this up ourselves. This allows DRM to supply proper aspect ratio information derived from the DRM display mode structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 43d5d91fe880..fbc9c1facdfe 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -610,19 +610,21 @@ tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p)
610static void 610static void
611tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) 611tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
612{ 612{
613 u8 buf[PB(HDMI_AVI_INFOFRAME_SIZE) + 1]; 613 struct hdmi_avi_infoframe frame;
614 u8 buf[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
615 ssize_t len;
614 616
615 memset(buf, 0, sizeof(buf)); 617 drm_hdmi_avi_infoframe_from_display_mode(&frame, mode);
616 buf[HB(0)] = HDMI_INFOFRAME_TYPE_AVI; 618
617 buf[HB(1)] = 0x02; 619 frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
618 buf[HB(2)] = HDMI_AVI_INFOFRAME_SIZE; 620
619 buf[PB(1)] = HDMI_SCAN_MODE_UNDERSCAN; 621 len = hdmi_avi_infoframe_pack(&frame, buf, sizeof(buf));
620 buf[PB(2)] = HDMI_ACTIVE_ASPECT_PICTURE; 622 if (len < 0) {
621 buf[PB(3)] = HDMI_QUANTIZATION_RANGE_FULL << 2; 623 dev_err(&priv->hdmi->dev, "hdmi_avi_infoframe_pack() failed: %d\n", len);
622 buf[PB(4)] = drm_match_cea_mode(mode); 624 return;
623 625 }
624 tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf, 626
625 sizeof(buf)); 627 tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf, len);
626} 628}
627 629
628static void tda998x_audio_mute(struct tda998x_priv *priv, bool on) 630static void tda998x_audio_mute(struct tda998x_priv *priv, bool on)