diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-20 13:05:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-08 05:38:31 -0400 |
commit | 680fee04a227d60dca5850e55597a09d15b92eb3 (patch) | |
tree | 44bb749c3871235abbe4bee40915a8988ead7791 /drivers/media/i2c | |
parent | 8b44b4e513a8da1d68759897445431b5d2e99d91 (diff) |
[media] adv: use V4L2_DV_FL_IS_CE_VIDEO instead of V4L2_DV_BT_STD_CEA861
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>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/ad9389b.c | 10 | ||||
-rw-r--r-- | drivers/media/i2c/adv7511.c | 10 | ||||
-rw-r--r-- | drivers/media/i2c/adv7604.c | 5 | ||||
-rw-r--r-- | drivers/media/i2c/adv7842.c | 5 |
4 files changed, 16 insertions, 14 deletions
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index fada17566205..69094ab047b1 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c | |||
@@ -239,8 +239,8 @@ static void ad9389b_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd) | |||
239 | { | 239 | { |
240 | struct ad9389b_state *state = get_ad9389b_state(sd); | 240 | struct ad9389b_state *state = get_ad9389b_state(sd); |
241 | 241 | ||
242 | if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 242 | if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
243 | /* CEA format, not IT */ | 243 | /* CE format, not IT */ |
244 | ad9389b_wr_and_or(sd, 0xcd, 0xbf, 0x00); | 244 | ad9389b_wr_and_or(sd, 0xcd, 0xbf, 0x00); |
245 | } else { | 245 | } else { |
246 | /* IT format */ | 246 | /* IT format */ |
@@ -255,11 +255,11 @@ static int ad9389b_set_rgb_quantization_mode(struct v4l2_subdev *sd, struct v4l2 | |||
255 | switch (ctrl->val) { | 255 | switch (ctrl->val) { |
256 | case V4L2_DV_RGB_RANGE_AUTO: | 256 | case V4L2_DV_RGB_RANGE_AUTO: |
257 | /* automatic */ | 257 | /* automatic */ |
258 | if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 258 | if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
259 | /* cea format, RGB limited range (16-235) */ | 259 | /* CE format, RGB limited range (16-235) */ |
260 | ad9389b_csc_rgb_full2limit(sd, true); | 260 | ad9389b_csc_rgb_full2limit(sd, true); |
261 | } else { | 261 | } else { |
262 | /* not cea format, RGB full range (0-255) */ | 262 | /* not CE format, RGB full range (0-255) */ |
263 | ad9389b_csc_rgb_full2limit(sd, false); | 263 | ad9389b_csc_rgb_full2limit(sd, false); |
264 | } | 264 | } |
265 | break; | 265 | break; |
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 03ea62f9c074..12d93203d405 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c | |||
@@ -312,8 +312,8 @@ static void adv7511_csc_rgb_full2limit(struct v4l2_subdev *sd, bool enable) | |||
312 | static void adv7511_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd) | 312 | static void adv7511_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd) |
313 | { | 313 | { |
314 | struct adv7511_state *state = get_adv7511_state(sd); | 314 | struct adv7511_state *state = get_adv7511_state(sd); |
315 | if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 315 | if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
316 | /* CEA format, not IT */ | 316 | /* CE format, not IT */ |
317 | adv7511_wr_and_or(sd, 0x57, 0x7f, 0x00); | 317 | adv7511_wr_and_or(sd, 0x57, 0x7f, 0x00); |
318 | } else { | 318 | } else { |
319 | /* IT format */ | 319 | /* IT format */ |
@@ -331,11 +331,11 @@ static int adv7511_set_rgb_quantization_mode(struct v4l2_subdev *sd, struct v4l2 | |||
331 | /* automatic */ | 331 | /* automatic */ |
332 | struct adv7511_state *state = get_adv7511_state(sd); | 332 | struct adv7511_state *state = get_adv7511_state(sd); |
333 | 333 | ||
334 | if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 334 | if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
335 | /* cea format, RGB limited range (16-235) */ | 335 | /* CE format, RGB limited range (16-235) */ |
336 | adv7511_csc_rgb_full2limit(sd, true); | 336 | adv7511_csc_rgb_full2limit(sd, true); |
337 | } else { | 337 | } else { |
338 | /* not cea format, RGB full range (0-255) */ | 338 | /* not CE format, RGB full range (0-255) */ |
339 | adv7511_csc_rgb_full2limit(sd, false); | 339 | adv7511_csc_rgb_full2limit(sd, false); |
340 | } | 340 | } |
341 | } | 341 | } |
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 1e58537c3ea3..60ffcf098bef 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -1075,7 +1075,7 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd) | |||
1075 | /* Receiving DVI-D signal | 1075 | /* Receiving DVI-D signal |
1076 | * ADV7604 selects RGB limited range regardless of | 1076 | * ADV7604 selects RGB limited range regardless of |
1077 | * input format (CE/IT) in automatic mode */ | 1077 | * input format (CE/IT) in automatic mode */ |
1078 | if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 1078 | if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
1079 | /* RGB limited range (16-235) */ | 1079 | /* RGB limited range (16-235) */ |
1080 | io_write_clr_set(sd, 0x02, 0xf0, 0x00); | 1080 | io_write_clr_set(sd, 0x02, 0xf0, 0x00); |
1081 | } else { | 1081 | } else { |
@@ -1755,8 +1755,9 @@ static void adv76xx_fill_format(struct adv76xx_state *state, | |||
1755 | format->width = state->timings.bt.width; | 1755 | format->width = state->timings.bt.width; |
1756 | format->height = state->timings.bt.height; | 1756 | format->height = state->timings.bt.height; |
1757 | format->field = V4L2_FIELD_NONE; | 1757 | format->field = V4L2_FIELD_NONE; |
1758 | format->colorspace = V4L2_COLORSPACE_SRGB; | ||
1758 | 1759 | ||
1759 | if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) | 1760 | if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) |
1760 | format->colorspace = (state->timings.bt.height <= 576) ? | 1761 | format->colorspace = (state->timings.bt.height <= 576) ? |
1761 | V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; | 1762 | V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; |
1762 | } | 1763 | } |
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 7c215ee142c4..b5a37fe10a6a 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c | |||
@@ -1119,7 +1119,7 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd) | |||
1119 | /* Receiving DVI-D signal | 1119 | /* Receiving DVI-D signal |
1120 | * ADV7842 selects RGB limited range regardless of | 1120 | * ADV7842 selects RGB limited range regardless of |
1121 | * input format (CE/IT) in automatic mode */ | 1121 | * input format (CE/IT) in automatic mode */ |
1122 | if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 1122 | if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { |
1123 | /* RGB limited range (16-235) */ | 1123 | /* RGB limited range (16-235) */ |
1124 | io_write_and_or(sd, 0x02, 0x0f, 0x00); | 1124 | io_write_and_or(sd, 0x02, 0x0f, 0x00); |
1125 | } else { | 1125 | } else { |
@@ -1901,7 +1901,8 @@ static int adv7842_g_mbus_fmt(struct v4l2_subdev *sd, | |||
1901 | return 0; | 1901 | return 0; |
1902 | } | 1902 | } |
1903 | 1903 | ||
1904 | if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { | 1904 | fmt->colorspace = V4L2_COLORSPACE_SRGB; |
1905 | if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { | ||
1905 | fmt->colorspace = (state->timings.bt.height <= 576) ? | 1906 | fmt->colorspace = (state->timings.bt.height <= 576) ? |
1906 | V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; | 1907 | V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; |
1907 | } | 1908 | } |