History

[media] v4l2: add new VIDIOC_DBG_G_CHIP_NAME ioctl

Simplify the debugging ioctls by creating the VIDIOC_DBG_G_CHIP_NAME ioctl. This will eventually replace VIDIOC_DBG_G_CHIP_IDENT. Chip matching is done by the name or index of subdevices or an index to a bridge chip. Most of this can all be done automatically, so most drivers just need to provide get/set register ops. In particular, it is now possible to get/set subdev registers without requiring assistance of the bridge driver.

Hans Verkuil committed 13 years ago

Commit 79b0c641 parent 820eac05 files · +146 −16Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/videodev2.h+25−9
@@ -1807,10 +1807,13 @@ struct v4l2_event_subscription { · 1806 unmodified lines
18071807
18081808 /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
18091809
1810−#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
1811−#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1812−#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1813−#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
1810+#define V4L2_CHIP_MATCH_BRIDGE 0 /* Match against chip ID on the bridge (0 for the bridge) */
1811+#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE
1812+#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1813+#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1814+#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
1815+#define V4L2_CHIP_MATCH_SUBDEV_NAME 4 /* Match against subdev name */
1816+#define V4L2_CHIP_MATCH_SUBDEV_IDX 5 /* Match against subdev index */
18141817
18151818 struct v4l2_dbg_match {
18161819 __u32 type; /* Match type */
@@ -1834,6 +1837,17 @@ struct v4l2_dbg_chip_ident { · 17 unmodified lines
18341837 __u32 revision; /* chip revision, chip specific */
18351838 } __attribute__ ((packed));
18361839
1840+#define V4L2_CHIP_FL_READABLE (1 << 0)
1841+#define V4L2_CHIP_FL_WRITABLE (1 << 1)
1842+
1843+/* VIDIOC_DBG_G_CHIP_NAME */
1844+struct v4l2_dbg_chip_name {
1845+ struct v4l2_dbg_match match;
1846+ char name[32];
1847+ __u32 flags;
1848+ __u32 reserved[8];
1849+} __attribute__ ((packed));
1850+
18371851 /**
18381852 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
18391853 * @index: on return, index of the first created buffer
@@ -1911,15 +1925,12 @@ struct v4l2_create_buffers { · 71 unmodified lines
19111925 #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
19121926 #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
19131927 #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
1914−#if 1
19151928 #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
19161929 #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
19171930 #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
19181931 #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
19191932 #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
1920−#endif
19211933
1922−#if 1
19231934 /* Experimental, meant for debugging, testing and internal use.
19241935 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
19251936 You must be root to use these ioctls. Never use these in applications! */
@@ -1927,9 +1938,10 @@ struct v4l2_create_buffers { · 1 unmodified line
19271938 #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
19281939
19291940 /* Experimental, meant for debugging, testing and internal use.
1930− Never use this ioctl in applications! */
1941+ Never use this ioctl in applications!
1942+ Note: this ioctl is deprecated in favor of VIDIOC_DBG_G_CHIP_NAME and
1943+ will go away in the future. */
19311944 #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
1932−#endif
19331945
19341946 #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
19351947
@@ -1963,6 +1975,10 @@ struct v4l2_create_buffers { · 27 unmodified lines
19631975 versions. */
19641976 #define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
19651977
1978+/* Experimental, meant for debugging, testing and internal use.
1979+ Never use these in applications! */
1980+#define VIDIOC_DBG_G_CHIP_NAME _IOWR('V', 102, struct v4l2_dbg_chip_name)
1981+
19661982 /* Reminder: when adding new ioctls please add support for them to
19671983 drivers/media/video/v4l2-compat-ioctl32.c as well! */
19681984

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t