[media] cobalt: support reduced fps
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 17 Jul 2016 09:03:15 +0000 (06:03 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 24 Aug 2016 12:40:18 +0000 (09:40 -0300)
Add support for reduced fps (i.e. 59.94 Hz instead of 60 Hz) for the
HDMI output.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/cobalt/cobalt-v4l2.c

index d05672fe9ff95635f60a9b17656f53b855c1a778..5c76637900d0be15330e920734f939a03b2820a0 100644 (file)
@@ -161,8 +161,11 @@ static void cobalt_enable_output(struct cobalt_stream *s)
        struct v4l2_subdev_format sd_fmt = {
                .which = V4L2_SUBDEV_FORMAT_ACTIVE,
        };
+       u64 clk = bt->pixelclock;
 
-       if (!cobalt_cpld_set_freq(cobalt, bt->pixelclock)) {
+       if (bt->flags & V4L2_DV_FL_REDUCED_FPS)
+               clk = div_u64(clk * 1000ULL, 1001);
+       if (!cobalt_cpld_set_freq(cobalt, clk)) {
                cobalt_err("pixelclock out of range\n");
                return;
        }
@@ -644,7 +647,7 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh,
                return 0;
        }
 
-       if (v4l2_match_dv_timings(timings, &s->timings, 0, false))
+       if (v4l2_match_dv_timings(timings, &s->timings, 0, true))
                return 0;
 
        if (vb2_is_busy(&s->q))