Blame view

include/linux/v4l2-mediabus.h 3.98 KB
2ef2d5a33   Laurent Pinchart   [media] v4l: Move...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  /*
   * 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.
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
27
28
29
30
31
32
33
34
35
   *
   * The pixel codes are grouped by type, bus_width, bits per component, samples
   * per pixel and order of subsamples. Numerical values are sorted using generic
   * numerical sort order (8 thus comes before 10).
   *
   * As their value can't change when a new pixel code is inserted in the
   * enumeration, the pixel codes are explicitly given a numerical value. The next
   * free values for each category are listed below, update them when inserting
   * new pixel codes.
2ef2d5a33   Laurent Pinchart   [media] v4l: Move...
36
37
   */
  enum v4l2_mbus_pixelcode {
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
38
39
40
41
42
43
44
45
46
47
48
  	V4L2_MBUS_FMT_FIXED = 0x0001,
  
  	/* RGB - next is 0x1009 */
  	V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
  	V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
  	V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
  	V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
  	V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005,
  	V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006,
  	V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007,
  	V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008,
cbbc69a4a   Michael Jones   [media] media: ad...
49
  	/* YUV (including grey) - next is 0x2014 */
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
50
51
52
53
54
55
56
57
58
59
60
61
  	V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
  	V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
  	V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003,
  	V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004,
  	V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005,
  	V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006,
  	V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007,
  	V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008,
  	V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009,
  	V4L2_MBUS_FMT_Y10_1X10 = 0x200a,
  	V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b,
  	V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c,
cbbc69a4a   Michael Jones   [media] media: ad...
62
  	V4L2_MBUS_FMT_Y12_1X12 = 0x2013,
2d8deaf6b   Laurent Pinchart   [media] v4l: Add ...
63
64
65
66
  	V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f,
  	V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010,
  	V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011,
  	V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012,
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
67
68
  	V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
  	V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
cbbc69a4a   Michael Jones   [media] media: ad...
69
  	/* Bayer - next is 0x3015 */
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
70
  	V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
cbbc69a4a   Michael Jones   [media] media: ad...
71
  	V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013,
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
72
  	V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002,
cbbc69a4a   Michael Jones   [media] media: ad...
73
  	V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014,
b1fd18cd9   Laurent Pinchart   [media] v4l: Add ...
74
75
  	V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b,
  	V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c,
2d8deaf6b   Laurent Pinchart   [media] v4l: Add ...
76
  	V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009,
b1fd18cd9   Laurent Pinchart   [media] v4l: Add ...
77
  	V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 0x300d,
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
78
79
80
81
82
  	V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003,
  	V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004,
  	V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005,
  	V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006,
  	V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007,
b1fd18cd9   Laurent Pinchart   [media] v4l: Add ...
83
  	V4L2_MBUS_FMT_SGBRG10_1X10 = 0x300e,
2d8deaf6b   Laurent Pinchart   [media] v4l: Add ...
84
  	V4L2_MBUS_FMT_SGRBG10_1X10 = 0x300a,
b1fd18cd9   Laurent Pinchart   [media] v4l: Add ...
85
  	V4L2_MBUS_FMT_SRGGB10_1X10 = 0x300f,
dacdde78b   Laurent Pinchart   [media] v4l: Grou...
86
  	V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008,
7140c5573   Laurent Pinchart   [media] v4l: Add ...
87
88
89
  	V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010,
  	V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011,
  	V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012,
16846524a   Sylwester Nawrocki   [media] v4l: Add ...
90
91
92
  
  	/* JPEG compressed formats - next is 0x4002 */
  	V4L2_MBUS_FMT_JPEG_1X8 = 0x4001,
2ef2d5a33   Laurent Pinchart   [media] v4l: Move...
93
94
95
96
97
98
  };
  
  /**
   * struct v4l2_mbus_framefmt - frame format on the media bus
   * @width:	frame width
   * @height:	frame height
84d0688df   Laurent Pinchart   [media] v4l: Repl...
99
100
101
   * @code:	data format code (from enum v4l2_mbus_pixelcode)
   * @field:	used interlacing type (from enum v4l2_field)
   * @colorspace:	colorspace of the data (from enum v4l2_colorspace)
2ef2d5a33   Laurent Pinchart   [media] v4l: Move...
102
103
   */
  struct v4l2_mbus_framefmt {
84d0688df   Laurent Pinchart   [media] v4l: Repl...
104
105
106
107
108
109
  	__u32			width;
  	__u32			height;
  	__u32			code;
  	__u32			field;
  	__u32			colorspace;
  	__u32			reserved[7];
2ef2d5a33   Laurent Pinchart   [media] v4l: Move...
110
111
112
  };
  
  #endif