From 10bfe06f9f65dab9bce59c49f6170b8bd0563086 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 26 Mar 2013 09:25:17 +0100 Subject: [PATCH] v4l-utils: sync to the latest kernel. Signed-off-by: Hans Verkuil --- contrib/freebsd/include/linux/videodev2.h | 34 +++++++++++++++++++++++-------- contrib/test/ioctl-test.h | 2 ++ contrib/test/ioctl_32.h | 1 + contrib/test/ioctl_64.h | 1 + include/linux/videodev2.h | 34 +++++++++++++++++++++++-------- 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/contrib/freebsd/include/linux/videodev2.h b/contrib/freebsd/include/linux/videodev2.h index 220ea0c..b88ba17 100644 --- a/contrib/freebsd/include/linux/videodev2.h +++ b/contrib/freebsd/include/linux/videodev2.h @@ -1841,10 +1841,13 @@ struct v4l2_event_subscription { /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ -#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ -#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ -#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ -#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ +#define V4L2_CHIP_MATCH_BRIDGE 0 /* Match against chip ID on the bridge (0 for the bridge) */ +#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE +#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ +#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ +#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ +#define V4L2_CHIP_MATCH_SUBDEV_NAME 4 /* Match against subdev name */ +#define V4L2_CHIP_MATCH_SUBDEV_IDX 5 /* Match against subdev index */ struct v4l2_dbg_match { uint32_t type; /* Match type */ @@ -1868,6 +1871,17 @@ struct v4l2_dbg_chip_ident { uint32_t revision; /* chip revision, chip specific */ } __attribute__ ((packed)); +#define V4L2_CHIP_FL_READABLE (1 << 0) +#define V4L2_CHIP_FL_WRITABLE (1 << 1) + +/* VIDIOC_DBG_G_CHIP_NAME */ +struct v4l2_dbg_chip_name { + struct v4l2_dbg_match match; + char name[32]; + uint32_t flags; + uint32_t reserved[8]; +} __attribute__ ((packed)); + /** * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument * @index: on return, index of the first created buffer @@ -1945,15 +1959,12 @@ struct v4l2_create_buffers { #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) -#if 1 #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) -#endif -#if 1 /* Experimental, meant for debugging, testing and internal use. Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. You must be root to use these ioctls. Never use these in applications! */ @@ -1961,9 +1972,10 @@ struct v4l2_create_buffers { #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) /* Experimental, meant for debugging, testing and internal use. - Never use this ioctl in applications! */ + Never use this ioctl in applications! + Note: this ioctl is deprecated in favor of VIDIOC_DBG_G_CHIP_NAME and + will go away in the future. */ #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) -#endif #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) @@ -1997,6 +2009,10 @@ struct v4l2_create_buffers { versions. */ #define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band) +/* Experimental, meant for debugging, testing and internal use. + Never use these in applications! */ +#define VIDIOC_DBG_G_CHIP_NAME _IOWR('V', 102, struct v4l2_dbg_chip_name) + /* Reminder: when adding new ioctls please add support for them to drivers/media/video/v4l2-compat-ioctl32.c as well! */ diff --git a/contrib/test/ioctl-test.h b/contrib/test/ioctl-test.h index 67333d7..9f01b4d 100644 --- a/contrib/test/ioctl-test.h +++ b/contrib/test/ioctl-test.h @@ -31,6 +31,7 @@ union v4l_parms { struct v4l2_crop p_v4l2_crop; struct v4l2_cropcap p_v4l2_cropcap; struct v4l2_dbg_chip_ident p_v4l2_dbg_chip_ident; + struct v4l2_dbg_chip_name p_v4l2_dbg_chip_name; struct v4l2_dbg_register p_v4l2_dbg_register; struct v4l2_decoder_cmd p_v4l2_decoder_cmd; struct v4l2_dv_timings p_v4l2_dv_timings; @@ -108,6 +109,7 @@ static const struct { ioc(video, VIDIOC_CREATE_BUFS), /* struct v4l2_create_buffers */ ioc(video, VIDIOC_CROPCAP), /* struct v4l2_cropcap */ ioc(video, VIDIOC_DBG_G_CHIP_IDENT), /* struct v4l2_dbg_chip_ident */ + ioc(video, VIDIOC_DBG_G_CHIP_NAME), /* struct v4l2_dbg_chip_name */ ioc(video, VIDIOC_DBG_G_REGISTER), /* struct v4l2_dbg_register */ ioc(video, VIDIOC_DBG_S_REGISTER), /* struct v4l2_dbg_register */ ioc(video, VIDIOC_DECODER_CMD), /* struct v4l2_decoder_cmd */ diff --git a/contrib/test/ioctl_32.h b/contrib/test/ioctl_32.h index ce83b69..7debedd 100644 --- a/contrib/test/ioctl_32.h +++ b/contrib/test/ioctl_32.h @@ -34,6 +34,7 @@ #define CMD32_VIDIOC_CREATE_BUFS 0xc0f8565c #define CMD32_VIDIOC_CROPCAP 0xc02c563a #define CMD32_VIDIOC_DBG_G_CHIP_IDENT 0xc02c5651 +#define CMD32_VIDIOC_DBG_G_CHIP_NAME 0xc0685666 #define CMD32_VIDIOC_DBG_G_REGISTER 0xc0385650 #define CMD32_VIDIOC_DBG_S_REGISTER 0x4038564f #define CMD32_VIDIOC_DECODER_CMD 0xc0485660 diff --git a/contrib/test/ioctl_64.h b/contrib/test/ioctl_64.h index 171b1af..65bbd60 100644 --- a/contrib/test/ioctl_64.h +++ b/contrib/test/ioctl_64.h @@ -34,6 +34,7 @@ #define CMD64_VIDIOC_CREATE_BUFS 0xc100565c #define CMD64_VIDIOC_CROPCAP 0xc02c563a #define CMD64_VIDIOC_DBG_G_CHIP_IDENT 0xc02c5651 +#define CMD64_VIDIOC_DBG_G_CHIP_NAME 0xc0685666 #define CMD64_VIDIOC_DBG_G_REGISTER 0xc0385650 #define CMD64_VIDIOC_DBG_S_REGISTER 0x4038564f #define CMD64_VIDIOC_DECODER_CMD 0xc0485660 diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 9d57dba..e9c49c5 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1807,10 +1807,13 @@ struct v4l2_event_subscription { /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ -#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ -#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ -#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ -#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ +#define V4L2_CHIP_MATCH_BRIDGE 0 /* Match against chip ID on the bridge (0 for the bridge) */ +#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE +#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ +#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ +#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ +#define V4L2_CHIP_MATCH_SUBDEV_NAME 4 /* Match against subdev name */ +#define V4L2_CHIP_MATCH_SUBDEV_IDX 5 /* Match against subdev index */ struct v4l2_dbg_match { __u32 type; /* Match type */ @@ -1834,6 +1837,17 @@ struct v4l2_dbg_chip_ident { __u32 revision; /* chip revision, chip specific */ } __attribute__ ((packed)); +#define V4L2_CHIP_FL_READABLE (1 << 0) +#define V4L2_CHIP_FL_WRITABLE (1 << 1) + +/* VIDIOC_DBG_G_CHIP_NAME */ +struct v4l2_dbg_chip_name { + struct v4l2_dbg_match match; + char name[32]; + __u32 flags; + __u32 reserved[8]; +} __attribute__ ((packed)); + /** * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument * @index: on return, index of the first created buffer @@ -1911,15 +1925,12 @@ struct v4l2_create_buffers { #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) -#if 1 #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) -#endif -#if 1 /* Experimental, meant for debugging, testing and internal use. Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. You must be root to use these ioctls. Never use these in applications! */ @@ -1927,9 +1938,10 @@ struct v4l2_create_buffers { #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) /* Experimental, meant for debugging, testing and internal use. - Never use this ioctl in applications! */ + Never use this ioctl in applications! + Note: this ioctl is deprecated in favor of VIDIOC_DBG_G_CHIP_NAME and + will go away in the future. */ #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) -#endif #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) @@ -1963,6 +1975,10 @@ struct v4l2_create_buffers { versions. */ #define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band) +/* Experimental, meant for debugging, testing and internal use. + Never use these in applications! */ +#define VIDIOC_DBG_G_CHIP_NAME _IOWR('V', 102, struct v4l2_dbg_chip_name) + /* Reminder: when adding new ioctls please add support for them to drivers/media/video/v4l2-compat-ioctl32.c as well! */ -- 2.7.4