diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-01-23 17:38:13 -0800 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-01-23 17:38:13 -0800 |
commit | 0f5b64e7c37c66e5cd7693eb7f9fc011e62eee33 (patch) | |
tree | 6db14113f73046b6a617f8fb6a5a951dc8eb0775 /linux/include | |
parent | 95e9306ca0dbf322edde55eee84e9884b097613d (diff) | |
download | mediapointer-dvb-s2-0f5b64e7c37c66e5cd7693eb7f9fc011e62eee33.tar.gz mediapointer-dvb-s2-0f5b64e7c37c66e5cd7693eb7f9fc011e62eee33.tar.bz2 |
Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal only
From: Trent Piepho <xyzzy@speakeasy.org>
The direct register access ioctls were defined as kernel internal only,
but they are very useful for debugging hardware from userspace and are
used as such. Officially export them.
VIDIOC_INT_[SG]_REGISTER is renamed to VIDIOC_DBG_[SG]_REGISTER
Definition of ioctl and struct v4l2_register is moved from v4l2-common.h
to videodev2.h.
Types used in struct v4l2_register are changed to the userspace
exportable versions (u32 -> __u32, etc).
Use of VIDIOC_DBG_S_REGISTER requires CAP_SYS_ADMIN permission, so move
the check into the video_ioctl2() dispatcher so it doesn't need to be
duplicated in each driver's call-back function.
CAP_SYS_ADMIN check is added to pvrusb2 (which doesn't use video_ioctl2).
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/linux/videodev2.h | 14 | ||||
-rw-r--r-- | linux/include/media/v4l2-common.h | 11 | ||||
-rw-r--r-- | linux/include/media/v4l2-dev.h | 3 |
3 files changed, 15 insertions, 13 deletions
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index f02067f7f..29a1c889e 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -1337,6 +1337,17 @@ struct v4l2_streamparm }; /* + * A D V A N C E D D E B U G G I N G + */ + +/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ +struct v4l2_register { + __u32 i2c_id; /* I2C driver ID of the I2C chip, or 0 for the host */ + __u32 reg; + __u32 val; +}; + +/* * I O C T L C O D E S F O R V I D E O D E V I C E S * */ @@ -1405,6 +1416,9 @@ struct v4l2_streamparm #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) #endif +/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ +#define VIDIOC_DBG_S_REGISTER _IOW ('d', 100, struct v4l2_register) +#define VIDIOC_DBG_G_REGISTER _IOWR('d', 101, struct v4l2_register) #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h index 6e7500f1d..4d5c3ef64 100644 --- a/linux/include/media/v4l2-common.h +++ b/linux/include/media/v4l2-common.h @@ -105,13 +105,6 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); /* Internal ioctls */ -/* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ -struct v4l2_register { - u32 i2c_id; /* I2C driver ID of the I2C chip. 0 for the I2C adapter. */ - unsigned long reg; - u32 val; -}; - /* VIDIOC_INT_DECODE_VBI_LINE */ struct v4l2_decode_vbi_line { u32 is_second_field; /* Set to 0 for the first (odd) field, @@ -181,9 +174,7 @@ enum v4l2_chip_ident { Replacement of TUNER_SET_STANDBY. */ #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) -/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ -#define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register) -#define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) +/* 100, 101 used by VIDIOC_DBG_[SG]_REGISTER */ /* Generic reset command. The argument selects which subsystems to reset. Passing 0 will always reset the whole chip. */ diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index f42ac241b..1734898b4 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -81,9 +81,6 @@ int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg); -/* Forward definition of v4l2-common.h defined structure */ -struct v4l2_register; - /* * Newer version of video_device, handled by videodev2.c * This version moves redundant code from video device code to |