History

[media] v4l2: allow v4l2_subdev_edid to be used with video nodes

Struct v4l2_subdev_edid and the VIDIOC_SUBDEV_G/S_EDID ioctls were specific for subdevices, but for hardware with a simple video pipeline you do not need/want to create subdevice nodes to just get/set the EDID. Move the v4l2_subdev_edid struct to v4l2-common.h and rename as v4l2_edid. Add the same ioctls to videodev2.h as well, thus allowing this API to be used with both video nodes and v4l-subdev nodes.

Hans Verkuil committed 12 years ago

Commit 254a4771 parent bc826d63 files · +15 −9Browse files

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

Unified · Split

3 files
  1. include/uapi/linux/v4l2-common.h +8 −0
  2. include/uapi/linux/v4l2-subdev.h +5 −9
  3. include/uapi/linux/videodev2.h +2 −0
include/uapi/linux/v4l2-common.h+8−0
@@ -68,4 +68,12 @@ · 67 unmodified lines
6868 #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
6969 #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
7070
71+struct v4l2_edid {
72+ __u32 pad;
73+ __u32 start_block;
74+ __u32 blocks;
75+ __u32 reserved[5];
76+ __u8 __user *edid;
77+};
78+
7179 #endif /* __V4L2_COMMON__ */
include/uapi/linux/v4l2-subdev.h+5−9
@@ -148,13 +148,8 @@ struct v4l2_subdev_selection { · 147 unmodified lines
148148 __u32 reserved[8];
149149 };
150150
151−struct v4l2_subdev_edid {
152− __u32 pad;
153− __u32 start_block;
154− __u32 blocks;
155− __u32 reserved[5];
156− __u8 __user *edid;
157−};
151+/* Backwards compatibility define --- to be removed */
152+#define v4l2_subdev_edid v4l2_edid
158153
159154 #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
160155 #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
@@ -174,7 +169,8 @@ struct v4l2_subdev_edid { · 13 unmodified lines
174169 _IOWR('V', 61, struct v4l2_subdev_selection)
175170 #define VIDIOC_SUBDEV_S_SELECTION \
176171 _IOWR('V', 62, struct v4l2_subdev_selection)
177−#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_subdev_edid)
178−#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_subdev_edid)
172+/* These two G/S_EDID ioctls are identical to the ioctls in videodev2.h */
173+#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid)
174+#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid)
179175
180176 #endif
include/uapi/linux/videodev2.h+2−0
@@ -1913,6 +1913,8 @@ struct v4l2_create_buffers { · 1912 unmodified lines
19131913 #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
19141914 #define VIDIOC_G_INPUT _IOR('V', 38, int)
19151915 #define VIDIOC_S_INPUT _IOWR('V', 39, int)
1916+#define VIDIOC_G_EDID _IOWR('V', 40, struct v4l2_edid)
1917+#define VIDIOC_S_EDID _IOWR('V', 41, struct v4l2_edid)
19161918 #define VIDIOC_G_OUTPUT _IOR('V', 46, int)
19171919 #define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
19181920 #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)