summaryrefslogtreecommitdiff
path: root/include/linux/videodev2.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-01-23 22:38:13 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 13:34:55 -0200
commit52ebc763d8e0c9f2ab48af89a75e90e2318bac86 (patch)
tree5699ff9425fb1da30a18b00661fcea659ace6a72 /include/linux/videodev2.h
parentdbbff48f39263f7e5c96a55624da87879de2bf71 (diff)
V4L/DVB (5146): Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal only
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r--include/linux/videodev2.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 112b28c1f63a..fe6ccdfa9d48 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1271,6 +1271,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
*
*/
@@ -1339,6 +1350,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 */