diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-07-14 11:53:47 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-16 15:20:59 -0200 |
commit | 827c1f525a07e07997bee034a84d32216af10e58 (patch) | |
tree | e2c71c05f8a377a6c1127e41fcb2916a43539d5c /drivers/media/i2c | |
parent | d736e348a0bcf25972c23d743821b91d3694e328 (diff) | |
download | linux-827c1f525a07e07997bee034a84d32216af10e58.tar.gz linux-827c1f525a07e07997bee034a84d32216af10e58.tar.bz2 linux-827c1f525a07e07997bee034a84d32216af10e58.zip |
[media] adv7604: add vic detect
Obtain the correct timings based on the VIC code from the AVI InfoFrame.
It does a sanity check to see if at least the measured width and height
are in line with what the VIC code reports. If not, then use the timings
instead of the VIC code (as per the CEA-861 spec).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/adv7604.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index fa7046ef09b2..5630eb22daaa 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1566,10 +1566,24 @@ static int adv76xx_query_dv_timings(struct v4l2_subdev *sd, V4L2_DV_INTERLACED : V4L2_DV_PROGRESSIVE; if (is_digital_input(sd)) { + bool hdmi_signal = hdmi_read(sd, 0x05) & 0x80; + u8 vic = 0; + u32 w, h; + + w = hdmi_read16(sd, 0x07, info->linewidth_mask); + h = hdmi_read16(sd, 0x09, info->field0_height_mask); + + if (hdmi_signal && (io_read(sd, 0x60) & 1)) + vic = infoframe_read(sd, 0x04); + + if (vic && v4l2_find_dv_timings_cea861_vic(timings, vic) && + bt->width == w && bt->height == h) + goto found; + timings->type = V4L2_DV_BT_656_1120; - bt->width = hdmi_read16(sd, 0x07, info->linewidth_mask); - bt->height = hdmi_read16(sd, 0x09, info->field0_height_mask); + bt->width = w; + bt->height = h; bt->pixelclock = info->read_hdmi_pixelclock(sd); bt->hfrontporch = hdmi_read16(sd, 0x20, info->hfrontporch_mask); bt->hsync = hdmi_read16(sd, 0x22, info->hsync_mask); |