aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/v4l2-mediabus.h
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2014-11-10 12:28:35 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-14 14:56:18 -0500
commitaa1b4da6af67d5c6a4e933c2d30890c6f282f505 (patch)
tree2b925dd9f63ab6361747cbf648f44b60f7a2030c /include/uapi/linux/v4l2-mediabus.h
parent3e47608f2db93153bdaf3d78a604dcf8f8197059 (diff)
[media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel users don't have access to these definitions. We have to keep this definition for user-space users even though they're encouraged to move to the new media_bus_format enum. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/uapi/linux/v4l2-mediabus.h')
-rw-r--r--include/uapi/linux/v4l2-mediabus.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 26180844c6b8..b1934a3961e4 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -15,6 +15,33 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/videodev2.h> 16#include <linux/videodev2.h>
17 17
18/**
19 * struct v4l2_mbus_framefmt - frame format on the media bus
20 * @width: frame width
21 * @height: frame height
22 * @code: data format code (from enum v4l2_mbus_pixelcode)
23 * @field: used interlacing type (from enum v4l2_field)
24 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
25 */
26struct v4l2_mbus_framefmt {
27 __u32 width;
28 __u32 height;
29 __u32 code;
30 __u32 field;
31 __u32 colorspace;
32 __u32 reserved[7];
33};
34
35#ifndef __KERNEL__
36/*
37 * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and
38 * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be
39 * used instead.
40 *
41 * New defines should only be added to media-bus-format.h. The
42 * v4l2_mbus_pixelcode enum is frozen.
43 */
44
18#define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ 45#define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \
19 V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name 46 V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name
20 47
@@ -102,22 +129,6 @@ enum v4l2_mbus_pixelcode {
102 129
103 V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32), 130 V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32),
104}; 131};
105 132#endif /* __KERNEL__ */
106/**
107 * struct v4l2_mbus_framefmt - frame format on the media bus
108 * @width: frame width
109 * @height: frame height
110 * @code: data format code (from enum v4l2_mbus_pixelcode)
111 * @field: used interlacing type (from enum v4l2_field)
112 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
113 */
114struct v4l2_mbus_framefmt {
115 __u32 width;
116 __u32 height;
117 __u32 code;
118 __u32 field;
119 __u32 colorspace;
120 __u32 reserved[7];
121};
122 133
123#endif 134#endif