]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
[media] adv7604: select YPbPr if RGB_RANGE_FULL/LIMITED is set for VGA_COMP inputs
authorMats Randgaard <matrandg@cisco.com>
Thu, 5 Dec 2013 13:17:15 +0000 (10:17 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 07:57:22 +0000 (05:57 -0200)
Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/adv7604.c

index d4ac8dd51589ad3df75bffe62a8877c0ec707af4..d1de747f4542bce34b827ad76cbd83c107b0d103 100644 (file)
@@ -949,17 +949,26 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd)
                }
                break;
        case V4L2_DV_RGB_RANGE_LIMITED:
-               /* RGB limited range (16-235) */
-               io_write_and_or(sd, 0x02, 0x0f, 0x00);
+               if (state->selected_input == ADV7604_INPUT_VGA_COMP) {
+                       /* YCrCb limited range (16-235) */
+                       io_write_and_or(sd, 0x02, 0x0f, 0x20);
+               } else {
+                       /* RGB limited range (16-235) */
+                       io_write_and_or(sd, 0x02, 0x0f, 0x00);
+               }
                break;
        case V4L2_DV_RGB_RANGE_FULL:
-               /* RGB full range (0-255) */
-               io_write_and_or(sd, 0x02, 0x0f, 0x10);
+               if (state->selected_input == ADV7604_INPUT_VGA_COMP) {
+                       /* YCrCb full range (0-255) */
+                       io_write_and_or(sd, 0x02, 0x0f, 0x60);
+               } else {
+                       /* RGB full range (0-255) */
+                       io_write_and_or(sd, 0x02, 0x0f, 0x10);
+               }
                break;
        }
 }
 
-
 static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl)
 {
        struct v4l2_subdev *sd = to_sd(ctrl);