diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-04-14 12:10:32 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-16 18:11:58 -0300 |
commit | 7087d31b0c9dddbca71b8e33d3f0a3b719afa397 (patch) | |
tree | 6ad09261fa0e6884132f40200f3efc6eea9f11aa /drivers/media/pci/cx25821/cx25821-video.c | |
parent | [media] cx25821: add output format ioctls (diff) | |
download | linux-dev-7087d31b0c9dddbca71b8e33d3f0a3b719afa397.tar.xz linux-dev-7087d31b0c9dddbca71b8e33d3f0a3b719afa397.zip |
[media] cx25821: drop cx25821-video-upstream-ch2.c/h
cx25821-video-upstream_ch2.c/h is practically identical to cx25821-video-upstream.c/h
so add support for ch2 into cx25821-video-upstream.c instead.
After this we can replace the custom ioctls with a proper write() interface.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/cx25821/cx25821-video.c')
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-video.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c index 70e33b125969..dde0ba3d3401 100644 --- a/drivers/media/pci/cx25821/cx25821-video.c +++ b/drivers/media/pci/cx25821/cx25821-video.c @@ -893,6 +893,20 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *priv, return 0; } +static int video_out_release(struct file *file) +{ + struct cx25821_channel *chan = video_drvdata(file); + struct cx25821_video_out_data *out = chan->out; + struct cx25821_dev *dev = chan->dev; + + mutex_lock(&dev->lock); + if ((chan->id == SRAM_CH09 || chan->id == SRAM_CH10) && out->_is_running) + cx25821_stop_upstream_video(chan); + mutex_unlock(&dev->lock); + + return v4l2_fh_release(file); +} + static const struct v4l2_ctrl_ops cx25821_ctrl_ops = { .s_ctrl = cx25821_s_ctrl, }; @@ -941,7 +955,7 @@ static const struct video_device cx25821_video_device = { static const struct v4l2_file_operations video_out_fops = { .owner = THIS_MODULE, .open = v4l2_fh_open, - .release = v4l2_fh_release, + .release = video_out_release, .unlocked_ioctl = video_ioctl2, }; @@ -1017,6 +1031,9 @@ int cx25821_video_register(struct cx25821_dev *dev) err = v4l2_ctrl_handler_setup(hdl); if (err) goto fail_unreg; + } else { + chan->out = &dev->vid_out_data[i - SRAM_CH09]; + chan->out->chan = chan; } cx25821_risc_stopper(dev->pci, &chan->dma_vidq.stopper, |