Laurent Pinchart | 2ef2d5a | 2010-03-15 19:33:31 -0300 | [diff] [blame] | 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 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 14 | #include <linux/media-bus-format.h> |
Laurent Pinchart | 2ef2d5a | 2010-03-15 19:33:31 -0300 | [diff] [blame] | 15 | #include <linux/types.h> |
| 16 | #include <linux/videodev2.h> |
| 17 | |
Boris BREZILLON | aa1b4da | 2014-11-10 14:28:35 -0300 | [diff] [blame] | 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) |
Hans Verkuil | 11ff030 | 2014-11-17 09:10:33 -0300 | [diff] [blame] | 25 | * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding) |
| 26 | * @quantization: quantization of the data (from enum v4l2_quantization) |
Hans Verkuil | 74fdcb2 | 2015-04-28 08:49:09 -0300 | [diff] [blame] | 27 | * @xfer_func: transfer function of the data (from enum v4l2_xfer_func) |
Boris BREZILLON | aa1b4da | 2014-11-10 14:28:35 -0300 | [diff] [blame] | 28 | */ |
| 29 | struct v4l2_mbus_framefmt { |
| 30 | __u32 width; |
| 31 | __u32 height; |
| 32 | __u32 code; |
| 33 | __u32 field; |
| 34 | __u32 colorspace; |
Hans Verkuil | f2d27e4 | 2014-12-05 10:02:47 -0300 | [diff] [blame] | 35 | __u16 ycbcr_enc; |
| 36 | __u16 quantization; |
Hans Verkuil | 74fdcb2 | 2015-04-28 08:49:09 -0300 | [diff] [blame] | 37 | __u16 xfer_func; |
| 38 | __u16 reserved[11]; |
Boris BREZILLON | aa1b4da | 2014-11-10 14:28:35 -0300 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | #ifndef __KERNEL__ |
| 42 | /* |
| 43 | * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and |
| 44 | * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be |
| 45 | * used instead. |
| 46 | * |
| 47 | * New defines should only be added to media-bus-format.h. The |
| 48 | * v4l2_mbus_pixelcode enum is frozen. |
| 49 | */ |
| 50 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 51 | #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ |
| 52 | V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name |
| 53 | |
Laurent Pinchart | 2ef2d5a | 2010-03-15 19:33:31 -0300 | [diff] [blame] | 54 | enum v4l2_mbus_pixelcode { |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 55 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(FIXED), |
Laurent Pinchart | dacdde7 | 2010-09-01 12:58:22 -0300 | [diff] [blame] | 56 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 57 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_BE), |
| 58 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_LE), |
| 59 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_BE), |
| 60 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_LE), |
| 61 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_BE), |
| 62 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_LE), |
| 63 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_BE), |
| 64 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_LE), |
| 65 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB666_1X18), |
| 66 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_1X24), |
| 67 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_BE), |
| 68 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_LE), |
| 69 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(ARGB8888_1X32), |
Laurent Pinchart | dacdde7 | 2010-09-01 12:58:22 -0300 | [diff] [blame] | 70 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 71 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y8_1X8), |
| 72 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UV8_1X8), |
| 73 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1_5X8), |
| 74 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1_5X8), |
| 75 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1_5X8), |
| 76 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1_5X8), |
| 77 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_2X8), |
| 78 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_2X8), |
| 79 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_2X8), |
| 80 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_2X8), |
| 81 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y10_1X10), |
| 82 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_2X10), |
| 83 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_2X10), |
| 84 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_2X10), |
| 85 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_2X10), |
| 86 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y12_1X12), |
| 87 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1X16), |
| 88 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1X16), |
| 89 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1X16), |
| 90 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1X16), |
| 91 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YDYUYDYV8_1X16), |
| 92 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_1X20), |
| 93 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_1X20), |
| 94 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_1X20), |
| 95 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_1X20), |
| 96 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUV10_1X30), |
| 97 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(AYUV8_1X32), |
| 98 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_2X12), |
| 99 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_2X12), |
| 100 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_2X12), |
| 101 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_2X12), |
| 102 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_1X24), |
| 103 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_1X24), |
| 104 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_1X24), |
| 105 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_1X24), |
Laurent Pinchart | dacdde7 | 2010-09-01 12:58:22 -0300 | [diff] [blame] | 106 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 107 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR8_1X8), |
| 108 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG8_1X8), |
| 109 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG8_1X8), |
| 110 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB8_1X8), |
| 111 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_ALAW8_1X8), |
| 112 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_ALAW8_1X8), |
| 113 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_ALAW8_1X8), |
| 114 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_ALAW8_1X8), |
| 115 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_DPCM8_1X8), |
| 116 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_DPCM8_1X8), |
| 117 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_DPCM8_1X8), |
| 118 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_DPCM8_1X8), |
| 119 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_BE), |
| 120 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_LE), |
| 121 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_BE), |
| 122 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_LE), |
| 123 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_1X10), |
| 124 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_1X10), |
| 125 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_1X10), |
| 126 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_1X10), |
| 127 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR12_1X12), |
| 128 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG12_1X12), |
| 129 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG12_1X12), |
| 130 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB12_1X12), |
Sylwester Nawrocki | 1684652 | 2011-03-25 12:09:43 -0300 | [diff] [blame] | 131 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 132 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(JPEG_1X8), |
Sylwester Nawrocki | d264248 | 2012-02-16 14:23:54 -0300 | [diff] [blame] | 133 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 134 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(S5C_UYVY_JPEG_1X8), |
Sylwester Nawrocki | d264248 | 2012-02-16 14:23:54 -0300 | [diff] [blame] | 135 | |
Boris BREZILLON | edcf58b | 2014-11-10 14:28:26 -0300 | [diff] [blame] | 136 | V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32), |
Laurent Pinchart | 2ef2d5a | 2010-03-15 19:33:31 -0300 | [diff] [blame] | 137 | }; |
Boris BREZILLON | aa1b4da | 2014-11-10 14:28:35 -0300 | [diff] [blame] | 138 | #endif /* __KERNEL__ */ |
Laurent Pinchart | 2ef2d5a | 2010-03-15 19:33:31 -0300 | [diff] [blame] | 139 | |
| 140 | #endif |