Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtl2832_priv.h
Go to the documentation of this file.
1 /*
2  * Realtek RTL2832 DVB-T demodulator driver
3  *
4  * Copyright (C) 2012 Thomas Mair <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef RTL2832_PRIV_H
22 #define RTL2832_PRIV_H
23 
24 #include "dvb_frontend.h"
25 #include "rtl2832.h"
26 
27 struct rtl2832_priv {
28  struct i2c_adapter *i2c;
29  struct dvb_frontend fe;
31 
33  bool sleeping;
34 
36  u8 page; /* active register page */
37 };
38 
44 };
45 
47  int reg;
49 };
50 
51 
52 /* Demod register bit names */
243 };
244 
245 static const struct rtl2832_reg_value rtl2832_tuner_init_tua9001[] = {
246  {DVBT_DAGC_TRG_VAL, 0x39},
247  {DVBT_AGC_TARG_VAL_0, 0x0},
248  {DVBT_AGC_TARG_VAL_8_1, 0x5a},
249  {DVBT_AAGC_LOOP_GAIN, 0x16},
250  {DVBT_LOOP_GAIN2_3_0, 0x6},
251  {DVBT_LOOP_GAIN2_4, 0x1},
252  {DVBT_LOOP_GAIN3, 0x16},
253  {DVBT_VTOP1, 0x35},
254  {DVBT_VTOP2, 0x21},
255  {DVBT_VTOP3, 0x21},
256  {DVBT_KRF1, 0x0},
257  {DVBT_KRF2, 0x40},
258  {DVBT_KRF3, 0x10},
259  {DVBT_KRF4, 0x10},
260  {DVBT_IF_AGC_MIN, 0x80},
261  {DVBT_IF_AGC_MAX, 0x7f},
262  {DVBT_RF_AGC_MIN, 0x9c},
263  {DVBT_RF_AGC_MAX, 0x7f},
264  {DVBT_POLAR_RF_AGC, 0x0},
265  {DVBT_POLAR_IF_AGC, 0x0},
266  {DVBT_AD7_SETTING, 0xe9f4},
267  {DVBT_OPT_ADC_IQ, 0x1},
268  {DVBT_AD_AVI, 0x0},
269  {DVBT_AD_AVQ, 0x0},
270 };
271 
272 static const struct rtl2832_reg_value rtl2832_tuner_init_fc0012[] = {
273  {DVBT_DAGC_TRG_VAL, 0x5a},
274  {DVBT_AGC_TARG_VAL_0, 0x0},
275  {DVBT_AGC_TARG_VAL_8_1, 0x5a},
276  {DVBT_AAGC_LOOP_GAIN, 0x16},
277  {DVBT_LOOP_GAIN2_3_0, 0x6},
278  {DVBT_LOOP_GAIN2_4, 0x1},
279  {DVBT_LOOP_GAIN3, 0x16},
280  {DVBT_VTOP1, 0x35},
281  {DVBT_VTOP2, 0x21},
282  {DVBT_VTOP3, 0x21},
283  {DVBT_KRF1, 0x0},
284  {DVBT_KRF2, 0x40},
285  {DVBT_KRF3, 0x10},
286  {DVBT_KRF4, 0x10},
287  {DVBT_IF_AGC_MIN, 0x80},
288  {DVBT_IF_AGC_MAX, 0x7f},
289  {DVBT_RF_AGC_MIN, 0x80},
290  {DVBT_RF_AGC_MAX, 0x7f},
291  {DVBT_POLAR_RF_AGC, 0x0},
292  {DVBT_POLAR_IF_AGC, 0x0},
293  {DVBT_AD7_SETTING, 0xe9bf},
294  {DVBT_EN_GI_PGA, 0x0},
295  {DVBT_THD_LOCK_UP, 0x0},
296  {DVBT_THD_LOCK_DW, 0x0},
297  {DVBT_THD_UP1, 0x11},
298  {DVBT_THD_DW1, 0xef},
299  {DVBT_INTER_CNT_LEN, 0xc},
300  {DVBT_GI_PGA_STATE, 0x0},
301  {DVBT_EN_AGC_PGA, 0x1},
302  {DVBT_IF_AGC_MAN, 0x0},
303 };
304 
305 static const struct rtl2832_reg_value rtl2832_tuner_init_e4000[] = {
306  {DVBT_DAGC_TRG_VAL, 0x5a},
307  {DVBT_AGC_TARG_VAL_0, 0x0},
308  {DVBT_AGC_TARG_VAL_8_1, 0x5a},
309  {DVBT_AAGC_LOOP_GAIN, 0x18},
310  {DVBT_LOOP_GAIN2_3_0, 0x8},
311  {DVBT_LOOP_GAIN2_4, 0x1},
312  {DVBT_LOOP_GAIN3, 0x18},
313  {DVBT_VTOP1, 0x35},
314  {DVBT_VTOP2, 0x21},
315  {DVBT_VTOP3, 0x21},
316  {DVBT_KRF1, 0x0},
317  {DVBT_KRF2, 0x40},
318  {DVBT_KRF3, 0x10},
319  {DVBT_KRF4, 0x10},
320  {DVBT_IF_AGC_MIN, 0x80},
321  {DVBT_IF_AGC_MAX, 0x7f},
322  {DVBT_RF_AGC_MIN, 0x80},
323  {DVBT_RF_AGC_MAX, 0x7f},
324  {DVBT_POLAR_RF_AGC, 0x0},
325  {DVBT_POLAR_IF_AGC, 0x0},
326  {DVBT_AD7_SETTING, 0xe9d4},
327  {DVBT_EN_GI_PGA, 0x0},
328  {DVBT_THD_LOCK_UP, 0x0},
329  {DVBT_THD_LOCK_DW, 0x0},
330  {DVBT_THD_UP1, 0x14},
331  {DVBT_THD_DW1, 0xec},
332  {DVBT_INTER_CNT_LEN, 0xc},
333  {DVBT_GI_PGA_STATE, 0x0},
334  {DVBT_EN_AGC_PGA, 0x1},
335  {DVBT_REG_GPE, 0x1},
336  {DVBT_REG_GPO, 0x1},
337  {DVBT_REG_MONSEL, 0x1},
338  {DVBT_REG_MON, 0x1},
339  {DVBT_REG_4MSEL, 0x0},
340 };
341 
342 #endif /* RTL2832_PRIV_H */