aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7604.c
diff options
context:
space:
mode:
authorMats Randgaard <matrandg@cisco.com>2013-12-05 08:17:15 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-07 02:57:22 -0500
commitd261e8428b9fed1d42827677688c457e7197e5d1 (patch)
tree7a2338b608f730fcacef3c465cdb0fb49508652d /drivers/media/i2c/adv7604.c
parent9833239e13735dc318d1b76a6aec32b409d2653c (diff)
[media] adv7604: select YPbPr if RGB_RANGE_FULL/LIMITED is set for VGA_COMP inputs
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>
Diffstat (limited to 'drivers/media/i2c/adv7604.c')
-rw-r--r--drivers/media/i2c/adv7604.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index d4ac8dd51589..d1de747f4542 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -949,17 +949,26 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd)
949 } 949 }
950 break; 950 break;
951 case V4L2_DV_RGB_RANGE_LIMITED: 951 case V4L2_DV_RGB_RANGE_LIMITED:
952 /* RGB limited range (16-235) */ 952 if (state->selected_input == ADV7604_INPUT_VGA_COMP) {
953 io_write_and_or(sd, 0x02, 0x0f, 0x00); 953 /* YCrCb limited range (16-235) */
954 io_write_and_or(sd, 0x02, 0x0f, 0x20);
955 } else {
956 /* RGB limited range (16-235) */
957 io_write_and_or(sd, 0x02, 0x0f, 0x00);
958 }
954 break; 959 break;
955 case V4L2_DV_RGB_RANGE_FULL: 960 case V4L2_DV_RGB_RANGE_FULL:
956 /* RGB full range (0-255) */ 961 if (state->selected_input == ADV7604_INPUT_VGA_COMP) {
957 io_write_and_or(sd, 0x02, 0x0f, 0x10); 962 /* YCrCb full range (0-255) */
963 io_write_and_or(sd, 0x02, 0x0f, 0x60);
964 } else {
965 /* RGB full range (0-255) */
966 io_write_and_or(sd, 0x02, 0x0f, 0x10);
967 }
958 break; 968 break;
959 } 969 }
960} 970}
961 971
962
963static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl) 972static int adv7604_s_ctrl(struct v4l2_ctrl *ctrl)
964{ 973{
965 struct v4l2_subdev *sd = to_sd(ctrl); 974 struct v4l2_subdev *sd = to_sd(ctrl);