bktr_card.c revision 1.5 1 /* $NetBSD: bktr_card.c,v 1.5 2000/05/21 15:43:57 wiz Exp $ */
2
3 /* FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.9 2000/02/12 08:49:21 peter Exp */
4
5 /*
6 * This is part of the Driver for Video Capture Cards (Frame grabbers)
7 * and TV Tuner cards using the Brooktree Bt848, Bt848A, Bt849A, Bt878, Bt879
8 * chipset.
9 * Copyright Roger Hardiman and Amancio Hasty.
10 *
11 * bktr_card : This deals with identifying TV cards.
12 * trying to find the card make and model of card.
13 * trying to find the type of tuner fitted.
14 * reading the configuration EEPROM.
15 * locating i2c devices.
16 *
17 */
18
19 /*
20 * 1. Redistributions of source code must retain the
21 * Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
22 * All rights reserved.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 * 1. Redistributions of source code must retain the above copyright
28 * notice, this list of conditions and the following disclaimer.
29 * 2. Redistributions in binary form must reproduce the above copyright
30 * notice, this list of conditions and the following disclaimer in the
31 * documentation and/or other materials provided with the distribution.
32 * 3. All advertising materials mentioning features or use of this software
33 * must display the following acknowledgement:
34 * This product includes software developed by Amancio Hasty and
35 * Roger Hardiman
36 * 4. The name of the author may not be used to endorse or promote products
37 * derived from this software without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
40 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
41 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
43 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
44 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
48 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 * POSSIBILITY OF SUCH DAMAGE.
50 */
51
52 #include "opt_bktr.h" /* Include any kernel config options */
53
54 #include <sys/param.h>
55 #include <sys/systm.h>
56 #include <sys/vnode.h>
57
58 #ifdef __FreeBSD__
59 #include <machine/clock.h> /* for DELAY */
60 #include <pci/pcivar.h>
61
62 #if (__FreeBSD_version >=300000)
63 #include <machine/bus_memio.h> /* for bus space */
64 #include <machine/bus.h>
65 #include <sys/bus.h>
66 #endif
67 #endif
68
69 #ifdef __NetBSD__
70 #include <dev/ic/bt8xx.h> /* NetBSD location for .h files */
71 #include <dev/pci/bktr/bktr_reg.h>
72 #include <dev/pci/bktr/bktr_core.h>
73 #include <dev/pci/bktr/bktr_tuner.h>
74 #include <dev/pci/bktr/bktr_card.h>
75 #include <dev/pci/bktr/bktr_audio.h>
76 #else
77 #include <machine/ioctl_meteor.h> /* Traditional location for .h files */
78 #include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
79 #include <dev/bktr/bktr_reg.h>
80 #include <dev/bktr/bktr_core.h>
81 #include <dev/bktr/bktr_tuner.h>
82 #include <dev/bktr/bktr_card.h>
83 #include <dev/bktr/bktr_audio.h>
84 #endif
85
86 /* Various defines */
87 #define HAUP_REMOTE_INT_WADDR 0x30
88 #define HAUP_REMOTE_INT_RADDR 0x31
89
90 #define HAUP_REMOTE_EXT_WADDR 0x34
91 #define HAUP_REMOTE_EXT_RADDR 0x35
92
93 /* address of BTSC/SAP decoder chip */
94 #define TDA9850_WADDR 0xb6
95 #define TDA9850_RADDR 0xb7
96
97 /* address of MSP3400C chip */
98 #define MSP3400C_WADDR 0x80
99 #define MSP3400C_RADDR 0x81
100
101 /* address of DPL3518A chip */
102 #define DPL3518A_WADDR 0x84
103 #define DPL3518A_RADDR 0x85
104
105 /* EEProm (128 * 8) on an STB card */
106 #define X24C01_WADDR 0xae
107 #define X24C01_RADDR 0xaf
108
109
110 /* EEProm (256 * 8) on a Hauppauge card */
111 /* and on most BT878s cards to store the sub-system vendor id */
112 #define PFC8582_WADDR 0xa0
113 #define PFC8582_RADDR 0xa1
114
115 #if BKTR_SYSTEM_DEFAULT == BROOKTREE_PAL
116 #define DEFAULT_TUNER PHILIPS_PALI
117 #else
118 #define DEFAULT_TUNER PHILIPS_NTSC
119 #endif
120
121
122
123
124 /*
125 * the data for each type of card
126 *
127 * Note:
128 * these entried MUST be kept in the order defined by the CARD_XXX defines!
129 */
130 static const struct CARDTYPE cards[] = {
131
132 { CARD_UNKNOWN, /* the card id */
133 "Unknown", /* the 'name' */
134 NULL, /* the tuner */
135 0, /* the tuner i2c address */
136 0, /* dbx unknown */
137 0,
138 0,
139 0, /* EEProm unknown */
140 0, /* EEProm unknown */
141 { 0, 0, 0, 0, 0 },
142 0 }, /* GPIO mask */
143
144 { CARD_MIRO, /* the card id */
145 "Miro TV", /* the 'name' */
146 NULL, /* the tuner */
147 0, /* the tuner i2c address */
148 0, /* dbx unknown */
149 0,
150 0,
151 0, /* EEProm unknown */
152 0, /* size unknown */
153 { 0x02, 0x01, 0x00, 0x0a, 1 }, /* audio MUX values */
154 0x0f }, /* GPIO mask */
155
156 { CARD_HAUPPAUGE, /* the card id */
157 "Hauppauge WinCast/TV", /* the 'name' */
158 NULL, /* the tuner */
159 0, /* the tuner i2c address */
160 0, /* dbx is optional */
161 0,
162 0,
163 PFC8582_WADDR, /* EEProm type */
164 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */
165 { 0x00, 0x02, 0x01, 0x04, 1 }, /* audio MUX values */
166 0x0f }, /* GPIO mask */
167
168 { CARD_STB, /* the card id */
169 "STB TV/PCI", /* the 'name' */
170 NULL, /* the tuner */
171 0, /* the tuner i2c address */
172 0, /* dbx is optional */
173 0,
174 0,
175 X24C01_WADDR, /* EEProm type */
176 (u_char)(128 / EEPROMBLOCKSIZE), /* 128 bytes */
177 { 0x00, 0x01, 0x02, 0x02, 1 }, /* audio MUX values */
178 0x0f }, /* GPIO mask */
179
180 { CARD_INTEL, /* the card id */
181 "Intel Smart Video III/VideoLogic Captivator PCI", /* the 'name' */
182 NULL, /* the tuner */
183 0, /* the tuner i2c address */
184 0,
185 0,
186 0,
187 0,
188 0,
189 { 0, 0, 0, 0, 0 }, /* audio MUX values */
190 0x00 }, /* GPIO mask */
191
192 { CARD_IMS_TURBO, /* the card id */
193 "IMS TV Turbo", /* the 'name' */
194 NULL, /* the tuner */
195 0, /* the tuner i2c address */
196 0, /* dbx is optional */
197 0,
198 0,
199 PFC8582_WADDR, /* EEProm type */
200 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */
201 { 0x01, 0x02, 0x01, 0x00, 1 }, /* audio MUX values */
202 0x0f }, /* GPIO mask */
203
204 { CARD_AVER_MEDIA, /* the card id */
205 "AVer Media TV/FM", /* the 'name' */
206 NULL, /* the tuner */
207 0, /* the tuner i2c address */
208 0, /* dbx is optional */
209 0,
210 0,
211 0, /* EEProm type */
212 0, /* EEProm size */
213 { 0x0c, 0x08, 0x04, 0x00, 1 }, /* audio MUX values */
214 0x1f }, /* GPIO mask */
215
216 { CARD_OSPREY, /* the card id */
217 "MMAC Osprey", /* the 'name' */
218 NULL, /* the tuner */
219 0, /* the tuner i2c address */
220 0, /* dbx is optional */
221 0,
222 0,
223 PFC8582_WADDR, /* EEProm type */
224 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */
225 { 0x00, 0x00, 0x00, 0x00, 0 }, /* audio MUX values */
226 0 }, /* GPIO mask */
227
228 { CARD_NEC_PK, /* the card id */
229 "NEC PK-UG-X017", /* the 'name' */
230 NULL, /* the tuner */
231 0, /* the tuner i2c address */
232 0, /* dbx is optional */
233 0,
234 0,
235 0, /* EEProm type */
236 0, /* EEProm size */
237 { 0x01, 0x02, 0x01, 0x00, 1 }, /* audio MUX values */
238 0x0f }, /* GPIO mask */
239
240 { CARD_IO_GV, /* the card id */
241 "I/O DATA GV-BCTV2/PCI", /* the 'name' */
242 NULL, /* the tuner */
243 0, /* the tuner i2c address */
244 0, /* dbx is optional */
245 0,
246 0,
247 0, /* EEProm type */
248 0, /* EEProm size */
249 { 0x00, 0x00, 0x00, 0x00, 1 }, /* Has special MUX handler */
250 0x0f }, /* GPIO mask */
251
252 { CARD_FLYVIDEO, /* the card id */
253 "FlyVideo", /* the 'name' */
254 NULL, /* the tuner */
255 0, /* the tuner i2c address */
256 0, /* dbx is optional */
257 0, /* msp34xx is optional */
258 0, /* dpl3518a is optional */
259 0xac, /* EEProm type */
260 (u_char)(256 / EEPROMBLOCKSIZE), /* 256 bytes */
261 { 0x000, 0x800, 0x400, 0x8dff00, 1 },/* audio MUX values */
262 0x8dff00 }, /* GPIO mask */
263
264 { CARD_ZOLTRIX, /* the card id */
265 "Zoltrix", /* the 'name' */
266 NULL, /* the tuner */
267 0, /* the tuner i2c address */
268 0, /* dbx is optional */
269 0, /* msp34xx is optional */
270 0, /* dpl3518a is optional */
271 0, /* EEProm type */
272 0, /* EEProm size */
273 { 0x04, 0x01, 0x00, 0x0a, 1 }, /* audio MUX values */
274 0x0f }, /* GPIO mask */
275
276 { CARD_KISS, /* the card id */
277 "KISS TV/FM PCI", /* the 'name' */
278 NULL, /* the tuner */
279 0, /* the tuner i2c address */
280 0, /* dbx is optional */
281 0, /* msp34xx is optional */
282 0, /* dpl3518a is optional */
283 0, /* EEProm type */
284 0, /* EEProm size */
285 { 0x0c, 0x00, 0x0b, 0x0b, 1 }, /* audio MUX values */
286 0x0f }, /* GPIO mask */
287
288 { CARD_VIDEO_HIGHWAY_XTREME, /* the card id */
289 "Video Highway Xtreme", /* the 'name' */
290 NULL, /* the tuner */
291 0,
292 0,
293 0,
294 0,
295 0, /* EEProm type */
296 0, /* EEProm size */
297 { 0x00, 0x02, 0x01, 0x04, 1 }, /* audio MUX values */
298 0x0f }, /* GPIO mask */
299
300 { CARD_ASKEY_DYNALINK_MAGIC_TVIEW, /* the card id */
301 "Askey/Dynalink Magic TView", /* the 'name' */
302 NULL, /* the tuner */
303 0,
304 0,
305 0,
306 0,
307 0, /* EEProm type */
308 0, /* EEProm size */
309 { 0x400, 0xE00, 0x400, 0xC00, 1 }, /* audio MUX values */
310 0xE00 }, /* GPIO mask */
311
312 { CARD_LEADTEK, /* the card id */
313 "Leadtek Winfast TV 2000", /* the 'name' */
314 NULL, /* the tuner */
315 0,
316 0,
317 0,
318 0,
319 0, /* EEProm type */
320 0, /* EEProm size */
321 /* Tuner, Extern, Intern, Mute, Enabled */
322 { 0x621000, 0x621000, 0x621000, 0xE21000, 1 }, /* audio MUX values */
323 0xfff000 }, /* GPIO mask */
324
325 { CARD_TERRATVPLUS, /* the card id */
326 "TerraTVplus", /* the 'name' */
327 NULL, /* the tuner */
328 0,
329 0,
330 0,
331 0,
332 0, /* EEProm type */
333 0, /* EEProm size */
334 { 0x20000, 0x00000, 0x30000, 0x40000, 1 }, /* audio MUX values*/
335 0x70000 }, /* GPIO mask */
336
337 };
338
339 struct bt848_card_sig bt848_card_signature[1]= {
340 /* IMS TURBO TV : card 5 */
341 { 5,9, {00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 02, 00, 00, 00}}
342
343
344 };
345
346
347 /*
348 * Write to the configuration EEPROM on the card.
349 * This is dangerous and will mess up your card. Therefore it is not
350 * implemented.
351 */
352 int
353 writeEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
354 {
355 return( -1 );
356 }
357
358 /*
359 * Read the contents of the configuration EEPROM on the card.
360 * (This is not fitted to all makes of card. All Hauppuage cards have them
361 * and so do newer Bt878 based cards.
362 */
363 int
364 readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
365 {
366 int x;
367 int addr;
368 int max;
369 int byte;
370
371 /* get the address of the EEProm */
372 addr = (int)(bktr->card.eepromAddr & 0xff);
373 if ( addr == 0 )
374 return( -1 );
375
376 max = (int)(bktr->card.eepromSize * EEPROMBLOCKSIZE);
377 if ( (offset + count) > max )
378 return( -1 );
379
380 /* set the start address */
381 if ( i2cWrite( bktr, addr, offset, -1 ) == -1 )
382 return( -1 );
383
384 /* the read cycle */
385 for ( x = 0; x < count; ++x ) {
386 if ( (byte = i2cRead( bktr, (addr | 1) )) == -1 )
387 return( -1 );
388 data[ x ] = byte;
389 }
390
391 return( 0 );
392 }
393
394
395 #define ABSENT (-1)
396
397 /*
398 * get a signature of the card
399 * read all 128 possible i2c read addresses from 0x01 thru 0xff
400 * build a bit array with a 1 bit for each i2c device that responds
401 *
402 * XXX FIXME: use offset & count args
403 */
404 int
405 signCard( bktr_ptr_t bktr, int offset, int count, u_char* sig )
406 {
407 int x;
408
409 for ( x = 0; x < 16; ++x )
410 sig[ x ] = 0;
411
412 for ( x = 0; x < count; ++x ) {
413 if ( i2cRead( bktr, (2 * x) + 1 ) != ABSENT ) {
414 sig[ x / 8 ] |= (1 << (x % 8) );
415 }
416 }
417
418 return( 0 );
419 }
420
421
422 /*
423 * check_for_i2c_devices.
424 * Some BT848 cards have no tuner and no additional i2c devices
425 * eg stereo decoder. These are used for video conferencing or capture from
426 * a video camera. (eg VideoLogic Captivator PCI, Intel SmartCapture card).
427 *
428 * Determine if there are any i2c devices present. There are none present if
429 * a) reading from all 128 devices returns ABSENT (-1) for each one
430 * (eg VideoLogic Captivator PCI with BT848)
431 * b) reading from all 128 devices returns 0 for each one
432 * (eg VideoLogic Captivator PCI rev. 2F with BT848A)
433 */
434 static int check_for_i2c_devices( bktr_ptr_t bktr ){
435 int x, temp_read;
436 int i2c_all_0 = 1;
437 int i2c_all_absent = 1;
438 for ( x = 0; x < 128; ++x ) {
439 temp_read = i2cRead( bktr, (2 * x) + 1 );
440 if (temp_read != 0) i2c_all_0 = 0;
441 if (temp_read != ABSENT) i2c_all_absent = 0;
442 }
443
444 if ((i2c_all_0) || (i2c_all_absent)) return 0;
445 else return 1;
446 }
447
448
449 /*
450 * Temic/Philips datasheets say tuners can be at i2c addresses 0xc0, 0xc2,
451 * 0xc4 or 0xc6, settable by links on the tuner.
452 * Determine the actual address used on the TV card by probing read addresses.
453 */
454 static int locate_tuner_address( bktr_ptr_t bktr) {
455 if (i2cRead( bktr, 0xc1) != ABSENT) return 0xc0;
456 if (i2cRead( bktr, 0xc3) != ABSENT) return 0xc2;
457 if (i2cRead( bktr, 0xc5) != ABSENT) return 0xc4;
458 if (i2cRead( bktr, 0xc7) != ABSENT) return 0xc6;
459 return -1; /* no tuner found */
460 }
461
462
463 /*
464 * Search for a configuration EEPROM on the i2c bus by looking at i2c addresses
465 * where EEPROMs are usually found.
466 * On some cards, the EEPROM appears in several locations, but all in the
467 * range 0xa0 to 0xae.
468 */
469 static int locate_eeprom_address( bktr_ptr_t bktr) {
470 if (i2cRead( bktr, 0xa0) != ABSENT) return 0xa0;
471 if (i2cRead( bktr, 0xac) != ABSENT) return 0xac;
472 if (i2cRead( bktr, 0xae) != ABSENT) return 0xae;
473 return -1; /* no eeprom found */
474 }
475
476
477 /*
478 * determine the card brand/model
479 * BKTR_OVERRIDE_CARD, BKTR_OVERRIDE_TUNER, BKTR_OVERRIDE_DBX and
480 * BKTR_OVERRIDE_MSP can be used to select a specific device,
481 * regardless of the autodetection and i2c device checks.
482 *
483 * The scheme used for probing cards faces these problems:
484 * It is impossible to work out which type of tuner is actually fitted,
485 * (the driver cannot tell if the Tuner is PAL or NTSC, Temic or Philips)
486 * It is impossible to determine what audio-mux hardware is connected.
487 * It is impossible to determine if there is extra hardware connected to the
488 * GPIO pins (eg radio chips or MSP34xx reset logic)
489 *
490 * However some makes of card (eg Hauppauge) come with a configuration eeprom
491 * which tells us the make of the card. Most eeproms also tell us the
492 * tuner type and other features of the the cards.
493 *
494 * The current probe code works as follows
495 * A) If the card uses a Bt878/879:
496 * 1) Read the sub-system vendor id from the configuration EEPROM.
497 * Select the required tuner, audio mux arrangement and any other
498 * onboard features. If this fails, move to step B.
499 * B) If it card uses a Bt848, 848A, 849A or an unknown Bt878/879:
500 * 1) Look for I2C devices. If there are none fitted, it is an Intel or
501 * VideoLogic cards.
502 * 2) Look for a configuration EEPROM.
503 * 2a) If there is one at I2C address 0xa0 it may be
504 * a Hauppauge or an Osprey. Check the EEPROM contents to determine which
505 * one it is. For Hauppauge, select the tuner type and audio hardware.
506 * 2b) If there is an EEPROM at I2C address 0xa8 it will be an STB card.
507 * We still have to guess on the tuner type.
508 *
509 * C) If we do not know the card type from (A) or (B), guess at the tuner
510 * type based on the I2C address of the tuner.
511 *
512 * D) After determining the Tuner Type, we probe the i2c bus for other
513 * devices at known locations, eg IR-Remote Control, MSP34xx and TDA
514 * stereo chips.
515 */
516
517
518 /*
519 * These are the sub-system vendor ID codes stored in the
520 * configuration EEPROM used on Bt878/879 cards. They should match the
521 * number assigned to the company by the PCI Special Interest Group
522 */
523 #define VENDOR_AVER_MEDIA 0x1461
524 #define VENDOR_HAUPPAUGE 0x0070
525 #define VENDOR_FLYVIDEO 0x1851
526 #define VENDOR_STB 0x10B4
527 #define VENDOR_ASKEY_COMP 0x144F
528 #define VENDOR_LEADTEK 0x6606
529
530
531 void
532 probeCard( bktr_ptr_t bktr, int verbose, int unit )
533 {
534 int card, i,j, card_found;
535 int status;
536 u_char probe_signature[128], *probe_temp;
537 int any_i2c_devices;
538 u_char eeprom[256];
539 u_char tuner_code = 0;
540 int tuner_i2c_address = -1;
541 int eeprom_i2c_address = -1;
542
543 /* Select all GPIO bits as inputs */
544 OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
545 if (bootverbose)
546 printf("%s: GPIO is 0x%08x\n", bktr_name(bktr),
547 INL(bktr, BKTR_GPIO_DATA));
548
549 #ifdef HAUPPAUGE_MSP_RESET
550 /* Reset the MSP34xx audio chip. This resolves bootup card
551 * detection problems with old Bt848 based Hauppauge cards with
552 * MSP34xx stereo audio chips. This must be user enabled because
553 * at this point the probe function does not know the card type. */
554 OUTL(bktr, BKTR_GPIO_OUT_EN, INL(bktr, BKTR_GPIO_OUT_EN) | (1<<5));
555 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) | (1<<5)); /* write '1' */
556 DELAY(2500); /* wait 2.5ms */
557 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) & ~(1<<5)); /* write '0' */
558 DELAY(2500); /* wait 2.5ms */
559 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) | (1<<5)); /* write '1' */
560 DELAY(2500); /* wait 2.5ms */
561 #endif
562
563 /* Check for the presence of i2c devices */
564 any_i2c_devices = check_for_i2c_devices( bktr );
565
566
567 /* Check for a user specified override on the card selection */
568 #if defined( BKTR_OVERRIDE_CARD )
569 bktr->card = cards[ (card = BKTR_OVERRIDE_CARD) ];
570 goto checkEEPROM;
571 #endif
572 if (bktr->bt848_card != -1 ) {
573 bktr->card = cards[ (card = bktr->bt848_card) ];
574 goto checkEEPROM;
575 }
576
577
578 /* No override, so try and determine the make of the card */
579
580 /* On BT878/879 cards, read the sub-system vendor id */
581 /* This identifies the manufacturer of the card and the model */
582 /* In theory this can be read from PCI registers but this does not */
583 /* appear to work on the FlyVideo 98. Hauppauge also warned that */
584 /* the PCI registers are sometimes not loaded correctly. */
585 /* Therefore, I will read the sub-system vendor ID from the EEPROM */
586 /* (just like the Bt878 does during power up initialisation) */
587
588 if ((bktr->id==BROOKTREE_878) || (bktr->id==BROOKTREE_879)) {
589 /* Try and locate the EEPROM */
590 eeprom_i2c_address = locate_eeprom_address( bktr );
591 if (eeprom_i2c_address != -1) {
592
593 unsigned int subsystem_vendor_id; /* vendors PCI-SIG ID */
594 unsigned int subsystem_id; /* board model number */
595 unsigned int byte_252, byte_253, byte_254, byte_255;
596
597 bktr->card = cards[ (card = CARD_UNKNOWN) ];
598 bktr->card.eepromAddr = eeprom_i2c_address;
599 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
600
601 readEEProm(bktr, 0, 256, (u_char *) &eeprom );
602 byte_252 = (unsigned int)eeprom[252];
603 byte_253 = (unsigned int)eeprom[253];
604 byte_254 = (unsigned int)eeprom[254];
605 byte_255 = (unsigned int)eeprom[255];
606
607 subsystem_id = (byte_252 << 8) | byte_253;
608 subsystem_vendor_id = (byte_254 << 8) | byte_255;
609
610 if ( bootverbose )
611 printf("%s: subsystem 0x%04x 0x%04x\n", bktr_name(bktr),
612 subsystem_vendor_id, subsystem_id);
613
614 if (subsystem_vendor_id == VENDOR_AVER_MEDIA) {
615 bktr->card = cards[ (card = CARD_AVER_MEDIA) ];
616 bktr->card.eepromAddr = eeprom_i2c_address;
617 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
618 goto checkTuner;
619 }
620
621 if (subsystem_vendor_id == VENDOR_HAUPPAUGE) {
622 bktr->card = cards[ (card = CARD_HAUPPAUGE) ];
623 bktr->card.eepromAddr = eeprom_i2c_address;
624 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
625 goto checkTuner;
626 }
627
628 if (subsystem_vendor_id == VENDOR_FLYVIDEO) {
629 bktr->card = cards[ (card = CARD_FLYVIDEO) ];
630 bktr->card.eepromAddr = eeprom_i2c_address;
631 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
632 goto checkTuner;
633 }
634
635 if (subsystem_vendor_id == VENDOR_STB) {
636 bktr->card = cards[ (card = CARD_STB) ];
637 bktr->card.eepromAddr = eeprom_i2c_address;
638 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
639 goto checkTuner;
640 }
641
642 if (subsystem_vendor_id == VENDOR_ASKEY_COMP) {
643 bktr->card = cards[ (card = CARD_ASKEY_DYNALINK_MAGIC_TVIEW) ];
644 bktr->card.eepromAddr = eeprom_i2c_address;
645 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
646 goto checkTuner;
647 }
648
649 if (subsystem_vendor_id == VENDOR_LEADTEK) {
650 bktr->card = cards[ (card = CARD_LEADTEK) ];
651 bktr->card.eepromAddr = eeprom_i2c_address;
652 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
653 goto checkTuner;
654 }
655
656 /* Vendor is unknown. We will use the standard probe code */
657 /* which may not give best results */
658 printf("%s: Warning - card vendor 0x%04x (model 0x%04x) unknown.\n",
659 bktr_name(bktr), subsystem_vendor_id, subsystem_id);
660 }
661 else
662 {
663 printf("%s: Card has no configuration EEPROM. Cannot determine card make.\n",
664 bktr_name(bktr));
665 }
666 } /* end of bt878/bt879 card detection code */
667
668 /* If we get to this point, we must have a Bt848/848A/849A card */
669 /* or a Bt878/879 with an unknown subsystem vendor id */
670 /* Try and determine the make of card by clever i2c probing */
671
672 /* Check for i2c devices. If none, move on */
673 if (!any_i2c_devices) {
674 bktr->card = cards[ (card = CARD_INTEL) ];
675 bktr->card.eepromAddr = 0;
676 bktr->card.eepromSize = 0;
677 goto checkTuner;
678 }
679
680 /* Look for Hauppauge, STB and Osprey cards by the presence */
681 /* of an EEPROM */
682 /* Note: Bt878 based cards also use EEPROMs so we can only do this */
683 /* test on BT848/848A and 849A based cards. */
684 if ((bktr->id==BROOKTREE_848) ||
685 (bktr->id==BROOKTREE_848A) ||
686 (bktr->id==BROOKTREE_849A)) {
687
688 /* At i2c address 0xa0, look for Hauppauge and Osprey cards */
689 if ( (status = i2cRead( bktr, PFC8582_RADDR )) != ABSENT ) {
690
691 /* Read the eeprom contents */
692 bktr->card = cards[ (card = CARD_UNKNOWN) ];
693 bktr->card.eepromAddr = PFC8582_WADDR;
694 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
695 readEEProm(bktr, 0, 128, (u_char *) &eeprom );
696
697 /* For Hauppauge, check the EEPROM begins with 0x84 */
698 if (eeprom[0] == 0x84) {
699 bktr->card = cards[ (card = CARD_HAUPPAUGE) ];
700 bktr->card.eepromAddr = PFC8582_WADDR;
701 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
702 goto checkTuner;
703 }
704
705 /* For Osprey, check the EEPROM begins with "MMAC" */
706 if ( (eeprom[0] == 'M') &&(eeprom[1] == 'M')
707 &&(eeprom[2] == 'A') &&(eeprom[3] == 'C')) {
708 bktr->card = cards[ (card = CARD_OSPREY) ];
709 bktr->card.eepromAddr = PFC8582_WADDR;
710 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
711 goto checkTuner;
712 }
713 printf("%s: Warning: Unknown card type. EEPROM data not recognised\n",
714 bktr_name(bktr));
715 printf("%s: %x %x %x %x\n", bktr_name(bktr),
716 eeprom[0],eeprom[1],eeprom[2],eeprom[3]);
717 }
718
719 /* look for an STB card */
720 if ( (status = i2cRead( bktr, X24C01_RADDR )) != ABSENT ) {
721 bktr->card = cards[ (card = CARD_STB) ];
722 bktr->card.eepromAddr = X24C01_WADDR;
723 bktr->card.eepromSize = (u_char)(128 / EEPROMBLOCKSIZE);
724 goto checkTuner;
725 }
726
727 }
728
729 signCard( bktr, 1, 128, (u_char *) &probe_signature );
730
731 if (bootverbose) {
732 printf("%s: card signature: ", bktr_name(bktr));
733 for (j = 0; j < Bt848_MAX_SIGN; j++) {
734 printf(" %02x ", probe_signature[j]);
735 }
736 printf("\n\n");
737 }
738 for (i = 0;
739 i < (sizeof bt848_card_signature)/ sizeof (struct bt848_card_sig);
740 i++ ) {
741
742 card_found = 1;
743 probe_temp = (u_char *) &bt848_card_signature[i].signature;
744
745 for (j = 0; j < Bt848_MAX_SIGN; j++) {
746 if ((probe_temp[j] & 0xf) != (probe_signature[j] & 0xf)) {
747 card_found = 0;
748 break;
749 }
750
751 }
752 if (card_found) {
753 bktr->card = cards[ card = bt848_card_signature[i].card];
754 eeprom_i2c_address = locate_eeprom_address( bktr );
755 if (eeprom_i2c_address != -1) {
756 bktr->card.eepromAddr = eeprom_i2c_address;
757 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
758 } else {
759 bktr->card.eepromAddr = 0;
760 bktr->card.eepromSize = 0;
761 }
762 tuner_i2c_address = locate_tuner_address( bktr );
763 select_tuner( bktr, bt848_card_signature[i].tuner );
764 goto checkDBX;
765 }
766 }
767
768 /* We do not know the card type. Default to Miro */
769 bktr->card = cards[ (card = CARD_MIRO) ];
770
771
772 checkEEPROM:
773 /* look for a configuration eeprom */
774 eeprom_i2c_address = locate_eeprom_address( bktr );
775 if (eeprom_i2c_address != -1) {
776 bktr->card.eepromAddr = eeprom_i2c_address;
777 bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
778 } else {
779 bktr->card.eepromAddr = 0;
780 bktr->card.eepromSize = 0;
781 }
782
783
784 checkTuner:
785
786 /* look for a tuner */
787 tuner_i2c_address = locate_tuner_address( bktr );
788 if ( tuner_i2c_address == -1 ) {
789 select_tuner( bktr, NO_TUNER );
790 goto checkDBX;
791 }
792
793 #if defined( BKTR_OVERRIDE_TUNER )
794 select_tuner( bktr, BKTR_OVERRIDE_TUNER );
795 goto checkDBX;
796 #endif
797 if (bktr->bt848_tuner != -1 ) {
798 select_tuner( bktr, bktr->bt848_tuner & 0xff );
799 goto checkDBX;
800 }
801
802 /* Check for i2c devices */
803 if (!any_i2c_devices) {
804 select_tuner( bktr, NO_TUNER );
805 goto checkDBX;
806 }
807
808 /* differentiate type of tuner */
809
810 switch (card) {
811 case CARD_MIRO:
812 switch (((INL(bktr, BKTR_GPIO_DATA) >> 10)-1)&7) {
813 case 0: select_tuner( bktr, TEMIC_PAL ); break;
814 case 1: select_tuner( bktr, PHILIPS_PAL ); break;
815 case 2: select_tuner( bktr, PHILIPS_NTSC ); break;
816 case 3: select_tuner( bktr, PHILIPS_SECAM ); break;
817 case 4: select_tuner( bktr, NO_TUNER ); break;
818 case 5: select_tuner( bktr, PHILIPS_PALI ); break;
819 case 6: select_tuner( bktr, TEMIC_NTSC ); break;
820 case 7: select_tuner( bktr, TEMIC_PALI ); break;
821 }
822 goto checkDBX;
823 break;
824
825 case CARD_HAUPPAUGE:
826 /* Hauppauge kindly supplied the following Tuner Table */
827 /* FIXME: I think the tuners the driver selects for types */
828 /* 0x08 and 0x15 may be incorrect but no one has complained. */
829 /*
830 ID Tuner Model Format We select Format
831 0 NONE
832 1 EXTERNAL
833 2 OTHER
834 3 Philips FI1216 BG
835 4 Philips FI1216MF BGLL' PHILIPS_SECAM
836 5 Philips FI1236 MN PHILIPS_NTSC
837 6 Philips FI1246 I PHILIPS_PALI
838 7 Philips FI1256 DK
839 8 Philips FI1216 MK2 BG PHILIPS_PALI
840 9 Philips FI1216MF MK2 BGLL' PHILIPS_SECAM
841 a Philips FI1236 MK2 MN PHILIPS_NTSC
842 b Philips FI1246 MK2 I PHILIPS_PALI
843 c Philips FI1256 MK2 DK
844 d Temic 4032FY5 NTSC TEMIC_NTSC
845 e Temic 4002FH5 BG TEMIC_PAL
846 f Temic 4062FY5 I TEMIC_PALI
847 10 Philips FR1216 MK2 BG
848 11 Philips FR1216MF MK2 BGLL' PHILIPS_FR1236_SECAM
849 12 Philips FR1236 MK2 MN PHILIPS_FR1236_NTSC
850 13 Philips FR1246 MK2 I
851 14 Philips FR1256 MK2 DK
852 15 Philips FM1216 BG PHILIPS_FR1216_PAL
853 16 Philips FM1216MF BGLL' PHILIPS_FR1236_SECAM
854 17 Philips FM1236 MN PHILIPS_FR1236_NTSC
855 18 Philips FM1246 I
856 19 Philips FM1256 DK
857 1a Temic 4036FY5 MN - FI1236 MK2 clone PHILIPS_NTSC
858 1b Samsung TCPN9082D MN
859 1c Samsung TCPM9092P Pal BG/I/DK
860 1d Temic 4006FH5 BG PHILIPS_PALI clone
861 1e Samsung TCPN9085D MN/Radio
862 1f Samsung TCPB9085P Pal BG/I/DK / Radio
863 20 Samsung TCPL9091P Pal BG & Secam L/L'
864 21 Temic 4039FY5 NTSC Radio
865
866 */
867
868
869
870 /* Determine the model number from the eeprom */
871 if (bktr->card.eepromAddr != 0) {
872 u_int model;
873 u_int revision;
874
875 readEEProm(bktr, 0, 128, (u_char *) &eeprom );
876
877 model = (eeprom[12] << 8 | eeprom[11]);
878 revision = (eeprom[15] << 16 | eeprom[14] << 8 | eeprom[13]);
879 if (verbose)
880 printf("%s: Hauppauge Model %d %c%c%c%c\n",
881 bktr_name(bktr),
882 model,
883 ((revision >> 18) & 0x3f) + 32,
884 ((revision >> 12) & 0x3f) + 32,
885 ((revision >> 6) & 0x3f) + 32,
886 ((revision >> 0) & 0x3f) + 32 );
887
888 /* Determine the tuner type from the eeprom */
889 tuner_code = eeprom[9];
890 switch (tuner_code) {
891
892 case 0x5:
893 case 0x0a:
894 case 0x1a:
895 select_tuner( bktr, PHILIPS_NTSC );
896 goto checkDBX;
897
898 case 0x4:
899 case 0x9:
900 select_tuner( bktr, PHILIPS_SECAM );
901 goto checkDBX;
902
903 case 0x11:
904 case 0x16:
905 select_tuner( bktr, PHILIPS_FR1236_SECAM );
906 goto checkDBX;
907
908 case 0x12:
909 case 0x17:
910 select_tuner( bktr, PHILIPS_FR1236_NTSC );
911 goto checkDBX;
912
913 case 0x6:
914 case 0x8:
915 case 0xb:
916 case 0x1d:
917 select_tuner( bktr, PHILIPS_PALI );
918 goto checkDBX;
919
920 case 0xd:
921 select_tuner( bktr, TEMIC_NTSC );
922 goto checkDBX;
923
924 case 0xe:
925 select_tuner( bktr, TEMIC_PAL );
926 goto checkDBX;
927
928 case 0xf:
929 select_tuner( bktr, TEMIC_PALI );
930 goto checkDBX;
931
932 case 0x15:
933 select_tuner( bktr, PHILIPS_FR1216_PAL );
934 goto checkDBX;
935
936 default :
937 printf("%s: Warning - Unknown Hauppauge Tuner 0x%x\n",
938 bktr_name(bktr), tuner_code);
939 }
940 }
941 break;
942
943
944 case CARD_AVER_MEDIA:
945 /* AVerMedia kindly supplied some details of their EEPROM contents
946 * which allow us to auto select the Tuner Type.
947 * Only the newer AVerMedia cards actually have an EEPROM.
948 */
949 if (bktr->card.eepromAddr != 0) {
950
951 u_char tuner_make; /* Eg Philips, Temic */
952 u_char tuner_tv_fm; /* TV or TV with FM Radio */
953 u_char tuner_format; /* Eg NTSC, PAL, SECAM */
954 int tuner;
955
956 int tuner_0_table[] = {
957 PHILIPS_NTSC, PHILIPS_PAL,
958 PHILIPS_PAL, PHILIPS_PAL,
959 PHILIPS_PAL, PHILIPS_PAL,
960 PHILIPS_SECAM, PHILIPS_SECAM,
961 PHILIPS_SECAM, PHILIPS_PAL};
962
963 int tuner_0_fm_table[] = {
964 PHILIPS_FR1236_NTSC, PHILIPS_FR1216_PAL,
965 PHILIPS_FR1216_PAL, PHILIPS_FR1216_PAL,
966 PHILIPS_FR1216_PAL, PHILIPS_FR1216_PAL,
967 PHILIPS_FR1236_SECAM, PHILIPS_FR1236_SECAM,
968 PHILIPS_FR1236_SECAM, PHILIPS_FR1216_PAL};
969
970 int tuner_1_table[] = {
971 TEMIC_NTSC, TEMIC_PAL, TEMIC_PAL,
972 TEMIC_PAL, TEMIC_PAL, TEMIC_PAL,
973 TEMIC_SECAM, TEMIC_SECAM, TEMIC_SECAM,
974 TEMIC_PAL};
975
976
977 /* Extract information from the EEPROM data */
978 readEEProm(bktr, 0, 128, (u_char *) &eeprom );
979
980 tuner_make = (eeprom[0x41] & 0x7);
981 tuner_tv_fm = (eeprom[0x41] & 0x18) >> 3;
982 tuner_format = (eeprom[0x42] & 0xf0) >> 4;
983
984 /* Treat tuner make 0 (Philips) and make 2 (LG) the same */
985 if ( ((tuner_make == 0) || (tuner_make == 2))
986 && (tuner_format <= 9) && (tuner_tv_fm == 0) ) {
987 tuner = tuner_0_table[tuner_format];
988 select_tuner( bktr, tuner );
989 goto checkDBX;
990 }
991
992 if ( ((tuner_make == 0) || (tuner_make == 2))
993 && (tuner_format <= 9) && (tuner_tv_fm == 1) ) {
994 tuner = tuner_0_fm_table[tuner_format];
995 select_tuner( bktr, tuner );
996 goto checkDBX;
997 }
998
999 if ( (tuner_make == 1) && (tuner_format <= 9) ) {
1000 tuner = tuner_1_table[tuner_format];
1001 select_tuner( bktr, tuner );
1002 goto checkDBX;
1003 }
1004
1005 printf("%s: Warning - Unknown AVerMedia Tuner Make %d Format %d\n",
1006 bktr_name(bktr), tuner_make, tuner_format);
1007 }
1008 break;
1009
1010 case CARD_LEADTEK:
1011 #if BKTR_SYSTEM_DEFAULT == BROOKTREE_PAL
1012 select_tuner( bktr, PHILIPS_FR1216_PAL );
1013 #else
1014 select_tuner( bktr, PHILIPS_FR1236_NTSC );
1015 #endif
1016 goto checkDBX;
1017 break;
1018
1019 } /* end switch(card) */
1020
1021
1022 /* At this point, a goto checkDBX has not occured */
1023 /* We have not been able to select a Tuner */
1024 /* Some cards make use of the tuner address to */
1025 /* identify the make/model of tuner */
1026
1027 /* At address 0xc0/0xc1 we often find a TEMIC NTSC */
1028 if ( i2cRead( bktr, 0xc1 ) != ABSENT ) {
1029 select_tuner( bktr, TEMIC_NTSC );
1030 goto checkDBX;
1031 }
1032
1033 /* At address 0xc6/0xc7 we often find a PHILIPS NTSC Tuner */
1034 if ( i2cRead( bktr, 0xc7 ) != ABSENT ) {
1035 select_tuner( bktr, PHILIPS_NTSC );
1036 goto checkDBX;
1037 }
1038
1039 /* Address 0xc2/0xc3 is default (or common address) for several */
1040 /* tuners and we cannot tell which is which. */
1041 /* And for all other tuner i2c addresses, select the default */
1042 select_tuner( bktr, DEFAULT_TUNER );
1043
1044
1045 checkDBX:
1046 #if defined( BKTR_OVERRIDE_DBX )
1047 bktr->card.dbx = BKTR_OVERRIDE_DBX;
1048 goto checkMSP;
1049 #endif
1050 /* Check for i2c devices */
1051 if (!any_i2c_devices) {
1052 goto checkMSP;
1053 }
1054
1055 /* probe for BTSC (dbx) chip */
1056 if ( i2cRead( bktr, TDA9850_RADDR ) != ABSENT )
1057 bktr->card.dbx = 1;
1058
1059 checkMSP:
1060 /* If this is a Hauppauge Bt878 card, we need to enable the
1061 * MSP 34xx audio chip.
1062 * If this is a Hauppauge Bt848 card, reset the MSP device.
1063 * The MSP reset line is wired to GPIO pin 5. On Bt878 cards a pulldown
1064 * resistor holds the device in reset until we set GPIO pin 5.
1065 */
1066
1067 /* Optionally skip the MSP reset. This is handy if you initialise the
1068 * MSP audio in another operating system (eg Windows) first and then
1069 * do a soft reboot.
1070 */
1071
1072 #ifndef BKTR_NO_MSP_RESET
1073 if (card == CARD_HAUPPAUGE) {
1074 OUTL(bktr, BKTR_GPIO_OUT_EN, INL(bktr, BKTR_GPIO_OUT_EN) | (1<<5));
1075 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) | (1<<5)); /* write '1' */
1076 DELAY(2500); /* wait 2.5ms */
1077 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) & ~(1<<5)); /* write '0' */
1078 DELAY(2500); /* wait 2.5ms */
1079 OUTL(bktr, BKTR_GPIO_DATA, INL(bktr, BKTR_GPIO_DATA) | (1<<5)); /* write '1' */
1080 DELAY(2500); /* wait 2.5ms */
1081 }
1082 #endif
1083
1084 #if defined( BKTR_OVERRIDE_MSP )
1085 bktr->card.msp3400c = BKTR_OVERRIDE_MSP;
1086 goto checkMSPEnd;
1087 #endif
1088
1089 /* Check for i2c devices */
1090 if (!any_i2c_devices) {
1091 goto checkMSPEnd;
1092 }
1093
1094 if ( i2cRead( bktr, MSP3400C_RADDR ) != ABSENT ) {
1095 bktr->card.msp3400c = 1;
1096 }
1097
1098 checkMSPEnd:
1099
1100 if (bktr->card.msp3400c) {
1101 bktr->msp_addr = MSP3400C_WADDR;
1102 msp_read_id( bktr );
1103 printf("%s: Detected a MSP%s at 0x%x\n", bktr_name(bktr),
1104 bktr->msp_version_string,
1105 bktr->msp_addr);
1106
1107 }
1108
1109 /* Check for Dolby Surround Sound DPL3518A sound chip */
1110 if ( i2cRead( bktr, DPL3518A_RADDR ) != ABSENT ) {
1111 bktr->card.dpl3518a = 1;
1112 }
1113
1114 if (bktr->card.dpl3518a) {
1115 bktr->dpl_addr = DPL3518A_WADDR;
1116 dpl_read_id( bktr );
1117 printf("%s: Detected a DPL%s at 0x%x\n", bktr_name(bktr),
1118 bktr->dpl_version_string,
1119 bktr->dpl_addr);
1120 }
1121
1122 /* Start of Check Remote */
1123 /* Check for the Hauppauge IR Remote Control */
1124 /* If there is an external unit, the internal will be ignored */
1125
1126 bktr->remote_control = 0; /* initial value */
1127
1128 if (any_i2c_devices) {
1129 if (i2cRead( bktr, HAUP_REMOTE_EXT_RADDR ) != ABSENT )
1130 {
1131 bktr->remote_control = 1;
1132 bktr->remote_control_addr = HAUP_REMOTE_EXT_RADDR;
1133 }
1134 else if (i2cRead( bktr, HAUP_REMOTE_INT_RADDR ) != ABSENT )
1135 {
1136 bktr->remote_control = 1;
1137 bktr->remote_control_addr = HAUP_REMOTE_INT_RADDR;
1138 }
1139
1140 }
1141 /* If a remote control is found, poll it 5 times to turn off the LED */
1142 if (bktr->remote_control) {
1143 int i;
1144 for (i=0; i<5; i++)
1145 i2cRead( bktr, bktr->remote_control_addr );
1146 }
1147 /* End of Check Remote */
1148
1149 #if defined( BKTR_USE_PLL )
1150 bktr->xtal_pll_mode = BT848_USE_PLL;
1151 goto checkPLLEnd;
1152 #endif
1153 /* Default is to use XTALS and not PLL mode */
1154 bktr->xtal_pll_mode = BT848_USE_XTALS;
1155
1156 /* Enable PLL mode for OSPREY users */
1157 if (card == CARD_OSPREY)
1158 bktr->xtal_pll_mode = BT848_USE_PLL;
1159
1160 /* Enable PLL mode for Video Highway Xtreme users */
1161 if (card == CARD_VIDEO_HIGHWAY_XTREME)
1162 bktr->xtal_pll_mode = BT848_USE_PLL;
1163
1164
1165 /* Most (perhaps all) Bt878 cards need to be switched to PLL mode */
1166 /* as they only fit the NTSC crystal to their cards */
1167 /* Default to enabling PLL mode for all Bt878/879 cards */
1168
1169 if ((bktr->id==BROOKTREE_878 || bktr->id==BROOKTREE_879) )
1170 bktr->xtal_pll_mode = BT848_USE_PLL;
1171
1172
1173 #if defined( BKTR_USE_PLL )
1174 checkPLLEnd:
1175 #endif
1176
1177
1178 bktr->card.tuner_pllAddr = tuner_i2c_address;
1179
1180 if ( verbose ) {
1181 printf( "%s: %s", bktr_name(bktr), bktr->card.name );
1182 if ( bktr->card.tuner )
1183 printf( ", %s tuner", bktr->card.tuner->name );
1184 if ( bktr->card.dbx )
1185 printf( ", dbx stereo" );
1186 if ( bktr->card.msp3400c )
1187 printf( ", msp3400c stereo" );
1188 if ( bktr->card.dpl3518a )
1189 printf( ", dpl3518a dolby" );
1190 if ( bktr->remote_control )
1191 printf( ", remote control" );
1192 printf( ".\n" );
1193 }
1194 }
1195
1196 #undef ABSENT
1197