2 * Driver for Zarlink DVB-T MT352 demodulator
4 * Written by Holger Waechtler <holger@qanu.de>
5 * and Daniel Mack <daniel@qanu.de>
7 * AVerMedia AVerTV DVB-T 771 support by
8 * Wolfram Joost <dbox2@frokaschwei.de>
10 * Support for Samsung TDTC9251DH01C(M) tuner
11 * Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it>
12 * Amauri Celani <acelani@essegi.net>
14 * DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by
15 * Christopher Pascoe <c.pascoe@itee.uq.edu.au>
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
36 #define I2C_MT352_ADDR 0x0f
39 #define CARD_AVDVBT771 0x00
40 #define CARD_TUA6034 0x01
41 #define CARD_TDTC9251DH01C 0x02
42 #define CARD_DVICODVBT1 0x03
43 #define CARD_DVICODVBTLITE 0x04
45 #define msb(x) (((x) >> 8) & 0xff)
46 #define lsb(x) ((x) & 0xff)
74 TIMING_OFFSET_1
= 0x1A,
75 TIMING_OFFSET_0
= 0x1B,
78 TPS_RECEIVED_1
= 0x1E,
79 TPS_RECEIVED_0
= 0x1F,
84 TPS_MISC_DATA_2
= 0x24,
85 TPS_MISC_DATA_1
= 0x25,
86 TPS_MISC_DATA_0
= 0x26,
91 TRL_NOMINAL_RATE_1
= 0x54,
92 TRL_NOMINAL_RATE_0
= 0x55,
103 INTERRUPT_EN_0
= 0x61,
104 INTERRUPT_EN_1
= 0x62,
105 INTERRUPT_EN_2
= 0x63,
106 INTERRUPT_EN_3
= 0x64,
119 FEC_LOCK_TIME
= 0x85,
120 OFDM_LOCK_TIME
= 0x86,
133 #define FE_NAME tuner_info[card_type].fe_name
135 __u32 fe_frequency_min
;
136 #define FE_FREQ_MIN tuner_info[card_type].fe_frequency_min
138 __u32 fe_frequency_max
;
139 #define FE_FREQ_MAX tuner_info[card_type].fe_frequency_max
141 __u32 fe_frequency_stepsize
; //verificare se u32 e' corretto
142 #define FE_FREQ_STEPSIZE tuner_info[card_type].fe_frequency_stepsize
145 #define PLL_I2C_ADDR tuner_info[card_type].pll_i2c_addr
147 int (* mt352_init
) (struct i2c_adapter
*i2c
);
148 #define MT352_INIT tuner_info[card_type].mt352_init
150 unsigned char (* mt352_charge_pump
) (u32 freq
);
151 #define MT352_CHARGE_PUMP tuner_info[card_type].mt352_charge_pump
153 unsigned char (* mt352_band_select
) (u32 freq
);
154 #define MT352_BAND_SELECT tuner_info[card_type].mt352_band_select
157 static int mt352_init_TUA6034(struct i2c_adapter
*i2c
);
158 static int mt352_init_AVERMEDIA771(struct i2c_adapter
*i2c
);
159 static int mt352_init_TDTC9251DH01C(struct i2c_adapter
*i2c
);
160 static int mt352_init_DVICODVBT1(struct i2c_adapter
*i2c
);
161 static int mt352_init_DVICODVBTLITE(struct i2c_adapter
*i2c
);
162 static unsigned char mt352_cp_TUA6034(u32 freq
);
163 static unsigned char mt352_cp_AVERMEDIA771(u32 freq
);
164 static unsigned char mt352_cp_TDTC9251DH01C(u32 freq
);
165 static unsigned char mt352_cp_DVICODVBT1(u32 freq
);
166 static unsigned char mt352_cp_DVICODVBTLITE(u32 freq
);
167 static unsigned char mt352_bs_TUA6034(u32 freq
);
168 static unsigned char mt352_bs_AVERMEDIA771(u32 freq
);
169 static unsigned char mt352_bs_TDTC9251DH01C(u32 freq
);
170 static unsigned char mt352_bs_DVICODVBT1(u32 freq
);
171 static unsigned char mt352_bs_DVICODVBTLITE(u32 freq
);
172 static u8
mt352_read_register(struct i2c_adapter
*i2c
, u8 reg
);