[media] adv7511: the h/vsync polarities were always positive
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 5 Jul 2016 10:16:23 +0000 (07:16 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 12 Jul 2016 16:37:41 +0000 (13:37 -0300)
Correctly set the h/vsync polarities instead of keeping to the
default (positive).

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

index 03797b5f3172b21b27a5f8890a4f4acaa1430f5e..6d7cad54a65d59cf46d1671b4aa65be6f2f6a9d5 100644 (file)
@@ -1057,6 +1057,11 @@ static int adv7511_s_dv_timings(struct v4l2_subdev *sd,
        /* save timings */
        state->dv_timings = *timings;
 
+       /* set h/vsync polarities */
+       adv7511_wr_and_or(sd, 0x17, 0x9f,
+               ((timings->bt.polarities & V4L2_DV_VSYNC_POS_POL) ? 0 : 0x40) |
+               ((timings->bt.polarities & V4L2_DV_HSYNC_POS_POL) ? 0 : 0x20));
+
        /* update quantization range based on new dv_timings */
        adv7511_set_rgb_quantization_mode(sd, state->rgb_quantization_range_ctrl);