diff options
author | Dave Airlie <airlied@redhat.com> | 2015-05-15 07:23:10 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-05-15 07:23:10 +0200 |
commit | 72a81683a8feac3c67bac24dfd88f81bac077be0 (patch) | |
tree | 5447b73aa7d854e65ec1c52d69d8ea6db3b5c1ae /drivers/gpu/drm/i2c | |
parent | drm/i915/vlv: remove wait for previous GFX clk disable request (diff) | |
parent | drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode() (diff) | |
download | linux-72a81683a8feac3c67bac24dfd88f81bac077be0.tar.xz linux-72a81683a8feac3c67bac24dfd88f81bac077be0.zip |
Merge branch 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next
tda998x: use helpers for infoframe.
* 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r-- | drivers/gpu/drm/i2c/tda998x_drv.c | 26 |
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 5febffdb027d..011e1cac3e4c 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -634,19 +634,21 @@ tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p) static void tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) { - u8 buf[PB(HDMI_AVI_INFOFRAME_SIZE) + 1]; + struct hdmi_avi_infoframe frame; + u8 buf[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE]; + ssize_t len; - memset(buf, 0, sizeof(buf)); - buf[HB(0)] = HDMI_INFOFRAME_TYPE_AVI; - buf[HB(1)] = 0x02; - buf[HB(2)] = HDMI_AVI_INFOFRAME_SIZE; - buf[PB(1)] = HDMI_SCAN_MODE_UNDERSCAN; - buf[PB(2)] = HDMI_ACTIVE_ASPECT_PICTURE; - buf[PB(3)] = HDMI_QUANTIZATION_RANGE_FULL << 2; - buf[PB(4)] = drm_match_cea_mode(mode); - - tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf, - sizeof(buf)); + drm_hdmi_avi_infoframe_from_display_mode(&frame, mode); + + frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL; + + len = hdmi_avi_infoframe_pack(&frame, buf, sizeof(buf)); + if (len < 0) { + dev_err(&priv->hdmi->dev, "hdmi_avi_infoframe_pack() failed: %d\n", len); + return; + } + + tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf, len); } static void tda998x_audio_mute(struct tda998x_priv *priv, bool on) |