diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-03-15 18:33:31 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:53:21 -0400 |
| commit | 2ef2d5a336891ee38fee7c7ad2396e31ac9d8aaa (patch) | |
| tree | 433db5b5d9a74a387b5d8ad12ae7f971e7f1a926 /include | |
| parent | 61f5db549dde43fb91a8b337f3a4096e4076c2d9 (diff) | |
[media] v4l: Move the media/v4l2-mediabus.h header to include/linux
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/v4l2-mediabus.h | 78 | ||||
| -rw-r--r-- | include/media/soc_mediabus.h | 3 | ||||
| -rw-r--r-- | include/media/v4l2-mediabus.h | 61 |
4 files changed, 81 insertions, 62 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 31eb174a226..c33f22a6a40 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -371,6 +371,7 @@ header-y += unistd.h | |||
| 371 | header-y += usbdevice_fs.h | 371 | header-y += usbdevice_fs.h |
| 372 | header-y += utime.h | 372 | header-y += utime.h |
| 373 | header-y += utsname.h | 373 | header-y += utsname.h |
| 374 | header-y += v4l2-mediabus.h | ||
| 374 | header-y += veth.h | 375 | header-y += veth.h |
| 375 | header-y += vhost.h | 376 | header-y += vhost.h |
| 376 | header-y += videodev2.h | 377 | header-y += videodev2.h |
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h new file mode 100644 index 00000000000..a62cd64e846 --- /dev/null +++ b/include/linux/v4l2-mediabus.h | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | /* | ||
| 2 | * Media Bus API header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_V4L2_MEDIABUS_H | ||
| 12 | #define __LINUX_V4L2_MEDIABUS_H | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/videodev2.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * These pixel codes uniquely identify data formats on the media bus. Mostly | ||
| 19 | * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is | ||
| 20 | * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the | ||
| 21 | * data format is fixed. Additionally, "2X8" means that one pixel is transferred | ||
| 22 | * in two 8-bit samples, "BE" or "LE" specify in which order those samples are | ||
| 23 | * transferred over the bus: "LE" means that the least significant bits are | ||
| 24 | * transferred first, "BE" means that the most significant bits are transferred | ||
| 25 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the | ||
| 26 | * incomplete high byte, are filled with padding bits. | ||
| 27 | */ | ||
| 28 | enum v4l2_mbus_pixelcode { | ||
| 29 | V4L2_MBUS_FMT_FIXED = 1, | ||
| 30 | V4L2_MBUS_FMT_YUYV8_2X8, | ||
| 31 | V4L2_MBUS_FMT_YVYU8_2X8, | ||
| 32 | V4L2_MBUS_FMT_UYVY8_2X8, | ||
| 33 | V4L2_MBUS_FMT_VYUY8_2X8, | ||
| 34 | V4L2_MBUS_FMT_YVYU10_2X10, | ||
| 35 | V4L2_MBUS_FMT_YUYV10_2X10, | ||
| 36 | V4L2_MBUS_FMT_YVYU10_1X20, | ||
| 37 | V4L2_MBUS_FMT_YUYV10_1X20, | ||
| 38 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, | ||
| 39 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, | ||
| 40 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | ||
| 41 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | ||
| 42 | V4L2_MBUS_FMT_RGB565_2X8_LE, | ||
| 43 | V4L2_MBUS_FMT_RGB565_2X8_BE, | ||
| 44 | V4L2_MBUS_FMT_BGR565_2X8_LE, | ||
| 45 | V4L2_MBUS_FMT_BGR565_2X8_BE, | ||
| 46 | V4L2_MBUS_FMT_SBGGR8_1X8, | ||
| 47 | V4L2_MBUS_FMT_SBGGR10_1X10, | ||
| 48 | V4L2_MBUS_FMT_GREY8_1X8, | ||
| 49 | V4L2_MBUS_FMT_Y10_1X10, | ||
| 50 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, | ||
| 51 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, | ||
| 52 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | ||
| 53 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | ||
| 54 | V4L2_MBUS_FMT_SGRBG8_1X8, | ||
| 55 | V4L2_MBUS_FMT_SBGGR12_1X12, | ||
| 56 | V4L2_MBUS_FMT_YUYV8_1_5X8, | ||
| 57 | V4L2_MBUS_FMT_YVYU8_1_5X8, | ||
| 58 | V4L2_MBUS_FMT_UYVY8_1_5X8, | ||
| 59 | V4L2_MBUS_FMT_VYUY8_1_5X8, | ||
| 60 | }; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * struct v4l2_mbus_framefmt - frame format on the media bus | ||
| 64 | * @width: frame width | ||
| 65 | * @height: frame height | ||
| 66 | * @code: data format code | ||
| 67 | * @field: used interlacing type | ||
| 68 | * @colorspace: colorspace of the data | ||
| 69 | */ | ||
| 70 | struct v4l2_mbus_framefmt { | ||
| 71 | __u32 width; | ||
| 72 | __u32 height; | ||
| 73 | __u32 code; | ||
| 74 | enum v4l2_field field; | ||
| 75 | enum v4l2_colorspace colorspace; | ||
| 76 | }; | ||
| 77 | |||
| 78 | #endif | ||
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index f5522b3f175..b338108ec30 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h | |||
| @@ -12,8 +12,7 @@ | |||
| 12 | #define SOC_MEDIABUS_H | 12 | #define SOC_MEDIABUS_H |
| 13 | 13 | ||
| 14 | #include <linux/videodev2.h> | 14 | #include <linux/videodev2.h> |
| 15 | 15 | #include <linux/v4l2-mediabus.h> | |
| 16 | #include <media/v4l2-mediabus.h> | ||
| 17 | 16 | ||
| 18 | /** | 17 | /** |
| 19 | * enum soc_mbus_packing - data packing types on the media-bus | 18 | * enum soc_mbus_packing - data packing types on the media-bus |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 8e6559838ae..971c7fa2961 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h | |||
| @@ -11,66 +11,7 @@ | |||
| 11 | #ifndef V4L2_MEDIABUS_H | 11 | #ifndef V4L2_MEDIABUS_H |
| 12 | #define V4L2_MEDIABUS_H | 12 | #define V4L2_MEDIABUS_H |
| 13 | 13 | ||
| 14 | /* | 14 | #include <linux/v4l2-mediabus.h> |
| 15 | * These pixel codes uniquely identify data formats on the media bus. Mostly | ||
| 16 | * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is | ||
| 17 | * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the | ||
| 18 | * data format is fixed. Additionally, "2X8" means that one pixel is transferred | ||
| 19 | * in two 8-bit samples, "BE" or "LE" specify in which order those samples are | ||
| 20 | * transferred over the bus: "LE" means that the least significant bits are | ||
| 21 | * transferred first, "BE" means that the most significant bits are transferred | ||
| 22 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the | ||
| 23 | * incomplete high byte, are filled with padding bits. | ||
| 24 | */ | ||
| 25 | enum v4l2_mbus_pixelcode { | ||
| 26 | V4L2_MBUS_FMT_FIXED = 1, | ||
| 27 | V4L2_MBUS_FMT_YUYV8_2X8, | ||
| 28 | V4L2_MBUS_FMT_YVYU8_2X8, | ||
| 29 | V4L2_MBUS_FMT_UYVY8_2X8, | ||
| 30 | V4L2_MBUS_FMT_VYUY8_2X8, | ||
| 31 | V4L2_MBUS_FMT_YVYU10_2X10, | ||
| 32 | V4L2_MBUS_FMT_YUYV10_2X10, | ||
| 33 | V4L2_MBUS_FMT_YVYU10_1X20, | ||
| 34 | V4L2_MBUS_FMT_YUYV10_1X20, | ||
| 35 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, | ||
| 36 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, | ||
| 37 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | ||
| 38 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | ||
| 39 | V4L2_MBUS_FMT_RGB565_2X8_LE, | ||
| 40 | V4L2_MBUS_FMT_RGB565_2X8_BE, | ||
| 41 | V4L2_MBUS_FMT_BGR565_2X8_LE, | ||
| 42 | V4L2_MBUS_FMT_BGR565_2X8_BE, | ||
| 43 | V4L2_MBUS_FMT_SBGGR8_1X8, | ||
| 44 | V4L2_MBUS_FMT_SBGGR10_1X10, | ||
| 45 | V4L2_MBUS_FMT_GREY8_1X8, | ||
| 46 | V4L2_MBUS_FMT_Y10_1X10, | ||
| 47 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, | ||
| 48 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, | ||
| 49 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | ||
| 50 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | ||
| 51 | V4L2_MBUS_FMT_SGRBG8_1X8, | ||
| 52 | V4L2_MBUS_FMT_SBGGR12_1X12, | ||
| 53 | V4L2_MBUS_FMT_YUYV8_1_5X8, | ||
| 54 | V4L2_MBUS_FMT_YVYU8_1_5X8, | ||
| 55 | V4L2_MBUS_FMT_UYVY8_1_5X8, | ||
| 56 | V4L2_MBUS_FMT_VYUY8_1_5X8, | ||
| 57 | }; | ||
| 58 | |||
| 59 | /** | ||
| 60 | * struct v4l2_mbus_framefmt - frame format on the media bus | ||
| 61 | * @width: frame width | ||
| 62 | * @height: frame height | ||
| 63 | * @code: data format code | ||
| 64 | * @field: used interlacing type | ||
| 65 | * @colorspace: colorspace of the data | ||
| 66 | */ | ||
| 67 | struct v4l2_mbus_framefmt { | ||
| 68 | __u32 width; | ||
| 69 | __u32 height; | ||
| 70 | enum v4l2_mbus_pixelcode code; | ||
| 71 | enum v4l2_field field; | ||
| 72 | enum v4l2_colorspace colorspace; | ||
| 73 | }; | ||
| 74 | 15 | ||
| 75 | static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, | 16 | static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, |
| 76 | const struct v4l2_mbus_framefmt *mbus_fmt) | 17 | const struct v4l2_mbus_framefmt *mbus_fmt) |
