-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[media] v4l: subdev: Add device node support
Create a device node named subdevX for every registered subdev. As the device node is registered before the subdev core::s_config function is called, return -EGAIN on open until initialization completes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Vimarsh Zutshi <vimarsh.zutshi@gmail.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
- Loading branch information
Laurent Pinchart
authored and
Mauro Carvalho Chehab
committed
Mar 21, 2011
1 parent
0070d91
commit 2096a5d
Showing
8 changed files
with
158 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* V4L2 subdevice support. | ||
* | ||
* Copyright (C) 2010 Nokia Corporation | ||
* | ||
* Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <linux/types.h> | ||
#include <linux/ioctl.h> | ||
#include <linux/videodev2.h> | ||
|
||
#include <media/v4l2-device.h> | ||
#include <media/v4l2-ioctl.h> | ||
|
||
static int subdev_open(struct file *file) | ||
{ | ||
return 0; | ||
} | ||
|
||
static int subdev_close(struct file *file) | ||
{ | ||
return 0; | ||
} | ||
|
||
static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) | ||
{ | ||
switch (cmd) { | ||
default: | ||
return -ENOIOCTLCMD; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static long subdev_ioctl(struct file *file, unsigned int cmd, | ||
unsigned long arg) | ||
{ | ||
return video_usercopy(file, cmd, arg, subdev_do_ioctl); | ||
} | ||
|
||
const struct v4l2_file_operations v4l2_subdev_fops = { | ||
.owner = THIS_MODULE, | ||
.open = subdev_open, | ||
.unlocked_ioctl = subdev_ioctl, | ||
.release = subdev_close, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters