[media] adv: use V4L2_DV_FL_IS_CE_VIDEO instead of V4L2_DV_BT_STD_CEA861
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 20 Mar 2015 17:05:05 +0000 (14:05 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 09:38:31 +0000 (06:38 -0300)
Don't rely on V4L2_DV_BT_STD_CEA861 since that include the
640x480p format, which is an IT format, not CE.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/ad9389b.c
drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c

index fada17566205015d32d5923ed068d21efcc6ae5a..69094ab047b1d955040f6f6e2a7afd10287fec6c 100644 (file)
@@ -239,8 +239,8 @@ static void ad9389b_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd)
 {
        struct ad9389b_state *state = get_ad9389b_state(sd);
 
-       if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
-               /* CEA format, not IT  */
+       if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
+               /* CE format, not IT  */
                ad9389b_wr_and_or(sd, 0xcd, 0xbf, 0x00);
        } else {
                /* IT format */
@@ -255,11 +255,11 @@ static int ad9389b_set_rgb_quantization_mode(struct v4l2_subdev *sd, struct v4l2
        switch (ctrl->val) {
        case V4L2_DV_RGB_RANGE_AUTO:
                /* automatic */
-               if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
-                       /* cea format, RGB limited range (16-235) */
+               if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
+                       /* CE format, RGB limited range (16-235) */
                        ad9389b_csc_rgb_full2limit(sd, true);
                } else {
-                       /* not cea format, RGB full range (0-255) */
+                       /* not CE format, RGB full range (0-255) */
                        ad9389b_csc_rgb_full2limit(sd, false);
                }
                break;
index 03ea62f9c07466112975b12741e9d731f76d924b..12d93203d405b8de9512287eb31007b2c3d31333 100644 (file)
@@ -312,8 +312,8 @@ static void adv7511_csc_rgb_full2limit(struct v4l2_subdev *sd, bool enable)
 static void adv7511_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd)
 {
        struct adv7511_state *state = get_adv7511_state(sd);
-       if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
-               /* CEA format, not IT  */
+       if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
+               /* CE format, not IT  */
                adv7511_wr_and_or(sd, 0x57, 0x7f, 0x00);
        } else {
                /* IT format */
@@ -331,11 +331,11 @@ static int adv7511_set_rgb_quantization_mode(struct v4l2_subdev *sd, struct v4l2
                /* automatic */
                struct adv7511_state *state = get_adv7511_state(sd);
 
-               if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
-                       /* cea format, RGB limited range (16-235) */
+               if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
+                       /* CE format, RGB limited range (16-235) */
                        adv7511_csc_rgb_full2limit(sd, true);
                } else {
-                       /* not cea format, RGB full range (0-255) */
+                       /* not CE format, RGB full range (0-255) */
                        adv7511_csc_rgb_full2limit(sd, false);
                }
        }
index 1e58537c3ea3de3900c2f7f1e30a8cd4f5f4e8c3..60ffcf098befa991021ae43f161ebdb1fd7f2037 100644 (file)
@@ -1075,7 +1075,7 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd)
                /* Receiving DVI-D signal
                 * ADV7604 selects RGB limited range regardless of
                 * input format (CE/IT) in automatic mode */
-               if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
+               if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
                        /* RGB limited range (16-235) */
                        io_write_clr_set(sd, 0x02, 0xf0, 0x00);
                } else {
@@ -1755,8 +1755,9 @@ static void adv76xx_fill_format(struct adv76xx_state *state,
        format->width = state->timings.bt.width;
        format->height = state->timings.bt.height;
        format->field = V4L2_FIELD_NONE;
+       format->colorspace = V4L2_COLORSPACE_SRGB;
 
-       if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861)
+       if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO)
                format->colorspace = (state->timings.bt.height <= 576) ?
                        V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709;
 }
index 7c215ee142c4057a040c6ccfd46a1bb987ce4b9d..b5a37fe10a6a5d423ff63af635894e028e6abcf3 100644 (file)
@@ -1119,7 +1119,7 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd)
                /* Receiving DVI-D signal
                 * ADV7842 selects RGB limited range regardless of
                 * input format (CE/IT) in automatic mode */
-               if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
+               if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
                        /* RGB limited range (16-235) */
                        io_write_and_or(sd, 0x02, 0x0f, 0x00);
                } else {
@@ -1901,7 +1901,8 @@ static int adv7842_g_mbus_fmt(struct v4l2_subdev *sd,
                return 0;
        }
 
-       if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) {
+       fmt->colorspace = V4L2_COLORSPACE_SRGB;
+       if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) {
                fmt->colorspace = (state->timings.bt.height <= 576) ?
                        V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709;
        }