aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-simple.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@m1k.net>2006-01-09 12:25:38 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:38 -0500
commit90200d2b7f526128671a971ab29db38973bf3f51 (patch)
treea0ef256cec866e3570b2e398012e002baba226c4 /drivers/media/video/tuner-simple.c
parent21dcd8ccd76e80118f524b1a730c35ab1c46c09e (diff)
V4L/DVB (3239): reorganize tuner-simple threshold structure.
- Create an array containing frequency threshold and control byte. - allows for an arbitrary amount of frequency ranges to be set, like dvb-pll. - improves code readability. Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r--drivers/media/video/tuner-simple.c768
1 files changed, 417 insertions, 351 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 985464f4b7c2..e5fb74365836 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -79,17 +79,19 @@ MODULE_PARM_DESC(offset,"Allows to specify an offset for tuner");
79#define TUNER_PLL_LOCKED 0x40 79#define TUNER_PLL_LOCKED 0x40
80#define TUNER_STEREO_MK3 0x04 80#define TUNER_STEREO_MK3 0x04
81 81
82#define TUNER_MAX_RANGES 3
83
82/* ---------------------------------------------------------------------- */ 84/* ---------------------------------------------------------------------- */
83 85
84struct tunertype 86struct tunertype
85{ 87{
86 char *name; 88 char *name;
87 89
88 unsigned short thresh1; /* band switch VHF_LO <=> VHF_HI */ 90 int count;
89 unsigned short thresh2; /* band switch VHF_HI <=> UHF */ 91 struct {
90 unsigned char VHF_L; 92 unsigned short thresh;
91 unsigned char VHF_H; 93 unsigned char cb;
92 unsigned char UHF; 94 } ranges[TUNER_MAX_RANGES];
93 unsigned char config; 95 unsigned char config;
94}; 96};
95 97
@@ -102,305 +104,336 @@ static struct tunertype tuners[] = {
102 /* 0-9 */ 104 /* 0-9 */
103 [TUNER_TEMIC_PAL] = { /* TEMIC PAL */ 105 [TUNER_TEMIC_PAL] = { /* TEMIC PAL */
104 .name = "Temic PAL (4002 FH5)", 106 .name = "Temic PAL (4002 FH5)",
105 .thresh1= 16 * 140.25 /*MHz*/, 107 .count = 3,
106 .thresh2= 16 * 463.25 /*MHz*/, 108 .ranges = {
107 .VHF_L = 0x02, 109 { 16 * 140.25 /*MHz*/, 0x02, },
108 .VHF_H = 0x04, 110 { 16 * 463.25 /*MHz*/, 0x04, },
109 .UHF = 0x01, 111 { 16 * 999.99 , 0x01, },
112 },
110 .config = 0x8e, 113 .config = 0x8e,
111 }, 114 },
112 [TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */ 115 [TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */
113 .name = "Philips PAL_I (FI1246 and compatibles)", 116 .name = "Philips PAL_I (FI1246 and compatibles)",
114 .thresh1= 16 * 140.25 /*MHz*/, 117 .count = 3,
115 .thresh2= 16 * 463.25 /*MHz*/, 118 .ranges = {
116 .VHF_L = 0xa0, 119 { 16 * 140.25 /*MHz*/, 0xa0, },
117 .VHF_H = 0x90, 120 { 16 * 463.25 /*MHz*/, 0x90, },
118 .UHF = 0x30, 121 { 16 * 999.99 , 0x30, },
122 },
119 .config = 0x8e, 123 .config = 0x8e,
120 }, 124 },
121 [TUNER_PHILIPS_NTSC] = { /* Philips NTSC */ 125 [TUNER_PHILIPS_NTSC] = { /* Philips NTSC */
122 .name = "Philips NTSC (FI1236,FM1236 and compatibles)", 126 .name = "Philips NTSC (FI1236,FM1236 and compatibles)",
123 .thresh1= 16 * 157.25 /*MHz*/, 127 .count = 3,
124 .thresh2= 16 * 451.25 /*MHz*/, 128 .ranges = {
125 .VHF_L = 0xa0, 129 { 16 * 157.25 /*MHz*/, 0xa0, },
126 .VHF_H = 0x90, 130 { 16 * 451.25 /*MHz*/, 0x90, },
127 .UHF = 0x30, 131 { 16 * 999.99 , 0x30, },
132 },
128 .config = 0x8e, 133 .config = 0x8e,
129 }, 134 },
130 [TUNER_PHILIPS_SECAM] = { /* Philips SECAM */ 135 [TUNER_PHILIPS_SECAM] = { /* Philips SECAM */
131 .name = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)", 136 .name = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)",
132 .thresh1= 16 * 168.25 /*MHz*/, 137 .count = 3,
133 .thresh2= 16 * 447.25 /*MHz*/, 138 .ranges = {
134 .VHF_L = 0xa7, 139 { 16 * 168.25 /*MHz*/, 0xa7, },
135 .VHF_H = 0x97, 140 { 16 * 447.25 /*MHz*/, 0x97, },
136 .UHF = 0x37, 141 { 16 * 999.99 , 0x37, },
142 },
137 .config = 0x8e, 143 .config = 0x8e,
138 }, 144 },
139 [TUNER_ABSENT] = { /* Tuner Absent */ 145 [TUNER_ABSENT] = { /* Tuner Absent */
140 .name = "NoTuner", 146 .name = "NoTuner",
141 .thresh1= 0 /*MHz*/, 147 .count = 1,
142 .thresh2= 0 /*MHz*/, 148 .ranges = {
143 .VHF_L = 0x00, 149 { 0, 0x00, },
144 .VHF_H = 0x00, 150 },
145 .UHF = 0x00,
146 .config = 0x00, 151 .config = 0x00,
147 }, 152 },
148 [TUNER_PHILIPS_PAL] = { /* Philips PAL */ 153 [TUNER_PHILIPS_PAL] = { /* Philips PAL */
149 .name = "Philips PAL_BG (FI1216 and compatibles)", 154 .name = "Philips PAL_BG (FI1216 and compatibles)",
150 .thresh1= 16 * 168.25 /*MHz*/, 155 .count = 3,
151 .thresh2= 16 * 447.25 /*MHz*/, 156 .ranges = {
152 .VHF_L = 0xa0, 157 { 16 * 168.25 /*MHz*/, 0xa0, },
153 .VHF_H = 0x90, 158 { 16 * 447.25 /*MHz*/, 0x90, },
154 .UHF = 0x30, 159 { 16 * 999.99 , 0x30, },
160 },
155 .config = 0x8e, 161 .config = 0x8e,
156 }, 162 },
157 [TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */ 163 [TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */
158 .name = "Temic NTSC (4032 FY5)", 164 .name = "Temic NTSC (4032 FY5)",
159 .thresh1= 16 * 157.25 /*MHz*/, 165 .count = 3,
160 .thresh2= 16 * 463.25 /*MHz*/, 166 .ranges = {
161 .VHF_L = 0x02, 167 { 16 * 157.25 /*MHz*/, 0x02, },
162 .VHF_H = 0x04, 168 { 16 * 463.25 /*MHz*/, 0x04, },
163 .UHF = 0x01, 169 { 16 * 999.99 , 0x01, },
170 },
164 .config = 0x8e, 171 .config = 0x8e,
165 }, 172 },
166 [TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */ 173 [TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */
167 .name = "Temic PAL_I (4062 FY5)", 174 .name = "Temic PAL_I (4062 FY5)",
168 .thresh1= 16 * 170.00 /*MHz*/, 175 .count = 3,
169 .thresh2= 16 * 450.00 /*MHz*/, 176 .ranges = {
170 .VHF_L = 0x02, 177 { 16 * 170.00 /*MHz*/, 0x02, },
171 .VHF_H = 0x04, 178 { 16 * 450.00 /*MHz*/, 0x04, },
172 .UHF = 0x01, 179 { 16 * 999.99 , 0x01, },
180 },
173 .config = 0x8e, 181 .config = 0x8e,
174 }, 182 },
175 [TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */ 183 [TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */
176 .name = "Temic NTSC (4036 FY5)", 184 .name = "Temic NTSC (4036 FY5)",
177 .thresh1= 16 * 157.25 /*MHz*/, 185 .count = 3,
178 .thresh2= 16 * 463.25 /*MHz*/, 186 .ranges = {
179 .VHF_L = 0xa0, 187 { 16 * 157.25 /*MHz*/, 0xa0, },
180 .VHF_H = 0x90, 188 { 16 * 463.25 /*MHz*/, 0x90, },
181 .UHF = 0x30, 189 { 16 * 999.99 , 0x30, },
190 },
182 .config = 0x8e, 191 .config = 0x8e,
183 }, 192 },
184 [TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */ 193 [TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */
185 .name = "Alps HSBH1", 194 .name = "Alps HSBH1",
186 .thresh1= 16 * 137.25 /*MHz*/, 195 .count = 3,
187 .thresh2= 16 * 385.25 /*MHz*/, 196 .ranges = {
188 .VHF_L = 0x01, 197 { 16 * 137.25 /*MHz*/, 0x01, },
189 .VHF_H = 0x02, 198 { 16 * 385.25 /*MHz*/, 0x02, },
190 .UHF = 0x08, 199 { 16 * 999.99 , 0x08, },
200 },
191 .config = 0x8e, 201 .config = 0x8e,
192 }, 202 },
193 203
194 /* 10-19 */ 204 /* 10-19 */
195 [TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */ 205 [TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */
196 .name = "Alps TSBE1", 206 .name = "Alps TSBE1",
197 .thresh1= 16 * 137.25 /*MHz*/, 207 .count = 3,
198 .thresh2= 16 * 385.25 /*MHz*/, 208 .ranges = {
199 .VHF_L = 0x01, 209 { 16 * 137.25 /*MHz*/, 0x01, },
200 .VHF_H = 0x02, 210 { 16 * 385.25 /*MHz*/, 0x02, },
201 .UHF = 0x08, 211 { 16 * 999.99 , 0x08, },
212 },
202 .config = 0x8e, 213 .config = 0x8e,
203 }, 214 },
204 [TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */ 215 [TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */
205 .name = "Alps TSBB5", 216 .name = "Alps TSBB5",
206 .thresh1= 16 * 133.25 /*MHz*/, 217 .count = 3,
207 .thresh2= 16 * 351.25 /*MHz*/, 218 .ranges = {
208 .VHF_L = 0x01, 219 { 16 * 133.25 /*MHz*/, 0x01, },
209 .VHF_H = 0x02, 220 { 16 * 351.25 /*MHz*/, 0x02, },
210 .UHF = 0x08, 221 { 16 * 999.99 , 0x08, },
222 },
211 .config = 0x8e, 223 .config = 0x8e,
212 }, 224 },
213 [TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */ 225 [TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */
214 .name = "Alps TSBE5", 226 .name = "Alps TSBE5",
215 .thresh1= 16 * 133.25 /*MHz*/, 227 .count = 3,
216 .thresh2= 16 * 351.25 /*MHz*/, 228 .ranges = {
217 .VHF_L = 0x01, 229 { 16 * 133.25 /*MHz*/, 0x01, },
218 .VHF_H = 0x02, 230 { 16 * 351.25 /*MHz*/, 0x02, },
219 .UHF = 0x08, 231 { 16 * 999.99 , 0x08, },
232 },
220 .config = 0x8e, 233 .config = 0x8e,
221 }, 234 },
222 [TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */ 235 [TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */
223 .name = "Alps TSBC5", 236 .name = "Alps TSBC5",
224 .thresh1= 16 * 133.25 /*MHz*/, 237 .count = 3,
225 .thresh2= 16 * 351.25 /*MHz*/, 238 .ranges = {
226 .VHF_L = 0x01, 239 { 16 * 133.25 /*MHz*/, 0x01, },
227 .VHF_H = 0x02, 240 { 16 * 351.25 /*MHz*/, 0x02, },
228 .UHF = 0x08, 241 { 16 * 999.99 , 0x08, },
242 },
229 .config = 0x8e, 243 .config = 0x8e,
230 }, 244 },
231 [TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */ 245 [TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */
232 .name = "Temic PAL_BG (4006FH5)", 246 .name = "Temic PAL_BG (4006FH5)",
233 .thresh1= 16 * 170.00 /*MHz*/, 247 .count = 3,
234 .thresh2= 16 * 450.00 /*MHz*/, 248 .ranges = {
235 .VHF_L = 0xa0, 249 { 16 * 170.00 /*MHz*/, 0xa0, },
236 .VHF_H = 0x90, 250 { 16 * 450.00 /*MHz*/, 0x90, },
237 .UHF = 0x30, 251 { 16 * 999.99 , 0x30, },
252 },
238 .config = 0x8e, 253 .config = 0x8e,
239 }, 254 },
240 [TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */ 255 [TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */
241 .name = "Alps TSCH6", 256 .name = "Alps TSCH6",
242 .thresh1= 16 * 137.25 /*MHz*/, 257 .count = 3,
243 .thresh2= 16 * 385.25 /*MHz*/, 258 .ranges = {
244 .VHF_L = 0x14, 259 { 16 * 137.25 /*MHz*/, 0x14, },
245 .VHF_H = 0x12, 260 { 16 * 385.25 /*MHz*/, 0x12, },
246 .UHF = 0x11, 261 { 16 * 999.99 , 0x11, },
262 },
247 .config = 0x8e, 263 .config = 0x8e,
248 }, 264 },
249 [TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */ 265 [TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */
250 .name = "Temic PAL_DK (4016 FY5)", 266 .name = "Temic PAL_DK (4016 FY5)",
251 .thresh1= 16 * 168.25 /*MHz*/, 267 .count = 3,
252 .thresh2= 16 * 456.25 /*MHz*/, 268 .ranges = {
253 .VHF_L = 0xa0, 269 { 16 * 168.25 /*MHz*/, 0xa0, },
254 .VHF_H = 0x90, 270 { 16 * 456.25 /*MHz*/, 0x90, },
255 .UHF = 0x30, 271 { 16 * 999.99 , 0x30, },
272 },
256 .config = 0x8e, 273 .config = 0x8e,
257 }, 274 },
258 [TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */ 275 [TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */
259 .name = "Philips NTSC_M (MK2)", 276 .name = "Philips NTSC_M (MK2)",
260 .thresh1= 16 * 160.00 /*MHz*/, 277 .count = 3,
261 .thresh2= 16 * 454.00 /*MHz*/, 278 .ranges = {
262 .VHF_L = 0xa0, 279 { 16 * 160.00 /*MHz*/, 0xa0, },
263 .VHF_H = 0x90, 280 { 16 * 454.00 /*MHz*/, 0x90, },
264 .UHF = 0x30, 281 { 16 * 999.99 , 0x30, },
282 },
265 .config = 0x8e, 283 .config = 0x8e,
266 }, 284 },
267 [TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */ 285 [TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */
268 .name = "Temic PAL_I (4066 FY5)", 286 .name = "Temic PAL_I (4066 FY5)",
269 .thresh1= 16 * 169.00 /*MHz*/, 287 .count = 3,
270 .thresh2= 16 * 454.00 /*MHz*/, 288 .ranges = {
271 .VHF_L = 0xa0, 289 { 16 * 169.00 /*MHz*/, 0xa0, },
272 .VHF_H = 0x90, 290 { 16 * 454.00 /*MHz*/, 0x90, },
273 .UHF = 0x30, 291 { 16 * 999.99 , 0x30, },
292 },
274 .config = 0x8e, 293 .config = 0x8e,
275 }, 294 },
276 [TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */ 295 [TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */
277 .name = "Temic PAL* auto (4006 FN5)", 296 .name = "Temic PAL* auto (4006 FN5)",
278 .thresh1= 16 * 169.00 /*MHz*/, 297 .count = 3,
279 .thresh2= 16 * 454.00 /*MHz*/, 298 .ranges = {
280 .VHF_L = 0xa0, 299 { 16 * 169.00 /*MHz*/, 0xa0, },
281 .VHF_H = 0x90, 300 { 16 * 454.00 /*MHz*/, 0x90, },
282 .UHF = 0x30, 301 { 16 * 999.99 , 0x30, },
302 },
283 .config = 0x8e, 303 .config = 0x8e,
284 }, 304 },
285 305
286 /* 20-29 */ 306 /* 20-29 */
287 [TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */ 307 [TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */
288 .name = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", 308 .name = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)",
289 .thresh1= 16 * 141.00 /*MHz*/, 309 .count = 3,
290 .thresh2= 16 * 464.00 /*MHz*/, 310 .ranges = {
291 .VHF_L = 0xa0, 311 { 16 * 141.00 /*MHz*/, 0xa0, },
292 .VHF_H = 0x90, 312 { 16 * 464.00 /*MHz*/, 0x90, },
293 .UHF = 0x30, 313 { 16 * 999.99 , 0x30, },
314 },
294 .config = 0x8e, 315 .config = 0x8e,
295 }, 316 },
296 [TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */ 317 [TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */
297 .name = "Temic NTSC (4039 FR5)", 318 .name = "Temic NTSC (4039 FR5)",
298 .thresh1= 16 * 158.00 /*MHz*/, 319 .count = 3,
299 .thresh2= 16 * 453.00 /*MHz*/, 320 .ranges = {
300 .VHF_L = 0xa0, 321 { 16 * 158.00 /*MHz*/, 0xa0, },
301 .VHF_H = 0x90, 322 { 16 * 453.00 /*MHz*/, 0x90, },
302 .UHF = 0x30, 323 { 16 * 999.99 , 0x30, },
324 },
303 .config = 0x8e, 325 .config = 0x8e,
304 }, 326 },
305 [TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */ 327 [TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */
306 .name = "Temic PAL/SECAM multi (4046 FM5)", 328 .name = "Temic PAL/SECAM multi (4046 FM5)",
307 .thresh1= 16 * 169.00 /*MHz*/, 329 .count = 3,
308 .thresh2= 16 * 454.00 /*MHz*/, 330 .ranges = {
309 .VHF_L = 0xa0, 331 { 16 * 169.00 /*MHz*/, 0xa0, },
310 .VHF_H = 0x90, 332 { 16 * 454.00 /*MHz*/, 0x90, },
311 .UHF = 0x30, 333 { 16 * 999.99 , 0x30, },
334 },
312 .config = 0x8e, 335 .config = 0x8e,
313 }, 336 },
314 [TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */ 337 [TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */
315 .name = "Philips PAL_DK (FI1256 and compatibles)", 338 .name = "Philips PAL_DK (FI1256 and compatibles)",
316 .thresh1= 16 * 170.00 /*MHz*/, 339 .count = 3,
317 .thresh2= 16 * 450.00 /*MHz*/, 340 .ranges = {
318 .VHF_L = 0xa0, 341 { 16 * 170.00 /*MHz*/, 0xa0, },
319 .VHF_H = 0x90, 342 { 16 * 450.00 /*MHz*/, 0x90, },
320 .UHF = 0x30, 343 { 16 * 999.99 , 0x30, },
344 },
321 .config = 0x8e, 345 .config = 0x8e,
322 }, 346 },
323 [TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */ 347 [TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */
324 .name = "Philips PAL/SECAM multi (FQ1216ME)", 348 .name = "Philips PAL/SECAM multi (FQ1216ME)",
325 .thresh1= 16 * 170.00 /*MHz*/, 349 .count = 3,
326 .thresh2= 16 * 450.00 /*MHz*/, 350 .ranges = {
327 .VHF_L = 0xa0, 351 { 16 * 170.00 /*MHz*/, 0xa0, },
328 .VHF_H = 0x90, 352 { 16 * 450.00 /*MHz*/, 0x90, },
329 .UHF = 0x30, 353 { 16 * 999.99 , 0x30, },
354 },
330 .config = 0x8e, 355 .config = 0x8e,
331 }, 356 },
332 [TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */ 357 [TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */
333 .name = "LG PAL_I+FM (TAPC-I001D)", 358 .name = "LG PAL_I+FM (TAPC-I001D)",
334 .thresh1= 16 * 170.00 /*MHz*/, 359 .count = 3,
335 .thresh2= 16 * 450.00 /*MHz*/, 360 .ranges = {
336 .VHF_L = 0xa0, 361 { 16 * 170.00 /*MHz*/, 0xa0, },
337 .VHF_H = 0x90, 362 { 16 * 450.00 /*MHz*/, 0x90, },
338 .UHF = 0x30, 363 { 16 * 999.99 , 0x30, },
364 },
339 .config = 0x8e, 365 .config = 0x8e,
340 }, 366 },
341 [TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */ 367 [TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */
342 .name = "LG PAL_I (TAPC-I701D)", 368 .name = "LG PAL_I (TAPC-I701D)",
343 .thresh1= 16 * 170.00 /*MHz*/, 369 .count = 3,
344 .thresh2= 16 * 450.00 /*MHz*/, 370 .ranges = {
345 .VHF_L = 0xa0, 371 { 16 * 170.00 /*MHz*/, 0xa0, },
346 .VHF_H = 0x90, 372 { 16 * 450.00 /*MHz*/, 0x90, },
347 .UHF = 0x30, 373 { 16 * 999.99 , 0x30, },
374 },
348 .config = 0x8e, 375 .config = 0x8e,
349 }, 376 },
350 [TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */ 377 [TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */
351 .name = "LG NTSC+FM (TPI8NSR01F)", 378 .name = "LG NTSC+FM (TPI8NSR01F)",
352 .thresh1= 16 * 210.00 /*MHz*/, 379 .count = 3,
353 .thresh2= 16 * 497.00 /*MHz*/, 380 .ranges = {
354 .VHF_L = 0xa0, 381 { 16 * 210.00 /*MHz*/, 0xa0, },
355 .VHF_H = 0x90, 382 { 16 * 497.00 /*MHz*/, 0x90, },
356 .UHF = 0x30, 383 { 16 * 999.99 , 0x30, },
384 },
357 .config = 0x8e, 385 .config = 0x8e,
358 }, 386 },
359 [TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */ 387 [TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */
360 .name = "LG PAL_BG+FM (TPI8PSB01D)", 388 .name = "LG PAL_BG+FM (TPI8PSB01D)",
361 .thresh1= 16 * 170.00 /*MHz*/, 389 .count = 3,
362 .thresh2= 16 * 450.00 /*MHz*/, 390 .ranges = {
363 .VHF_L = 0xa0, 391 { 16 * 170.00 /*MHz*/, 0xa0, },
364 .VHF_H = 0x90, 392 { 16 * 450.00 /*MHz*/, 0x90, },
365 .UHF = 0x30, 393 { 16 * 999.99 , 0x30, },
394 },
366 .config = 0x8e, 395 .config = 0x8e,
367 }, 396 },
368 [TUNER_LG_PAL] = { /* LGINNOTEK PAL */ 397 [TUNER_LG_PAL] = { /* LGINNOTEK PAL */
369 .name = "LG PAL_BG (TPI8PSB11D)", 398 .name = "LG PAL_BG (TPI8PSB11D)",
370 .thresh1= 16 * 170.00 /*MHz*/, 399 .count = 3,
371 .thresh2= 16 * 450.00 /*MHz*/, 400 .ranges = {
372 .VHF_L = 0xa0, 401 { 16 * 170.00 /*MHz*/, 0xa0, },
373 .VHF_H = 0x90, 402 { 16 * 450.00 /*MHz*/, 0x90, },
374 .UHF = 0x30, 403 { 16 * 999.99 , 0x30, },
404 },
375 .config = 0x8e, 405 .config = 0x8e,
376 }, 406 },
377 407
378 /* 30-39 */ 408 /* 30-39 */
379 [TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */ 409 [TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */
380 .name = "Temic PAL* auto + FM (4009 FN5)", 410 .name = "Temic PAL* auto + FM (4009 FN5)",
381 .thresh1= 16 * 141.00 /*MHz*/, 411 .count = 3,
382 .thresh2= 16 * 464.00 /*MHz*/, 412 .ranges = {
383 .VHF_L = 0xa0, 413 { 16 * 141.00 /*MHz*/, 0xa0, },
384 .VHF_H = 0x90, 414 { 16 * 464.00 /*MHz*/, 0x90, },
385 .UHF = 0x30, 415 { 16 * 999.99 , 0x30, },
416 },
386 .config = 0x8e, 417 .config = 0x8e,
387 }, 418 },
388 [TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */ 419 [TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */
389 .name = "SHARP NTSC_JP (2U5JF5540)", 420 .name = "SHARP NTSC_JP (2U5JF5540)",
390 .thresh1= 16 * 137.25 /*MHz*/, 421 .count = 3,
391 .thresh2= 16 * 317.25 /*MHz*/, 422 .ranges = {
392 .VHF_L = 0x01, 423 { 16 * 137.25 /*MHz*/, 0x01, },
393 .VHF_H = 0x02, 424 { 16 * 317.25 /*MHz*/, 0x02, },
394 .UHF = 0x08, 425 { 16 * 999.99 , 0x08, },
426 },
395 .config = 0x8e, 427 .config = 0x8e,
396 }, 428 },
397 [TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */ 429 [TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */
398 .name = "Samsung PAL TCPM9091PD27", 430 .name = "Samsung PAL TCPM9091PD27",
399 .thresh1= 16 * 169 /*MHz*/, 431 .count = 3,
400 .thresh2= 16 * 464 /*MHz*/, 432 .ranges = {
401 .VHF_L = 0xa0, 433 { 16 * 169 /*MHz*/, 0xa0, },
402 .VHF_H = 0x90, 434 { 16 * 464 /*MHz*/, 0x90, },
403 .UHF = 0x30, 435 { 16 * 999.99 , 0x30, },
436 },
404 .config = 0x8e, 437 .config = 0x8e,
405 }, 438 },
406 [TUNER_MT2032] = { /* Microtune PAL|NTSC */ 439 [TUNER_MT2032] = { /* Microtune PAL|NTSC */
@@ -408,186 +441,206 @@ static struct tunertype tuners[] = {
408 /* see mt20xx.c for details */ }, 441 /* see mt20xx.c for details */ },
409 [TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */ 442 [TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */
410 .name = "Temic PAL_BG (4106 FH5)", 443 .name = "Temic PAL_BG (4106 FH5)",
411 .thresh1= 16 * 141.00 /*MHz*/, 444 .count = 3,
412 .thresh2= 16 * 464.00 /*MHz*/, 445 .ranges = {
413 .VHF_L = 0xa0, 446 { 16 * 141.00 /*MHz*/, 0xa0, },
414 .VHF_H = 0x90, 447 { 16 * 464.00 /*MHz*/, 0x90, },
415 .UHF = 0x30, 448 { 16 * 999.99 , 0x30, },
449 },
416 .config = 0x8e, 450 .config = 0x8e,
417 }, 451 },
418 [TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */ 452 [TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */
419 .name = "Temic PAL_DK/SECAM_L (4012 FY5)", 453 .name = "Temic PAL_DK/SECAM_L (4012 FY5)",
420 .thresh1= 16 * 140.25 /*MHz*/, 454 .count = 3,
421 .thresh2= 16 * 463.25 /*MHz*/, 455 .ranges = {
422 .VHF_L = 0x02, 456 { 16 * 140.25 /*MHz*/, 0x02, },
423 .VHF_H = 0x04, 457 { 16 * 463.25 /*MHz*/, 0x04, },
424 .UHF = 0x01, 458 { 16 * 999.99 , 0x01, },
459 },
425 .config = 0x8e, 460 .config = 0x8e,
426 }, 461 },
427 [TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */ 462 [TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */
428 .name = "Temic NTSC (4136 FY5)", 463 .name = "Temic NTSC (4136 FY5)",
429 .thresh1= 16 * 158.00 /*MHz*/, 464 .count = 3,
430 .thresh2= 16 * 453.00 /*MHz*/, 465 .ranges = {
431 .VHF_L = 0xa0, 466 { 16 * 158.00 /*MHz*/, 0xa0, },
432 .VHF_H = 0x90, 467 { 16 * 453.00 /*MHz*/, 0x90, },
433 .UHF = 0x30, 468 { 16 * 999.99 , 0x30, },
469 },
434 .config = 0x8e, 470 .config = 0x8e,
435 }, 471 },
436 [TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */ 472 [TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */
437 .name = "LG PAL (newer TAPC series)", 473 .name = "LG PAL (newer TAPC series)",
438 .thresh1= 16 * 170.00 /*MHz*/, 474 .count = 3,
439 .thresh2= 16 * 450.00 /*MHz*/, 475 .ranges = {
440 .VHF_L = 0x01, 476 { 16 * 170.00 /*MHz*/, 0x01, },
441 .VHF_H = 0x02, 477 { 16 * 450.00 /*MHz*/, 0x02, },
442 .UHF = 0x08, 478 { 16 * 999.99 , 0x08, },
479 },
443 .config = 0x8e, 480 .config = 0x8e,
444 }, 481 },
445 [TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */ 482 [TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */
446 .name = "Philips PAL/SECAM multi (FM1216ME MK3)", 483 .name = "Philips PAL/SECAM multi (FM1216ME MK3)",
447 .thresh1= 16 * 158.00 /*MHz*/, 484 .count = 3,
448 .thresh2= 16 * 442.00 /*MHz*/, 485 .ranges = {
449 .VHF_L = 0x01, 486 { 16 * 158.00 /*MHz*/, 0x01, },
450 .VHF_H = 0x02, 487 { 16 * 442.00 /*MHz*/, 0x02, },
451 .UHF = 0x04, 488 { 16 * 999.99 , 0x04, },
489 },
452 .config = 0x8e, 490 .config = 0x8e,
453 }, 491 },
454 [TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */ 492 [TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */
455 .name = "LG NTSC (newer TAPC series)", 493 .name = "LG NTSC (newer TAPC series)",
456 .thresh1= 16 * 170.00 /*MHz*/, 494 .count = 3,
457 .thresh2= 16 * 450.00 /*MHz*/, 495 .ranges = {
458 .VHF_L = 0x01, 496 { 16 * 170.00 /*MHz*/, 0x01, },
459 .VHF_H = 0x02, 497 { 16 * 450.00 /*MHz*/, 0x02, },
460 .UHF = 0x08, 498 { 16 * 999.99 , 0x08, },
499 },
461 .config = 0x8e, 500 .config = 0x8e,
462 }, 501 },
463 502
464 /* 40-49 */ 503 /* 40-49 */
465 [TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */ 504 [TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */
466 .name = "HITACHI V7-J180AT", 505 .name = "HITACHI V7-J180AT",
467 .thresh1= 16 * 170.00 /*MHz*/, 506 .count = 3,
468 .thresh2= 16 * 450.00 /*MHz*/, 507 .ranges = {
469 .VHF_L = 0x01, 508 { 16 * 170.00 /*MHz*/, 0x01, },
470 .VHF_H = 0x02, 509 { 16 * 450.00 /*MHz*/, 0x02, },
471 .UHF = 0x08, 510 { 16 * 999.99 , 0x08, },
511 },
472 .config = 0x8e, 512 .config = 0x8e,
473 }, 513 },
474 [TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */ 514 [TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */
475 .name = "Philips PAL_MK (FI1216 MK)", 515 .name = "Philips PAL_MK (FI1216 MK)",
476 .thresh1= 16 * 140.25 /*MHz*/, 516 .count = 3,
477 .thresh2= 16 * 463.25 /*MHz*/, 517 .ranges = {
478 .VHF_L = 0x01, 518 { 16 * 140.25 /*MHz*/, 0x01, },
479 .VHF_H = 0xc2, 519 { 16 * 463.25 /*MHz*/, 0xc2, },
480 .UHF = 0xcf, 520 { 16 * 999.99 , 0xcf, },
521 },
481 .config = 0x8e, 522 .config = 0x8e,
482 }, 523 },
483 [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */ 524 [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */
484 .name = "Philips 1236D ATSC/NTSC dual in", 525 .name = "Philips 1236D ATSC/NTSC dual in",
485 .thresh1= 16 * 157.25 /*MHz*/, 526 .count = 3,
486 .thresh2= 16 * 454.00 /*MHz*/, 527 .ranges = {
487 .VHF_L = 0xa0, 528 { 16 * 157.25 /*MHz*/, 0xa0, },
488 .VHF_H = 0x90, 529 { 16 * 454.00 /*MHz*/, 0x90, },
489 .UHF = 0x30, 530 { 16 * 999.99 , 0x30, },
531 },
490 .config = 0x8e, 532 .config = 0x8e,
491 }, 533 },
492 [TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */ 534 [TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */
493 .name = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", 535 .name = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)",
494 .thresh1= 16 * 160.00 /*MHz*/, 536 .count = 3,
495 .thresh2= 16 * 442.00 /*MHz*/, 537 .ranges = {
496 .VHF_L = 0x01, 538 { 16 * 160.00 /*MHz*/, 0x01, },
497 .VHF_H = 0x02, 539 { 16 * 442.00 /*MHz*/, 0x02, },
498 .UHF = 0x04, 540 { 16 * 999.99 , 0x04, },
541 },
499 .config = 0x8e, 542 .config = 0x8e,
500 }, 543 },
501 [TUNER_PHILIPS_4IN1] = { /* Philips NTSC */ 544 [TUNER_PHILIPS_4IN1] = { /* Philips NTSC */
502 .name = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", 545 .name = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)",
503 .thresh1= 16 * 160.00 /*MHz*/, 546 .count = 3,
504 .thresh2= 16 * 442.00 /*MHz*/, 547 .ranges = {
505 .VHF_L = 0x01, 548 { 16 * 160.00 /*MHz*/, 0x01, },
506 .VHF_H = 0x02, 549 { 16 * 442.00 /*MHz*/, 0x02, },
507 .UHF = 0x04, 550 { 16 * 999.99 , 0x04, },
551 },
508 .config = 0x8e, 552 .config = 0x8e,
509 }, 553 },
510 [TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */ 554 [TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */
511 .name = "Microtune 4049 FM5", 555 .name = "Microtune 4049 FM5",
512 .thresh1= 16 * 141.00 /*MHz*/, 556 .count = 3,
513 .thresh2= 16 * 464.00 /*MHz*/, 557 .ranges = {
514 .VHF_L = 0xa0, 558 { 16 * 141.00 /*MHz*/, 0xa0, },
515 .VHF_H = 0x90, 559 { 16 * 464.00 /*MHz*/, 0x90, },
516 .UHF = 0x30, 560 { 16 * 999.99 , 0x30, },
561 },
517 .config = 0x8e, 562 .config = 0x8e,
518 }, 563 },
519 [TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */ 564 [TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */
520 .name = "Panasonic VP27s/ENGE4324D", 565 .name = "Panasonic VP27s/ENGE4324D",
521 .thresh1= 16 * 160.00 /*MHz*/, 566 .count = 3,
522 .thresh2= 16 * 454.00 /*MHz*/, 567 .ranges = {
523 .VHF_L = 0x01, 568 { 16 * 160.00 /*MHz*/, 0x01, },
524 .VHF_H = 0x02, 569 { 16 * 454.00 /*MHz*/, 0x02, },
525 .UHF = 0x08, 570 { 16 * 999.99 , 0x08, },
571 },
526 .config = 0xce, 572 .config = 0xce,
527 }, 573 },
528 [TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */ 574 [TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */
529 .name = "LG NTSC (TAPE series)", 575 .name = "LG NTSC (TAPE series)",
530 .thresh1= 16 * 160.00 /*MHz*/, 576 .count = 3,
531 .thresh2= 16 * 442.00 /*MHz*/, 577 .ranges = {
532 .VHF_L = 0x01, 578 { 16 * 160.00 /*MHz*/, 0x01, },
533 .VHF_H = 0x02, 579 { 16 * 442.00 /*MHz*/, 0x02, },
534 .UHF = 0x04, 580 { 16 * 999.99 , 0x04, },
581 },
535 .config = 0x8e, 582 .config = 0x8e,
536 }, 583 },
537 [TUNER_TNF_8831BGFF] = { /* Philips PAL */ 584 [TUNER_TNF_8831BGFF] = { /* Philips PAL */
538 .name = "Tenna TNF 8831 BGFF)", 585 .name = "Tenna TNF 8831 BGFF)",
539 .thresh1= 16 * 161.25 /*MHz*/, 586 .count = 3,
540 .thresh2= 16 * 463.25 /*MHz*/, 587 .ranges = {
541 .VHF_L = 0xa0, 588 { 16 * 161.25 /*MHz*/, 0xa0, },
542 .VHF_H = 0x90, 589 { 16 * 463.25 /*MHz*/, 0x90, },
543 .UHF = 0x30, 590 { 16 * 999.99 , 0x30, },
591 },
544 .config = 0x8e, 592 .config = 0x8e,
545 }, 593 },
546 [TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */ 594 [TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */
547 .name = "Microtune 4042 FI5 ATSC/NTSC dual in", 595 .name = "Microtune 4042 FI5 ATSC/NTSC dual in",
548 .thresh1= 16 * 162.00 /*MHz*/, 596 .count = 3,
549 .thresh2= 16 * 457.00 /*MHz*/, 597 .ranges = {
550 .VHF_L = 0xa2, 598 { 16 * 162.00 /*MHz*/, 0xa2, },
551 .VHF_H = 0x94, 599 { 16 * 457.00 /*MHz*/, 0x94, },
552 .UHF = 0x31, 600 { 16 * 999.99 , 0x31, },
601 },
553 .config = 0x8e, 602 .config = 0x8e,
554 }, 603 },
555 604
556 /* 50-59 */ 605 /* 50-59 */
557 [TUNER_TCL_2002N] = { /* TCL NTSC */ 606 [TUNER_TCL_2002N] = { /* TCL NTSC */
558 .name = "TCL 2002N", 607 .name = "TCL 2002N",
559 .thresh1= 16 * 172.00 /*MHz*/, 608 .count = 3,
560 .thresh2= 16 * 448.00 /*MHz*/, 609 .ranges = {
561 .VHF_L = 0x01, 610 { 16 * 172.00 /*MHz*/, 0x01, },
562 .VHF_H = 0x02, 611 { 16 * 448.00 /*MHz*/, 0x02, },
563 .UHF = 0x08, 612 { 16 * 999.99 , 0x08, },
613 },
564 .config = 0x8e, 614 .config = 0x8e,
565 }, 615 },
566 [TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */ 616 [TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */
567 .name = "Philips PAL/SECAM_D (FM 1256 I-H3)", 617 .name = "Philips PAL/SECAM_D (FM 1256 I-H3)",
568 .thresh1= 16 * 160.00 /*MHz*/, 618 .count = 3,
569 .thresh2= 16 * 442.00 /*MHz*/, 619 .ranges = {
570 .VHF_L = 0x01, 620 { 16 * 160.00 /*MHz*/, 0x01, },
571 .VHF_H = 0x02, 621 { 16 * 442.00 /*MHz*/, 0x02, },
572 .UHF = 0x04, 622 { 16 * 999.99 , 0x04, },
623 },
573 .config = 0x8e, 624 .config = 0x8e,
574 }, 625 },
575 [TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */ 626 [TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */
576 .name = "Thomson DTT 7610 (ATSC/NTSC)", 627 .name = "Thomson DTT 7610 (ATSC/NTSC)",
577 .thresh1= 16 * 157.25 /*MHz*/, 628 .count = 3,
578 .thresh2= 16 * 454.00 /*MHz*/, 629 .ranges = {
579 .VHF_L = 0x39, 630 { 16 * 157.25 /*MHz*/, 0x39, },
580 .VHF_H = 0x3a, 631 { 16 * 454.00 /*MHz*/, 0x3a, },
581 .UHF = 0x3c, 632 { 16 * 999.99 , 0x3c, },
633 },
582 .config = 0x8e, 634 .config = 0x8e,
583 }, 635 },
584 [TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */ 636 [TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */
585 .name = "Philips FQ1286", 637 .name = "Philips FQ1286",
586 .thresh1= 16 * 160.00 /*MHz*/, 638 .count = 3,
587 .thresh2= 16 * 454.00 /*MHz*/, 639 .ranges = {
588 .VHF_L = 0x41, 640 { 16 * 160.00 /*MHz*/, 0x41, },
589 .VHF_H = 0x42, 641 { 16 * 454.00 /*MHz*/, 0x42, },
590 .UHF = 0x04, 642 { 16 * 999.99 , 0x04, },
643 },
591 .config = 0x8e, 644 .config = 0x8e,
592 }, 645 },
593 [TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */ 646 [TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */
@@ -595,47 +648,52 @@ static struct tunertype tuners[] = {
595 /* see tda8290.c for details */ }, 648 /* see tda8290.c for details */ },
596 [TUNER_TCL_2002MB] = { /* TCL PAL */ 649 [TUNER_TCL_2002MB] = { /* TCL PAL */
597 .name = "TCL 2002MB", 650 .name = "TCL 2002MB",
598 .thresh1= 16 * 170.00 /*MHz*/, 651 .count = 3,
599 .thresh2= 16 * 450.00 /*MHz*/, 652 .ranges = {
600 .VHF_L = 0x01, 653 { 16 * 170.00 /*MHz*/, 0x01, },
601 .VHF_H = 0x02, 654 { 16 * 450.00 /*MHz*/, 0x02, },
602 .UHF = 0x08, 655 { 16 * 999.99 , 0x08, },
656 },
603 .config = 0xce, 657 .config = 0xce,
604 }, 658 },
605 [TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */ 659 [TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */
606 .name = "Philips PAL/SECAM multi (FQ1216AME MK4)", 660 .name = "Philips PAL/SECAM multi (FQ1216AME MK4)",
607 .thresh1= 16 * 160.00 /*MHz*/, 661 .count = 3,
608 .thresh2= 16 * 442.00 /*MHz*/, 662 .ranges = {
609 .VHF_L = 0x01, 663 { 16 * 160.00 /*MHz*/, 0x01, },
610 .VHF_H = 0x02, 664 { 16 * 442.00 /*MHz*/, 0x02, },
611 .UHF = 0x04, 665 { 16 * 999.99 , 0x04, },
666 },
612 .config = 0xce, 667 .config = 0xce,
613 }, 668 },
614 [TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */ 669 [TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */
615 .name = "Philips FQ1236A MK4", 670 .name = "Philips FQ1236A MK4",
616 .thresh1= 16 * 160.00 /*MHz*/, 671 .count = 3,
617 .thresh2= 16 * 442.00 /*MHz*/, 672 .ranges = {
618 .VHF_L = 0x01, 673 { 16 * 160.00 /*MHz*/, 0x01, },
619 .VHF_H = 0x02, 674 { 16 * 442.00 /*MHz*/, 0x02, },
620 .UHF = 0x04, 675 { 16 * 999.99 , 0x04, },
676 },
621 .config = 0x8e, 677 .config = 0x8e,
622 }, 678 },
623 [TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */ 679 [TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */
624 .name = "Ymec TVision TVF-8531MF/8831MF/8731MF", 680 .name = "Ymec TVision TVF-8531MF/8831MF/8731MF",
625 .thresh1= 16 * 160.00 /*MHz*/, 681 .count = 3,
626 .thresh2= 16 * 454.00 /*MHz*/, 682 .ranges = {
627 .VHF_L = 0xa0, 683 { 16 * 160.00 /*MHz*/, 0xa0, },
628 .VHF_H = 0x90, 684 { 16 * 454.00 /*MHz*/, 0x90, },
629 .UHF = 0x30, 685 { 16 * 999.99 , 0x30, },
686 },
630 .config = 0x8e, 687 .config = 0x8e,
631 }, 688 },
632 [TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */ 689 [TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */
633 .name = "Ymec TVision TVF-5533MF", 690 .name = "Ymec TVision TVF-5533MF",
634 .thresh1= 16 * 160.00 /*MHz*/, 691 .count = 3,
635 .thresh2= 16 * 454.00 /*MHz*/, 692 .ranges = {
636 .VHF_L = 0x01, 693 { 16 * 160.00 /*MHz*/, 0x01, },
637 .VHF_H = 0x02, 694 { 16 * 454.00 /*MHz*/, 0x02, },
638 .UHF = 0x04, 695 { 16 * 999.99 , 0x04, },
696 },
639 .config = 0x8e, 697 .config = 0x8e,
640 }, 698 },
641 699
@@ -643,20 +701,22 @@ static struct tunertype tuners[] = {
643 [TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */ 701 [TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */
644 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ 702 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */
645 .name = "Thomson DTT 761X (ATSC/NTSC)", 703 .name = "Thomson DTT 761X (ATSC/NTSC)",
646 .thresh1= 16 * 145.25 /*MHz*/, 704 .count = 3,
647 .thresh2= 16 * 415.25 /*MHz*/, 705 .ranges = {
648 .VHF_L = 0x39, 706 { 16 * 145.25 /*MHz*/, 0x39, },
649 .VHF_H = 0x3a, 707 { 16 * 415.25 /*MHz*/, 0x3a, },
650 .UHF = 0x3c, 708 { 16 * 999.99 , 0x3c, },
709 },
651 .config = 0x8e, 710 .config = 0x8e,
652 }, 711 },
653 [TUNER_TENA_9533_DI] = { /* Philips PAL */ 712 [TUNER_TENA_9533_DI] = { /* Philips PAL */
654 .name = "Tena TNF9533-D/IF/TNF9533-B/DF", 713 .name = "Tena TNF9533-D/IF/TNF9533-B/DF",
655 .thresh1= 16 * 160.25 /*MHz*/, 714 .count = 3,
656 .thresh2= 16 * 464.25 /*MHz*/, 715 .ranges = {
657 .VHF_L = 0x01, 716 { 16 * 160.25 /*MHz*/, 0x01, },
658 .VHF_H = 0x02, 717 { 16 * 464.25 /*MHz*/, 0x02, },
659 .UHF = 0x04, 718 { 16 * 999.99 , 0x04, },
719 },
660 .config = 0x8e, 720 .config = 0x8e,
661 }, 721 },
662 [TUNER_TEA5767] = { /* Philips RADIO */ 722 [TUNER_TEA5767] = { /* Philips RADIO */
@@ -664,65 +724,72 @@ static struct tunertype tuners[] = {
664 /* see tea5767.c for details */}, 724 /* see tea5767.c for details */},
665 [TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */ 725 [TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */
666 .name = "Philips FMD1216ME MK3 Hybrid Tuner", 726 .name = "Philips FMD1216ME MK3 Hybrid Tuner",
667 .thresh1= 16 * 160.00 /*MHz*/, 727 .count = 3,
668 .thresh2= 16 * 442.00 /*MHz*/, 728 .ranges = {
669 .VHF_L = 0x51, 729 { 16 * 160.00 /*MHz*/, 0x51, },
670 .VHF_H = 0x52, 730 { 16 * 442.00 /*MHz*/, 0x52, },
671 .UHF = 0x54, 731 { 16 * 999.99 , 0x54, },
732 },
672 .config = 0x86, 733 .config = 0x86,
673 }, 734 },
674 [TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */ 735 [TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */
675 .name = "LG TDVS-H062F/TUA6034", 736 .name = "LG TDVS-H062F/TUA6034",
676 .thresh1= 16 * 160.00 /*MHz*/, 737 .count = 3,
677 .thresh2= 16 * 455.00 /*MHz*/, 738 .ranges = {
678 .VHF_L = 0x01, 739 { 16 * 160.00 /*MHz*/, 0x01 },
679 .VHF_H = 0x02, 740 { 16 * 455.00 /*MHz*/, 0x02 },
680 .UHF = 0x04, 741 { 16 * 999.99 , 0x04 },
742 },
681 .config = 0x8e, 743 .config = 0x8e,
682 }, 744 },
683 [TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */ 745 [TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */
684 .name = "Ymec TVF66T5-B/DFF", 746 .name = "Ymec TVF66T5-B/DFF",
685 .thresh1= 16 * 160.25 /*MHz*/, 747 .count = 3,
686 .thresh2= 16 * 464.25 /*MHz*/, 748 .ranges = {
687 .VHF_L = 0x01, 749 { 16 * 160.25 /*MHz*/, 0x01, },
688 .VHF_H = 0x02, 750 { 16 * 464.25 /*MHz*/, 0x02, },
689 .UHF = 0x08, 751 { 16 * 999.99 , 0x08, },
752 },
690 .config = 0x8e, 753 .config = 0x8e,
691 }, 754 },
692 [TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */ 755 [TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */
693 .name = "LG NTSC (TALN mini series)", 756 .name = "LG NTSC (TALN mini series)",
694 .thresh1= 16 * 137.25 /*MHz*/, 757 .count = 3,
695 .thresh2= 16 * 373.25 /*MHz*/, 758 .ranges = {
696 .VHF_L = 0x01, 759 { 16 * 137.25 /*MHz*/, 0x01, },
697 .VHF_H = 0x02, 760 { 16 * 373.25 /*MHz*/, 0x02, },
698 .UHF = 0x08, 761 { 16 * 999.99 , 0x08, },
762 },
699 .config = 0x8e, 763 .config = 0x8e,
700 }, 764 },
701 [TUNER_PHILIPS_TD1316] = { /* Philips PAL */ 765 [TUNER_PHILIPS_TD1316] = { /* Philips PAL */
702 .name = "Philips TD1316 Hybrid Tuner", 766 .name = "Philips TD1316 Hybrid Tuner",
703 .thresh1= 16 * 160.00 /*MHz*/, 767 .count = 3,
704 .thresh2= 16 * 442.00 /*MHz*/, 768 .ranges = {
705 .VHF_L = 0xa1, 769 { 16 * 160.00 /*MHz*/, 0xa1, },
706 .VHF_H = 0xa2, 770 { 16 * 442.00 /*MHz*/, 0xa2, },
707 .UHF = 0xa4, 771 { 16 * 999.99 , 0xa4, },
772 },
708 .config = 0xc8, 773 .config = 0xc8,
709 }, 774 },
710 [TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */ 775 [TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */
711 .name = "Philips TUV1236D ATSC/NTSC dual in", 776 .name = "Philips TUV1236D ATSC/NTSC dual in",
712 .thresh1= 16 * 157.25 /*MHz*/, 777 .count = 3,
713 .thresh2= 16 * 454.00 /*MHz*/, 778 .ranges = {
714 .VHF_L = 0x01, 779 { 16 * 157.25 /*MHz*/, 0x01, },
715 .VHF_H = 0x02, 780 { 16 * 454.00 /*MHz*/, 0x02, },
716 .UHF = 0x04, 781 { 16 * 999.99 , 0x04, },
782 },
717 .config = 0xce, 783 .config = 0xce,
718 }, 784 },
719 [TUNER_TNF_5335MF] = { /* Philips NTSC */ 785 [TUNER_TNF_5335MF] = { /* Philips NTSC */
720 .name = "Tena TNF 5335 MF", 786 .name = "Tena TNF 5335 MF",
721 .thresh1= 16 * 157.25 /*MHz*/, 787 .count = 3,
722 .thresh2= 16 * 454.00 /*MHz*/, 788 .ranges = {
723 .VHF_L = 0x01, 789 { 16 * 157.25 /*MHz*/, 0x01, },
724 .VHF_H = 0x02, 790 { 16 * 454.00 /*MHz*/, 0x02, },
725 .UHF = 0x04, 791 { 16 * 999.99 , 0x04, },
792 },
726 .config = 0x8e, 793 .config = 0x8e,
727 }, 794 },
728}; 795};
@@ -776,20 +843,19 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
776 u16 div; 843 u16 div;
777 struct tunertype *tun; 844 struct tunertype *tun;
778 unsigned char buffer[4]; 845 unsigned char buffer[4];
779 int rc, IFPCoff; 846 int rc, IFPCoff, i;
780 847
781 tun = &tuners[t->type]; 848 tun = &tuners[t->type];
782 if (freq < tun->thresh1) { 849 for (i = 0; i < tun->count; i++) {
783 config = tun->VHF_L; 850 if (freq > tun->ranges[i].thresh)
784 tuner_dbg("tv: VHF lowrange\n"); 851 continue;
785 } else if (freq < tun->thresh2) { 852 break;
786 config = tun->VHF_H;
787 tuner_dbg("tv: VHF high range\n");
788 } else {
789 config = tun->UHF;
790 tuner_dbg("tv: UHF range\n");
791 } 853 }
792 854 config = tun->ranges[i].cb;
855 /* i == 0 -> VHF_LO */
856 /* i == 1 -> VHF_HI */
857 /* i == 2 -> UHF */
858 tuner_dbg("tv: range %d\n",i);
793 859
794 /* tv norm specific stuff for multi-norm tuners */ 860 /* tv norm specific stuff for multi-norm tuners */
795 switch (t->type) { 861 switch (t->type) {