aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:32:41 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:32:41 -0500
commitda4ae5a72b2a9de351ec8f98543b7c666ec97005 (patch)
tree4ba2bb7e3deea78eb8b56a4573a35dce2bb78986
parentd92c20e0a5b560bbe46d7e68bb47df2366cddf8f (diff)
V4L/DVB (3280): Added VIDIOC_QUERYCTRL to saa7115
- Added VIDIOC_QUERYCTRL to saa7115 Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r--drivers/media/video/saa7115.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 6cc13311bc2c..4a4bc69fb0e9 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1012,6 +1012,48 @@ static void saa7115_decode_vbi_line(struct i2c_client *client,
1012 1012
1013/* ============ SAA7115 AUDIO settings (end) ============= */ 1013/* ============ SAA7115 AUDIO settings (end) ============= */
1014 1014
1015static struct v4l2_queryctrl saa7115_qctrl[] = {
1016 {
1017 .id = V4L2_CID_BRIGHTNESS,
1018 .type = V4L2_CTRL_TYPE_INTEGER,
1019 .name = "Brightness",
1020 .minimum = 0,
1021 .maximum = 255,
1022 .step = 1,
1023 .default_value = 128,
1024 .flags = 0,
1025 }, {
1026 .id = V4L2_CID_CONTRAST,
1027 .type = V4L2_CTRL_TYPE_INTEGER,
1028 .name = "Contrast",
1029 .minimum = 0,
1030 .maximum = 255,
1031 .step = 1,
1032 .default_value = 64,
1033 .flags = 0,
1034 }, {
1035 .id = V4L2_CID_SATURATION,
1036 .type = V4L2_CTRL_TYPE_INTEGER,
1037 .name = "Saturation",
1038 .minimum = 0,
1039 .maximum = 255,
1040 .step = 1,
1041 .default_value = 64,
1042 .flags = 0,
1043 }, {
1044 .id = V4L2_CID_HUE,
1045 .type = V4L2_CTRL_TYPE_INTEGER,
1046 .name = "Hue",
1047 .minimum = -128,
1048 .maximum = 127,
1049 .step = 1,
1050 .default_value = 0,
1051 .flags = 0,
1052 },
1053};
1054
1055/* ----------------------------------------------------------------------- */
1056
1015static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *arg) 1057static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *arg)
1016{ 1058{
1017 struct saa7115_state *state = i2c_get_clientdata(client); 1059 struct saa7115_state *state = i2c_get_clientdata(client);
@@ -1052,6 +1094,19 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1052 case VIDIOC_S_CTRL: 1094 case VIDIOC_S_CTRL:
1053 return saa7115_set_v4lctrl(client, (struct v4l2_control *)arg); 1095 return saa7115_set_v4lctrl(client, (struct v4l2_control *)arg);
1054 1096
1097 case VIDIOC_QUERYCTRL:
1098 {
1099 struct v4l2_queryctrl *qc = arg;
1100 int i;
1101
1102 for (i = 0; i < ARRAY_SIZE(saa7115_qctrl); i++)
1103 if (qc->id && qc->id == saa7115_qctrl[i].id) {
1104 memcpy(qc, &saa7115_qctrl[i], sizeof(*qc));
1105 return 0;
1106 }
1107 return -EINVAL;
1108 }
1109
1055 case VIDIOC_G_STD: 1110 case VIDIOC_G_STD:
1056 *(v4l2_std_id *)arg = saa7115_get_v4lstd(client); 1111 *(v4l2_std_id *)arg = saa7115_get_v4lstd(client);
1057 break; 1112 break;