adv7343_regs.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * ADV7343 encoder related structure and register definitions
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed .as is. WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef ADV7343_REGS_H
  16. #define ADV7343_REGS_H
  17. struct adv7343_std_info {
  18. u32 standard_val3;
  19. u32 fsc_val;
  20. v4l2_std_id stdid;
  21. };
  22. /* Register offset macros */
  23. #define ADV7343_POWER_MODE_REG (0x00)
  24. #define ADV7343_MODE_SELECT_REG (0x01)
  25. #define ADV7343_MODE_REG0 (0x02)
  26. #define ADV7343_DAC2_OUTPUT_LEVEL (0x0b)
  27. #define ADV7343_SOFT_RESET (0x17)
  28. #define ADV7343_HD_MODE_REG1 (0x30)
  29. #define ADV7343_HD_MODE_REG2 (0x31)
  30. #define ADV7343_HD_MODE_REG3 (0x32)
  31. #define ADV7343_HD_MODE_REG4 (0x33)
  32. #define ADV7343_HD_MODE_REG5 (0x34)
  33. #define ADV7343_HD_MODE_REG6 (0x35)
  34. #define ADV7343_HD_MODE_REG7 (0x39)
  35. #define ADV7343_SD_MODE_REG1 (0x80)
  36. #define ADV7343_SD_MODE_REG2 (0x82)
  37. #define ADV7343_SD_MODE_REG3 (0x83)
  38. #define ADV7343_SD_MODE_REG4 (0x84)
  39. #define ADV7343_SD_MODE_REG5 (0x86)
  40. #define ADV7343_SD_MODE_REG6 (0x87)
  41. #define ADV7343_SD_MODE_REG7 (0x88)
  42. #define ADV7343_SD_MODE_REG8 (0x89)
  43. #define ADV7343_FSC_REG0 (0x8C)
  44. #define ADV7343_FSC_REG1 (0x8D)
  45. #define ADV7343_FSC_REG2 (0x8E)
  46. #define ADV7343_FSC_REG3 (0x8F)
  47. #define ADV7343_SD_CGMS_WSS0 (0x99)
  48. #define ADV7343_SD_HUE_REG (0xA0)
  49. #define ADV7343_SD_BRIGHTNESS_WSS (0xA1)
  50. /* Default values for the registers */
  51. #define ADV7343_POWER_MODE_REG_DEFAULT (0x10)
  52. #define ADV7343_HD_MODE_REG1_DEFAULT (0x3C) /* Changed Default
  53. 720p EAVSAV code*/
  54. #define ADV7343_HD_MODE_REG2_DEFAULT (0x01) /* Changed Pixel data
  55. valid */
  56. #define ADV7343_HD_MODE_REG3_DEFAULT (0x00) /* Color delay 0 clks */
  57. #define ADV7343_HD_MODE_REG4_DEFAULT (0xE8) /* Changed */
  58. #define ADV7343_HD_MODE_REG5_DEFAULT (0x08)
  59. #define ADV7343_HD_MODE_REG6_DEFAULT (0x00)
  60. #define ADV7343_HD_MODE_REG7_DEFAULT (0x00)
  61. #define ADV7343_SD_MODE_REG8_DEFAULT (0x00)
  62. #define ADV7343_SOFT_RESET_DEFAULT (0x02)
  63. #define ADV7343_COMPOSITE_POWER_VALUE (0x80)
  64. #define ADV7343_COMPONENT_POWER_VALUE (0x1C)
  65. #define ADV7343_SVIDEO_POWER_VALUE (0x60)
  66. #define ADV7343_SD_HUE_REG_DEFAULT (127)
  67. #define ADV7343_SD_BRIGHTNESS_WSS_DEFAULT (0x03)
  68. #define ADV7343_SD_CGMS_WSS0_DEFAULT (0x10)
  69. #define ADV7343_SD_MODE_REG1_DEFAULT (0x00)
  70. #define ADV7343_SD_MODE_REG2_DEFAULT (0xC9)
  71. #define ADV7343_SD_MODE_REG3_DEFAULT (0x10)
  72. #define ADV7343_SD_MODE_REG4_DEFAULT (0x01)
  73. #define ADV7343_SD_MODE_REG5_DEFAULT (0x02)
  74. #define ADV7343_SD_MODE_REG6_DEFAULT (0x0C)
  75. #define ADV7343_SD_MODE_REG7_DEFAULT (0x04)
  76. #define ADV7343_SD_MODE_REG8_DEFAULT (0x00)
  77. /* Bit masks for Mode Select Register */
  78. #define INPUT_MODE_MASK (0x70)
  79. #define SD_INPUT_MODE (0x00)
  80. #define HD_720P_INPUT_MODE (0x10)
  81. #define HD_1080I_INPUT_MODE (0x10)
  82. /* Bit masks for Mode Register 0 */
  83. #define TEST_PATTERN_BLACK_BAR_EN (0x04)
  84. #define YUV_OUTPUT_SELECT (0x20)
  85. #define RGB_OUTPUT_SELECT (0xDF)
  86. /* Bit masks for DAC output levels */
  87. #define DAC_OUTPUT_LEVEL_MASK (0xFF)
  88. /* Bit masks for soft reset register */
  89. #define SOFT_RESET (0x02)
  90. /* Bit masks for HD Mode Register 1 */
  91. #define OUTPUT_STD_MASK (0x03)
  92. #define OUTPUT_STD_SHIFT (0)
  93. #define OUTPUT_STD_EIA0_2 (0x00)
  94. #define OUTPUT_STD_EIA0_1 (0x01)
  95. #define OUTPUT_STD_FULL (0x02)
  96. #define EMBEDDED_SYNC (0x04)
  97. #define EXTERNAL_SYNC (0xFB)
  98. #define STD_MODE_SHIFT (3)
  99. #define STD_MODE_MASK (0x1F)
  100. #define STD_MODE_720P (0x05)
  101. #define STD_MODE_720P_25 (0x08)
  102. #define STD_MODE_720P_30 (0x07)
  103. #define STD_MODE_720P_50 (0x06)
  104. #define STD_MODE_1080I (0x0D)
  105. #define STD_MODE_1080I_25fps (0x0E)
  106. #define STD_MODE_1080P_24 (0x12)
  107. #define STD_MODE_1080P_25 (0x10)
  108. #define STD_MODE_1080P_30 (0x0F)
  109. #define STD_MODE_525P (0x00)
  110. #define STD_MODE_625P (0x03)
  111. /* Bit masks for SD Mode Register 1 */
  112. #define SD_STD_MASK (0x03)
  113. #define SD_STD_NTSC (0x00)
  114. #define SD_STD_PAL_BDGHI (0x01)
  115. #define SD_STD_PAL_M (0x02)
  116. #define SD_STD_PAL_N (0x03)
  117. #define SD_LUMA_FLTR_MASK (0x7)
  118. #define SD_LUMA_FLTR_SHIFT (0x2)
  119. #define SD_CHROMA_FLTR_MASK (0x7)
  120. #define SD_CHROMA_FLTR_SHIFT (0x5)
  121. /* Bit masks for SD Mode Register 2 */
  122. #define SD_PBPR_SSAF_EN (0x01)
  123. #define SD_PBPR_SSAF_DI (0xFE)
  124. #define SD_DAC_1_DI (0xFD)
  125. #define SD_DAC_2_DI (0xFB)
  126. #define SD_PEDESTAL_EN (0x08)
  127. #define SD_PEDESTAL_DI (0xF7)
  128. #define SD_SQUARE_PIXEL_EN (0x10)
  129. #define SD_SQUARE_PIXEL_DI (0xEF)
  130. #define SD_PIXEL_DATA_VALID (0x40)
  131. #define SD_ACTIVE_EDGE_EN (0x80)
  132. #define SD_ACTIVE_EDGE_DI (0x7F)
  133. /* Bit masks for HD Mode Register 6 */
  134. #define HD_RGB_INPUT_EN (0x02)
  135. #define HD_RGB_INPUT_DI (0xFD)
  136. #define HD_PBPR_SYNC_EN (0x04)
  137. #define HD_PBPR_SYNC_DI (0xFB)
  138. #define HD_DAC_SWAP_EN (0x08)
  139. #define HD_DAC_SWAP_DI (0xF7)
  140. #define HD_GAMMA_CURVE_A (0xEF)
  141. #define HD_GAMMA_CURVE_B (0x10)
  142. #define HD_GAMMA_EN (0x20)
  143. #define HD_GAMMA_DI (0xDF)
  144. #define HD_ADPT_FLTR_MODEB (0x40)
  145. #define HD_ADPT_FLTR_MODEA (0xBF)
  146. #define HD_ADPT_FLTR_EN (0x80)
  147. #define HD_ADPT_FLTR_DI (0x7F)
  148. #define ADV7343_BRIGHTNESS_MAX (127)
  149. #define ADV7343_BRIGHTNESS_MIN (0)
  150. #define ADV7343_BRIGHTNESS_DEF (3)
  151. #define ADV7343_HUE_MAX (255)
  152. #define ADV7343_HUE_MIN (0)
  153. #define ADV7343_HUE_DEF (127)
  154. #define ADV7343_GAIN_MAX (64)
  155. #define ADV7343_GAIN_MIN (-64)
  156. #define ADV7343_GAIN_DEF (0)
  157. #endif