cx231xx-pcb-cfg.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /*
  2. cx231xx-pcb-cfg.h - driver for Conexant
  3. Cx23100/101/102 USB video capture devices
  4. Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef _PCB_CONFIG_H_
  18. #define _PCB_CONFIG_H_
  19. #include <linux/init.h>
  20. #include <linux/module.h>
  21. /***************************************************************************
  22. * Class Information *
  23. ***************************************************************************/
  24. #define CLASS_DEFAULT 0xFF
  25. enum VENDOR_REQUEST_TYPE {
  26. /* Set/Get I2C */
  27. VRT_SET_I2C0 = 0x0,
  28. VRT_SET_I2C1 = 0x1,
  29. VRT_SET_I2C2 = 0x2,
  30. VRT_GET_I2C0 = 0x4,
  31. VRT_GET_I2C1 = 0x5,
  32. VRT_GET_I2C2 = 0x6,
  33. /* Set/Get GPIO */
  34. VRT_SET_GPIO = 0x8,
  35. VRT_GET_GPIO = 0x9,
  36. /* Set/Get GPIE */
  37. VRT_SET_GPIE = 0xA,
  38. VRT_GET_GPIE = 0xB,
  39. /* Set/Get Register Control/Status */
  40. VRT_SET_REGISTER = 0xC,
  41. VRT_GET_REGISTER = 0xD,
  42. /* Get Extended Compat ID Descriptor */
  43. VRT_GET_EXTCID_DESC = 0xFF,
  44. };
  45. enum BYTE_ENABLE_MASK {
  46. ENABLE_ONE_BYTE = 0x1,
  47. ENABLE_TWE_BYTE = 0x3,
  48. ENABLE_THREE_BYTE = 0x7,
  49. ENABLE_FOUR_BYTE = 0xF,
  50. };
  51. #define SPEED_MASK 0x1
  52. enum USB_SPEED{
  53. FULL_SPEED = 0x0, /* 0: full speed */
  54. HIGH_SPEED = 0x1 /* 1: high speed */
  55. };
  56. enum _true_false{
  57. FALSE = 0,
  58. TRUE = 1
  59. };
  60. #define TS_MASK 0x6
  61. enum TS_PORT{
  62. NO_TS_PORT = 0x0, /* 2'b00: Neither port used. PCB not a Hybrid,
  63. only offers Analog TV or Video */
  64. TS1_PORT = 0x4, /* 2'b10: TS1 Input (Hybrid mode :
  65. Digital or External Analog/Compressed source) */
  66. TS1_TS2_PORT = 0x6, /* 2'b11: TS1 & TS2 Inputs
  67. (Dual inputs from Digital and/or
  68. External Analog/Compressed sources) */
  69. TS1_EXT_CLOCK = 0x6, /* 2'b11: TS1 & TS2 as selector
  70. to external clock */
  71. TS1VIP_TS2_PORT = 0x2 /* 2'b01: TS1 used as 656/VIP Output,
  72. TS2 Input (from Compressor) */
  73. };
  74. #define EAVP_MASK 0x8
  75. enum EAV_PRESENT{
  76. NO_EXTERNAL_AV = 0x0, /* 0: No External A/V inputs
  77. (no need for i2s blcok),
  78. Analog Tuner must be present */
  79. EXTERNAL_AV = 0x8 /* 1: External A/V inputs
  80. present (requires i2s blk) */
  81. };
  82. #define ATM_MASK 0x30
  83. enum AT_MODE{
  84. DIF_TUNER = 0x30, /* 2'b11: IF Tuner (requires use of DIF) */
  85. BASEBAND_SOUND = 0x20, /* 2'b10: Baseband Composite &
  86. Sound-IF Signals present */
  87. NO_TUNER = 0x10 /* 2'b0x: No Analog Tuner present */
  88. };
  89. #define PWR_SEL_MASK 0x40
  90. enum POWE_TYPE{
  91. SELF_POWER = 0x0, /* 0: self power */
  92. BUS_POWER = 0x40 /* 1: bus power */
  93. };
  94. enum USB_POWE_TYPE{
  95. USB_SELF_POWER = 0,
  96. USB_BUS_POWER
  97. };
  98. #define BO_0_MASK 0x80
  99. enum AVDEC_STATUS{
  100. AVDEC_DISABLE = 0x0, /* 0: A/V Decoder Disabled */
  101. AVDEC_ENABLE = 0x80 /* 1: A/V Decoder Enabled */
  102. };
  103. #define BO_1_MASK 0x100
  104. #define BUSPOWER_MASK 0xC4 /* for Polaris spec 0.8 */
  105. #define SELFPOWER_MASK 0x86
  106. /***************************************************************************/
  107. #define NOT_DECIDE_YET 0xFE
  108. #define NOT_SUPPORTED 0xFF
  109. /***************************************************************************
  110. * for mod field use *
  111. ***************************************************************************/
  112. #define MOD_DIGITAL 0x1
  113. #define MOD_ANALOG 0x2
  114. #define MOD_DIF 0x4
  115. #define MOD_EXTERNAL 0x8
  116. #define CAP_ALL_MOD 0x0f
  117. /***************************************************************************
  118. * source define *
  119. ***************************************************************************/
  120. #define SOURCE_DIGITAL 0x1
  121. #define SOURCE_ANALOG 0x2
  122. #define SOURCE_DIF 0x4
  123. #define SOURCE_EXTERNAL 0x8
  124. #define SOURCE_TS_BDA 0x10
  125. #define SOURCE_TS_ENCODE 0x20
  126. #define SOURCE_TS_EXTERNAL 0x40
  127. /***************************************************************************
  128. * interface information define *
  129. ***************************************************************************/
  130. struct INTERFACE_INFO {
  131. u8 interrupt_index;
  132. u8 ts1_index;
  133. u8 ts2_index;
  134. u8 audio_index;
  135. u8 video_index;
  136. u8 vanc_index; /* VBI */
  137. u8 hanc_index; /* Sliced CC */
  138. u8 ir_index;
  139. };
  140. enum INDEX_INTERFACE_INFO{
  141. INDEX_INTERRUPT = 0x0,
  142. INDEX_TS1,
  143. INDEX_TS2,
  144. INDEX_AUDIO,
  145. INDEX_VIDEO,
  146. INDEX_VANC,
  147. INDEX_HANC,
  148. INDEX_IR,
  149. };
  150. /***************************************************************************
  151. * configuration information define *
  152. ***************************************************************************/
  153. struct CONFIG_INFO {
  154. u8 config_index;
  155. struct INTERFACE_INFO interface_info;
  156. };
  157. struct pcb_config {
  158. u8 index;
  159. u8 type; /* bus power or self power,
  160. self power--0, bus_power--1 */
  161. u8 speed; /* usb speed, 2.0--1, 1.1--0 */
  162. u8 mode; /* digital , anlog, dif or external A/V */
  163. u32 ts1_source; /* three source -- BDA,External,encode */
  164. u32 ts2_source;
  165. u32 analog_source;
  166. u8 digital_index; /* bus-power used */
  167. u8 analog_index; /* bus-power used */
  168. u8 dif_index; /* bus-power used */
  169. u8 external_index; /* bus-power used */
  170. u8 config_num; /* current config num, 0,1,2,
  171. for self-power, always 0 */
  172. struct CONFIG_INFO hs_config_info[3];
  173. struct CONFIG_INFO fs_config_info[3];
  174. };
  175. enum INDEX_PCB_CONFIG{
  176. INDEX_SELFPOWER_DIGITAL_ONLY = 0x0,
  177. INDEX_SELFPOWER_DUAL_DIGITAL,
  178. INDEX_SELFPOWER_ANALOG_ONLY,
  179. INDEX_SELFPOWER_DUAL,
  180. INDEX_SELFPOWER_TRIPLE,
  181. INDEX_SELFPOWER_COMPRESSOR,
  182. INDEX_BUSPOWER_DIGITAL_ONLY,
  183. INDEX_BUSPOWER_ANALOG_ONLY,
  184. INDEX_BUSPOWER_DIF_ONLY,
  185. INDEX_BUSPOWER_EXTERNAL_ONLY,
  186. INDEX_BUSPOWER_EXTERNAL_ANALOG,
  187. INDEX_BUSPOWER_EXTERNAL_DIF,
  188. INDEX_BUSPOWER_EXTERNAL_DIGITAL,
  189. INDEX_BUSPOWER_DIGITAL_ANALOG,
  190. INDEX_BUSPOWER_DIGITAL_DIF,
  191. INDEX_BUSPOWER_DIGITAL_ANALOG_EXTERNAL,
  192. INDEX_BUSPOWER_DIGITAL_DIF_EXTERNAL,
  193. };
  194. /***************************************************************************/
  195. struct cx231xx;
  196. u32 initialize_cx231xx(struct cx231xx *p_dev);
  197. #endif