2 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
5 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
6 Markus Rechberger <mrechberger@gmail.com>
7 Mauro Carvalho Chehab <mchehab@infradead.org>
8 Sascha Sommer <saschasommer@freenet.de>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <linux/init.h>
26 #include <linux/module.h>
27 #include <linux/delay.h>
28 #include <linux/i2c.h>
29 #include <linux/usb.h>
30 #include <media/tuner.h>
31 #include <media/msp3400.h>
32 #include <media/saa7115.h>
33 #include <media/tvp5150.h>
34 #include <media/tveeprom.h>
35 #include <media/audiochip.h>
36 #include <media/v4l2-common.h>
39 #include "tuner-xc2028.h"
41 static int tuner
= -1;
42 module_param(tuner
, int, 0444);
43 MODULE_PARM_DESC(tuner
, "tuner type");
45 struct em28xx_hash_table
{
51 struct em28xx_board em28xx_boards
[] = {
52 [EM2800_BOARD_UNKNOWN
] = {
53 .name
= "Unknown EM2800 video grabber",
56 .tda9887_conf
= TDA9887_PRESENT
,
58 .decoder
= EM28XX_SAA7113
,
60 .type
= EM28XX_VMUX_COMPOSITE1
,
61 .vmux
= SAA7115_COMPOSITE0
,
64 .type
= EM28XX_VMUX_SVIDEO
,
65 .vmux
= SAA7115_SVIDEO3
,
69 [EM2820_BOARD_UNKNOWN
] = {
70 .name
= "Unknown EM2750/28xx video grabber",
73 [EM2820_BOARD_KWORLD_PVRTV2800RF
] = {
74 .name
= "Kworld PVR TV 2800 RF",
77 .tda9887_conf
= TDA9887_PRESENT
,
79 .decoder
= EM28XX_SAA7113
,
81 .type
= EM28XX_VMUX_COMPOSITE1
,
82 .vmux
= SAA7115_COMPOSITE0
,
85 .type
= EM28XX_VMUX_SVIDEO
,
86 .vmux
= SAA7115_SVIDEO3
,
90 [EM2820_BOARD_TERRATEC_CINERGY_250
] = {
91 .name
= "Terratec Cinergy 250 USB",
93 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
94 .tda9887_conf
= TDA9887_PRESENT
,
96 .decoder
= EM28XX_SAA7113
,
98 .type
= EM28XX_VMUX_TELEVISION
,
99 .vmux
= SAA7115_COMPOSITE2
,
102 .type
= EM28XX_VMUX_COMPOSITE1
,
103 .vmux
= SAA7115_COMPOSITE0
,
106 .type
= EM28XX_VMUX_SVIDEO
,
107 .vmux
= SAA7115_SVIDEO3
,
111 [EM2820_BOARD_PINNACLE_USB_2
] = {
112 .name
= "Pinnacle PCTV USB 2",
114 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
115 .tda9887_conf
= TDA9887_PRESENT
,
117 .decoder
= EM28XX_SAA7113
,
119 .type
= EM28XX_VMUX_TELEVISION
,
120 .vmux
= SAA7115_COMPOSITE2
,
123 .type
= EM28XX_VMUX_COMPOSITE1
,
124 .vmux
= SAA7115_COMPOSITE0
,
127 .type
= EM28XX_VMUX_SVIDEO
,
128 .vmux
= SAA7115_SVIDEO3
,
132 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
] = {
133 .name
= "Hauppauge WinTV USB 2",
135 .tuner_type
= TUNER_PHILIPS_FM1236_MK3
,
136 .tda9887_conf
= TDA9887_PRESENT
|
137 TDA9887_PORT1_ACTIVE
|
138 TDA9887_PORT2_ACTIVE
,
140 .decoder
= EM28XX_TVP5150
,
142 /*FIXME: S-Video not tested */
144 .type
= EM28XX_VMUX_TELEVISION
,
145 .vmux
= TVP5150_COMPOSITE0
,
146 .amux
= MSP_INPUT_DEFAULT
,
148 .type
= EM28XX_VMUX_SVIDEO
,
149 .vmux
= TVP5150_SVIDEO
,
150 .amux
= MSP_INPUT(MSP_IN_SCART1
, MSP_IN_TUNER1
,
151 MSP_DSP_IN_SCART
, MSP_DSP_IN_SCART
),
154 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
] = {
155 .name
= "Hauppauge WinTV HVR 900",
157 .tda9887_conf
= TDA9887_PRESENT
,
158 .tuner_type
= TUNER_XC2028
,
161 .decoder
= EM28XX_TVP5150
,
163 .type
= EM28XX_VMUX_TELEVISION
,
164 .vmux
= TVP5150_COMPOSITE0
,
167 .type
= EM28XX_VMUX_COMPOSITE1
,
168 .vmux
= TVP5150_COMPOSITE1
,
171 .type
= EM28XX_VMUX_SVIDEO
,
172 .vmux
= TVP5150_SVIDEO
,
176 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950
] = {
177 .name
= "Hauppauge WinTV HVR 950",
179 .tda9887_conf
= TDA9887_PRESENT
,
180 .tuner_type
= TUNER_XC2028
,
183 .decoder
= EM28XX_TVP5150
,
185 .type
= EM28XX_VMUX_TELEVISION
,
186 .vmux
= TVP5150_COMPOSITE0
,
189 .type
= EM28XX_VMUX_COMPOSITE1
,
190 .vmux
= TVP5150_COMPOSITE1
,
193 .type
= EM28XX_VMUX_SVIDEO
,
194 .vmux
= TVP5150_SVIDEO
,
199 .analog_gpio
= 0x003d2d,
201 [EM2880_BOARD_TERRATEC_HYBRID_XS
] = {
202 .name
= "Terratec Hybrid XS",
204 .tda9887_conf
= TDA9887_PRESENT
,
206 .tuner_type
= TUNER_XC2028
,
207 .decoder
= EM28XX_TVP5150
,
209 .type
= EM28XX_VMUX_TELEVISION
,
210 .vmux
= TVP5150_COMPOSITE0
,
213 .type
= EM28XX_VMUX_COMPOSITE1
,
214 .vmux
= TVP5150_COMPOSITE1
,
217 .type
= EM28XX_VMUX_SVIDEO
,
218 .vmux
= TVP5150_SVIDEO
,
222 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
223 as Prodigy XS with a different PID, let's keep it separated for now
224 maybe we'll need it lateron */
225 [EM2880_BOARD_TERRATEC_PRODIGY_XS
] = {
226 .name
= "Terratec Prodigy XS",
228 .tda9887_conf
= TDA9887_PRESENT
,
230 .tuner_type
= TUNER_XC2028
,
231 .decoder
= EM28XX_TVP5150
,
233 .type
= EM28XX_VMUX_TELEVISION
,
234 .vmux
= TVP5150_COMPOSITE0
,
237 .type
= EM28XX_VMUX_COMPOSITE1
,
238 .vmux
= TVP5150_COMPOSITE1
,
241 .type
= EM28XX_VMUX_SVIDEO
,
242 .vmux
= TVP5150_SVIDEO
,
246 [EM2820_BOARD_MSI_VOX_USB_2
] = {
247 .name
= "MSI VOX USB 2.0",
249 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
250 .tda9887_conf
= TDA9887_PRESENT
|
251 TDA9887_PORT1_ACTIVE
|
252 TDA9887_PORT2_ACTIVE
,
254 .decoder
= EM28XX_SAA7114
,
256 .type
= EM28XX_VMUX_TELEVISION
,
257 .vmux
= SAA7115_COMPOSITE4
,
260 .type
= EM28XX_VMUX_COMPOSITE1
,
261 .vmux
= SAA7115_COMPOSITE0
,
264 .type
= EM28XX_VMUX_SVIDEO
,
265 .vmux
= SAA7115_SVIDEO3
,
269 [EM2800_BOARD_TERRATEC_CINERGY_200
] = {
270 .name
= "Terratec Cinergy 200 USB",
273 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
274 .tda9887_conf
= TDA9887_PRESENT
,
276 .decoder
= EM28XX_SAA7113
,
278 .type
= EM28XX_VMUX_TELEVISION
,
279 .vmux
= SAA7115_COMPOSITE2
,
282 .type
= EM28XX_VMUX_COMPOSITE1
,
283 .vmux
= SAA7115_COMPOSITE0
,
286 .type
= EM28XX_VMUX_SVIDEO
,
287 .vmux
= SAA7115_SVIDEO3
,
291 [EM2800_BOARD_LEADTEK_WINFAST_USBII
] = {
292 .name
= "Leadtek Winfast USB II",
295 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
296 .tda9887_conf
= TDA9887_PRESENT
,
298 .decoder
= EM28XX_SAA7113
,
300 .type
= EM28XX_VMUX_TELEVISION
,
301 .vmux
= SAA7115_COMPOSITE2
,
304 .type
= EM28XX_VMUX_COMPOSITE1
,
305 .vmux
= SAA7115_COMPOSITE0
,
308 .type
= EM28XX_VMUX_SVIDEO
,
309 .vmux
= SAA7115_SVIDEO3
,
313 [EM2800_BOARD_KWORLD_USB2800
] = {
314 .name
= "Kworld USB2800",
317 .tuner_type
= TUNER_PHILIPS_ATSC
,
318 .tda9887_conf
= TDA9887_PRESENT
,
320 .decoder
= EM28XX_SAA7113
,
322 .type
= EM28XX_VMUX_TELEVISION
,
323 .vmux
= SAA7115_COMPOSITE2
,
326 .type
= EM28XX_VMUX_COMPOSITE1
,
327 .vmux
= SAA7115_COMPOSITE0
,
330 .type
= EM28XX_VMUX_SVIDEO
,
331 .vmux
= SAA7115_SVIDEO3
,
335 [EM2820_BOARD_PINNACLE_DVC_90
] = {
336 .name
= "Pinnacle Dazzle DVC 90/DVC 100",
339 .decoder
= EM28XX_SAA7113
,
341 .type
= EM28XX_VMUX_COMPOSITE1
,
342 .vmux
= SAA7115_COMPOSITE0
,
345 .type
= EM28XX_VMUX_SVIDEO
,
346 .vmux
= SAA7115_SVIDEO3
,
350 [EM2800_BOARD_VGEAR_POCKETTV
] = {
351 .name
= "V-Gear PocketTV",
354 .tuner_type
= TUNER_LG_PAL_NEW_TAPC
,
355 .tda9887_conf
= TDA9887_PRESENT
,
357 .decoder
= EM28XX_SAA7113
,
359 .type
= EM28XX_VMUX_TELEVISION
,
360 .vmux
= SAA7115_COMPOSITE2
,
363 .type
= EM28XX_VMUX_COMPOSITE1
,
364 .vmux
= SAA7115_COMPOSITE0
,
367 .type
= EM28XX_VMUX_SVIDEO
,
368 .vmux
= SAA7115_SVIDEO3
,
372 [EM2820_BOARD_PROLINK_PLAYTV_USB2
] = {
373 .name
= "Pixelview Prolink PlayTV USB 2.0",
375 .tda9887_conf
= TDA9887_PRESENT
,
377 .decoder
= EM28XX_SAA7113
,
379 .type
= EM28XX_VMUX_TELEVISION
,
380 .vmux
= SAA7115_COMPOSITE2
,
383 .type
= EM28XX_VMUX_COMPOSITE1
,
384 .vmux
= SAA7115_COMPOSITE0
,
387 .type
= EM28XX_VMUX_SVIDEO
,
388 .vmux
= SAA7115_SVIDEO3
,
393 const unsigned int em28xx_bcount
= ARRAY_SIZE(em28xx_boards
);
395 /* table of devices that work with this driver */
396 struct usb_device_id em28xx_id_table
[] = {
397 { USB_DEVICE(0xeb1a, 0x2750),
398 .driver_info
= EM2820_BOARD_UNKNOWN
},
399 { USB_DEVICE(0xeb1a, 0x2800),
400 .driver_info
= EM2800_BOARD_UNKNOWN
},
401 { USB_DEVICE(0xeb1a, 0x2820),
402 .driver_info
= EM2820_BOARD_UNKNOWN
},
403 { USB_DEVICE(0xeb1a, 0x2821),
404 .driver_info
= EM2820_BOARD_UNKNOWN
},
405 { USB_DEVICE(0xeb1a, 0x2860),
406 .driver_info
= EM2820_BOARD_UNKNOWN
},
407 { USB_DEVICE(0xeb1a, 0x2861),
408 .driver_info
= EM2820_BOARD_UNKNOWN
},
409 { USB_DEVICE(0xeb1a, 0x2870),
410 .driver_info
= EM2820_BOARD_UNKNOWN
},
411 { USB_DEVICE(0xeb1a, 0x2881),
412 .driver_info
= EM2820_BOARD_UNKNOWN
},
413 { USB_DEVICE(0xeb1a, 0x2883),
414 .driver_info
= EM2820_BOARD_UNKNOWN
},
415 { USB_DEVICE(0x0ccd, 0x0036),
416 .driver_info
= EM2820_BOARD_TERRATEC_CINERGY_250
},
417 { USB_DEVICE(0x2304, 0x0208),
418 .driver_info
= EM2820_BOARD_PINNACLE_USB_2
},
419 { USB_DEVICE(0x2040, 0x4200),
420 .driver_info
= EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
},
421 { USB_DEVICE(0x2304, 0x0207),
422 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
423 { USB_DEVICE(0x2304, 0x021a),
424 .driver_info
= EM2820_BOARD_PINNACLE_DVC_90
},
425 { USB_DEVICE(0x2040, 0x6500),
426 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
},
427 { USB_DEVICE(0x2040, 0x6513),
428 .driver_info
= EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950
},
429 { USB_DEVICE(0x0ccd, 0x0042),
430 .driver_info
= EM2880_BOARD_TERRATEC_HYBRID_XS
},
431 { USB_DEVICE(0x0ccd, 0x0047),
432 .driver_info
= EM2880_BOARD_TERRATEC_PRODIGY_XS
},
435 MODULE_DEVICE_TABLE(usb
, em28xx_id_table
);
437 /* EEPROM hash table for devices with generic USB IDs */
438 static struct em28xx_hash_table em28xx_eeprom_hash
[] = {
439 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
440 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2
, TUNER_YMEC_TVF_5533MF
},
443 /* I2C devicelist hash table for devices with generic USB IDs */
444 static struct em28xx_hash_table em28xx_i2c_hash
[] = {
445 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200
, TUNER_LG_PAL_NEW_TAPC
},
446 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV
, TUNER_LG_PAL_NEW_TAPC
},
449 /* Since em28xx_pre_card_setup() requires a proper dev->model,
450 * this won't work for boards with generic PCI IDs
452 void em28xx_pre_card_setup(struct em28xx
*dev
)
454 /* request some modules */
455 switch (dev
->model
) {
456 case EM2880_BOARD_TERRATEC_PRODIGY_XS
:
457 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
458 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950
:
459 case EM2880_BOARD_TERRATEC_HYBRID_XS
:
460 em28xx_write_regs(dev
, XCLK_REG
, "\x27", 1);
461 em28xx_write_regs(dev
, I2C_CLK_REG
, "\x40", 1);
462 em28xx_write_regs(dev
, 0x08, "\xff", 1);
463 em28xx_write_regs(dev
, 0x04, "\x00", 1);
465 em28xx_write_regs(dev
, 0x04, "\x08", 1);
467 em28xx_write_regs(dev
, 0x08, "\xff", 1);
469 em28xx_write_regs(dev
, 0x08, "\x2d", 1);
471 em28xx_write_regs(dev
, 0x08, "\x3d", 1);
476 static int em28xx_tuner_callback(void *ptr
, int command
, int arg
)
479 struct em28xx
*dev
= ptr
;
481 if (dev
->tuner_type
!= TUNER_XC2028
)
485 case XC2028_TUNER_RESET
:
487 char gpio0
, gpio1
, gpio4
;
489 /* GPIO and initialization codes for analog TV */
490 gpio0
= dev
->analog_gpio
& 0xff;
491 gpio1
= (dev
->analog_gpio
>> 8) & 0xff;
492 gpio4
= dev
->analog_gpio
>> 24;
494 dev
->em28xx_write_regs_req(dev
, 0x00, 0x48, "\x00", 1);
495 dev
->em28xx_write_regs_req(dev
, 0x00, 0x12, "\x67", 1);
498 dev
->em28xx_write_regs(dev
, 0x04, &gpio4
, 1);
503 dev
->em28xx_write_regs(dev
, 0x08, &gpio0
, 1);
505 dev
->em28xx_write_regs(dev
, 0x08, &gpio1
, 1);
514 static void em28xx_config_tuner(struct em28xx
*dev
)
516 struct v4l2_priv_tun_config xc2028_cfg
;
517 struct xc2028_ctrl ctl
;
518 struct tuner_setup tun_setup
;
519 struct v4l2_frequency f
;
524 tun_setup
.mode_mask
= T_ANALOG_TV
| T_RADIO
;
525 tun_setup
.type
= dev
->tuner_type
;
526 tun_setup
.addr
= dev
->tuner_addr
;
527 tun_setup
.tuner_callback
= em28xx_tuner_callback
;
529 em28xx_i2c_call_clients(dev
, TUNER_SET_TYPE_ADDR
, &tun_setup
);
531 if (dev
->tuner_type
== TUNER_XC2028
) {
532 memset(&ctl
, 0, sizeof(ctl
));
534 ctl
.fname
= XC2028_DEFAULT_FIRMWARE
;
536 ctl
.mts
= em28xx_boards
[dev
->model
].mts_firmware
;
538 xc2028_cfg
.tuner
= TUNER_XC2028
;
539 xc2028_cfg
.priv
= &ctl
;
541 em28xx_i2c_call_clients(dev
, TUNER_SET_CONFIG
, &xc2028_cfg
);
544 /* configure tuner */
546 f
.type
= V4L2_TUNER_ANALOG_TV
;
547 f
.frequency
= 9076; /* just a magic number */
548 dev
->ctl_freq
= f
.frequency
;
549 em28xx_i2c_call_clients(dev
, VIDIOC_S_FREQUENCY
, &f
);
552 static int em28xx_hint_board(struct em28xx
*dev
)
556 /* HINT method: EEPROM
558 * This method works only for boards with eeprom.
559 * Uses a hash of all eeprom bytes. The hash should be
560 * unique for a vendor/tuner pair.
561 * There are a high chance that tuners for different
562 * video standards produce different hashes.
564 for (i
= 0; i
< ARRAY_SIZE(em28xx_eeprom_hash
); i
++) {
565 if (dev
->hash
== em28xx_eeprom_hash
[i
].hash
) {
566 dev
->model
= em28xx_eeprom_hash
[i
].model
;
567 dev
->tuner_type
= em28xx_eeprom_hash
[i
].tuner
;
569 em28xx_errdev("Your board has no unique USB ID.\n");
570 em28xx_errdev("A hint were successfully done, "
571 "based on eeprom hash.\n");
572 em28xx_errdev("This method is not 100%% failproof.\n");
573 em28xx_errdev("If the board were missdetected, "
574 "please email this log to:\n");
575 em28xx_errdev("\tV4L Mailing List "
576 " <video4linux-list@redhat.com>\n");
577 em28xx_errdev("Board detected as %s\n",
578 em28xx_boards
[dev
->model
].name
);
584 /* HINT method: I2C attached devices
586 * This method works for all boards.
587 * Uses a hash of i2c scanned devices.
588 * Devices with the same i2c attached chips will
589 * be considered equal.
590 * This method is less precise than the eeprom one.
593 /* user did not request i2c scanning => do it now */
595 em28xx_do_i2c_scan(dev
);
597 for (i
= 0; i
< ARRAY_SIZE(em28xx_i2c_hash
); i
++) {
598 if (dev
->i2c_hash
== em28xx_i2c_hash
[i
].hash
) {
599 dev
->model
= em28xx_i2c_hash
[i
].model
;
600 dev
->tuner_type
= em28xx_i2c_hash
[i
].tuner
;
601 em28xx_errdev("Your board has no unique USB ID.\n");
602 em28xx_errdev("A hint were successfully done, "
603 "based on i2c devicelist hash.\n");
604 em28xx_errdev("This method is not 100%% failproof.\n");
605 em28xx_errdev("If the board were missdetected, "
606 "please email this log to:\n");
607 em28xx_errdev("\tV4L Mailing List "
608 " <video4linux-list@redhat.com>\n");
609 em28xx_errdev("Board detected as %s\n",
610 em28xx_boards
[dev
->model
].name
);
616 em28xx_errdev("Your board has no unique USB ID and thus need a "
617 "hint to be detected.\n");
618 em28xx_errdev("You may try to use card=<n> insmod option to "
619 "workaround that.\n");
620 em28xx_errdev("Please send an email with this log to:\n");
621 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
622 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev
->hash
);
623 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev
->i2c_hash
);
625 em28xx_errdev("Here is a list of valid choices for the card=<n>"
626 " insmod option:\n");
627 for (i
= 0; i
< em28xx_bcount
; i
++) {
628 em28xx_errdev(" card=%d -> %s\n",
629 i
, em28xx_boards
[i
].name
);
635 static void em28xx_set_model(struct em28xx
*dev
)
637 dev
->is_em2800
= em28xx_boards
[dev
->model
].is_em2800
;
638 dev
->has_tuner
= em28xx_boards
[dev
->model
].has_tuner
;
639 dev
->has_msp34xx
= em28xx_boards
[dev
->model
].has_msp34xx
;
640 dev
->tda9887_conf
= em28xx_boards
[dev
->model
].tda9887_conf
;
641 dev
->decoder
= em28xx_boards
[dev
->model
].decoder
;
642 dev
->video_inputs
= em28xx_boards
[dev
->model
].vchannels
;
643 dev
->analog_gpio
= em28xx_boards
[dev
->model
].analog_gpio
;
645 if (!em28xx_boards
[dev
->model
].has_tuner
)
646 dev
->tuner_type
= UNSET
;
649 void em28xx_card_setup(struct em28xx
*dev
)
651 em28xx_set_model(dev
);
653 dev
->tuner_type
= em28xx_boards
[dev
->model
].tuner_type
;
655 /* request some modules */
656 switch (dev
->model
) {
657 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2
:
658 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
:
659 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950
:
662 #ifdef CONFIG_MODULES
663 request_module("tveeprom");
665 /* Call first TVeeprom */
667 dev
->i2c_client
.addr
= 0xa0 >> 1;
668 tveeprom_hauppauge_analog(&dev
->i2c_client
, &tv
, dev
->eedata
);
670 dev
->tuner_type
= tv
.tuner_type
;
671 if (tv
.audio_processor
== AUDIO_CHIP_MSP34XX
) {
672 dev
->i2s_speed
= 2048000;
673 dev
->has_msp34xx
= 1;
675 #ifdef CONFIG_MODULES
677 request_module("ir-kbd-i2c");
679 /* enable audio 12 mhz i2s */
680 em28xx_write_regs(dev
, XCLK_REG
, "\xa7", 1);
685 case EM2820_BOARD_KWORLD_PVRTV2800RF
:
686 /* GPIO enables sound on KWORLD PVR TV 2800RF */
687 em28xx_write_regs_req(dev
, 0x00, 0x08, "\xf9", 1);
689 case EM2820_BOARD_UNKNOWN
:
690 case EM2800_BOARD_UNKNOWN
:
691 if (!em28xx_hint_board(dev
))
692 em28xx_set_model(dev
);
695 /* Allow override tuner type by a module parameter */
697 dev
->tuner_type
= tuner
;
699 #ifdef CONFIG_MODULES
700 /* request some modules */
701 if (dev
->has_msp34xx
)
702 request_module("msp3400");
703 if (dev
->decoder
== EM28XX_SAA7113
|| dev
->decoder
== EM28XX_SAA7114
)
704 request_module("saa7115");
705 if (dev
->decoder
== EM28XX_TVP5150
)
706 request_module("tvp5150");
708 request_module("tuner");
711 em28xx_config_tuner(dev
);