Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drxk_hard.h
Go to the documentation of this file.
1 #include "drxk_map.h"
2 
3 #define DRXK_VERSION_MAJOR 0
4 #define DRXK_VERSION_MINOR 9
5 #define DRXK_VERSION_PATCH 4300
6 
7 #define HI_I2C_DELAY 42
8 #define HI_I2C_BRIDGE_DELAY 350
9 #define DRXK_MAX_RETRIES 100
10 
11 #define DRIVER_4400 1
12 
13 #define DRXX_JTAGID 0x039210D9
14 #define DRXX_J_JTAGID 0x239310D9
15 #define DRXX_K_JTAGID 0x039210D9
16 
17 #define DRX_UNKNOWN 254
18 #define DRX_AUTO 255
19 
20 #define DRX_SCU_READY 0
21 #define DRXK_MAX_WAITTIME (200)
22 #define SCU_RESULT_OK 0
23 #define SCU_RESULT_SIZE -4
24 #define SCU_RESULT_INVPAR -3
25 #define SCU_RESULT_UNKSTD -2
26 #define SCU_RESULT_UNKCMD -1
27 
28 #ifndef DRXK_OFDM_TR_SHUTDOWN_TIMEOUT
29 #define DRXK_OFDM_TR_SHUTDOWN_TIMEOUT (200)
30 #endif
31 
32 #define DRXK_8VSB_MPEG_BIT_RATE 19392658UL /*bps*/
33 #define DRXK_DVBT_MPEG_BIT_RATE 32000000UL /*bps*/
34 #define DRXK_QAM16_MPEG_BIT_RATE 27000000UL /*bps*/
35 #define DRXK_QAM32_MPEG_BIT_RATE 33000000UL /*bps*/
36 #define DRXK_QAM64_MPEG_BIT_RATE 40000000UL /*bps*/
37 #define DRXK_QAM128_MPEG_BIT_RATE 46000000UL /*bps*/
38 #define DRXK_QAM256_MPEG_BIT_RATE 52000000UL /*bps*/
39 #define DRXK_MAX_MPEG_BIT_RATE 52000000UL /*bps*/
40 
41 #define IQM_CF_OUT_ENA_OFDM__M 0x4
42 #define IQM_FS_ADJ_SEL_B_QAM 0x1
43 #define IQM_FS_ADJ_SEL_B_OFF 0x0
44 #define IQM_FS_ADJ_SEL_B_VSB 0x2
45 #define IQM_RC_ADJ_SEL_B_OFF 0x0
46 #define IQM_RC_ADJ_SEL_B_QAM 0x1
47 #define IQM_RC_ADJ_SEL_B_VSB 0x2
48 
55 };
56 
67 
77 };
78 
79 
81 #ifndef DRXK_POWER_DOWN_OFDM
82 #define DRXK_POWER_DOWN_OFDM DRX_POWER_MODE_1
83 #endif
84 
86 #ifndef DRXK_POWER_DOWN_CORE
87 #define DRXK_POWER_DOWN_CORE DRX_POWER_MODE_9
88 #endif
89 
91 #ifndef DRXK_POWER_DOWN_PLL
92 #define DRXK_POWER_DOWN_PLL DRX_POWER_MODE_10
93 #endif
94 
95 
97 enum EDrxkState {
103  DRXK_NO_DEV /* If drxk init failed */
104 };
105 
115 };
121 };
135 };
139 };
140 enum {
145 };
146 
152 } ;
153 
160 };
161 
165 };
166 
170 };
171 
175 } ;
176 
177 struct SCfgAgc {
178  enum AGC_CTRL_MODE ctrlMode; /* off, user, auto */
179  u16 outputLevel; /* range dependent on AGC */
180  u16 minOutputLevel; /* range dependent on AGC */
181  u16 maxOutputLevel; /* range dependent on AGC */
182  u16 speed; /* range dependent on AGC */
183  u16 top; /* rf-agc take over point */
184  u16 cutOffCurrent; /* rf-agc is accelerated if output current
185  is below cut-off current */
188 };
189 
190 struct SCfgPreSaw {
191  u16 reference; /* pre SAW reference value, range 0 .. 31 */
192  bool usePreSaw; /* TRUE algorithms must use pre SAW sense */
193 };
194 
203 };
204 
205 struct drxk_state {
208  struct device *dev;
209 
210  struct i2c_adapter *i2c;
212  void *priv;
213 
214  struct mutex mutex;
215 
219  u8 Chunk[256];
220 
221  bool m_hasLNA;
222  bool m_hasDVBT;
223  bool m_hasDVBC;
225  bool m_hasATV;
226  bool m_hasOOB;
227  bool m_hasSAWSW;
228  bool m_hasGPIO1;
229  bool m_hasGPIO2;
230  bool m_hasIRQN;
258  bool m_invertERR;
259  bool m_invertSTR;
260  bool m_invertVAL;
261  bool m_invertCLK;
268 
271 
272  bool m_itut_annex_c; /* If true, uses ITU-T DVB-C Annex C, instead of Annex A */
273 
278  /* LARGE_INTEGER m_StartTime; */
283 
286 
306 
308 
311 
320 
329 
333 
335 
336  /* when true, avoids other devices to use the I2C bus */
338 
339  /*
340  * Configurable parameters at the driver. They stores the values found
341  * at struct drxk_config.
342  */
343 
344  u16 UIO_mask; /* Bits used by UIO */
345 
351 
352  /* Firmware */
353  const char *microcode_name;
355  const struct firmware *fw;
357 };
358 
359 #define NEVER_LOCK 0
360 #define NOT_LOCKED 1
361 #define DEMOD_LOCK 2
362 #define FEC_LOCK 3
363 #define MPEG_LOCK 4
364