aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision/usbvision-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-video.c')
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 85661b1848fe..2be5e47ed081 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -355,7 +355,7 @@ static void usbvision_remove_sysfs(struct video_device *vdev)
355 * then allocates buffers needed for video processing. 355 * then allocates buffers needed for video processing.
356 * 356 *
357 */ 357 */
358static int usbvision_v4l2_open(struct inode *inode, struct file *file) 358static int usbvision_v4l2_open(struct file *file)
359{ 359{
360 struct usb_usbvision *usbvision = video_drvdata(file); 360 struct usb_usbvision *usbvision = video_drvdata(file);
361 int errCode = 0; 361 int errCode = 0;
@@ -432,7 +432,7 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
432 * allocated in usbvision_v4l2_open(). 432 * allocated in usbvision_v4l2_open().
433 * 433 *
434 */ 434 */
435static int usbvision_v4l2_close(struct inode *inode, struct file *file) 435static int usbvision_v4l2_close(struct file *file)
436{ 436{
437 struct usb_usbvision *usbvision = video_drvdata(file); 437 struct usb_usbvision *usbvision = video_drvdata(file);
438 438
@@ -477,12 +477,12 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file)
477 */ 477 */
478#ifdef CONFIG_VIDEO_ADV_DEBUG 478#ifdef CONFIG_VIDEO_ADV_DEBUG
479static int vidioc_g_register (struct file *file, void *priv, 479static int vidioc_g_register (struct file *file, void *priv,
480 struct v4l2_register *reg) 480 struct v4l2_dbg_register *reg)
481{ 481{
482 struct usb_usbvision *usbvision = video_drvdata(file); 482 struct usb_usbvision *usbvision = video_drvdata(file);
483 int errCode; 483 int errCode;
484 484
485 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 485 if (!v4l2_chip_match_host(&reg->match))
486 return -EINVAL; 486 return -EINVAL;
487 /* NT100x has a 8-bit register space */ 487 /* NT100x has a 8-bit register space */
488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff); 488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff);
@@ -492,16 +492,17 @@ static int vidioc_g_register (struct file *file, void *priv,
492 return errCode; 492 return errCode;
493 } 493 }
494 reg->val = errCode; 494 reg->val = errCode;
495 reg->size = 1;
495 return 0; 496 return 0;
496} 497}
497 498
498static int vidioc_s_register (struct file *file, void *priv, 499static int vidioc_s_register (struct file *file, void *priv,
499 struct v4l2_register *reg) 500 struct v4l2_dbg_register *reg)
500{ 501{
501 struct usb_usbvision *usbvision = video_drvdata(file); 502 struct usb_usbvision *usbvision = video_drvdata(file);
502 int errCode; 503 int errCode;
503 504
504 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 505 if (!v4l2_chip_match_host(&reg->match))
505 return -EINVAL; 506 return -EINVAL;
506 /* NT100x has a 8-bit register space */ 507 /* NT100x has a 8-bit register space */
507 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); 508 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
@@ -1178,7 +1179,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
1178 * Here comes the stuff for radio on usbvision based devices 1179 * Here comes the stuff for radio on usbvision based devices
1179 * 1180 *
1180 */ 1181 */
1181static int usbvision_radio_open(struct inode *inode, struct file *file) 1182static int usbvision_radio_open(struct file *file)
1182{ 1183{
1183 struct usb_usbvision *usbvision = video_drvdata(file); 1184 struct usb_usbvision *usbvision = video_drvdata(file);
1184 int errCode = 0; 1185 int errCode = 0;
@@ -1228,7 +1229,7 @@ out:
1228} 1229}
1229 1230
1230 1231
1231static int usbvision_radio_close(struct inode *inode, struct file *file) 1232static int usbvision_radio_close(struct file *file)
1232{ 1233{
1233 struct usb_usbvision *usbvision = video_drvdata(file); 1234 struct usb_usbvision *usbvision = video_drvdata(file);
1234 int errCode = 0; 1235 int errCode = 0;
@@ -1266,26 +1267,26 @@ static int usbvision_radio_close(struct inode *inode, struct file *file)
1266 * Here comes the stuff for vbi on usbvision based devices 1267 * Here comes the stuff for vbi on usbvision based devices
1267 * 1268 *
1268 */ 1269 */
1269static int usbvision_vbi_open(struct inode *inode, struct file *file) 1270static int usbvision_vbi_open(struct file *file)
1270{ 1271{
1271 /* TODO */ 1272 /* TODO */
1272 return -ENODEV; 1273 return -ENODEV;
1273} 1274}
1274 1275
1275static int usbvision_vbi_close(struct inode *inode, struct file *file) 1276static int usbvision_vbi_close(struct file *file)
1276{ 1277{
1277 /* TODO */ 1278 /* TODO */
1278 return -ENODEV; 1279 return -ENODEV;
1279} 1280}
1280 1281
1281static int usbvision_do_vbi_ioctl(struct file *file, 1282static long usbvision_do_vbi_ioctl(struct file *file,
1282 unsigned int cmd, void *arg) 1283 unsigned int cmd, void *arg)
1283{ 1284{
1284 /* TODO */ 1285 /* TODO */
1285 return -ENOIOCTLCMD; 1286 return -ENOIOCTLCMD;
1286} 1287}
1287 1288
1288static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, 1289static long usbvision_vbi_ioctl(struct file *file,
1289 unsigned int cmd, unsigned long arg) 1290 unsigned int cmd, unsigned long arg)
1290{ 1291{
1291 return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl); 1292 return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl);
@@ -1297,16 +1298,14 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file,
1297// 1298//
1298 1299
1299// Video template 1300// Video template
1300static const struct file_operations usbvision_fops = { 1301static const struct v4l2_file_operations usbvision_fops = {
1301 .owner = THIS_MODULE, 1302 .owner = THIS_MODULE,
1302 .open = usbvision_v4l2_open, 1303 .open = usbvision_v4l2_open,
1303 .release = usbvision_v4l2_close, 1304 .release = usbvision_v4l2_close,
1304 .read = usbvision_v4l2_read, 1305 .read = usbvision_v4l2_read,
1305 .mmap = usbvision_v4l2_mmap, 1306 .mmap = usbvision_v4l2_mmap,
1306 .ioctl = video_ioctl2, 1307 .ioctl = video_ioctl2,
1307 .llseek = no_llseek,
1308/* .poll = video_poll, */ 1308/* .poll = video_poll, */
1309 .compat_ioctl = v4l_compat_ioctl32,
1310}; 1309};
1311 1310
1312static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { 1311static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
@@ -1355,13 +1354,11 @@ static struct video_device usbvision_video_template = {
1355 1354
1356 1355
1357// Radio template 1356// Radio template
1358static const struct file_operations usbvision_radio_fops = { 1357static const struct v4l2_file_operations usbvision_radio_fops = {
1359 .owner = THIS_MODULE, 1358 .owner = THIS_MODULE,
1360 .open = usbvision_radio_open, 1359 .open = usbvision_radio_open,
1361 .release = usbvision_radio_close, 1360 .release = usbvision_radio_close,
1362 .ioctl = video_ioctl2, 1361 .ioctl = video_ioctl2,
1363 .llseek = no_llseek,
1364 .compat_ioctl = v4l_compat_ioctl32,
1365}; 1362};
1366 1363
1367static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { 1364static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = {
@@ -1392,13 +1389,11 @@ static struct video_device usbvision_radio_template = {
1392}; 1389};
1393 1390
1394// vbi template 1391// vbi template
1395static const struct file_operations usbvision_vbi_fops = { 1392static const struct v4l2_file_operations usbvision_vbi_fops = {
1396 .owner = THIS_MODULE, 1393 .owner = THIS_MODULE,
1397 .open = usbvision_vbi_open, 1394 .open = usbvision_vbi_open,
1398 .release = usbvision_vbi_close, 1395 .release = usbvision_vbi_close,
1399 .ioctl = usbvision_vbi_ioctl, 1396 .ioctl = usbvision_vbi_ioctl,
1400 .llseek = no_llseek,
1401 .compat_ioctl = v4l_compat_ioctl32,
1402}; 1397};
1403 1398
1404static struct video_device usbvision_vbi_template= 1399static struct video_device usbvision_vbi_template=