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.
Showing the changes to include/uapi/linux (1 of 5 files). Show all
Unified · Split
| @@ -1807,10 +1807,13 @@ struct v4l2_event_subscription { · 1806 unmodified lines | ||
| 1807 | 1807 | |
| 1808 | 1808 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ |
| 1809 | 1809 | |
| 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 */ | |
| 1814 | 1817 | |
| 1815 | 1818 | struct v4l2_dbg_match { |
| 1816 | 1819 | __u32 type; /* Match type */ |
| @@ -1834,6 +1837,17 @@ struct v4l2_dbg_chip_ident { · 17 unmodified lines | ||
| 1834 | 1837 | __u32 revision; /* chip revision, chip specific */ |
| 1835 | 1838 | } __attribute__ ((packed)); |
| 1836 | 1839 | |
| 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 | + | |
| 1837 | 1851 | /** |
| 1838 | 1852 | * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument |
| 1839 | 1853 | * @index: on return, index of the first created buffer |
| @@ -1911,15 +1925,12 @@ struct v4l2_create_buffers { · 71 unmodified lines | ||
| 1911 | 1925 | #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) |
| 1912 | 1926 | #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) |
| 1913 | 1927 | #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) |
| 1914 | −#if 1 | |
| 1915 | 1928 | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) |
| 1916 | 1929 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) |
| 1917 | 1930 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) |
| 1918 | 1931 | #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) |
| 1919 | 1932 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) |
| 1920 | −#endif | |
| 1921 | 1933 | |
| 1922 | −#if 1 | |
| 1923 | 1934 | /* Experimental, meant for debugging, testing and internal use. |
| 1924 | 1935 | Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. |
| 1925 | 1936 | You must be root to use these ioctls. Never use these in applications! */ |
| @@ -1927,9 +1938,10 @@ struct v4l2_create_buffers { · 1 unmodified line | ||
| 1927 | 1938 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) |
| 1928 | 1939 | |
| 1929 | 1940 | /* 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. */ | |
| 1931 | 1944 | #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) |
| 1932 | −#endif | |
| 1933 | 1945 | |
| 1934 | 1946 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
| 1935 | 1947 | |
| @@ -1963,6 +1975,10 @@ struct v4l2_create_buffers { · 27 unmodified lines | ||
| 1963 | 1975 | versions. */ |
| 1964 | 1976 | #define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band) |
| 1965 | 1977 | |
| 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 | + | |
| 1966 | 1982 | /* Reminder: when adding new ioctls please add support for them to |
| 1967 | 1983 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
| 1968 | 1984 | |