Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138207
b: refs/heads/master
c: 5a5a4e1
h: refs/heads/master
i:
  138205: a938edd
  138203: b226344
  138199: 61be533
  138191: 3c2d508
  138175: ce72ddb
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 9332e4a commit b484c1c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ef21071d985cb9e33238210760810c71e100b20
refs/heads/master: 5a5a4e16fa19fa3789398e8c707168b7da718b64
29 changes: 24 additions & 5 deletions trunk/drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,10 @@ void au0828_analog_unregister(struct au0828_dev *dev)
mutex_lock(&au0828_sysfs_lock);

list_del(&dev->au0828list);
video_unregister_device(dev->vdev);
video_unregister_device(dev->vbi_dev);
if (dev->vdev)
video_unregister_device(dev->vdev);
if (dev->vbi_dev)
video_unregister_device(dev->vbi_dev);

mutex_unlock(&au0828_sysfs_lock);
}
Expand Down Expand Up @@ -754,10 +756,12 @@ static int au0828_v4l2_open(struct file *filp)
dev = h;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
}
#ifdef VBI_NOT_YET_WORKING
if(h->vbi_dev->minor == minor) {
dev = h;
type = V4L2_BUF_TYPE_VBI_CAPTURE;
}
#endif
}

if(NULL == dev)
Expand Down Expand Up @@ -931,13 +935,15 @@ static int au0828_set_format(struct au0828_dev *dev, unsigned int cmd,
maxwidth = 720;
maxheight = 480;

#ifdef VBI_NOT_YET_WORKING
if(format->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) {
dprintk(1, "VBI format set: to be supported!\n");
return 0;
}
if(format->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
return 0;
}
#endif
if(format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
return -EINVAL;
}
Expand Down Expand Up @@ -1019,8 +1025,10 @@ static int vidioc_querycap(struct file *file, void *priv,
cap->version = AU0828_VERSION_CODE;

/*set the device capabilities */
cap->capabilities = V4L2_CAP_VBI_CAPTURE |
V4L2_CAP_VIDEO_CAPTURE |
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
#ifdef VBI_NOT_YET_WORKING
V4L2_CAP_VBI_CAPTURE |
#endif
V4L2_CAP_AUDIO |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING |
Expand Down Expand Up @@ -1551,10 +1559,15 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
.vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
.vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
#ifdef VBI_NOT_YET_WORKING
.vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap,
.vidioc_try_fmt_vbi_cap = vidioc_s_fmt_vbi_cap,
.vidioc_s_fmt_vbi_cap = vidioc_s_fmt_vbi_cap,
#endif
.vidioc_g_audio = vidioc_g_audio,
.vidioc_s_audio = vidioc_s_audio,
.vidioc_cropcap = vidioc_cropcap,
#ifdef AAA
#ifdef VBI_NOT_YET_WORKING
.vidioc_g_fmt_sliced_vbi_cap = vidioc_g_fmt_sliced_vbi_cap,
.vidioc_try_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,
.vidioc_s_fmt_sliced_vbi_cap = vidioc_try_set_sliced_vbi_cap,
Expand Down Expand Up @@ -1624,24 +1637,28 @@ int au0828_analog_register(struct au0828_dev *dev)
return -ENOMEM;
}

#ifdef VBI_NOT_YET_WORKING
dev->vbi_dev = video_device_alloc();
if(NULL == dev->vbi_dev) {
dprintk(1, "Can't allocate vbi_device.\n");
kfree(dev->vdev);
return -ENOMEM;
}
#endif

/* Fill the video capture device struct */
*dev->vdev = au0828_video_template;
dev->vdev->vfl_type = VID_TYPE_CAPTURE | VID_TYPE_TUNER;
dev->vdev->parent = &dev->usbdev->dev;
strcpy(dev->vdev->name, "au0828a video");

#ifdef VBI_NOT_YET_WORKING
/* Setup the VBI device */
*dev->vbi_dev = au0828_video_template;
dev->vbi_dev->vfl_type = VFL_TYPE_VBI;
dev->vbi_dev->parent = &dev->usbdev->dev;
strcpy(dev->vbi_dev->name, "au0828a vbi");
#endif

list_add_tail(&dev->au0828list, &au0828_devlist);

Expand All @@ -1653,6 +1670,7 @@ int au0828_analog_register(struct au0828_dev *dev)
return -ENODEV;
}

#ifdef VBI_NOT_YET_WORKING
/* Register the vbi device */
if((retval = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, -1)) != 0) {
dprintk(1, "unable to register vbi device (error = %d).\n", retval);
Expand All @@ -1661,6 +1679,7 @@ int au0828_analog_register(struct au0828_dev *dev)
video_device_release(dev->vdev);
return -ENODEV;
}
#endif

dprintk(1, "%s completed!\n", __FUNCTION__);

Expand Down

0 comments on commit b484c1c

Please sign in to comment.