V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()
The inode parameter at v4l_compat_translate_ioctl() were just passed over several places just to keep compatible with fops.ioctl. However, it weren't used anywere. This patch gets hid of this unused parameter. Cc: Laurent Pinchart <laurent.pinchart@skynet.be> Cc: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
4e7ca40dbf
commit
b1f88407f3
6 changed files with 130 additions and 138 deletions
|
@ -834,7 +834,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
|
||||||
* copying is done already, arg is a kernel pointer.
|
* copying is done already, arg is a kernel pointer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg)
|
static int __saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct saa7146_fh *fh = file->private_data;
|
struct saa7146_fh *fh = file->private_data;
|
||||||
struct saa7146_dev *dev = fh->dev;
|
struct saa7146_dev *dev = fh->dev;
|
||||||
|
@ -1215,12 +1215,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
return v4l_compat_translate_ioctl(inode,file,cmd,arg,
|
return v4l_compat_translate_ioctl(file, cmd, arg,
|
||||||
saa7146_video_do_ioctl);
|
__saa7146_video_do_ioctl);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int saa7146_video_do_ioctl(struct inode *inode, struct file *file,
|
||||||
|
unsigned int cmd, void *arg)
|
||||||
|
{
|
||||||
|
return __saa7146_video_do_ioctl(file, cmd, arg);
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/* buffer handling functions */
|
/* buffer handling functions */
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ static const char *get_v4l_name(int v4l_type)
|
||||||
* This is part of Video 4 Linux API. The procedure handles ioctl() calls.
|
* This is part of Video 4 Linux API. The procedure handles ioctl() calls.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
static int __pvr2_v4l2_do_ioctl(struct file *file,
|
||||||
unsigned int cmd, void *arg)
|
unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct pvr2_v4l2_fh *fh = file->private_data;
|
struct pvr2_v4l2_fh *fh = file->private_data;
|
||||||
|
@ -863,8 +863,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default :
|
default :
|
||||||
ret = v4l_compat_translate_ioctl(inode,file,cmd,
|
ret = v4l_compat_translate_ioctl(file, cmd,
|
||||||
arg,pvr2_v4l2_do_ioctl);
|
arg, __pvr2_v4l2_do_ioctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
pvr2_hdw_commit_ctl(hdw);
|
pvr2_hdw_commit_ctl(hdw);
|
||||||
|
@ -890,6 +890,11 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
|
unsigned int cmd, void *arg)
|
||||||
|
{
|
||||||
|
return __pvr2_v4l2_do_ioctl(file, cmd, arg);
|
||||||
|
}
|
||||||
|
|
||||||
static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
|
static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
|
||||||
{
|
{
|
||||||
|
|
|
@ -464,7 +464,7 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
static int __uvc_v4l2_do_ioctl(struct file *file,
|
||||||
unsigned int cmd, void *arg)
|
unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct video_device *vdev = video_devdata(file);
|
struct video_device *vdev = video_devdata(file);
|
||||||
|
@ -978,8 +978,8 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
return uvc_xu_ctrl_query(video, arg, 1);
|
return uvc_xu_ctrl_query(video, arg, 1);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((ret = v4l_compat_translate_ioctl(inode, file, cmd, arg,
|
if ((ret = v4l_compat_translate_ioctl(file, cmd, arg,
|
||||||
uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
|
__uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
|
||||||
uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
|
uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
|
||||||
cmd);
|
cmd);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -988,6 +988,12 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
|
||||||
|
unsigned int cmd, void *arg)
|
||||||
|
{
|
||||||
|
return __uvc_v4l2_do_ioctl(file, cmd, arg);
|
||||||
|
}
|
||||||
|
|
||||||
static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
|
static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,8 +57,7 @@ MODULE_LICENSE("GPL");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_v4l_control(struct inode *inode,
|
get_v4l_control(struct file *file,
|
||||||
struct file *file,
|
|
||||||
int cid,
|
int cid,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -67,12 +66,12 @@ get_v4l_control(struct inode *inode,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
qctrl2.id = cid;
|
qctrl2.id = cid;
|
||||||
err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
|
err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOC_QUERYCTRL: %d\n", err);
|
dprintk("VIDIOC_QUERYCTRL: %d\n", err);
|
||||||
if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
|
if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
|
||||||
ctrl2.id = qctrl2.id;
|
ctrl2.id = qctrl2.id;
|
||||||
err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2);
|
err = drv(file, VIDIOC_G_CTRL, &ctrl2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOC_G_CTRL: %d\n", err);
|
dprintk("VIDIOC_G_CTRL: %d\n", err);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -85,8 +84,7 @@ get_v4l_control(struct inode *inode,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
set_v4l_control(struct inode *inode,
|
set_v4l_control(struct file *file,
|
||||||
struct file *file,
|
|
||||||
int cid,
|
int cid,
|
||||||
int value,
|
int value,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
|
@ -96,7 +94,7 @@ set_v4l_control(struct inode *inode,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
qctrl2.id = cid;
|
qctrl2.id = cid;
|
||||||
err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
|
err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOC_QUERYCTRL: %d\n", err);
|
dprintk("VIDIOC_QUERYCTRL: %d\n", err);
|
||||||
if (err == 0 &&
|
if (err == 0 &&
|
||||||
|
@ -114,7 +112,7 @@ set_v4l_control(struct inode *inode,
|
||||||
+ 32767)
|
+ 32767)
|
||||||
/ 65535;
|
/ 65535;
|
||||||
ctrl2.value += qctrl2.minimum;
|
ctrl2.value += qctrl2.minimum;
|
||||||
err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2);
|
err = drv(file, VIDIOC_S_CTRL, &ctrl2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOC_S_CTRL: %d\n", err);
|
dprintk("VIDIOC_S_CTRL: %d\n", err);
|
||||||
}
|
}
|
||||||
|
@ -222,7 +220,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int count_inputs(
|
static int count_inputs(
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -232,14 +229,13 @@ static int count_inputs(
|
||||||
for (i = 0;; i++) {
|
for (i = 0;; i++) {
|
||||||
memset(&input2, 0, sizeof(input2));
|
memset(&input2, 0, sizeof(input2));
|
||||||
input2.index = i;
|
input2.index = i;
|
||||||
if (0 != drv(inode, file, VIDIOC_ENUMINPUT, &input2))
|
if (0 != drv(file, VIDIOC_ENUMINPUT, &input2))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_size(
|
static int check_size(
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv,
|
v4l2_kioctl drv,
|
||||||
int *maxw,
|
int *maxw,
|
||||||
|
@ -252,14 +248,14 @@ static int check_size(
|
||||||
memset(&fmt2, 0, sizeof(fmt2));
|
memset(&fmt2, 0, sizeof(fmt2));
|
||||||
|
|
||||||
desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
if (0 != drv(inode, file, VIDIOC_ENUM_FMT, &desc2))
|
if (0 != drv(file, VIDIOC_ENUM_FMT, &desc2))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
fmt2.fmt.pix.width = 10000;
|
fmt2.fmt.pix.width = 10000;
|
||||||
fmt2.fmt.pix.height = 10000;
|
fmt2.fmt.pix.height = 10000;
|
||||||
fmt2.fmt.pix.pixelformat = desc2.pixelformat;
|
fmt2.fmt.pix.pixelformat = desc2.pixelformat;
|
||||||
if (0 != drv(inode, file, VIDIOC_TRY_FMT, &fmt2))
|
if (0 != drv(file, VIDIOC_TRY_FMT, &fmt2))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
*maxw = fmt2.fmt.pix.width;
|
*maxw = fmt2.fmt.pix.width;
|
||||||
|
@ -273,7 +269,6 @@ static int check_size(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_capabilities(
|
static noinline int v4l1_compat_get_capabilities(
|
||||||
struct video_capability *cap,
|
struct video_capability *cap,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -289,13 +284,13 @@ static noinline int v4l1_compat_get_capabilities(
|
||||||
memset(cap, 0, sizeof(*cap));
|
memset(cap, 0, sizeof(*cap));
|
||||||
memset(&fbuf, 0, sizeof(fbuf));
|
memset(&fbuf, 0, sizeof(fbuf));
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_QUERYCAP, cap2);
|
err = drv(file, VIDIOC_QUERYCAP, cap2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
|
dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
|
if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
|
||||||
err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
|
err = drv(file, VIDIOC_G_FBUF, &fbuf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
|
dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
|
||||||
memset(&fbuf, 0, sizeof(fbuf));
|
memset(&fbuf, 0, sizeof(fbuf));
|
||||||
|
@ -317,8 +312,8 @@ static noinline int v4l1_compat_get_capabilities(
|
||||||
if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
|
if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
|
||||||
cap->type |= VID_TYPE_CLIPPING;
|
cap->type |= VID_TYPE_CLIPPING;
|
||||||
|
|
||||||
cap->channels = count_inputs(inode, file, drv);
|
cap->channels = count_inputs(file, drv);
|
||||||
check_size(inode, file, drv,
|
check_size(file, drv,
|
||||||
&cap->maxwidth, &cap->maxheight);
|
&cap->maxwidth, &cap->maxheight);
|
||||||
cap->audios = 0; /* FIXME */
|
cap->audios = 0; /* FIXME */
|
||||||
cap->minwidth = 48; /* FIXME */
|
cap->minwidth = 48; /* FIXME */
|
||||||
|
@ -331,7 +326,6 @@ static noinline int v4l1_compat_get_capabilities(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_frame_buffer(
|
static noinline int v4l1_compat_get_frame_buffer(
|
||||||
struct video_buffer *buffer,
|
struct video_buffer *buffer,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -341,7 +335,7 @@ static noinline int v4l1_compat_get_frame_buffer(
|
||||||
memset(buffer, 0, sizeof(*buffer));
|
memset(buffer, 0, sizeof(*buffer));
|
||||||
memset(&fbuf, 0, sizeof(fbuf));
|
memset(&fbuf, 0, sizeof(fbuf));
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
|
err = drv(file, VIDIOC_G_FBUF, &fbuf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
|
dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -386,7 +380,6 @@ static noinline int v4l1_compat_get_frame_buffer(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_frame_buffer(
|
static noinline int v4l1_compat_set_frame_buffer(
|
||||||
struct video_buffer *buffer,
|
struct video_buffer *buffer,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -415,7 +408,7 @@ static noinline int v4l1_compat_set_frame_buffer(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fbuf.fmt.bytesperline = buffer->bytesperline;
|
fbuf.fmt.bytesperline = buffer->bytesperline;
|
||||||
err = drv(inode, file, VIDIOC_S_FBUF, &fbuf);
|
err = drv(file, VIDIOC_S_FBUF, &fbuf);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
|
dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
@ -423,7 +416,6 @@ static noinline int v4l1_compat_set_frame_buffer(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_win_cap_dimensions(
|
static noinline int v4l1_compat_get_win_cap_dimensions(
|
||||||
struct video_window *win,
|
struct video_window *win,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -438,7 +430,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
|
||||||
memset(win, 0, sizeof(*win));
|
memset(win, 0, sizeof(*win));
|
||||||
|
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
|
dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
|
@ -453,7 +445,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
|
dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -472,7 +464,6 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_win_cap_dimensions(
|
static noinline int v4l1_compat_set_win_cap_dimensions(
|
||||||
struct video_window *win,
|
struct video_window *win,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -485,8 +476,8 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
drv(inode, file, VIDIOC_STREAMOFF, &fmt->type);
|
drv(file, VIDIOC_STREAMOFF, &fmt->type);
|
||||||
err1 = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err1 = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
if (err1 < 0)
|
if (err1 < 0)
|
||||||
dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
|
dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
|
||||||
if (err1 == 0) {
|
if (err1 == 0) {
|
||||||
|
@ -494,7 +485,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
|
||||||
fmt->fmt.pix.height = win->height;
|
fmt->fmt.pix.height = win->height;
|
||||||
fmt->fmt.pix.field = V4L2_FIELD_ANY;
|
fmt->fmt.pix.field = V4L2_FIELD_ANY;
|
||||||
fmt->fmt.pix.bytesperline = 0;
|
fmt->fmt.pix.bytesperline = 0;
|
||||||
err = drv(inode, file, VIDIOC_S_FMT, fmt);
|
err = drv(file, VIDIOC_S_FMT, fmt);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
|
dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
|
||||||
err);
|
err);
|
||||||
|
@ -511,7 +502,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
|
||||||
fmt->fmt.win.chromakey = win->chromakey;
|
fmt->fmt.win.chromakey = win->chromakey;
|
||||||
fmt->fmt.win.clips = (void __user *)win->clips;
|
fmt->fmt.win.clips = (void __user *)win->clips;
|
||||||
fmt->fmt.win.clipcount = win->clipcount;
|
fmt->fmt.win.clipcount = win->clipcount;
|
||||||
err2 = drv(inode, file, VIDIOC_S_FMT, fmt);
|
err2 = drv(file, VIDIOC_S_FMT, fmt);
|
||||||
if (err2 < 0)
|
if (err2 < 0)
|
||||||
dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
|
dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
|
||||||
|
|
||||||
|
@ -525,7 +516,6 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
|
||||||
|
|
||||||
static noinline int v4l1_compat_turn_preview_on_off(
|
static noinline int v4l1_compat_turn_preview_on_off(
|
||||||
int *on,
|
int *on,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -536,9 +526,9 @@ static noinline int v4l1_compat_turn_preview_on_off(
|
||||||
/* dirty hack time. But v4l1 has no STREAMOFF
|
/* dirty hack time. But v4l1 has no STREAMOFF
|
||||||
* equivalent in the API, and this one at
|
* equivalent in the API, and this one at
|
||||||
* least comes close ... */
|
* least comes close ... */
|
||||||
drv(inode, file, VIDIOC_STREAMOFF, &captype);
|
drv(file, VIDIOC_STREAMOFF, &captype);
|
||||||
}
|
}
|
||||||
err = drv(inode, file, VIDIOC_OVERLAY, on);
|
err = drv(file, VIDIOC_OVERLAY, on);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
|
dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
@ -546,7 +536,6 @@ static noinline int v4l1_compat_turn_preview_on_off(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_input_info(
|
static noinline int v4l1_compat_get_input_info(
|
||||||
struct video_channel *chan,
|
struct video_channel *chan,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -556,7 +545,7 @@ static noinline int v4l1_compat_get_input_info(
|
||||||
|
|
||||||
memset(&input2, 0, sizeof(input2));
|
memset(&input2, 0, sizeof(input2));
|
||||||
input2.index = chan->channel;
|
input2.index = chan->channel;
|
||||||
err = drv(inode, file, VIDIOC_ENUMINPUT, &input2);
|
err = drv(file, VIDIOC_ENUMINPUT, &input2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
|
dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
|
||||||
"channel=%d err=%d\n", chan->channel, err);
|
"channel=%d err=%d\n", chan->channel, err);
|
||||||
|
@ -578,7 +567,7 @@ static noinline int v4l1_compat_get_input_info(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chan->norm = 0;
|
chan->norm = 0;
|
||||||
err = drv(inode, file, VIDIOC_G_STD, &sid);
|
err = drv(file, VIDIOC_G_STD, &sid);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
|
dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
|
@ -595,14 +584,13 @@ static noinline int v4l1_compat_get_input_info(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_input(
|
static noinline int v4l1_compat_set_input(
|
||||||
struct video_channel *chan,
|
struct video_channel *chan,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
v4l2_std_id sid = 0;
|
v4l2_std_id sid = 0;
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel);
|
err = drv(file, VIDIOC_S_INPUT, &chan->channel);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
|
dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
|
||||||
switch (chan->norm) {
|
switch (chan->norm) {
|
||||||
|
@ -617,7 +605,7 @@ static noinline int v4l1_compat_set_input(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (0 != sid) {
|
if (0 != sid) {
|
||||||
err = drv(inode, file, VIDIOC_S_STD, &sid);
|
err = drv(file, VIDIOC_S_STD, &sid);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
|
dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
|
||||||
}
|
}
|
||||||
|
@ -626,7 +614,6 @@ static noinline int v4l1_compat_set_input(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_picture(
|
static noinline int v4l1_compat_get_picture(
|
||||||
struct video_picture *pict,
|
struct video_picture *pict,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -639,19 +626,19 @@ static noinline int v4l1_compat_get_picture(
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
pict->brightness = get_v4l_control(inode, file,
|
pict->brightness = get_v4l_control(file,
|
||||||
V4L2_CID_BRIGHTNESS, drv);
|
V4L2_CID_BRIGHTNESS, drv);
|
||||||
pict->hue = get_v4l_control(inode, file,
|
pict->hue = get_v4l_control(file,
|
||||||
V4L2_CID_HUE, drv);
|
V4L2_CID_HUE, drv);
|
||||||
pict->contrast = get_v4l_control(inode, file,
|
pict->contrast = get_v4l_control(file,
|
||||||
V4L2_CID_CONTRAST, drv);
|
V4L2_CID_CONTRAST, drv);
|
||||||
pict->colour = get_v4l_control(inode, file,
|
pict->colour = get_v4l_control(file,
|
||||||
V4L2_CID_SATURATION, drv);
|
V4L2_CID_SATURATION, drv);
|
||||||
pict->whiteness = get_v4l_control(inode, file,
|
pict->whiteness = get_v4l_control(file,
|
||||||
V4L2_CID_WHITENESS, drv);
|
V4L2_CID_WHITENESS, drv);
|
||||||
|
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
|
dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -669,7 +656,6 @@ static noinline int v4l1_compat_get_picture(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_picture(
|
static noinline int v4l1_compat_set_picture(
|
||||||
struct video_picture *pict,
|
struct video_picture *pict,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -685,15 +671,15 @@ static noinline int v4l1_compat_set_picture(
|
||||||
}
|
}
|
||||||
memset(&fbuf, 0, sizeof(fbuf));
|
memset(&fbuf, 0, sizeof(fbuf));
|
||||||
|
|
||||||
set_v4l_control(inode, file,
|
set_v4l_control(file,
|
||||||
V4L2_CID_BRIGHTNESS, pict->brightness, drv);
|
V4L2_CID_BRIGHTNESS, pict->brightness, drv);
|
||||||
set_v4l_control(inode, file,
|
set_v4l_control(file,
|
||||||
V4L2_CID_HUE, pict->hue, drv);
|
V4L2_CID_HUE, pict->hue, drv);
|
||||||
set_v4l_control(inode, file,
|
set_v4l_control(file,
|
||||||
V4L2_CID_CONTRAST, pict->contrast, drv);
|
V4L2_CID_CONTRAST, pict->contrast, drv);
|
||||||
set_v4l_control(inode, file,
|
set_v4l_control(file,
|
||||||
V4L2_CID_SATURATION, pict->colour, drv);
|
V4L2_CID_SATURATION, pict->colour, drv);
|
||||||
set_v4l_control(inode, file,
|
set_v4l_control(file,
|
||||||
V4L2_CID_WHITENESS, pict->whiteness, drv);
|
V4L2_CID_WHITENESS, pict->whiteness, drv);
|
||||||
/*
|
/*
|
||||||
* V4L1 uses this ioctl to set both memory capture and overlay
|
* V4L1 uses this ioctl to set both memory capture and overlay
|
||||||
|
@ -703,7 +689,7 @@ static noinline int v4l1_compat_set_picture(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
/* If VIDIOC_G_FMT failed, then the driver likely doesn't
|
/* If VIDIOC_G_FMT failed, then the driver likely doesn't
|
||||||
support memory capture. Trying to set the memory capture
|
support memory capture. Trying to set the memory capture
|
||||||
parameters would be pointless. */
|
parameters would be pointless. */
|
||||||
|
@ -714,13 +700,13 @@ static noinline int v4l1_compat_set_picture(
|
||||||
palette_to_pixelformat(pict->palette)) {
|
palette_to_pixelformat(pict->palette)) {
|
||||||
fmt->fmt.pix.pixelformat = palette_to_pixelformat(
|
fmt->fmt.pix.pixelformat = palette_to_pixelformat(
|
||||||
pict->palette);
|
pict->palette);
|
||||||
mem_err = drv(inode, file, VIDIOC_S_FMT, fmt);
|
mem_err = drv(file, VIDIOC_S_FMT, fmt);
|
||||||
if (mem_err < 0)
|
if (mem_err < 0)
|
||||||
dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
|
dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
|
||||||
mem_err);
|
mem_err);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
|
err = drv(file, VIDIOC_G_FBUF, &fbuf);
|
||||||
/* If VIDIOC_G_FBUF failed, then the driver likely doesn't
|
/* If VIDIOC_G_FBUF failed, then the driver likely doesn't
|
||||||
support overlay. Trying to set the overlay parameters
|
support overlay. Trying to set the overlay parameters
|
||||||
would be quite pointless. */
|
would be quite pointless. */
|
||||||
|
@ -731,7 +717,7 @@ static noinline int v4l1_compat_set_picture(
|
||||||
palette_to_pixelformat(pict->palette)) {
|
palette_to_pixelformat(pict->palette)) {
|
||||||
fbuf.fmt.pixelformat = palette_to_pixelformat(
|
fbuf.fmt.pixelformat = palette_to_pixelformat(
|
||||||
pict->palette);
|
pict->palette);
|
||||||
ovl_err = drv(inode, file, VIDIOC_S_FBUF, &fbuf);
|
ovl_err = drv(file, VIDIOC_S_FBUF, &fbuf);
|
||||||
if (ovl_err < 0)
|
if (ovl_err < 0)
|
||||||
dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
|
dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
|
||||||
ovl_err);
|
ovl_err);
|
||||||
|
@ -752,7 +738,6 @@ static noinline int v4l1_compat_set_picture(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_tuner(
|
static noinline int v4l1_compat_get_tuner(
|
||||||
struct video_tuner *tun,
|
struct video_tuner *tun,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -762,7 +747,7 @@ static noinline int v4l1_compat_get_tuner(
|
||||||
v4l2_std_id sid;
|
v4l2_std_id sid;
|
||||||
|
|
||||||
memset(&tun2, 0, sizeof(tun2));
|
memset(&tun2, 0, sizeof(tun2));
|
||||||
err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
|
err = drv(file, VIDIOC_G_TUNER, &tun2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
|
dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -778,7 +763,7 @@ static noinline int v4l1_compat_get_tuner(
|
||||||
for (i = 0; i < 64; i++) {
|
for (i = 0; i < 64; i++) {
|
||||||
memset(&std2, 0, sizeof(std2));
|
memset(&std2, 0, sizeof(std2));
|
||||||
std2.index = i;
|
std2.index = i;
|
||||||
if (0 != drv(inode, file, VIDIOC_ENUMSTD, &std2))
|
if (0 != drv(file, VIDIOC_ENUMSTD, &std2))
|
||||||
break;
|
break;
|
||||||
if (std2.id & V4L2_STD_PAL)
|
if (std2.id & V4L2_STD_PAL)
|
||||||
tun->flags |= VIDEO_TUNER_PAL;
|
tun->flags |= VIDEO_TUNER_PAL;
|
||||||
|
@ -788,7 +773,7 @@ static noinline int v4l1_compat_get_tuner(
|
||||||
tun->flags |= VIDEO_TUNER_SECAM;
|
tun->flags |= VIDEO_TUNER_SECAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_STD, &sid);
|
err = drv(file, VIDIOC_G_STD, &sid);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
|
dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
|
@ -811,7 +796,6 @@ static noinline int v4l1_compat_get_tuner(
|
||||||
|
|
||||||
static noinline int v4l1_compat_select_tuner(
|
static noinline int v4l1_compat_select_tuner(
|
||||||
struct video_tuner *tun,
|
struct video_tuner *tun,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -821,7 +805,7 @@ static noinline int v4l1_compat_select_tuner(
|
||||||
|
|
||||||
t.index = tun->tuner;
|
t.index = tun->tuner;
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_S_INPUT, &t);
|
err = drv(file, VIDIOC_S_INPUT, &t);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
|
dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
@ -829,7 +813,6 @@ static noinline int v4l1_compat_select_tuner(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_frequency(
|
static noinline int v4l1_compat_get_frequency(
|
||||||
unsigned long *freq,
|
unsigned long *freq,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -838,7 +821,7 @@ static noinline int v4l1_compat_get_frequency(
|
||||||
memset(&freq2, 0, sizeof(freq2));
|
memset(&freq2, 0, sizeof(freq2));
|
||||||
|
|
||||||
freq2.tuner = 0;
|
freq2.tuner = 0;
|
||||||
err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
|
err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
|
dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
|
||||||
if (0 == err)
|
if (0 == err)
|
||||||
|
@ -848,7 +831,6 @@ static noinline int v4l1_compat_get_frequency(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_frequency(
|
static noinline int v4l1_compat_set_frequency(
|
||||||
unsigned long *freq,
|
unsigned long *freq,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -856,9 +838,9 @@ static noinline int v4l1_compat_set_frequency(
|
||||||
struct v4l2_frequency freq2;
|
struct v4l2_frequency freq2;
|
||||||
memset(&freq2, 0, sizeof(freq2));
|
memset(&freq2, 0, sizeof(freq2));
|
||||||
|
|
||||||
drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
|
drv(file, VIDIOC_G_FREQUENCY, &freq2);
|
||||||
freq2.frequency = *freq;
|
freq2.frequency = *freq;
|
||||||
err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2);
|
err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
|
dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
@ -866,7 +848,6 @@ static noinline int v4l1_compat_set_frequency(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_audio(
|
static noinline int v4l1_compat_get_audio(
|
||||||
struct video_audio *aud,
|
struct video_audio *aud,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -876,7 +857,7 @@ static noinline int v4l1_compat_get_audio(
|
||||||
struct v4l2_tuner tun2;
|
struct v4l2_tuner tun2;
|
||||||
memset(&aud2, 0, sizeof(aud2));
|
memset(&aud2, 0, sizeof(aud2));
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_AUDIO, &aud2);
|
err = drv(file, VIDIOC_G_AUDIO, &aud2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
|
dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -886,27 +867,27 @@ static noinline int v4l1_compat_get_audio(
|
||||||
aud->name[sizeof(aud->name) - 1] = 0;
|
aud->name[sizeof(aud->name) - 1] = 0;
|
||||||
aud->audio = aud2.index;
|
aud->audio = aud2.index;
|
||||||
aud->flags = 0;
|
aud->flags = 0;
|
||||||
i = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv);
|
i = get_v4l_control(file, V4L2_CID_AUDIO_VOLUME, drv);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
aud->volume = i;
|
aud->volume = i;
|
||||||
aud->flags |= VIDEO_AUDIO_VOLUME;
|
aud->flags |= VIDEO_AUDIO_VOLUME;
|
||||||
}
|
}
|
||||||
i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv);
|
i = get_v4l_control(file, V4L2_CID_AUDIO_BASS, drv);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
aud->bass = i;
|
aud->bass = i;
|
||||||
aud->flags |= VIDEO_AUDIO_BASS;
|
aud->flags |= VIDEO_AUDIO_BASS;
|
||||||
}
|
}
|
||||||
i = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv);
|
i = get_v4l_control(file, V4L2_CID_AUDIO_TREBLE, drv);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
aud->treble = i;
|
aud->treble = i;
|
||||||
aud->flags |= VIDEO_AUDIO_TREBLE;
|
aud->flags |= VIDEO_AUDIO_TREBLE;
|
||||||
}
|
}
|
||||||
i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv);
|
i = get_v4l_control(file, V4L2_CID_AUDIO_BALANCE, drv);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
aud->balance = i;
|
aud->balance = i;
|
||||||
aud->flags |= VIDEO_AUDIO_BALANCE;
|
aud->flags |= VIDEO_AUDIO_BALANCE;
|
||||||
}
|
}
|
||||||
i = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv);
|
i = get_v4l_control(file, V4L2_CID_AUDIO_MUTE, drv);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
if (i)
|
if (i)
|
||||||
aud->flags |= VIDEO_AUDIO_MUTE;
|
aud->flags |= VIDEO_AUDIO_MUTE;
|
||||||
|
@ -914,13 +895,13 @@ static noinline int v4l1_compat_get_audio(
|
||||||
}
|
}
|
||||||
aud->step = 1;
|
aud->step = 1;
|
||||||
qctrl2.id = V4L2_CID_AUDIO_VOLUME;
|
qctrl2.id = V4L2_CID_AUDIO_VOLUME;
|
||||||
if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
|
if (drv(file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
|
||||||
!(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
|
!(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
|
||||||
aud->step = qctrl2.step;
|
aud->step = qctrl2.step;
|
||||||
aud->mode = 0;
|
aud->mode = 0;
|
||||||
|
|
||||||
memset(&tun2, 0, sizeof(tun2));
|
memset(&tun2, 0, sizeof(tun2));
|
||||||
err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
|
err = drv(file, VIDIOC_G_TUNER, &tun2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
|
dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
|
||||||
err = 0;
|
err = 0;
|
||||||
|
@ -939,7 +920,6 @@ static noinline int v4l1_compat_get_audio(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_audio(
|
static noinline int v4l1_compat_set_audio(
|
||||||
struct video_audio *aud,
|
struct video_audio *aud,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -951,24 +931,24 @@ static noinline int v4l1_compat_set_audio(
|
||||||
memset(&tun2, 0, sizeof(tun2));
|
memset(&tun2, 0, sizeof(tun2));
|
||||||
|
|
||||||
aud2.index = aud->audio;
|
aud2.index = aud->audio;
|
||||||
err = drv(inode, file, VIDIOC_S_AUDIO, &aud2);
|
err = drv(file, VIDIOC_S_AUDIO, &aud2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
|
dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME,
|
set_v4l_control(file, V4L2_CID_AUDIO_VOLUME,
|
||||||
aud->volume, drv);
|
aud->volume, drv);
|
||||||
set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS,
|
set_v4l_control(file, V4L2_CID_AUDIO_BASS,
|
||||||
aud->bass, drv);
|
aud->bass, drv);
|
||||||
set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE,
|
set_v4l_control(file, V4L2_CID_AUDIO_TREBLE,
|
||||||
aud->treble, drv);
|
aud->treble, drv);
|
||||||
set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE,
|
set_v4l_control(file, V4L2_CID_AUDIO_BALANCE,
|
||||||
aud->balance, drv);
|
aud->balance, drv);
|
||||||
set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE,
|
set_v4l_control(file, V4L2_CID_AUDIO_MUTE,
|
||||||
!!(aud->flags & VIDEO_AUDIO_MUTE), drv);
|
!!(aud->flags & VIDEO_AUDIO_MUTE), drv);
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
|
err = drv(file, VIDIOC_G_TUNER, &tun2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
|
dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
|
@ -985,7 +965,7 @@ static noinline int v4l1_compat_set_audio(
|
||||||
tun2.audmode = V4L2_TUNER_MODE_LANG2;
|
tun2.audmode = V4L2_TUNER_MODE_LANG2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
err = drv(inode, file, VIDIOC_S_TUNER, &tun2);
|
err = drv(file, VIDIOC_S_TUNER, &tun2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
|
dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
|
||||||
}
|
}
|
||||||
|
@ -996,7 +976,6 @@ static noinline int v4l1_compat_set_audio(
|
||||||
|
|
||||||
static noinline int v4l1_compat_capture_frame(
|
static noinline int v4l1_compat_capture_frame(
|
||||||
struct video_mmap *mm,
|
struct video_mmap *mm,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -1013,7 +992,7 @@ static noinline int v4l1_compat_capture_frame(
|
||||||
memset(&buf, 0, sizeof(buf));
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt);
|
err = drv(file, VIDIOC_G_FMT, fmt);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
|
dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1029,7 +1008,7 @@ static noinline int v4l1_compat_capture_frame(
|
||||||
palette_to_pixelformat(mm->format);
|
palette_to_pixelformat(mm->format);
|
||||||
fmt->fmt.pix.field = V4L2_FIELD_ANY;
|
fmt->fmt.pix.field = V4L2_FIELD_ANY;
|
||||||
fmt->fmt.pix.bytesperline = 0;
|
fmt->fmt.pix.bytesperline = 0;
|
||||||
err = drv(inode, file, VIDIOC_S_FMT, fmt);
|
err = drv(file, VIDIOC_S_FMT, fmt);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
|
dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1037,17 +1016,17 @@ static noinline int v4l1_compat_capture_frame(
|
||||||
}
|
}
|
||||||
buf.index = mm->frame;
|
buf.index = mm->frame;
|
||||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
|
err = drv(file, VIDIOC_QUERYBUF, &buf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
|
dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
err = drv(inode, file, VIDIOC_QBUF, &buf);
|
err = drv(file, VIDIOC_QBUF, &buf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
|
dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
err = drv(inode, file, VIDIOC_STREAMON, &captype);
|
err = drv(file, VIDIOC_STREAMON, &captype);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
|
dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
|
||||||
done:
|
done:
|
||||||
|
@ -1057,7 +1036,6 @@ static noinline int v4l1_compat_capture_frame(
|
||||||
|
|
||||||
static noinline int v4l1_compat_sync(
|
static noinline int v4l1_compat_sync(
|
||||||
int *i,
|
int *i,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -1069,7 +1047,7 @@ static noinline int v4l1_compat_sync(
|
||||||
memset(&buf, 0, sizeof(buf));
|
memset(&buf, 0, sizeof(buf));
|
||||||
buf.index = *i;
|
buf.index = *i;
|
||||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
|
err = drv(file, VIDIOC_QUERYBUF, &buf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
/* No such buffer */
|
/* No such buffer */
|
||||||
dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
|
dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
|
||||||
|
@ -1082,7 +1060,7 @@ static noinline int v4l1_compat_sync(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure capture actually runs so we don't block forever */
|
/* make sure capture actually runs so we don't block forever */
|
||||||
err = drv(inode, file, VIDIOC_STREAMON, &captype);
|
err = drv(file, VIDIOC_STREAMON, &captype);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
|
dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1096,7 +1074,7 @@ static noinline int v4l1_compat_sync(
|
||||||
if (err < 0 || /* error or sleep was interrupted */
|
if (err < 0 || /* error or sleep was interrupted */
|
||||||
err == 0) /* timeout? Shouldn't occur. */
|
err == 0) /* timeout? Shouldn't occur. */
|
||||||
break;
|
break;
|
||||||
err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
|
err = drv(file, VIDIOC_QUERYBUF, &buf);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
|
dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
|
||||||
}
|
}
|
||||||
|
@ -1104,7 +1082,7 @@ static noinline int v4l1_compat_sync(
|
||||||
if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
|
if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
|
||||||
goto done;
|
goto done;
|
||||||
do {
|
do {
|
||||||
err = drv(inode, file, VIDIOC_DQBUF, &buf);
|
err = drv(file, VIDIOC_DQBUF, &buf);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
|
dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
|
||||||
} while (err == 0 && buf.index != *i);
|
} while (err == 0 && buf.index != *i);
|
||||||
|
@ -1114,7 +1092,6 @@ static noinline int v4l1_compat_sync(
|
||||||
|
|
||||||
static noinline int v4l1_compat_get_vbi_format(
|
static noinline int v4l1_compat_get_vbi_format(
|
||||||
struct vbi_format *fmt,
|
struct vbi_format *fmt,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -1128,7 +1105,7 @@ static noinline int v4l1_compat_get_vbi_format(
|
||||||
}
|
}
|
||||||
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
|
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
|
||||||
|
|
||||||
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
|
err = drv(file, VIDIOC_G_FMT, fmt2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
|
dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1153,7 +1130,6 @@ static noinline int v4l1_compat_get_vbi_format(
|
||||||
|
|
||||||
static noinline int v4l1_compat_set_vbi_format(
|
static noinline int v4l1_compat_set_vbi_format(
|
||||||
struct vbi_format *fmt,
|
struct vbi_format *fmt,
|
||||||
struct inode *inode,
|
|
||||||
struct file *file,
|
struct file *file,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
{
|
{
|
||||||
|
@ -1179,7 +1155,7 @@ static noinline int v4l1_compat_set_vbi_format(
|
||||||
fmt2->fmt.vbi.start[1] = fmt->start[1];
|
fmt2->fmt.vbi.start[1] = fmt->start[1];
|
||||||
fmt2->fmt.vbi.count[1] = fmt->count[1];
|
fmt2->fmt.vbi.count[1] = fmt->count[1];
|
||||||
fmt2->fmt.vbi.flags = fmt->flags;
|
fmt2->fmt.vbi.flags = fmt->flags;
|
||||||
err = drv(inode, file, VIDIOC_TRY_FMT, fmt2);
|
err = drv(file, VIDIOC_TRY_FMT, fmt2);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
|
dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1196,7 +1172,7 @@ static noinline int v4l1_compat_set_vbi_format(
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
err = drv(inode, file, VIDIOC_S_FMT, fmt2);
|
err = drv(file, VIDIOC_S_FMT, fmt2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
|
dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
|
||||||
done:
|
done:
|
||||||
|
@ -1208,8 +1184,7 @@ static noinline int v4l1_compat_set_vbi_format(
|
||||||
* This function is exported.
|
* This function is exported.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
v4l_compat_translate_ioctl(struct inode *inode,
|
v4l_compat_translate_ioctl(struct file *file,
|
||||||
struct file *file,
|
|
||||||
int cmd,
|
int cmd,
|
||||||
void *arg,
|
void *arg,
|
||||||
v4l2_kioctl drv)
|
v4l2_kioctl drv)
|
||||||
|
@ -1218,64 +1193,64 @@ v4l_compat_translate_ioctl(struct inode *inode,
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case VIDIOCGCAP: /* capability */
|
case VIDIOCGCAP: /* capability */
|
||||||
err = v4l1_compat_get_capabilities(arg, inode, file, drv);
|
err = v4l1_compat_get_capabilities(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGFBUF: /* get frame buffer */
|
case VIDIOCGFBUF: /* get frame buffer */
|
||||||
err = v4l1_compat_get_frame_buffer(arg, inode, file, drv);
|
err = v4l1_compat_get_frame_buffer(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSFBUF: /* set frame buffer */
|
case VIDIOCSFBUF: /* set frame buffer */
|
||||||
err = v4l1_compat_set_frame_buffer(arg, inode, file, drv);
|
err = v4l1_compat_set_frame_buffer(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGWIN: /* get window or capture dimensions */
|
case VIDIOCGWIN: /* get window or capture dimensions */
|
||||||
err = v4l1_compat_get_win_cap_dimensions(arg, inode, file, drv);
|
err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSWIN: /* set window and/or capture dimensions */
|
case VIDIOCSWIN: /* set window and/or capture dimensions */
|
||||||
err = v4l1_compat_set_win_cap_dimensions(arg, inode, file, drv);
|
err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCCAPTURE: /* turn on/off preview */
|
case VIDIOCCAPTURE: /* turn on/off preview */
|
||||||
err = v4l1_compat_turn_preview_on_off(arg, inode, file, drv);
|
err = v4l1_compat_turn_preview_on_off(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGCHAN: /* get input information */
|
case VIDIOCGCHAN: /* get input information */
|
||||||
err = v4l1_compat_get_input_info(arg, inode, file, drv);
|
err = v4l1_compat_get_input_info(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSCHAN: /* set input */
|
case VIDIOCSCHAN: /* set input */
|
||||||
err = v4l1_compat_set_input(arg, inode, file, drv);
|
err = v4l1_compat_set_input(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGPICT: /* get tone controls & partial capture format */
|
case VIDIOCGPICT: /* get tone controls & partial capture format */
|
||||||
err = v4l1_compat_get_picture(arg, inode, file, drv);
|
err = v4l1_compat_get_picture(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSPICT: /* set tone controls & partial capture format */
|
case VIDIOCSPICT: /* set tone controls & partial capture format */
|
||||||
err = v4l1_compat_set_picture(arg, inode, file, drv);
|
err = v4l1_compat_set_picture(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGTUNER: /* get tuner information */
|
case VIDIOCGTUNER: /* get tuner information */
|
||||||
err = v4l1_compat_get_tuner(arg, inode, file, drv);
|
err = v4l1_compat_get_tuner(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSTUNER: /* select a tuner input */
|
case VIDIOCSTUNER: /* select a tuner input */
|
||||||
err = v4l1_compat_select_tuner(arg, inode, file, drv);
|
err = v4l1_compat_select_tuner(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGFREQ: /* get frequency */
|
case VIDIOCGFREQ: /* get frequency */
|
||||||
err = v4l1_compat_get_frequency(arg, inode, file, drv);
|
err = v4l1_compat_get_frequency(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSFREQ: /* set frequency */
|
case VIDIOCSFREQ: /* set frequency */
|
||||||
err = v4l1_compat_set_frequency(arg, inode, file, drv);
|
err = v4l1_compat_set_frequency(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGAUDIO: /* get audio properties/controls */
|
case VIDIOCGAUDIO: /* get audio properties/controls */
|
||||||
err = v4l1_compat_get_audio(arg, inode, file, drv);
|
err = v4l1_compat_get_audio(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSAUDIO: /* set audio controls */
|
case VIDIOCSAUDIO: /* set audio controls */
|
||||||
err = v4l1_compat_set_audio(arg, inode, file, drv);
|
err = v4l1_compat_set_audio(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCMCAPTURE: /* capture a frame */
|
case VIDIOCMCAPTURE: /* capture a frame */
|
||||||
err = v4l1_compat_capture_frame(arg, inode, file, drv);
|
err = v4l1_compat_capture_frame(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSYNC: /* wait for a frame */
|
case VIDIOCSYNC: /* wait for a frame */
|
||||||
err = v4l1_compat_sync(arg, inode, file, drv);
|
err = v4l1_compat_sync(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCGVBIFMT: /* query VBI data capture format */
|
case VIDIOCGVBIFMT: /* query VBI data capture format */
|
||||||
err = v4l1_compat_get_vbi_format(arg, inode, file, drv);
|
err = v4l1_compat_get_vbi_format(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
case VIDIOCSVBIFMT:
|
case VIDIOCSVBIFMT:
|
||||||
err = v4l1_compat_set_vbi_format(arg, inode, file, drv);
|
err = v4l1_compat_set_vbi_format(arg, file, drv);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = -ENOIOCTLCMD;
|
err = -ENOIOCTLCMD;
|
||||||
|
|
|
@ -625,7 +625,7 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __video_do_ioctl(struct inode *inode, struct file *file,
|
static int __video_do_ioctl(struct file *file,
|
||||||
unsigned int cmd, void *arg)
|
unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct video_device *vfd = video_devdata(file);
|
struct video_device *vfd = video_devdata(file);
|
||||||
|
@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
|
||||||
V4L2 ioctls.
|
V4L2 ioctls.
|
||||||
********************************************************/
|
********************************************************/
|
||||||
if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
|
if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
|
||||||
return v4l_compat_translate_ioctl(inode, file, cmd, arg,
|
return v4l_compat_translate_ioctl(file, cmd, arg,
|
||||||
__video_do_ioctl);
|
__video_do_ioctl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1832,7 +1832,7 @@ int video_ioctl2(struct inode *inode, struct file *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handles IOCTL */
|
/* Handles IOCTL */
|
||||||
err = __video_do_ioctl(inode, file, cmd, parg);
|
err = __video_do_ioctl(file, cmd, parg);
|
||||||
if (err == -ENOIOCTLCMD)
|
if (err == -ENOIOCTLCMD)
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if (is_ext_ctrl) {
|
if (is_ext_ctrl) {
|
||||||
|
|
|
@ -271,13 +271,13 @@ extern const char *v4l2_field_names[];
|
||||||
extern const char *v4l2_type_names[];
|
extern const char *v4l2_type_names[];
|
||||||
|
|
||||||
/* Compatibility layer interface -- v4l1-compat module */
|
/* Compatibility layer interface -- v4l1-compat module */
|
||||||
typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
|
typedef int (*v4l2_kioctl)(struct file *file,
|
||||||
unsigned int cmd, void *arg);
|
unsigned int cmd, void *arg);
|
||||||
#ifdef CONFIG_VIDEO_V4L1_COMPAT
|
#ifdef CONFIG_VIDEO_V4L1_COMPAT
|
||||||
int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
|
int v4l_compat_translate_ioctl(struct file *file,
|
||||||
int cmd, void *arg, v4l2_kioctl driver_ioctl);
|
int cmd, void *arg, v4l2_kioctl driver_ioctl);
|
||||||
#else
|
#else
|
||||||
#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL)
|
#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 32 Bits compatibility layer for 64 bits processors */
|
/* 32 Bits compatibility layer for 64 bits processors */
|
||||||
|
|
Loading…
Reference in a new issue