dw-csi-plat.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2018 Synopsys, Inc.
  4. *
  5. * Synopsys DesignWare MIPI CSI-2 Host controller driver.
  6. * Supported bus formats
  7. *
  8. * Author: Luis Oliveira <Luis.Oliveira@synopsys.com>
  9. */
  10. #ifndef _DW_CSI_PLAT_H__
  11. #define _DW_CSI_PLAT_H__
  12. #include "dw-mipi-csi.h"
  13. /** Color Space Converter Block **/
  14. #define CSC_UNIT_NR 1
  15. #define CSC_COREID 0x0000
  16. #define CSC_CFG 0x0004
  17. #define CSC_COEF_A(x) (0x0008 + ((x) * 4))
  18. #define CSC_COEF_B(x) (0x0018 + ((x) * 4))
  19. #define CSC_COEF_C(x) (0x0028 + ((x) * 4))
  20. #define CSC_LIMIT_DN 0x0038
  21. #define CSC_LIMIT_UP 0x003C
  22. #define CSC_VID_CFG 0x0040
  23. /** Demosaic Block **/
  24. #define DEMO_CONTROL 0x0
  25. #define DEMO_GLOBAL_INT_EN 0x4
  26. #define DEMO_IP_INT_EN_REG 0x8
  27. #define DEMO_IP_INT_SATUS_REG 0xC
  28. #define DEMO_ACTIVE_WIDTH 0x10
  29. #define DEMO_ACTIVE_HEIGHT 0x18
  30. #define DEMO_BAYER_PHASE 0x28//0x20
  31. #define BAYER_RGGB 0x0
  32. #define BAYER_GRBG 0x1
  33. #define BAYER_GBRG 0x2
  34. #define BAYER_BGGR 0x3
  35. /* Video formats supported by the MIPI CSI-2 */
  36. static struct mipi_fmt dw_mipi_csi_formats[] = {
  37. {
  38. /* RAW 8 */
  39. .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
  40. .depth = 8,
  41. }, {
  42. /* RAW 6 */
  43. .mbus_code = MEDIA_BUS_FMT_SBGGR6_1X8,
  44. .depth = 8,
  45. }, {
  46. /* RAW 7 */
  47. .mbus_code = MEDIA_BUS_FMT_SBGGR7_1X8,
  48. .depth = 8,
  49. }, {
  50. /* RAW 10 */
  51. .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10,
  52. .depth = 10,
  53. }, {
  54. /* RAW 8 */
  55. .mbus_code = 0x3001,
  56. .depth = 8,
  57. }, {
  58. /* RAW 12 */
  59. .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12,
  60. .depth = 12,
  61. }, {
  62. /* RAW 14 */
  63. .mbus_code = MEDIA_BUS_FMT_SBGGR14_1X14,
  64. .depth = 14,
  65. }, {
  66. /* RAW 16 */
  67. .mbus_code = MEDIA_BUS_FMT_SBGGR16_1X16,
  68. .depth = 16,
  69. }, {
  70. /* RGB 666 */
  71. .mbus_code = MEDIA_BUS_FMT_RGB666_1X18,
  72. .depth = 18,
  73. }, {
  74. /* RGB 565 */
  75. .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_BE,
  76. .depth = 16,
  77. }, {
  78. /* BGR 565 */
  79. .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE,
  80. .depth = 16,
  81. }, {
  82. /* RGB 555 */
  83. .mbus_code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
  84. .depth = 16,
  85. }, {
  86. /* BGR 555 */
  87. .mbus_code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
  88. .depth = 16,
  89. }, {
  90. /* RGB 444 */
  91. .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
  92. .depth = 16,
  93. }, {
  94. /* RGB 444 */
  95. .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
  96. .depth = 16,
  97. }, {
  98. /* RGB 888 */
  99. .mbus_code = MEDIA_BUS_FMT_RGB888_2X12_LE,
  100. .depth = 24,
  101. }, {
  102. /* BGR 888 */
  103. .mbus_code = MEDIA_BUS_FMT_RGB888_2X12_BE,
  104. .depth = 24,
  105. }, {
  106. /* BGR 888 */
  107. .mbus_code = MEDIA_BUS_FMT_RGB888_1X24,
  108. .depth = 24,
  109. }, {
  110. /* YUV 422 8-bit */
  111. .mbus_code = MEDIA_BUS_FMT_VYUY8_1X16,
  112. .depth = 16,
  113. }, {
  114. /* YUV 422 10-bit */
  115. .mbus_code = MEDIA_BUS_FMT_UYVY10_1X20,
  116. .depth = 24,
  117. }, {
  118. /* YUV 420 8-bit LEGACY */
  119. .mbus_code = MEDIA_BUS_FMT_Y8_1X8,
  120. .depth = 8,
  121. }, {
  122. /* YUV 420 8-bit LEGACY */
  123. .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16,
  124. .depth = 24,
  125. }, {
  126. /* YUV 420 10-bit */
  127. .mbus_code = MEDIA_BUS_FMT_VUY8_1X24,
  128. .depth = 24,
  129. }, {
  130. /* YUV 420 8-bit */
  131. .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
  132. .depth = 24,
  133. }, {
  134. /* YUV 420 10-bit */
  135. .mbus_code = MEDIA_BUS_FMT_Y10_1X10,
  136. .depth = 10,
  137. },
  138. };
  139. #endif /* _DW_CSI_PLAT_H__ */