1edcf58bcSBoris BREZILLON /*
2edcf58bcSBoris BREZILLON  * Media Bus API header
3edcf58bcSBoris BREZILLON  *
4edcf58bcSBoris BREZILLON  * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5edcf58bcSBoris BREZILLON  *
6edcf58bcSBoris BREZILLON  * This program is free software; you can redistribute it and/or modify
7edcf58bcSBoris BREZILLON  * it under the terms of the GNU General Public License version 2 as
8edcf58bcSBoris BREZILLON  * published by the Free Software Foundation.
9edcf58bcSBoris BREZILLON  */
10edcf58bcSBoris BREZILLON 
11edcf58bcSBoris BREZILLON #ifndef __LINUX_MEDIA_BUS_FORMAT_H
12edcf58bcSBoris BREZILLON #define __LINUX_MEDIA_BUS_FORMAT_H
13edcf58bcSBoris BREZILLON 
14edcf58bcSBoris BREZILLON /*
15edcf58bcSBoris BREZILLON  * These bus formats uniquely identify data formats on the data bus. Format 0
16edcf58bcSBoris BREZILLON  * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
17edcf58bcSBoris BREZILLON  * the data format is fixed. Additionally, "2X8" means that one pixel is
18edcf58bcSBoris BREZILLON  * transferred in two 8-bit samples, "BE" or "LE" specify in which order those
19edcf58bcSBoris BREZILLON  * samples are transferred over the bus: "LE" means that the least significant
20edcf58bcSBoris BREZILLON  * bits are transferred first, "BE" means that the most significant bits are
21edcf58bcSBoris BREZILLON  * transferred first, and "PADHI" and "PADLO" define which bits - low or high,
22edcf58bcSBoris BREZILLON  * in the incomplete high byte, are filled with padding bits.
23edcf58bcSBoris BREZILLON  *
24edcf58bcSBoris BREZILLON  * The bus formats are grouped by type, bus_width, bits per component, samples
25edcf58bcSBoris BREZILLON  * per pixel and order of subsamples. Numerical values are sorted using generic
26edcf58bcSBoris BREZILLON  * numerical sort order (8 thus comes before 10).
27edcf58bcSBoris BREZILLON  *
28edcf58bcSBoris BREZILLON  * As their value can't change when a new bus format is inserted in the
29edcf58bcSBoris BREZILLON  * enumeration, the bus formats are explicitly given a numerical value. The next
30edcf58bcSBoris BREZILLON  * free values for each category are listed below, update them when inserting
31edcf58bcSBoris BREZILLON  * new pixel codes.
32edcf58bcSBoris BREZILLON  */
33edcf58bcSBoris BREZILLON 
34edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_FIXED			0x0001
35edcf58bcSBoris BREZILLON 
36b295c229SPhilipp Zabel /* RGB - next is	0x1013 */
374b3a81a9SBoris Brezillion #define MEDIA_BUS_FMT_RGB444_1X12		0x100e
38edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
39edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
40edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE	0x1003
41edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE	0x1004
424b3a81a9SBoris Brezillion #define MEDIA_BUS_FMT_RGB565_1X16		0x100f
43edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_BGR565_2X8_BE		0x1005
44edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_BGR565_2X8_LE		0x1006
45edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB565_2X8_BE		0x1007
46edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB565_2X8_LE		0x1008
47edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB666_1X18		0x1009
48b295c229SPhilipp Zabel #define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG		0x1010
49edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB888_1X24		0x100a
50edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB888_2X12_BE		0x100b
51edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_RGB888_2X12_LE		0x100c
52b295c229SPhilipp Zabel #define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG		0x1011
53b295c229SPhilipp Zabel #define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA	0x1012
54edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_ARGB8888_1X32		0x100d
55edcf58bcSBoris BREZILLON 
56edcf58bcSBoris BREZILLON /* YUV (including grey) - next is	0x2024 */
57edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_Y8_1X8			0x2001
58edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UV8_1X8			0x2015
59edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY8_1_5X8		0x2002
60edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY8_1_5X8		0x2003
61edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV8_1_5X8		0x2004
62edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU8_1_5X8		0x2005
63edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY8_2X8			0x2006
64edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY8_2X8			0x2007
65edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV8_2X8			0x2008
66edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU8_2X8			0x2009
67edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_Y10_1X10			0x200a
68edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY10_2X10		0x2018
69edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY10_2X10		0x2019
70edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV10_2X10		0x200b
71edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU10_2X10		0x200c
72edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_Y12_1X12			0x2013
73edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY8_1X16		0x200f
74edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY8_1X16		0x2010
75edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV8_1X16		0x2011
76edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU8_1X16		0x2012
77edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YDYUYDYV8_1X16		0x2014
78edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY10_1X20		0x201a
79edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY10_1X20		0x201b
80edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV10_1X20		0x200d
81edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU10_1X20		0x200e
82edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUV10_1X30		0x2016
83edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_AYUV8_1X32		0x2017
84edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY12_2X12		0x201c
85edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY12_2X12		0x201d
86edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV12_2X12		0x201e
87edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU12_2X12		0x201f
88edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_UYVY12_1X24		0x2020
89edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_VYUY12_1X24		0x2021
90edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YUYV12_1X24		0x2022
91edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_YVYU12_1X24		0x2023
92edcf58bcSBoris BREZILLON 
93edcf58bcSBoris BREZILLON /* Bayer - next is	0x3019 */
94edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR8_1X8		0x3001
95edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGBRG8_1X8		0x3013
96edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGRBG8_1X8		0x3002
97edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SRGGB8_1X8		0x3014
98edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8		0x3015
99edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8		0x3016
100edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8		0x3017
101edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8		0x3018
102edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8		0x300b
103edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8		0x300c
104edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8		0x3009
105edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8		0x300d
106edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE	0x3003
107edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE	0x3004
108edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE	0x3005
109edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE	0x3006
110edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR10_1X10		0x3007
111edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGBRG10_1X10		0x300e
112edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGRBG10_1X10		0x300a
113edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SRGGB10_1X10		0x300f
114edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SBGGR12_1X12		0x3008
115edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGBRG12_1X12		0x3010
116edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SGRBG12_1X12		0x3011
117edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_SRGGB12_1X12		0x3012
118edcf58bcSBoris BREZILLON 
119edcf58bcSBoris BREZILLON /* JPEG compressed formats - next is	0x4002 */
120edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_JPEG_1X8			0x4001
121edcf58bcSBoris BREZILLON 
122edcf58bcSBoris BREZILLON /* Vendor specific formats - next is	0x5002 */
123edcf58bcSBoris BREZILLON 
124edcf58bcSBoris BREZILLON /* S5C73M3 sensor specific interleaved UYVY and JPEG */
125edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8		0x5001
126edcf58bcSBoris BREZILLON 
127edcf58bcSBoris BREZILLON /* HSV - next is	0x6002 */
128edcf58bcSBoris BREZILLON #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
129edcf58bcSBoris BREZILLON 
130edcf58bcSBoris BREZILLON #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
131