24 #include <linux/module.h>
25 #include <linux/slab.h>
27 #include <linux/i2c.h>
41 static int tuner = -1;
49 static unsigned int disable_ir;
54 static unsigned long cx231xx_devused;
72 .name =
"Unknown CX231xx video grabber",
73 .tuner_type = TUNER_ABSENT,
95 .name =
"Conexant Hybrid TV - CARRAERA",
96 .tuner_type = TUNER_XC5000,
98 .tuner_gpio = RDE250_XCV_TUNER,
99 .tuner_sif_gpio = 0x05,
100 .tuner_scl_gpio = 0x1a,
101 .tuner_sda_gpio = 0x1b,
104 .demod_xfer_mode = 0,
105 .ctl_pin_status_mask = 0xFFFFFFC4,
106 .agc_analog_digital_select_gpio = 0x0c,
107 .gpio_pin_status_mask = 0x4001000,
108 .tuner_i2c_master = 1,
109 .demod_i2c_master = 2,
135 .name =
"Conexant Hybrid TV - SHELBY",
136 .tuner_type = TUNER_XC5000,
138 .tuner_gpio = RDE250_XCV_TUNER,
139 .tuner_sif_gpio = 0x05,
140 .tuner_scl_gpio = 0x1a,
141 .tuner_sda_gpio = 0x1b,
144 .demod_xfer_mode = 0,
145 .ctl_pin_status_mask = 0xFFFFFFC4,
146 .agc_analog_digital_select_gpio = 0x0c,
147 .gpio_pin_status_mask = 0x4001000,
148 .tuner_i2c_master = 1,
149 .demod_i2c_master = 2,
175 .name =
"Conexant Hybrid TV - RDE253S",
176 .tuner_type = TUNER_NXP_TDA18271,
178 .tuner_gpio = RDE250_XCV_TUNER,
179 .tuner_sif_gpio = 0x05,
180 .tuner_scl_gpio = 0x1a,
181 .tuner_sda_gpio = 0x1b,
184 .demod_xfer_mode = 0,
185 .ctl_pin_status_mask = 0xFFFFFFC4,
186 .agc_analog_digital_select_gpio = 0x1c,
187 .gpio_pin_status_mask = 0x4001000,
188 .tuner_i2c_master = 1,
189 .demod_i2c_master = 2,
216 .name =
"Conexant Hybrid TV - RDU253S",
217 .tuner_type = TUNER_NXP_TDA18271,
219 .tuner_gpio = RDE250_XCV_TUNER,
220 .tuner_sif_gpio = 0x05,
221 .tuner_scl_gpio = 0x1a,
222 .tuner_sda_gpio = 0x1b,
225 .demod_xfer_mode = 0,
226 .ctl_pin_status_mask = 0xFFFFFFC4,
227 .agc_analog_digital_select_gpio = 0x1c,
228 .gpio_pin_status_mask = 0x4001000,
229 .tuner_i2c_master = 1,
230 .demod_i2c_master = 2,
256 .name =
"Conexant VIDEO GRABBER",
257 .tuner_type = TUNER_ABSENT,
260 .ctl_pin_status_mask = 0xFFFFFFC4,
261 .agc_analog_digital_select_gpio = 0x1c,
262 .gpio_pin_status_mask = 0x4001000,
284 .name =
"Conexant Hybrid TV - rde 250",
285 .tuner_type = TUNER_XC5000,
287 .tuner_gpio = RDE250_XCV_TUNER,
288 .tuner_sif_gpio = 0x05,
289 .tuner_scl_gpio = 0x1a,
290 .tuner_sda_gpio = 0x1b,
293 .demod_xfer_mode = 0,
294 .ctl_pin_status_mask = 0xFFFFFFC4,
295 .agc_analog_digital_select_gpio = 0x0c,
296 .gpio_pin_status_mask = 0x4001000,
297 .tuner_i2c_master = 1,
298 .demod_i2c_master = 2,
312 .name =
"Conexant Hybrid TV - RDU 250",
313 .tuner_type = TUNER_XC5000,
315 .tuner_gpio = RDE250_XCV_TUNER,
316 .tuner_sif_gpio = 0x05,
317 .tuner_scl_gpio = 0x1a,
318 .tuner_sda_gpio = 0x1b,
321 .demod_xfer_mode = 0,
322 .ctl_pin_status_mask = 0xFFFFFFC4,
323 .agc_analog_digital_select_gpio = 0x0c,
324 .gpio_pin_status_mask = 0x4001000,
325 .tuner_i2c_master = 1,
326 .demod_i2c_master = 2,
340 .name =
"Hauppauge EXETER",
341 .tuner_type = TUNER_NXP_TDA18271,
343 .tuner_gpio = RDE250_XCV_TUNER,
344 .tuner_sif_gpio = 0x05,
345 .tuner_scl_gpio = 0x1a,
346 .tuner_sda_gpio = 0x1b,
349 .demod_xfer_mode = 0,
350 .ctl_pin_status_mask = 0xFFFFFFC4,
351 .agc_analog_digital_select_gpio = 0x0c,
352 .gpio_pin_status_mask = 0x4001000,
353 .tuner_i2c_master = 1,
354 .demod_i2c_master = 2,
379 .name =
"Hauppauge USB Live 2",
380 .tuner_type = TUNER_ABSENT,
383 .demod_xfer_mode = 0,
384 .ctl_pin_status_mask = 0xFFFFFFC4,
385 .agc_analog_digital_select_gpio = 0x0c,
386 .gpio_pin_status_mask = 0x4001000,
390 .dont_use_port_3 = 1,
406 .name =
"Kworld UB430 USB Hybrid",
407 .tuner_type = TUNER_NXP_TDA18271,
411 .demod_xfer_mode = 0,
412 .ctl_pin_status_mask = 0xFFFFFFC4,
413 .agc_analog_digital_select_gpio = 0x11,
414 .tuner_sif_gpio = -1,
415 .tuner_scl_gpio = -1,
416 .tuner_sda_gpio = -1,
417 .gpio_pin_status_mask = 0x4001000,
418 .tuner_i2c_master = 2,
419 .demod_i2c_master = 1,
444 .name =
"Pixelview PlayTV USB Hybrid",
445 .tuner_type = TUNER_NXP_TDA18271,
449 .demod_xfer_mode = 0,
450 .ctl_pin_status_mask = 0xFFFFFFC4,
451 .agc_analog_digital_select_gpio = 0x00,
452 .tuner_sif_gpio = -1,
453 .tuner_scl_gpio = -1,
454 .tuner_sda_gpio = -1,
455 .gpio_pin_status_mask = 0x4001000,
456 .tuner_i2c_master = 2,
457 .demod_i2c_master = 1,
483 .name =
"Pixelview Xcapture USB",
484 .tuner_type = TUNER_ABSENT,
487 .demod_xfer_mode = 0,
488 .ctl_pin_status_mask = 0xFFFFFFC4,
489 .agc_analog_digital_select_gpio = 0x0c,
490 .gpio_pin_status_mask = 0x4001000,
494 .dont_use_port_3 = 1,
513 .name =
"Iconbit Analog Stick U100 FM",
514 .tuner_type = TUNER_ABSENT,
517 .demod_xfer_mode = 0,
518 .ctl_pin_status_mask = 0xFFFFFFC4,
519 .agc_analog_digital_select_gpio = 0x1C,
520 .gpio_pin_status_mask = 0x4001000,
537 .name =
"Hauppauge WinTV USB2 FM (PAL)",
538 .tuner_type = TUNER_NXP_TDA18271,
540 .tuner_gpio = RDE250_XCV_TUNER,
541 .tuner_sif_gpio = 0x05,
542 .tuner_scl_gpio = 0x1a,
543 .tuner_sda_gpio = 0x1b,
546 .ctl_pin_status_mask = 0xFFFFFFC4,
547 .agc_analog_digital_select_gpio = 0x0c,
548 .gpio_pin_status_mask = 0x4001000,
549 .tuner_i2c_master = 1,
572 .name =
"Hauppauge WinTV USB2 FM (NTSC)",
573 .tuner_type = TUNER_NXP_TDA18271,
575 .tuner_gpio = RDE250_XCV_TUNER,
576 .tuner_sif_gpio = 0x05,
577 .tuner_scl_gpio = 0x1a,
578 .tuner_sda_gpio = 0x1b,
581 .ctl_pin_status_mask = 0xFFFFFFC4,
582 .agc_analog_digital_select_gpio = 0x0c,
583 .gpio_pin_status_mask = 0x4001000,
584 .tuner_i2c_master = 1,
611 {USB_DEVICE(0x0572, 0x5A3C),
613 {USB_DEVICE(0x0572, 0x58A2),
615 {USB_DEVICE(0x0572, 0x58A1),
617 {USB_DEVICE(0x0572, 0x58A4),
619 {USB_DEVICE(0x0572, 0x58A5),
621 {USB_DEVICE(0x0572, 0x58A6),
623 {USB_DEVICE(0x0572, 0x589E),
625 {USB_DEVICE(0x0572, 0x58A0),
627 {USB_DEVICE(0x2040, 0xb110),
629 {USB_DEVICE(0x2040, 0xb111),
631 {USB_DEVICE(0x2040, 0xb120),
633 {USB_DEVICE(0x2040, 0xb140),
635 {USB_DEVICE(0x2040, 0xc200),
641 {USB_DEVICE(0x1b80, 0xe424),
643 {USB_DEVICE(0x1f4d, 0x0237),
662 (
"Tuner CB: RESET: cmd %d : tuner type %d \n",
674 }
else if (dev->
tuner_type == TUNER_NXP_TDA18271) {
706 static inline void cx231xx_set_model(
struct cx231xx *
dev)
717 cx231xx_set_model(dev);
723 if (dev->
board.tuner_gpio) {
727 if (dev->
board.tuner_sif_gpio >= 0)
740 static void cx231xx_config_tuner(
struct cx231xx *
dev)
742 struct tuner_setup tun_setup;
748 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
756 if (tun_setup.type == TUNER_XC5000) {
758 .fname = XC5000_DEFAULT_FIRMWARE,
781 cx231xx_set_model(dev);
791 "cx25840", 0x88 >> 1,
NULL);
799 if (dev->
board.tuner_type != TUNER_ABSENT) {
807 cx231xx_config_tuner(dev);
870 static int cx231xx_init_dev(
struct cx231xx *dev,
struct usb_device *
udev,
875 unsigned int maxh, maxw;
955 INIT_LIST_HEAD(&dev->
vbi_mode.vidq.active);
956 INIT_LIST_HEAD(&dev->
vbi_mode.vidq.queued);
961 if (dev->
board.has_417) {
965 "%s() Failed to register 417 on VID_B\n",
983 #if defined(CONFIG_MODULES) && defined(MODULE)
990 request_module(
"cx231xx-alsa");
992 if (dev->
board.has_dvb)
993 request_module(
"cx231xx-dvb");
1008 #define request_modules(dev)
1009 #define flush_request_modules(dev)
1019 struct usb_device *
udev;
1024 int i, isoc_pipe = 0;
1028 udev =
usb_get_dev(interface_to_usbdev(interface));
1029 ifnum = interface->altsetting[0].desc.bInterfaceNumber;
1059 dev->
model =
id->driver_info;
1075 assoc_desc = udev->actconfig->intf_assoc[0];
1085 switch (udev->speed) {
1101 "(%04x:%04x) with %d interfaces\n",
1102 udev->manufacturer ? udev->manufacturer :
"",
1103 udev->product ? udev->product :
"",
1115 assoc_desc = udev->actconfig->intf_assoc[0];
1118 "matching IAD interface\n");
1128 usb_set_intfdata(interface, dev);
1144 retval = cx231xx_init_dev(dev, udev, nr);
1150 usb_set_intfdata(interface,
NULL);
1157 hs_config_info[0].interface_info.video_index + 1];
1160 endpoint[isoc_pipe].desc.bEndpointAddress);
1162 dev->
video_mode.num_alt = uif->num_altsetting;
1163 cx231xx_info(
"EndPoint Addr 0x%x, Alternate settings: %i\n",
1178 for (i = 0; i < dev->
video_mode.num_alt; i++) {
1180 desc.wMaxPacketSize);
1182 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1183 cx231xx_info(
"Alternate setting %i, max size= %i\n", i,
1189 hs_config_info[0].interface_info.
1193 le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc.
1196 dev->
vbi_mode.num_alt = uif->num_altsetting;
1197 cx231xx_info(
"EndPoint Addr 0x%x, Alternate settings: %i\n",
1212 for (i = 0; i < dev->
vbi_mode.num_alt; i++) {
1214 le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].
1215 desc.wMaxPacketSize);
1217 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1218 cx231xx_info(
"Alternate setting %i, max size= %i\n", i,
1219 dev->
vbi_mode.alt_max_pkt_size[i]);
1224 hs_config_info[0].interface_info.
1228 le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc.
1232 cx231xx_info(
"EndPoint Addr 0x%x, Alternate settings: %i\n",
1249 desc.wMaxPacketSize);
1251 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1252 cx231xx_info(
"Alternate setting %i, max size= %i\n", i,
1264 le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].
1265 desc.bEndpointAddress);
1267 dev->
ts1_mode.num_alt = uif->num_altsetting;
1268 cx231xx_info(
"EndPoint Addr 0x%x, Alternate settings: %i\n",
1283 for (i = 0; i < dev->
ts1_mode.num_alt; i++) {
1288 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1289 cx231xx_info(
"Alternate setting %i, max size= %i\n", i,
1290 dev->
ts1_mode.alt_max_pkt_size[i]);
1318 dev = usb_get_intfdata(interface);
1319 usb_set_intfdata(interface,
NULL);
1339 (
"device %s is open! Deregistration and memory "
1340 "deallocation are deferred on close.\n",
1341 video_device_node_name(dev->
vdev));
1363 static struct usb_driver cx231xx_usb_driver = {
1365 .probe = cx231xx_usb_probe,
1366 .disconnect = cx231xx_usb_disconnect,