diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-01-23 20:38:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:55 -0500 |
commit | 52ebc763d8e0c9f2ab48af89a75e90e2318bac86 (patch) | |
tree | 5699ff9425fb1da30a18b00661fcea659ace6a72 /include/linux/videodev2.h | |
parent | dbbff48f39263f7e5c96a55624da87879de2bf71 (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.h | 14 |
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 | |||
1271 | }; | 1271 | }; |
1272 | 1272 | ||
1273 | /* | 1273 | /* |
1274 | * A D V A N C E D D E B U G G I N G | ||
1275 | */ | ||
1276 | |||
1277 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | ||
1278 | struct v4l2_register { | ||
1279 | __u32 i2c_id; /* I2C driver ID of the I2C chip, or 0 for the host */ | ||
1280 | __u32 reg; | ||
1281 | __u32 val; | ||
1282 | }; | ||
1283 | |||
1284 | /* | ||
1274 | * 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 | 1285 | * 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 |
1275 | * | 1286 | * |
1276 | */ | 1287 | */ |
@@ -1339,6 +1350,9 @@ struct v4l2_streamparm | |||
1339 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1350 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) |
1340 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1351 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) |
1341 | #endif | 1352 | #endif |
1353 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1354 | #define VIDIOC_DBG_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
1355 | #define VIDIOC_DBG_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
1342 | 1356 | ||
1343 | #ifdef __OLD_VIDIOC_ | 1357 | #ifdef __OLD_VIDIOC_ |
1344 | /* for compatibility, will go away some day */ | 1358 | /* for compatibility, will go away some day */ |