From e3355473f2eb668345c44ac8b93537f4ca46cd0b Mon Sep 17 00:00:00 2001 From: "yuyeon.oh" Date: Wed, 15 Jun 2011 21:51:22 +0900 Subject: [PATCH] svo : open and release Change-Id: I6d1f7f0c4f28aa29dc4a4a1bbd4f0f8329fb2b23 --- drivers/media/video/svo.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/svo.c b/drivers/media/video/svo.c index e896c01f0780..4037e037c316 100755 --- a/drivers/media/video/svo.c +++ b/drivers/media/video/svo.c @@ -27,26 +27,51 @@ static struct pci_device_id svo_pci_tbl[] = { struct svo { struct pci_dev *pci_dev; /* pci device */ struct video_device *video_dev; /* video device parameters */ + unsigned char __iomem *svo_mem; /* svo: memory */ unsigned char __iomem *svo_mmregs; /* svo: memory mapped registers */ + + unsigned long in_use; /* set to 1 if the device is in use */ +}; + +/* driver structure - only one possible */ +static struct svo svo; + +/****************************************************************************/ +/* video4linux integration */ +/****************************************************************************/ + +static int svo_open(struct file *file) +{ + if (test_and_set_bit(0, &svo.in_use)) + return -EBUSY; + + return 0; +} + +static int svo_release(struct file *file) +{ + // TODO: overlay off + clear_bit(0, &svo.in_use); + return 0; +} + +static const struct v4l2_ioctl_ops svo_ioctl_ops = { + // TODO: fill it }; static const struct v4l2_file_operations svo_fops = { .owner = THIS_MODULE, -// .open = meye_open, -// .release = meye_release, + .open = svo_open, + .release = svo_release, // .mmap = meye_mmap, .ioctl = video_ioctl2, -// .poll = meye_poll, }; -/* driver structure - only one possible */ -static struct svo svo; - static struct video_device svo_template = { .name = "svo", .fops = &svo_fops, -// .ioctl_ops = &meye_ioctl_ops, + .ioctl_ops = &svo_ioctl_ops, .release = video_device_release, .minor = -1, }; -- 2.34.1