aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPete Eberlein <pete@sensoray.com>2009-09-18 20:59:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:54:00 -0400
commitbb871652d9523d5be811c0c36b04c05c4ac37f92 (patch)
tree875cbe1ddc2ccf08090d1fab920042d1efee57ac /drivers
parentf4135b69cf9cb13ad4d639a1b368e14ccbb6348b (diff)
V4L/DVB (13024): go7007: Implement vidioc_g_std and vidioc_querystd
Implemented the vidio_g_std and vidio_querystd ioctls. Signed-off-by: Pete Eberlein <pete@sensoray.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/go7007/go7007-v4l2.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/drivers/staging/go7007/go7007-v4l2.c b/drivers/staging/go7007/go7007-v4l2.c
index 65f63d214985..4bd353afa596 100644
--- a/drivers/staging/go7007/go7007-v4l2.c
+++ b/drivers/staging/go7007/go7007-v4l2.c
@@ -1110,6 +1110,24 @@ static int vidioc_enum_frameintervals(struct file *filp, void *priv,
1110 return 0; 1110 return 0;
1111} 1111}
1112 1112
1113static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std)
1114{
1115 struct go7007 *go = ((struct go7007_file *) priv)->go;
1116
1117 switch (go->standard) {
1118 case GO7007_STD_NTSC:
1119 *std = V4L2_STD_NTSC;
1120 break;
1121 case GO7007_STD_PAL:
1122 *std = V4L2_STD_PAL;
1123 break;
1124 default:
1125 return -EINVAL;
1126 }
1127
1128 return 0;
1129}
1130
1113static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std) 1131static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
1114{ 1132{
1115 struct go7007 *go = ((struct go7007_file *) priv)->go; 1133 struct go7007 *go = ((struct go7007_file *) priv)->go;
@@ -1154,24 +1172,22 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
1154 return 0; 1172 return 0;
1155} 1173}
1156 1174
1157#if 0 1175static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std)
1158 case VIDIOC_QUERYSTD: 1176{
1159 { 1177 struct go7007 *go = ((struct go7007_file *) priv)->go;
1160 v4l2_std_id *std = arg;
1161 1178
1162 if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) && 1179 if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) &&
1163 go->input == go->board_info->num_inputs - 1) { 1180 go->input == go->board_info->num_inputs - 1) {
1164 if (!go->i2c_adapter_online) 1181 if (!go->i2c_adapter_online)
1165 return -EIO; 1182 return -EIO;
1166 i2c_clients_command(&go->i2c_adapter, 1183 i2c_clients_command(&go->i2c_adapter, VIDIOC_QUERYSTD, std);
1167 VIDIOC_QUERYSTD, arg); 1184 } else if (go->board_info->sensor_flags & GO7007_SENSOR_TV)
1168 } else if (go->board_info->sensor_flags & GO7007_SENSOR_TV) 1185 *std = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
1169 *std = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM; 1186 else
1170 else 1187 *std = 0;
1171 *std = 0; 1188
1172 return 0; 1189 return 0;
1173 } 1190}
1174#endif
1175 1191
1176static int vidioc_enum_input(struct file *file, void *priv, 1192static int vidioc_enum_input(struct file *file, void *priv,
1177 struct v4l2_input *inp) 1193 struct v4l2_input *inp)
@@ -1768,7 +1784,9 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1768 .vidioc_querybuf = vidioc_querybuf, 1784 .vidioc_querybuf = vidioc_querybuf,
1769 .vidioc_qbuf = vidioc_qbuf, 1785 .vidioc_qbuf = vidioc_qbuf,
1770 .vidioc_dqbuf = vidioc_dqbuf, 1786 .vidioc_dqbuf = vidioc_dqbuf,
1787 .vidioc_g_std = vidioc_g_std,
1771 .vidioc_s_std = vidioc_s_std, 1788 .vidioc_s_std = vidioc_s_std,
1789 .vidioc_querystd = vidioc_querystd,
1772 .vidioc_enum_input = vidioc_enum_input, 1790 .vidioc_enum_input = vidioc_enum_input,
1773 .vidioc_g_input = vidioc_g_input, 1791 .vidioc_g_input = vidioc_g_input,
1774 .vidioc_s_input = vidioc_s_input, 1792 .vidioc_s_input = vidioc_s_input,