cx25840.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*
  2. cx25840.h - definition for cx25840/1/2/3 inputs
  3. Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef _CX25840_H_
  17. #define _CX25840_H_
  18. /* Note that the cx25840 driver requires that the bridge driver calls the
  19. v4l2_subdev's init operation in order to load the driver's firmware.
  20. Without this the audio standard detection will fail and you will
  21. only get mono.
  22. Since loading the firmware is often problematic when the driver is
  23. compiled into the kernel I recommend postponing calling this function
  24. until the first open of the video device. Another reason for
  25. postponing it is that loading this firmware takes a long time (seconds)
  26. due to the slow i2c bus speed. So it will speed up the boot process if
  27. you can avoid loading the fw as long as the video device isn't used. */
  28. enum cx25840_video_input {
  29. /* Composite video inputs In1-In8 */
  30. CX25840_COMPOSITE1 = 1,
  31. CX25840_COMPOSITE2,
  32. CX25840_COMPOSITE3,
  33. CX25840_COMPOSITE4,
  34. CX25840_COMPOSITE5,
  35. CX25840_COMPOSITE6,
  36. CX25840_COMPOSITE7,
  37. CX25840_COMPOSITE8,
  38. /* S-Video inputs consist of one luma input (In1-In8) ORed with one
  39. chroma input (In5-In8) */
  40. CX25840_SVIDEO_LUMA1 = 0x10,
  41. CX25840_SVIDEO_LUMA2 = 0x20,
  42. CX25840_SVIDEO_LUMA3 = 0x30,
  43. CX25840_SVIDEO_LUMA4 = 0x40,
  44. CX25840_SVIDEO_LUMA5 = 0x50,
  45. CX25840_SVIDEO_LUMA6 = 0x60,
  46. CX25840_SVIDEO_LUMA7 = 0x70,
  47. CX25840_SVIDEO_LUMA8 = 0x80,
  48. CX25840_SVIDEO_CHROMA4 = 0x400,
  49. CX25840_SVIDEO_CHROMA5 = 0x500,
  50. CX25840_SVIDEO_CHROMA6 = 0x600,
  51. CX25840_SVIDEO_CHROMA7 = 0x700,
  52. CX25840_SVIDEO_CHROMA8 = 0x800,
  53. /* S-Video aliases for common luma/chroma combinations */
  54. CX25840_SVIDEO1 = 0x510,
  55. CX25840_SVIDEO2 = 0x620,
  56. CX25840_SVIDEO3 = 0x730,
  57. CX25840_SVIDEO4 = 0x840,
  58. /* Allow frames to specify specific input configurations */
  59. CX25840_VIN1_CH1 = 0x80000000,
  60. CX25840_VIN2_CH1 = 0x80000001,
  61. CX25840_VIN3_CH1 = 0x80000002,
  62. CX25840_VIN4_CH1 = 0x80000003,
  63. CX25840_VIN5_CH1 = 0x80000004,
  64. CX25840_VIN6_CH1 = 0x80000005,
  65. CX25840_VIN7_CH1 = 0x80000006,
  66. CX25840_VIN8_CH1 = 0x80000007,
  67. CX25840_VIN4_CH2 = 0x80000000,
  68. CX25840_VIN5_CH2 = 0x80000010,
  69. CX25840_VIN6_CH2 = 0x80000020,
  70. CX25840_NONE_CH2 = 0x80000030,
  71. CX25840_VIN7_CH3 = 0x80000000,
  72. CX25840_VIN8_CH3 = 0x80000040,
  73. CX25840_NONE0_CH3 = 0x80000080,
  74. CX25840_NONE1_CH3 = 0x800000c0,
  75. CX25840_SVIDEO_ON = 0x80000100,
  76. CX25840_COMPONENT_ON = 0x80000200,
  77. CX25840_DIF_ON = 0x80000400,
  78. };
  79. enum cx25840_audio_input {
  80. /* Audio inputs: serial or In4-In8 */
  81. CX25840_AUDIO_SERIAL,
  82. CX25840_AUDIO4 = 4,
  83. CX25840_AUDIO5,
  84. CX25840_AUDIO6,
  85. CX25840_AUDIO7,
  86. CX25840_AUDIO8,
  87. };
  88. enum cx25840_io_pin {
  89. CX25840_PIN_DVALID_PRGM0 = 0,
  90. CX25840_PIN_FIELD_PRGM1,
  91. CX25840_PIN_HRESET_PRGM2,
  92. CX25840_PIN_VRESET_HCTL_PRGM3,
  93. CX25840_PIN_IRQ_N_PRGM4,
  94. CX25840_PIN_IR_TX_PRGM6,
  95. CX25840_PIN_IR_RX_PRGM5,
  96. CX25840_PIN_GPIO0_PRGM8,
  97. CX25840_PIN_GPIO1_PRGM9,
  98. CX25840_PIN_SA_SDIN, /* Alternate GP Input only */
  99. CX25840_PIN_SA_SDOUT, /* Alternate GP Input only */
  100. CX25840_PIN_PLL_CLK_PRGM7,
  101. CX25840_PIN_CHIP_SEL_VIPCLK, /* Output only */
  102. };
  103. enum cx25840_io_pad {
  104. /* Output pads */
  105. CX25840_PAD_DEFAULT = 0,
  106. CX25840_PAD_ACTIVE,
  107. CX25840_PAD_VACTIVE,
  108. CX25840_PAD_CBFLAG,
  109. CX25840_PAD_VID_DATA_EXT0,
  110. CX25840_PAD_VID_DATA_EXT1,
  111. CX25840_PAD_GPO0,
  112. CX25840_PAD_GPO1,
  113. CX25840_PAD_GPO2,
  114. CX25840_PAD_GPO3,
  115. CX25840_PAD_IRQ_N,
  116. CX25840_PAD_AC_SYNC,
  117. CX25840_PAD_AC_SDOUT,
  118. CX25840_PAD_PLL_CLK,
  119. CX25840_PAD_VRESET,
  120. CX25840_PAD_RESERVED,
  121. /* Pads for PLL_CLK output only */
  122. CX25840_PAD_XTI_X5_DLL,
  123. CX25840_PAD_AUX_PLL,
  124. CX25840_PAD_VID_PLL,
  125. CX25840_PAD_XTI,
  126. /* Input Pads */
  127. CX25840_PAD_GPI0,
  128. CX25840_PAD_GPI1,
  129. CX25840_PAD_GPI2,
  130. CX25840_PAD_GPI3,
  131. };
  132. enum cx25840_io_pin_strength {
  133. CX25840_PIN_DRIVE_MEDIUM = 0,
  134. CX25840_PIN_DRIVE_SLOW,
  135. CX25840_PIN_DRIVE_FAST,
  136. };
  137. enum cx23885_io_pin {
  138. CX23885_PIN_IR_RX_GPIO19,
  139. CX23885_PIN_IR_TX_GPIO20,
  140. CX23885_PIN_I2S_SDAT_GPIO21,
  141. CX23885_PIN_I2S_WCLK_GPIO22,
  142. CX23885_PIN_I2S_BCLK_GPIO23,
  143. CX23885_PIN_IRQ_N_GPIO16,
  144. };
  145. enum cx23885_io_pad {
  146. CX23885_PAD_IR_RX,
  147. CX23885_PAD_GPIO19,
  148. CX23885_PAD_IR_TX,
  149. CX23885_PAD_GPIO20,
  150. CX23885_PAD_I2S_SDAT,
  151. CX23885_PAD_GPIO21,
  152. CX23885_PAD_I2S_WCLK,
  153. CX23885_PAD_GPIO22,
  154. CX23885_PAD_I2S_BCLK,
  155. CX23885_PAD_GPIO23,
  156. CX23885_PAD_IRQ_N,
  157. CX23885_PAD_GPIO16,
  158. };
  159. /* pvr150_workaround activates a workaround for a hardware bug that is
  160. present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
  161. certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
  162. audio autodetect fails on some channels for these models and the workaround
  163. is to select the audio standard explicitly. Many thanks to Hauppauge for
  164. providing this information.
  165. This platform data only needs to be supplied by the ivtv driver. */
  166. struct cx25840_platform_data {
  167. int pvr150_workaround;
  168. };
  169. #endif