aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,