media-bus-format.h 6.3 KB

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