3 #define DRXK_VERSION_MAJOR 0
4 #define DRXK_VERSION_MINOR 9
5 #define DRXK_VERSION_PATCH 4300
7 #define HI_I2C_DELAY 42
8 #define HI_I2C_BRIDGE_DELAY 350
9 #define DRXK_MAX_RETRIES 100
13 #define DRXX_JTAGID 0x039210D9
14 #define DRXX_J_JTAGID 0x239310D9
15 #define DRXX_K_JTAGID 0x039210D9
17 #define DRX_UNKNOWN 254
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
28 #ifndef DRXK_OFDM_TR_SHUTDOWN_TIMEOUT
29 #define DRXK_OFDM_TR_SHUTDOWN_TIMEOUT (200)
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*/
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
80 /** /brief Intermediate power mode for DRXK, power down OFDM clock domain */
81 #ifndef DRXK_POWER_DOWN_OFDM
82 #define DRXK_POWER_DOWN_OFDM DRX_POWER_MODE_1
85 /** /brief Intermediate power mode for DRXK, power down core (sysclk) */
86 #ifndef DRXK_POWER_DOWN_CORE
87 #define DRXK_POWER_DOWN_CORE DRX_POWER_MODE_9
90 /** /brief Intermediate power mode for DRXK, power down pll (only osc runs) */
91 #ifndef DRXK_POWER_DOWN_PLL
92 #define DRXK_POWER_DOWN_PLL DRX_POWER_MODE_10
96 enum agc_ctrl_mode { DRXK_AGC_CTRL_AUTO = 0, DRXK_AGC_CTRL_USER, DRXK_AGC_CTRL_OFF };
98 DRXK_UNINITIALIZED = 0,
103 DRXK_NO_DEV /* If drxk init failed */
106 enum e_drxk_coef_array_index {
107 DRXK_COEF_IDX_MN = 0,
116 enum e_drxk_sif_attenuation {
117 DRXK_SIF_ATTENUATION_0DB,
118 DRXK_SIF_ATTENUATION_3DB,
119 DRXK_SIF_ATTENUATION_6DB,
120 DRXK_SIF_ATTENUATION_9DB
122 enum e_drxk_constellation {
123 DRX_CONSTELLATION_BPSK = 0,
124 DRX_CONSTELLATION_QPSK,
125 DRX_CONSTELLATION_PSK8,
126 DRX_CONSTELLATION_QAM16,
127 DRX_CONSTELLATION_QAM32,
128 DRX_CONSTELLATION_QAM64,
129 DRX_CONSTELLATION_QAM128,
130 DRX_CONSTELLATION_QAM256,
131 DRX_CONSTELLATION_QAM512,
132 DRX_CONSTELLATION_QAM1024,
133 DRX_CONSTELLATION_UNKNOWN = DRX_UNKNOWN,
134 DRX_CONSTELLATION_AUTO = DRX_AUTO
136 enum e_drxk_interleave_mode {
137 DRXK_QAM_I12_J17 = 16,
138 DRXK_QAM_I_UNKNOWN = DRX_UNKNOWN
147 enum drxk_cfg_dvbt_sqi_speed {
148 DRXK_DVBT_SQI_SPEED_FAST = 0,
149 DRXK_DVBT_SQI_SPEED_MEDIUM,
150 DRXK_DVBT_SQI_SPEED_SLOW,
151 DRXK_DVBT_SQI_SPEED_UNKNOWN = DRX_UNKNOWN
158 DRX_FFTMODE_UNKNOWN = DRX_UNKNOWN,
159 DRX_FFTMODE_AUTO = DRX_AUTO
162 enum drxmpeg_str_width_t {
163 DRX_MPEG_STR_WIDTH_1,
167 enum drx_qam_lock_range_t {
168 DRX_QAM_LOCKRANGE_NORMAL,
169 DRX_QAM_LOCKRANGE_EXTENDED
172 struct drxk_cfg_dvbt_echo_thres_t {
174 enum drx_fftmode_t fft_mode;
178 enum agc_ctrl_mode ctrl_mode; /* off, user, auto */
179 u16 output_level; /* range dependent on AGC */
180 u16 min_output_level; /* range dependent on AGC */
181 u16 max_output_level; /* range dependent on AGC */
182 u16 speed; /* range dependent on AGC */
183 u16 top; /* rf-agc take over point */
184 u16 cut_off_current; /* rf-agc is accelerated if output current
185 is below cut-off current */
187 u16 fast_clip_ctrl_delay;
190 struct s_cfg_pre_saw {
191 u16 reference; /* pre SAW reference value, range 0 .. 31 */
192 bool use_pre_saw; /* TRUE algorithms must use pre SAW sense */
195 struct drxk_ofdm_sc_cmd_t {
196 u16 cmd; /**< Command number */
197 u16 subcmd; /**< Sub-command parameter*/
198 u16 param0; /**< General purpous param */
199 u16 param1; /**< General purpous param */
200 u16 param2; /**< General purpous param */
201 u16 param3; /**< General purpous param */
202 u16 param4; /**< General purpous param */
206 struct dvb_frontend frontend;
207 struct dtv_frontend_properties props;
210 struct i2c_adapter *i2c;
216 u32 m_instance; /**< Channel 1,2,3 or 4 */
227 bool m_has_sawsw; /* TRUE if mat_tx is available */
228 bool m_has_gpio1; /* TRUE if mat_rx is available */
229 bool m_has_gpio2; /* TRUE if GPIO is available */
230 bool m_has_irqn; /* TRUE if IRQN is available */
231 u16 m_osc_clock_freq;
232 u16 m_hi_cfg_timing_div;
233 u16 m_hi_cfg_bridge_delay;
234 u16 m_hi_cfg_wake_up_key;
235 u16 m_hi_cfg_timeout;
237 s32 m_sys_clock_freq; /**< system clock frequency in kHz */
239 enum e_drxk_state m_drxk_state; /**< State of Drxk (init,stopped,started) */
240 enum operation_mode m_operation_mode; /**< digital standards */
241 struct s_cfg_agc m_vsb_rf_agc_cfg; /**< settings for VSB RF-AGC */
242 struct s_cfg_agc m_vsb_if_agc_cfg; /**< settings for VSB IF-AGC */
243 u16 m_vsb_pga_cfg; /**< settings for VSB PGA */
244 struct s_cfg_pre_saw m_vsb_pre_saw_cfg; /**< settings for pre SAW sense */
245 s32 m_Quality83percent; /**< MER level (*0.1 dB) for 83% quality indication */
246 s32 m_Quality93percent; /**< MER level (*0.1 dB) for 93% quality indication */
247 bool m_smart_ant_inverted;
248 bool m_b_debug_enable_bridge;
249 bool m_b_p_down_open_bridge; /**< only open DRXK bridge before power-down once it has been accessed */
250 bool m_b_power_down; /**< Power down when not used */
252 u32 m_iqm_fs_rate_ofs; /**< frequency shift as written to DRXK register (28bit fixpoint) */
254 bool m_enable_mpeg_output; /**< If TRUE, enable MPEG output */
255 bool m_insert_rs_byte; /**< If TRUE, insert RS byte */
256 bool m_enable_parallel; /**< If TRUE, parallel out otherwise serial */
257 bool m_invert_data; /**< If TRUE, invert DATA signals */
258 bool m_invert_err; /**< If TRUE, invert ERR signal */
259 bool m_invert_str; /**< If TRUE, invert STR signals */
260 bool m_invert_val; /**< If TRUE, invert VAL signals */
261 bool m_invert_clk; /**< If TRUE, invert CLK signals */
262 bool m_dvbc_static_clk;
263 bool m_dvbt_static_clk; /**< If TRUE, static MPEG clockrate will
264 be used, otherwise clockrate will
265 adapt to the bitrate of the TS */
269 u8 m_ts_data_strength;
270 u8 m_ts_clockk_strength;
272 bool m_itut_annex_c; /* If true, uses ITU-T DVB-C Annex C, instead of Annex A */
274 enum drxmpeg_str_width_t m_width_str; /**< MPEG start width */
275 u32 m_mpeg_ts_static_bitrate; /**< Maximum bitrate in b/s in case
276 static clockrate is selected */
278 /* LARGE_INTEGER m_startTime; */ /**< Contains the time of the last demod start */
279 s32 m_mpeg_lock_time_out; /**< WaitForLockStatus Timeout (counts from start time) */
280 s32 m_demod_lock_time_out; /**< WaitForLockStatus Timeout (counts from start time) */
282 bool m_disable_te_ihandling;
287 struct s_cfg_agc m_atv_rf_agc_cfg; /**< settings for ATV RF-AGC */
288 struct s_cfg_agc m_atv_if_agc_cfg; /**< settings for ATV IF-AGC */
289 struct s_cfg_pre_saw m_atv_pre_saw_cfg; /**< settings for ATV pre SAW sense */
290 bool m_phase_correction_bypass;
291 s16 m_atv_top_vid_peak;
292 u16 m_atv_top_noise_th;
293 enum e_drxk_sif_attenuation m_sif_attenuation;
294 bool m_enable_cvbs_output;
295 bool m_enable_sif_output;
296 bool m_b_mirror_freq_spect;
297 enum e_drxk_constellation m_constellation; /**< constellation type of the channel */
298 u32 m_curr_symbol_rate; /**< Current QAM symbol rate */
299 struct s_cfg_agc m_qam_rf_agc_cfg; /**< settings for QAM RF-AGC */
300 struct s_cfg_agc m_qam_if_agc_cfg; /**< settings for QAM IF-AGC */
301 u16 m_qam_pga_cfg; /**< settings for QAM PGA */
302 struct s_cfg_pre_saw m_qam_pre_saw_cfg; /**< settings for QAM pre SAW sense */
303 enum e_drxk_interleave_mode m_qam_interleave_mode; /**< QAM Interleave mode */
305 u16 m_fec_rs_prescale;
307 enum drxk_cfg_dvbt_sqi_speed m_sqi_speed;
312 struct s_cfg_agc m_dvbt_rf_agc_cfg; /**< settings for QAM RF-AGC */
313 struct s_cfg_agc m_dvbt_if_agc_cfg; /**< settings for QAM IF-AGC */
314 struct s_cfg_pre_saw m_dvbt_pre_saw_cfg; /**< settings for QAM pre SAW sense */
316 u16 m_agcfast_clip_ctrl_delay;
317 bool m_adc_comp_passed;
318 u16 m_adcCompCoef[64];
322 int m_microcode_length;
323 bool m_drxk_a3_rom_code;
324 bool m_drxk_a3_patch_code;
330 enum drx_power_mode m_current_power_mode;
332 /* when true, avoids other devices to use the I2C bus */
333 bool drxk_i2c_exclusive_lock;
336 * Configurable parameters at the driver. They stores the values found
337 * at struct drxk_config.
340 u16 uio_mask; /* Bits used by UIO */
342 bool enable_merr_cfg;
348 fe_status_t fe_status;
351 const char *microcode_name;
352 struct completion fw_wait_load;
353 const struct firmware *fw;
354 int qam_demod_parameter_count;