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