]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] v4l: Move the media/v4l2-mediabus.h header to include/linux
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 15 Mar 2010 22:33:31 +0000 (19:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 07:53:21 +0000 (04:53 -0300)
The header defines the v4l2_mbus_framefmt structure which will be used
by the V4L2 subdevs userspace API.

Change the type of the v4l2_mbus_framefmt::code field to __u32, as enum
sizes can differ between different ABIs on the same architectures.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
include/linux/Kbuild
include/linux/v4l2-mediabus.h [new file with mode: 0644]
include/media/soc_mediabus.h
include/media/v4l2-mediabus.h

index 31eb174a22677e811f52405d07c795fe74611e57..c33f22a6a4045f09189c349c52432336eed3037e 100644 (file)
@@ -371,6 +371,7 @@ header-y += unistd.h
 header-y += usbdevice_fs.h
 header-y += utime.h
 header-y += utsname.h
+header-y += v4l2-mediabus.h
 header-y += veth.h
 header-y += vhost.h
 header-y += videodev2.h
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h
new file mode 100644 (file)
index 0000000..a62cd64
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Media Bus API header
+ *
+ * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_V4L2_MEDIABUS_H
+#define __LINUX_V4L2_MEDIABUS_H
+
+#include <linux/types.h>
+#include <linux/videodev2.h>
+
+/*
+ * These pixel codes uniquely identify data formats on the media bus. Mostly
+ * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
+ * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
+ * data format is fixed. Additionally, "2X8" means that one pixel is transferred
+ * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
+ * transferred over the bus: "LE" means that the least significant bits are
+ * transferred first, "BE" means that the most significant bits are transferred
+ * first, and "PADHI" and "PADLO" define which bits - low or high, in the
+ * incomplete high byte, are filled with padding bits.
+ */
+enum v4l2_mbus_pixelcode {
+       V4L2_MBUS_FMT_FIXED = 1,
+       V4L2_MBUS_FMT_YUYV8_2X8,
+       V4L2_MBUS_FMT_YVYU8_2X8,
+       V4L2_MBUS_FMT_UYVY8_2X8,
+       V4L2_MBUS_FMT_VYUY8_2X8,
+       V4L2_MBUS_FMT_YVYU10_2X10,
+       V4L2_MBUS_FMT_YUYV10_2X10,
+       V4L2_MBUS_FMT_YVYU10_1X20,
+       V4L2_MBUS_FMT_YUYV10_1X20,
+       V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
+       V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
+       V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
+       V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
+       V4L2_MBUS_FMT_RGB565_2X8_LE,
+       V4L2_MBUS_FMT_RGB565_2X8_BE,
+       V4L2_MBUS_FMT_BGR565_2X8_LE,
+       V4L2_MBUS_FMT_BGR565_2X8_BE,
+       V4L2_MBUS_FMT_SBGGR8_1X8,
+       V4L2_MBUS_FMT_SBGGR10_1X10,
+       V4L2_MBUS_FMT_GREY8_1X8,
+       V4L2_MBUS_FMT_Y10_1X10,
+       V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
+       V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
+       V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
+       V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
+       V4L2_MBUS_FMT_SGRBG8_1X8,
+       V4L2_MBUS_FMT_SBGGR12_1X12,
+       V4L2_MBUS_FMT_YUYV8_1_5X8,
+       V4L2_MBUS_FMT_YVYU8_1_5X8,
+       V4L2_MBUS_FMT_UYVY8_1_5X8,
+       V4L2_MBUS_FMT_VYUY8_1_5X8,
+};
+
+/**
+ * struct v4l2_mbus_framefmt - frame format on the media bus
+ * @width:     frame width
+ * @height:    frame height
+ * @code:      data format code
+ * @field:     used interlacing type
+ * @colorspace:        colorspace of the data
+ */
+struct v4l2_mbus_framefmt {
+       __u32                           width;
+       __u32                           height;
+       __u32                           code;
+       enum v4l2_field                 field;
+       enum v4l2_colorspace            colorspace;
+};
+
+#endif
index f5522b3f175a821c754c7d4c336e50fa682ecd03..b338108ec305cd1864baefe3a4f36a8d23156249 100644 (file)
@@ -12,8 +12,7 @@
 #define SOC_MEDIABUS_H
 
 #include <linux/videodev2.h>
-
-#include <media/v4l2-mediabus.h>
+#include <linux/v4l2-mediabus.h>
 
 /**
  * enum soc_mbus_packing - data packing types on the media-bus
index 8e6559838ae32f844ec9f33626787d9b86b19316..971c7fa29614092cc35fd4cf736ece5c54df5d3e 100644 (file)
 #ifndef V4L2_MEDIABUS_H
 #define V4L2_MEDIABUS_H
 
-/*
- * These pixel codes uniquely identify data formats on the media bus. Mostly
- * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
- * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
- * data format is fixed. Additionally, "2X8" means that one pixel is transferred
- * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
- * transferred over the bus: "LE" means that the least significant bits are
- * transferred first, "BE" means that the most significant bits are transferred
- * first, and "PADHI" and "PADLO" define which bits - low or high, in the
- * incomplete high byte, are filled with padding bits.
- */
-enum v4l2_mbus_pixelcode {
-       V4L2_MBUS_FMT_FIXED = 1,
-       V4L2_MBUS_FMT_YUYV8_2X8,
-       V4L2_MBUS_FMT_YVYU8_2X8,
-       V4L2_MBUS_FMT_UYVY8_2X8,
-       V4L2_MBUS_FMT_VYUY8_2X8,
-       V4L2_MBUS_FMT_YVYU10_2X10,
-       V4L2_MBUS_FMT_YUYV10_2X10,
-       V4L2_MBUS_FMT_YVYU10_1X20,
-       V4L2_MBUS_FMT_YUYV10_1X20,
-       V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
-       V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
-       V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
-       V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
-       V4L2_MBUS_FMT_RGB565_2X8_LE,
-       V4L2_MBUS_FMT_RGB565_2X8_BE,
-       V4L2_MBUS_FMT_BGR565_2X8_LE,
-       V4L2_MBUS_FMT_BGR565_2X8_BE,
-       V4L2_MBUS_FMT_SBGGR8_1X8,
-       V4L2_MBUS_FMT_SBGGR10_1X10,
-       V4L2_MBUS_FMT_GREY8_1X8,
-       V4L2_MBUS_FMT_Y10_1X10,
-       V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
-       V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
-       V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
-       V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
-       V4L2_MBUS_FMT_SGRBG8_1X8,
-       V4L2_MBUS_FMT_SBGGR12_1X12,
-       V4L2_MBUS_FMT_YUYV8_1_5X8,
-       V4L2_MBUS_FMT_YVYU8_1_5X8,
-       V4L2_MBUS_FMT_UYVY8_1_5X8,
-       V4L2_MBUS_FMT_VYUY8_1_5X8,
-};
-
-/**
- * struct v4l2_mbus_framefmt - frame format on the media bus
- * @width:     frame width
- * @height:    frame height
- * @code:      data format code
- * @field:     used interlacing type
- * @colorspace:        colorspace of the data
- */
-struct v4l2_mbus_framefmt {
-       __u32                           width;
-       __u32                           height;
-       enum v4l2_mbus_pixelcode        code;
-       enum v4l2_field                 field;
-       enum v4l2_colorspace            colorspace;
-};
+#include <linux/v4l2-mediabus.h>
 
 static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
                                const struct v4l2_mbus_framefmt *mbus_fmt)