v4l2-mediabus.h 5.0 KB

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