Commit d261e842 authored by Mats Randgaard's avatar Mats Randgaard Committed by Mauro Carvalho Chehab

[media] adv7604: select YPbPr if RGB_RANGE_FULL/LIMITED is set for VGA_COMP inputs

Signed-off-by: default avatarMats Randgaard <matrandg@cisco.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 9833239e
...@@ -949,17 +949,26 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd) ...@@ -949,17 +949,26 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd)
} }
break; break;
case V4L2_DV_RGB_RANGE_LIMITED: case V4L2_DV_RGB_RANGE_LIMITED:
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) */ /* RGB limited range (16-235) */
io_write_and_or(sd, 0x02, 0x0f, 0x00); io_write_and_or(sd, 0x02, 0x0f, 0x00);
}
break; break;
case V4L2_DV_RGB_RANGE_FULL: case V4L2_DV_RGB_RANGE_FULL:
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) */ /* RGB full range (0-255) */
io_write_and_or(sd, 0x02, 0x0f, 0x10); io_write_and_or(sd, 0x02, 0x0f, 0x10);
}
break; break;
} }
} }
static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl) static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl)
{ {
struct v4l2_subdev *sd = to_sd(ctrl); struct v4l2_subdev *sd = to_sd(ctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment