atmel-isc-regs.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ATMEL_ISC_REGS_H
  3. #define __ATMEL_ISC_REGS_H
  4. #include <linux/bitops.h>
  5. /* ISC Control Enable Register 0 */
  6. #define ISC_CTRLEN 0x00000000
  7. /* ISC Control Disable Register 0 */
  8. #define ISC_CTRLDIS 0x00000004
  9. /* ISC Control Status Register 0 */
  10. #define ISC_CTRLSR 0x00000008
  11. #define ISC_CTRL_CAPTURE BIT(0)
  12. #define ISC_CTRL_UPPRO BIT(1)
  13. #define ISC_CTRL_HISREQ BIT(2)
  14. #define ISC_CTRL_HISCLR BIT(3)
  15. /* ISC Parallel Front End Configuration 0 Register */
  16. #define ISC_PFE_CFG0 0x0000000c
  17. #define ISC_PFE_CFG0_HPOL_LOW BIT(0)
  18. #define ISC_PFE_CFG0_VPOL_LOW BIT(1)
  19. #define ISC_PFE_CFG0_PPOL_LOW BIT(2)
  20. #define ISC_PFE_CFG0_MODE_PROGRESSIVE (0x0 << 4)
  21. #define ISC_PFE_CFG0_MODE_MASK GENMASK(6, 4)
  22. #define ISC_PFE_CFG0_BPS_EIGHT (0x4 << 28)
  23. #define ISC_PFG_CFG0_BPS_NINE (0x3 << 28)
  24. #define ISC_PFG_CFG0_BPS_TEN (0x2 << 28)
  25. #define ISC_PFG_CFG0_BPS_ELEVEN (0x1 << 28)
  26. #define ISC_PFG_CFG0_BPS_TWELVE (0x0 << 28)
  27. #define ISC_PFE_CFG0_BPS_MASK GENMASK(30, 28)
  28. /* ISC Clock Enable Register */
  29. #define ISC_CLKEN 0x00000018
  30. /* ISC Clock Disable Register */
  31. #define ISC_CLKDIS 0x0000001c
  32. /* ISC Clock Status Register */
  33. #define ISC_CLKSR 0x00000020
  34. #define ISC_CLK(n) BIT(n)
  35. /* ISC Clock Configuration Register */
  36. #define ISC_CLKCFG 0x00000024
  37. #define ISC_CLKCFG_DIV_SHIFT(n) ((n)*16)
  38. #define ISC_CLKCFG_DIV_MASK(n) GENMASK(((n)*16 + 7), (n)*16)
  39. #define ISC_CLKCFG_SEL_SHIFT(n) ((n)*16 + 8)
  40. #define ISC_CLKCFG_SEL_MASK(n) GENMASK(((n)*17 + 8), ((n)*16 + 8))
  41. /* ISC Interrupt Enable Register */
  42. #define ISC_INTEN 0x00000028
  43. /* ISC Interrupt Disable Register */
  44. #define ISC_INTDIS 0x0000002c
  45. /* ISC Interrupt Mask Register */
  46. #define ISC_INTMASK 0x00000030
  47. /* ISC Interrupt Status Register */
  48. #define ISC_INTSR 0x00000034
  49. #define ISC_INT_DDONE BIT(8)
  50. #define ISC_INT_HISDONE BIT(12)
  51. /* ISC White Balance Control Register */
  52. #define ISC_WB_CTRL 0x00000058
  53. /* ISC White Balance Configuration Register */
  54. #define ISC_WB_CFG 0x0000005c
  55. /* ISC White Balance Offset for R, GR Register */
  56. #define ISC_WB_O_RGR 0x00000060
  57. /* ISC White Balance Offset for B, GB Register */
  58. #define ISC_WB_O_BGR 0x00000064
  59. /* ISC White Balance Gain for R, GR Register */
  60. #define ISC_WB_G_RGR 0x00000068
  61. /* ISC White Balance Gain for B, GB Register */
  62. #define ISC_WB_G_BGR 0x0000006c
  63. /* ISC Color Filter Array Control Register */
  64. #define ISC_CFA_CTRL 0x00000070
  65. /* ISC Color Filter Array Configuration Register */
  66. #define ISC_CFA_CFG 0x00000074
  67. #define ISC_CFA_CFG_EITPOL BIT(4)
  68. #define ISC_BAY_CFG_GRGR 0x0
  69. #define ISC_BAY_CFG_RGRG 0x1
  70. #define ISC_BAY_CFG_GBGB 0x2
  71. #define ISC_BAY_CFG_BGBG 0x3
  72. /* ISC Color Correction Control Register */
  73. #define ISC_CC_CTRL 0x00000078
  74. /* ISC Color Correction RR RG Register */
  75. #define ISC_CC_RR_RG 0x0000007c
  76. /* ISC Color Correction RB OR Register */
  77. #define ISC_CC_RB_OR 0x00000080
  78. /* ISC Color Correction GR GG Register */
  79. #define ISC_CC_GR_GG 0x00000084
  80. /* ISC Color Correction GB OG Register */
  81. #define ISC_CC_GB_OG 0x00000088
  82. /* ISC Color Correction BR BG Register */
  83. #define ISC_CC_BR_BG 0x0000008c
  84. /* ISC Color Correction BB OB Register */
  85. #define ISC_CC_BB_OB 0x00000090
  86. /* ISC Gamma Correction Control Register */
  87. #define ISC_GAM_CTRL 0x00000094
  88. /* ISC_Gamma Correction Blue Entry Register */
  89. #define ISC_GAM_BENTRY 0x00000098
  90. /* ISC_Gamma Correction Green Entry Register */
  91. #define ISC_GAM_GENTRY 0x00000198
  92. /* ISC_Gamma Correction Green Entry Register */
  93. #define ISC_GAM_RENTRY 0x00000298
  94. /* Color Space Conversion Control Register */
  95. #define ISC_CSC_CTRL 0x00000398
  96. /* Color Space Conversion YR YG Register */
  97. #define ISC_CSC_YR_YG 0x0000039c
  98. /* Color Space Conversion YB OY Register */
  99. #define ISC_CSC_YB_OY 0x000003a0
  100. /* Color Space Conversion CBR CBG Register */
  101. #define ISC_CSC_CBR_CBG 0x000003a4
  102. /* Color Space Conversion CBB OCB Register */
  103. #define ISC_CSC_CBB_OCB 0x000003a8
  104. /* Color Space Conversion CRR CRG Register */
  105. #define ISC_CSC_CRR_CRG 0x000003ac
  106. /* Color Space Conversion CRB OCR Register */
  107. #define ISC_CSC_CRB_OCR 0x000003b0
  108. /* Contrast And Brightness Control Register */
  109. #define ISC_CBC_CTRL 0x000003b4
  110. /* Contrast And Brightness Configuration Register */
  111. #define ISC_CBC_CFG 0x000003b8
  112. /* Brightness Register */
  113. #define ISC_CBC_BRIGHT 0x000003bc
  114. #define ISC_CBC_BRIGHT_MASK GENMASK(10, 0)
  115. /* Contrast Register */
  116. #define ISC_CBC_CONTRAST 0x000003c0
  117. #define ISC_CBC_CONTRAST_MASK GENMASK(11, 0)
  118. /* Subsampling 4:4:4 to 4:2:2 Control Register */
  119. #define ISC_SUB422_CTRL 0x000003c4
  120. /* Subsampling 4:2:2 to 4:2:0 Control Register */
  121. #define ISC_SUB420_CTRL 0x000003cc
  122. /* Rounding, Limiting and Packing Configuration Register */
  123. #define ISC_RLP_CFG 0x000003d0
  124. #define ISC_RLP_CFG_MODE_DAT8 0x0
  125. #define ISC_RLP_CFG_MODE_DAT9 0x1
  126. #define ISC_RLP_CFG_MODE_DAT10 0x2
  127. #define ISC_RLP_CFG_MODE_DAT11 0x3
  128. #define ISC_RLP_CFG_MODE_DAT12 0x4
  129. #define ISC_RLP_CFG_MODE_DATY8 0x5
  130. #define ISC_RLP_CFG_MODE_DATY10 0x6
  131. #define ISC_RLP_CFG_MODE_ARGB444 0x7
  132. #define ISC_RLP_CFG_MODE_ARGB555 0x8
  133. #define ISC_RLP_CFG_MODE_RGB565 0x9
  134. #define ISC_RLP_CFG_MODE_ARGB32 0xa
  135. #define ISC_RLP_CFG_MODE_YYCC 0xb
  136. #define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc
  137. #define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0)
  138. /* Histogram Control Register */
  139. #define ISC_HIS_CTRL 0x000003d4
  140. #define ISC_HIS_CTRL_EN BIT(0)
  141. #define ISC_HIS_CTRL_DIS 0x0
  142. /* Histogram Configuration Register */
  143. #define ISC_HIS_CFG 0x000003d8
  144. #define ISC_HIS_CFG_MODE_GR 0x0
  145. #define ISC_HIS_CFG_MODE_R 0x1
  146. #define ISC_HIS_CFG_MODE_GB 0x2
  147. #define ISC_HIS_CFG_MODE_B 0x3
  148. #define ISC_HIS_CFG_MODE_Y 0x4
  149. #define ISC_HIS_CFG_MODE_RAW 0x5
  150. #define ISC_HIS_CFG_MODE_YCCIR656 0x6
  151. #define ISC_HIS_CFG_BAYSEL_SHIFT 4
  152. #define ISC_HIS_CFG_RAR BIT(8)
  153. /* DMA Configuration Register */
  154. #define ISC_DCFG 0x000003e0
  155. #define ISC_DCFG_IMODE_PACKED8 0x0
  156. #define ISC_DCFG_IMODE_PACKED16 0x1
  157. #define ISC_DCFG_IMODE_PACKED32 0x2
  158. #define ISC_DCFG_IMODE_YC422SP 0x3
  159. #define ISC_DCFG_IMODE_YC422P 0x4
  160. #define ISC_DCFG_IMODE_YC420SP 0x5
  161. #define ISC_DCFG_IMODE_YC420P 0x6
  162. #define ISC_DCFG_IMODE_MASK GENMASK(2, 0)
  163. #define ISC_DCFG_YMBSIZE_SINGLE (0x0 << 4)
  164. #define ISC_DCFG_YMBSIZE_BEATS4 (0x1 << 4)
  165. #define ISC_DCFG_YMBSIZE_BEATS8 (0x2 << 4)
  166. #define ISC_DCFG_YMBSIZE_BEATS16 (0x3 << 4)
  167. #define ISC_DCFG_YMBSIZE_MASK GENMASK(5, 4)
  168. #define ISC_DCFG_CMBSIZE_SINGLE (0x0 << 8)
  169. #define ISC_DCFG_CMBSIZE_BEATS4 (0x1 << 8)
  170. #define ISC_DCFG_CMBSIZE_BEATS8 (0x2 << 8)
  171. #define ISC_DCFG_CMBSIZE_BEATS16 (0x3 << 8)
  172. #define ISC_DCFG_CMBSIZE_MASK GENMASK(9, 8)
  173. /* DMA Control Register */
  174. #define ISC_DCTRL 0x000003e4
  175. #define ISC_DCTRL_DVIEW_PACKED (0x0 << 1)
  176. #define ISC_DCTRL_DVIEW_SEMIPLANAR (0x1 << 1)
  177. #define ISC_DCTRL_DVIEW_PLANAR (0x2 << 1)
  178. #define ISC_DCTRL_DVIEW_MASK GENMASK(2, 1)
  179. #define ISC_DCTRL_IE_IS (0x0 << 4)
  180. /* DMA Descriptor Address Register */
  181. #define ISC_DNDA 0x000003e8
  182. /* DMA Address 0 Register */
  183. #define ISC_DAD0 0x000003ec
  184. /* DMA Address 1 Register */
  185. #define ISC_DAD1 0x000003f4
  186. /* DMA Address 2 Register */
  187. #define ISC_DAD2 0x000003fc
  188. /* Histogram Entry */
  189. #define ISC_HIS_ENTRY 0x00000410
  190. #endif