blob: 037aa28a5ed1bb0c77c89b2e9e1db7b9d4721081 [file] [log] [blame]
Laurent Pinchart2096a5d2009-12-09 08:38:49 -03001/*
2 * V4L2 subdevice support.
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/types.h>
23#include <linux/ioctl.h>
24#include <linux/videodev2.h>
25
26#include <media/v4l2-device.h>
27#include <media/v4l2-ioctl.h>
28
29static int subdev_open(struct file *file)
30{
31 return 0;
32}
33
34static int subdev_close(struct file *file)
35{
36 return 0;
37}
38
39static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
40{
41 switch (cmd) {
42 default:
43 return -ENOIOCTLCMD;
44 }
45
46 return 0;
47}
48
49static long subdev_ioctl(struct file *file, unsigned int cmd,
50 unsigned long arg)
51{
52 return video_usercopy(file, cmd, arg, subdev_do_ioctl);
53}
54
55const struct v4l2_file_operations v4l2_subdev_fops = {
56 .owner = THIS_MODULE,
57 .open = subdev_open,
58 .unlocked_ioctl = subdev_ioctl,
59 .release = subdev_close,
60};