26 #include <linux/module.h>
27 #include <linux/slab.h>
29 #include <linux/i2c.h>
44 #define DRIVER_NAME "em28xx"
46 static int tuner = -1;
50 static unsigned int disable_ir;
54 static unsigned int disable_usb_speed_check;
57 "override min bandwidth requirement of 480M bps");
64 static unsigned long em28xx_devused;
72 static void em28xx_pre_card_setup(
struct em28xx *
dev);
93 {0x05, 0xff, 0x10, 10},
106 static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
200 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
206 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
334 {0x0d, 0xff, 0xff, 50},
336 {0x0d, 0x42, 0xff, 50},
401 .name =
"EM2710/EM2750/EM2751 webcam grabber",
403 .tuner_type = TUNER_ABSENT,
409 .gpio = silvercrest_reg_seq,
413 .name =
"Unknown EM2800 video grabber",
415 .tda9887_conf = TDA9887_PRESENT,
417 .tuner_type = TUNER_ABSENT,
429 .name =
"Unknown EM2750/28xx video grabber",
430 .tuner_type = TUNER_ABSENT,
435 .name =
"Huaqi DLCW-130",
438 .tuner_type = TUNER_ABSENT,
447 .name =
"Kworld PVR TV 2800 RF",
448 .tuner_type = TUNER_TEMIC_PAL,
449 .tda9887_conf = TDA9887_PRESENT,
462 .name =
"Gadmei TVR200",
463 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
464 .tda9887_conf = TDA9887_PRESENT,
481 .name =
"Terratec Cinergy 250 USB",
482 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
484 .tda9887_conf = TDA9887_PRESENT,
501 .name =
"Pinnacle PCTV USB 2",
502 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
504 .tda9887_conf = TDA9887_PRESENT,
521 .name =
"Hauppauge WinTV USB 2",
522 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
523 .tda9887_conf = TDA9887_PRESENT |
524 TDA9887_PORT1_ACTIVE |
525 TDA9887_PORT2_ACTIVE,
541 .name =
"D-Link DUB-T210 TV Tuner",
543 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
544 .tda9887_conf = TDA9887_PRESENT,
561 .name =
"Hercules Smart TV USB 2.0",
563 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
564 .tda9887_conf = TDA9887_PRESENT,
581 .name =
"Pinnacle PCTV USB 2 (Philips FM1216ME)",
583 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
584 .tda9887_conf = TDA9887_PRESENT,
601 .name =
"Gadmei UTV310",
603 .tuner_type = TUNER_TNF_5335MF,
604 .tda9887_conf = TDA9887_PRESENT,
621 .name =
"Leadtek Winfast USB II Deluxe",
623 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
625 .tvaudio_addr = 0x58,
626 .tda9887_conf = TDA9887_PRESENT |
627 TDA9887_PORT2_ACTIVE |
650 .name =
"Videology 20K14XUSB USB2.0",
652 .tuner_type = TUNER_ABSENT,
661 .name =
"Silvercrest Webcam 1.3mpix",
662 .tuner_type = TUNER_ABSENT,
668 .gpio = silvercrest_reg_seq,
672 .name =
"Supercomp USB 2.0 TV",
674 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
675 .tda9887_conf = TDA9887_PRESENT |
676 TDA9887_PORT1_ACTIVE |
677 TDA9887_PORT2_ACTIVE,
694 .name =
"Usbgear VD204v9",
696 .tuner_type = TUNER_ABSENT,
710 .name =
"NetGMBH Cam",
712 .tuner_type = TUNER_ABSENT,
721 .name =
"Typhoon DVD Maker",
723 .tuner_type = TUNER_ABSENT,
735 .name =
"Gadmei UTV330",
737 .tuner_type = TUNER_TNF_5335MF,
738 .tda9887_conf = TDA9887_PRESENT,
755 .name =
"Gadmei UTV330+",
756 .tuner_type = TUNER_TNF_5335MF,
757 .tda9887_conf = TDA9887_PRESENT,
776 .name =
"Terratec Cinergy A Hybrid XS",
778 .tuner_type = TUNER_XC2028,
779 .tuner_gpio = default_tuner_gpio,
786 .gpio = hauppauge_wintv_hvr_900_analog,
791 .gpio = hauppauge_wintv_hvr_900_analog,
796 .gpio = hauppauge_wintv_hvr_900_analog,
800 .name =
"KWorld PVRTV 300U",
802 .tuner_type = TUNER_XC2028,
803 .tuner_gpio = default_tuner_gpio,
820 .name =
"Yakumo MovieMixer",
821 .tuner_type = TUNER_ABSENT,
838 .name =
"EM2860/TVP5150 Reference Design",
839 .tuner_type = TUNER_ABSENT,
852 .name =
"Plextor ConvertX PX-TV100U",
853 .tuner_type = TUNER_TNF_5335MF,
856 .tda9887_conf = TDA9887_PRESENT,
863 .gpio = pinnacle_hybrid_pro_analog,
868 .gpio = pinnacle_hybrid_pro_analog,
873 .gpio = pinnacle_hybrid_pro_analog,
880 .name =
"Terratec Cinergy T XS",
882 .tuner_type = TUNER_XC2028,
883 .tuner_gpio = default_tuner_gpio,
886 .name =
"Terratec Cinergy T XS (MT2060)",
888 .tuner_type = TUNER_ABSENT,
891 .name =
"Kworld 350 U DVB-T",
893 .tuner_type = TUNER_XC2028,
894 .tuner_gpio = default_tuner_gpio,
897 .name =
"Kworld 355 U DVB-T",
899 .tuner_type = TUNER_ABSENT,
900 .tuner_gpio = default_tuner_gpio,
902 .dvb_gpio = default_digital,
905 .name =
"Pinnacle PCTV DVB-T",
907 .tuner_type = TUNER_ABSENT,
913 .name =
"Compro, VideoMate U3",
915 .tuner_type = TUNER_ABSENT,
919 .name =
"Terratec Hybrid XS Secam",
921 .tuner_type = TUNER_XC2028,
922 .tuner_gpio = default_tuner_gpio,
925 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
930 .gpio = terratec_cinergy_USB_XS_FR_analog,
935 .gpio = terratec_cinergy_USB_XS_FR_analog,
940 .gpio = terratec_cinergy_USB_XS_FR_analog,
944 .name =
"Terratec Cinergy H5",
947 .tuner_type = TUNER_PHILIPS_TDA8290,
949 .dvb_gpio = terratec_h5_digital,
950 .tuner_gpio = terratec_h5_gpio,
952 .tuner_type = TUNER_ABSENT,
959 .name =
"Hauppauge WinTV HVR 930C",
962 .tuner_type = TUNER_XC5000,
964 .dvb_gpio = hauppauge_930c_digital,
965 .tuner_gpio = hauppauge_930c_gpio,
967 .tuner_type = TUNER_ABSENT,
975 .name =
"Terratec Cinergy HTC Stick",
978 .tuner_type = TUNER_ABSENT,
984 .name =
"Hauppauge WinTV HVR 900",
985 .tda9887_conf = TDA9887_PRESENT,
986 .tuner_type = TUNER_XC2028,
987 .tuner_gpio = default_tuner_gpio,
990 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
997 .gpio = hauppauge_wintv_hvr_900_analog,
1002 .gpio = hauppauge_wintv_hvr_900_analog,
1007 .gpio = hauppauge_wintv_hvr_900_analog,
1011 .name =
"Hauppauge WinTV HVR 900 (R2)",
1012 .tda9887_conf = TDA9887_PRESENT,
1013 .tuner_type = TUNER_XC2028,
1014 .tuner_gpio = default_tuner_gpio,
1017 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
1024 .gpio = hauppauge_wintv_hvr_900_analog,
1029 .gpio = hauppauge_wintv_hvr_900_analog,
1034 .gpio = hauppauge_wintv_hvr_900_analog,
1038 .name =
"Hauppauge WinTV HVR 850",
1039 .tuner_type = TUNER_XC2028,
1040 .tuner_gpio = default_tuner_gpio,
1043 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1050 .gpio = hauppauge_wintv_hvr_900_analog,
1055 .gpio = hauppauge_wintv_hvr_900_analog,
1060 .gpio = hauppauge_wintv_hvr_900_analog,
1064 .name =
"Hauppauge WinTV HVR 950",
1065 .tuner_type = TUNER_XC2028,
1066 .tuner_gpio = default_tuner_gpio,
1069 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1076 .gpio = hauppauge_wintv_hvr_900_analog,
1081 .gpio = hauppauge_wintv_hvr_900_analog,
1086 .gpio = hauppauge_wintv_hvr_900_analog,
1090 .name =
"Pinnacle PCTV HD Pro Stick",
1091 .tuner_type = TUNER_XC2028,
1092 .tuner_gpio = default_tuner_gpio,
1095 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1102 .gpio = hauppauge_wintv_hvr_900_analog,
1107 .gpio = hauppauge_wintv_hvr_900_analog,
1112 .gpio = hauppauge_wintv_hvr_900_analog,
1116 .name =
"AMD ATI TV Wonder HD 600",
1117 .tuner_type = TUNER_XC2028,
1118 .tuner_gpio = default_tuner_gpio,
1121 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1128 .gpio = hauppauge_wintv_hvr_900_analog,
1133 .gpio = hauppauge_wintv_hvr_900_analog,
1138 .gpio = hauppauge_wintv_hvr_900_analog,
1142 .name =
"Terratec Hybrid XS",
1143 .tuner_type = TUNER_XC2028,
1144 .tuner_gpio = default_tuner_gpio,
1147 .dvb_gpio = default_digital,
1154 .gpio = default_analog,
1159 .gpio = default_analog,
1164 .gpio = default_analog,
1171 .name =
"Terratec Prodigy XS",
1172 .tuner_type = TUNER_XC2028,
1173 .tuner_gpio = default_tuner_gpio,
1179 .gpio = hauppauge_wintv_hvr_900_analog,
1184 .gpio = hauppauge_wintv_hvr_900_analog,
1189 .gpio = hauppauge_wintv_hvr_900_analog,
1193 .name =
"MSI VOX USB 2.0",
1194 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1195 .tda9887_conf = TDA9887_PRESENT |
1196 TDA9887_PORT1_ACTIVE |
1197 TDA9887_PORT2_ACTIVE,
1198 .max_range_640_480 = 1,
1215 .name =
"Terratec Cinergy 200 USB",
1218 .tuner_type = TUNER_LG_TALN,
1219 .tda9887_conf = TDA9887_PRESENT,
1236 .name =
"eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1239 .tuner_type = TUNER_ABSENT,
1251 .name =
"Actionmaster/LinXcel/Digitus VC211A",
1253 .tuner_type = TUNER_ABSENT,
1259 .gpio = vc211a_enable,
1264 .gpio = vc211a_enable,
1268 .name =
"Leadtek Winfast USB II",
1270 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1271 .tda9887_conf = TDA9887_PRESENT,
1288 .name =
"Kworld USB2800",
1290 .tuner_type = TUNER_PHILIPS_FCV1236D,
1291 .tda9887_conf = TDA9887_PRESENT,
1308 .name =
"Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
1309 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
1310 .tuner_type = TUNER_ABSENT,
1323 .name =
"V-Gear PocketTV",
1325 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1326 .tda9887_conf = TDA9887_PRESENT,
1343 .name =
"Pixelview PlayTV Box 4 USB 2.0",
1344 .tda9887_conf = TDA9887_PRESENT,
1345 .tuner_type = TUNER_YMEC_TVF_5533MF,
1364 .name =
"SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
1365 .has_snapshot_button = 1,
1366 .tda9887_conf = TDA9887_PRESENT,
1367 .tuner_type = TUNER_YMEC_TVF_5533MF,
1386 .name =
"EM2860/SAA711X Reference Design",
1387 .has_snapshot_button = 1,
1388 .tuner_type = TUNER_ABSENT,
1404 .name =
"EM2874 Leadership ISDBT",
1405 .tuner_type = TUNER_ABSENT,
1406 .tuner_gpio = leadership_reset,
1407 .dvb_gpio = leadership_digital,
1412 .name =
"MSI DigiVox A/D",
1414 .tuner_type = TUNER_XC2028,
1415 .tuner_gpio = default_tuner_gpio,
1421 .gpio = em2880_msi_digivox_ad_analog,
1426 .gpio = em2880_msi_digivox_ad_analog,
1431 .gpio = em2880_msi_digivox_ad_analog,
1435 .name =
"MSI DigiVox A/D II",
1437 .tuner_type = TUNER_XC2028,
1438 .tuner_gpio = default_tuner_gpio,
1444 .gpio = em2880_msi_digivox_ad_analog,
1449 .gpio = em2880_msi_digivox_ad_analog,
1454 .gpio = em2880_msi_digivox_ad_analog,
1458 .name =
"KWorld DVB-T 305U",
1459 .tuner_type = TUNER_XC2028,
1460 .tuner_gpio = default_tuner_gpio,
1477 .name =
"KWorld DVB-T 310U",
1478 .tuner_type = TUNER_XC2028,
1479 .tuner_gpio = default_tuner_gpio,
1481 .dvb_gpio = default_digital,
1488 .gpio = default_analog,
1493 .gpio = default_analog,
1498 .gpio = default_analog,
1502 .name =
"KWorld ATSC 315U HDTV TV Box",
1504 .tuner_type = TUNER_THOMSON_DTT761X,
1505 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1506 .tda9887_conf = TDA9887_PRESENT,
1509 .dvb_gpio = em2882_kworld_315u_digital,
1535 .name =
"Empire dual TV",
1536 .tuner_type = TUNER_XC2028,
1537 .tuner_gpio = default_tuner_gpio,
1539 .dvb_gpio = default_digital,
1546 .gpio = default_analog,
1551 .gpio = default_analog,
1556 .gpio = default_analog,
1560 .name =
"DNT DA2 Hybrid",
1562 .tuner_type = TUNER_XC2028,
1563 .tuner_gpio = default_tuner_gpio,
1569 .gpio = default_analog,
1574 .gpio = default_analog,
1579 .gpio = default_analog,
1583 .name =
"Pinnacle Hybrid Pro",
1584 .tuner_type = TUNER_XC2028,
1585 .tuner_gpio = default_tuner_gpio,
1588 .dvb_gpio = pinnacle_hybrid_pro_digital,
1593 .gpio = pinnacle_hybrid_pro_analog,
1598 .gpio = pinnacle_hybrid_pro_analog,
1603 .gpio = pinnacle_hybrid_pro_analog,
1607 .name =
"Pinnacle Hybrid Pro (330e)",
1608 .tuner_type = TUNER_XC2028,
1609 .tuner_gpio = default_tuner_gpio,
1612 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
1619 .gpio = hauppauge_wintv_hvr_900_analog,
1624 .gpio = hauppauge_wintv_hvr_900_analog,
1629 .gpio = hauppauge_wintv_hvr_900_analog,
1633 .name =
"Kworld VS-DVB-T 323UR",
1634 .tuner_type = TUNER_XC2028,
1635 .tuner_gpio = default_tuner_gpio,
1639 .dvb_gpio = kworld_330u_digital,
1657 .name =
"Terratec Cinnergy Hybrid T USB XS (em2882)",
1658 .tuner_type = TUNER_XC2028,
1659 .tuner_gpio = default_tuner_gpio,
1663 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1670 .gpio = hauppauge_wintv_hvr_900_analog,
1675 .gpio = hauppauge_wintv_hvr_900_analog,
1680 .gpio = hauppauge_wintv_hvr_900_analog,
1684 .name =
"Dikom DK300",
1685 .tuner_type = TUNER_XC2028,
1686 .tuner_gpio = default_tuner_gpio,
1690 .dvb_gpio = dikom_dk300_digital,
1695 .gpio = default_analog,
1699 .name =
"Kworld PlusTV HD Hybrid 330",
1700 .tuner_type = TUNER_XC2028,
1701 .tuner_gpio = default_tuner_gpio,
1705 .dvb_gpio = kworld_330u_digital,
1714 .gpio = kworld_330u_analog,
1720 .gpio = kworld_330u_analog,
1726 .gpio = kworld_330u_analog,
1730 .name =
"Compro VideoMate ForYou/Stereo",
1731 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1732 .tvaudio_addr = 0xb0,
1733 .tda9887_conf = TDA9887_PRESENT,
1736 .mute_gpio = compro_mute_gpio,
1741 .gpio = compro_unmute_tv_gpio,
1746 .gpio = compro_unmute_svid_gpio,
1750 .name =
"Kaiomy TVnPC U2",
1752 .tuner_type = TUNER_XC2028,
1756 .tuner_gpio = default_tuner_gpio,
1778 .name =
"Easy Cap Capture DC-60",
1780 .tuner_type = TUNER_ABSENT,
1793 .name =
"IO-DATA GV-MVP/SZ",
1794 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1795 .tuner_gpio = default_tuner_gpio,
1796 .tda9887_conf = TDA9887_PRESENT,
1813 .name =
"Terratec Grabby",
1815 .tuner_type = TUNER_ABSENT,
1829 .name =
"Terratec AV350",
1831 .tuner_type = TUNER_ABSENT,
1834 .mute_gpio = terratec_av350_mute_gpio,
1839 .gpio = terratec_av350_unmute_gpio,
1845 .gpio = terratec_av350_unmute_gpio,
1850 .name =
"Elgato Video Capture",
1852 .tuner_type = TUNER_ABSENT,
1865 .name =
"Evga inDtube",
1866 .tuner_type = TUNER_XC2028,
1867 .tuner_gpio = default_tuner_gpio,
1872 .dvb_gpio = evga_indtube_digital,
1878 .gpio = evga_indtube_analog,
1883 .gpio = evga_indtube_analog,
1888 .gpio = evga_indtube_analog,
1894 .name =
"Reddo DVB-C USB TV Box",
1895 .tuner_type = TUNER_ABSENT,
1896 .tuner_gpio = reddo_dvb_c_usb_box,
1903 .name =
"KWorld PlusTV 340U or UB435-Q (ATSC)",
1904 .tuner_type = TUNER_ABSENT,
1906 .dvb_gpio = kworld_a340_digital,
1907 .tuner_gpio = default_tuner_gpio,
1912 .name =
"PCTV nanoStick T2 290e",
1915 .tuner_type = TUNER_ABSENT,
1916 .tuner_gpio = pctv_290e,
1925 .name =
"PCTV DVB-S2 Stick (460e)",
1926 .tuner_type = TUNER_ABSENT,
1927 .tuner_gpio = pctv_460e,
1934 .name =
"Honestech Vidbox NW03",
1935 .tuner_type = TUNER_ABSENT,
1950 .name =
"MaxMedia UB425-TC",
1951 .tuner_type = TUNER_ABSENT,
1952 .tuner_gpio = maxmedia_ub425_tc,
1961 .name =
"PCTV QuatroStick (510e)",
1962 .tuner_type = TUNER_ABSENT,
1963 .tuner_gpio = pctv_510e,
1973 .name =
"PCTV QuatroStick nano (520e)",
1974 .tuner_type = TUNER_ABSENT,
1975 .tuner_gpio = pctv_520e,
1987 { USB_DEVICE(0xeb1a, 0x2750),
1989 { USB_DEVICE(0xeb1a, 0x2751),
1991 { USB_DEVICE(0xeb1a, 0x2800),
1993 { USB_DEVICE(0xeb1a, 0x2710),
1995 { USB_DEVICE(0xeb1a, 0x2820),
1997 { USB_DEVICE(0xeb1a, 0x2821),
1999 { USB_DEVICE(0xeb1a, 0x2860),
2001 { USB_DEVICE(0xeb1a, 0x2861),
2003 { USB_DEVICE(0xeb1a, 0x2862),
2005 { USB_DEVICE(0xeb1a, 0x2863),
2007 { USB_DEVICE(0xeb1a, 0x2870),
2009 { USB_DEVICE(0xeb1a, 0x2881),
2011 { USB_DEVICE(0xeb1a, 0x2883),
2013 { USB_DEVICE(0xeb1a, 0x2868),
2015 { USB_DEVICE(0xeb1a, 0x2875),
2017 { USB_DEVICE(0xeb1a, 0xe300),
2019 { USB_DEVICE(0xeb1a, 0xe303),
2021 { USB_DEVICE(0xeb1a, 0xe305),
2023 { USB_DEVICE(0xeb1a, 0xe310),
2025 { USB_DEVICE(0xeb1a, 0xa313),
2027 { USB_DEVICE(0xeb1a, 0xa316),
2029 { USB_DEVICE(0xeb1a, 0xe320),
2031 { USB_DEVICE(0xeb1a, 0xe323),
2033 { USB_DEVICE(0xeb1a, 0xe350),
2035 { USB_DEVICE(0xeb1a, 0xe355),
2037 { USB_DEVICE(0xeb1a, 0x2801),
2039 { USB_DEVICE(0xeb1a, 0xe357),
2041 { USB_DEVICE(0xeb1a, 0xe359),
2043 { USB_DEVICE(0x1b80, 0xe302),
2045 { USB_DEVICE(0x1b80, 0xe304),
2047 { USB_DEVICE(0x0ccd, 0x0036),
2049 { USB_DEVICE(0x0ccd, 0x004c),
2051 { USB_DEVICE(0x0ccd, 0x004f),
2053 { USB_DEVICE(0x0ccd, 0x005e),
2055 { USB_DEVICE(0x0ccd, 0x0042),
2057 { USB_DEVICE(0x0ccd, 0x0043),
2059 { USB_DEVICE(0x0ccd, 0x008e),
2061 { USB_DEVICE(0x0ccd, 0x00ac),
2063 { USB_DEVICE(0x0ccd, 0x10a2),
2065 { USB_DEVICE(0x0ccd, 0x10ad),
2067 { USB_DEVICE(0x0ccd, 0x0084),
2069 { USB_DEVICE(0x0ccd, 0x0096),
2071 { USB_DEVICE(0x0ccd, 0x10AF),
2073 { USB_DEVICE(0x0ccd, 0x00b2),
2075 { USB_DEVICE(0x0fd9, 0x0033),
2077 { USB_DEVICE(0x185b, 0x2870),
2079 { USB_DEVICE(0x185b, 0x2041),
2081 { USB_DEVICE(0x2040, 0x4200),
2083 { USB_DEVICE(0x2040, 0x4201),
2085 { USB_DEVICE(0x2040, 0x6500),
2087 { USB_DEVICE(0x2040, 0x6502),
2089 { USB_DEVICE(0x2040, 0x6513),
2091 { USB_DEVICE(0x2040, 0x6517),
2093 { USB_DEVICE(0x2040, 0x651b),
2095 { USB_DEVICE(0x2040, 0x651f),
2097 { USB_DEVICE(0x0438, 0xb002),
2099 { USB_DEVICE(0x2001, 0xf112),
2101 { USB_DEVICE(0x2304, 0x0207),
2103 { USB_DEVICE(0x2304, 0x0208),
2105 { USB_DEVICE(0x2304, 0x021a),
2107 { USB_DEVICE(0x2304, 0x0226),
2109 { USB_DEVICE(0x2304, 0x0227),
2111 { USB_DEVICE(0x0413, 0x6023),
2113 { USB_DEVICE(0x093b, 0xa003),
2115 { USB_DEVICE(0x093b, 0xa005),
2117 { USB_DEVICE(0x04bb, 0x0515),
2119 { USB_DEVICE(0xeb1a, 0x50a6),
2121 { USB_DEVICE(0x1b80, 0xa340),
2123 { USB_DEVICE(0x2013, 0x024f),
2125 { USB_DEVICE(0x2013, 0x024c),
2127 { USB_DEVICE(0x2040, 0x1605),
2129 { USB_DEVICE(0xeb1a, 0x5006),
2131 { USB_DEVICE(0x1b80, 0xe309),
2133 { USB_DEVICE(0x1b80, 0xe425),
2135 { USB_DEVICE(0x2304, 0x0242),
2137 { USB_DEVICE(0x2013, 0x0251),
2170 static unsigned short saa711x_addrs[] = {
2171 0x4a >> 1, 0x48 >> 1,
2172 0x42 >> 1, 0x40 >> 1,
2175 static unsigned short tvp5150_addrs[] = {
2181 static unsigned short msp3400_addrs[] = {
2204 static inline void em28xx_set_model(
struct em28xx *
dev)
2211 if (!dev->
board.xclk)
2215 if (!dev->
board.i2c_speed)
2222 static int em28xx_initialize_mt9m111(
struct em28xx *dev)
2225 unsigned char regs[][3] = {
2226 { 0x0d, 0x00, 0x01, },
2227 { 0x0d, 0x00, 0x00, },
2228 { 0x0a, 0x00, 0x21, },
2229 { 0x21, 0x04, 0x00, },
2240 static int em28xx_initialize_mt9m001(
struct em28xx *dev)
2243 unsigned char regs[][3] = {
2244 { 0x0d, 0x00, 0x01, },
2245 { 0x0d, 0x00, 0x00, },
2246 { 0x04, 0x05, 0x00, },
2247 { 0x03, 0x04, 0x00, },
2248 { 0x20, 0x11, 0x00, },
2249 { 0x06, 0x00, 0x10, },
2250 { 0x2b, 0x00, 0x24, },
2251 { 0x2e, 0x00, 0x24, },
2252 { 0x35, 0x00, 0x24, },
2253 { 0x2d, 0x00, 0x20, },
2254 { 0x2c, 0x00, 0x20, },
2255 { 0x09, 0x0a, 0xd4, },
2256 { 0x35, 0x00, 0x57, },
2269 static int em28xx_hint_sensor(
struct em28xx *dev)
2290 em28xx_set_model(dev);
2292 sensor_name =
"mt9v011";
2316 em28xx_set_model(dev);
2318 sensor_name =
"mt9m111";
2321 em28xx_initialize_mt9m111(dev);
2332 em28xx_set_model(dev);
2334 sensor_name =
"mt9m001";
2336 em28xx_initialize_mt9m001(dev);
2346 printk(
"Unknown Micron Sensor 0x%04x\n", version);
2351 em28xx_pre_card_setup(dev);
2354 sensor_name, em28xx_boards[dev->
model].
name);
2362 static void em28xx_pre_card_setup(
struct em28xx *dev)
2367 if (!dev->
board.is_em2800)
2372 switch (dev->
model) {
2475 memset(ctl, 0,
sizeof(*ctl));
2481 switch (dev->
model) {
2521 static void em28xx_tuner_setup(
struct em28xx *dev)
2523 struct tuner_setup tun_setup;
2529 memset(&tun_setup, 0,
sizeof(tun_setup));
2531 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
2534 if (dev->
board.radio.type) {
2535 tun_setup.type = dev->
board.radio.type;
2536 tun_setup.addr = dev->
board.radio_addr;
2551 tda9887_cfg.
tuner = TUNER_TDA9887;
2561 memset(&xc2028_cfg, 0,
sizeof(xc2028_cfg));
2562 memset(&ctl, 0,
sizeof(ctl));
2564 em28xx_setup_xc3028(dev, &ctl);
2566 xc2028_cfg.tuner = TUNER_XC2028;
2567 xc2028_cfg.priv = &
ctl;
2580 static int em28xx_hint_board(
struct em28xx *dev)
2592 for (i = 0; i <
ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2593 if (dev->
hash == em28xx_eeprom_hash[i].
hash) {
2599 "based on eeprom hash.\n");
2602 "please email this log to:\n");
2625 for (i = 0; i <
ARRAY_SIZE(em28xx_i2c_hash); i++) {
2631 "based on i2c devicelist hash.\n");
2634 "please email this log to:\n");
2644 em28xx_errdev(
"Your board has no unique USB ID and thus need a "
2645 "hint to be detected.\n");
2646 em28xx_errdev(
"You may try to use card=<n> insmod option to "
2647 "workaround that.\n");
2653 em28xx_errdev(
"Here is a list of valid choices for the card=<n>"
2654 " insmod option:\n");
2657 i, em28xx_boards[i].
name);
2662 static void em28xx_card_setup(
struct em28xx *dev)
2668 if (dev->
board.is_webcam) {
2669 if (em28xx_hint_sensor(dev) < 0)
2670 dev->
board.is_webcam = 0;
2675 if (!dev->
board.is_webcam) {
2676 switch (dev->
model) {
2692 if (em28xx_hint_board(dev) < 0)
2695 em28xx_set_model(dev);
2696 em28xx_pre_card_setup(dev);
2700 em28xx_set_model(dev);
2715 switch (dev->
model) {
2723 #if defined(CONFIG_MODULES) && defined(MODULE)
2724 request_module(
"tveeprom");
2735 dev->
board.has_msp34xx = 1;
2765 if (!em28xx_hint_board(dev))
2766 em28xx_set_model(dev);
2790 if (!em28xx_hint_board(dev))
2791 em28xx_set_model(dev);
2806 em28xx_errdev(
"Please send a report of having this working\n");
2816 if (dev->
board.has_msp34xx)
2818 "msp3400", 0, msp3400_addrs);
2822 "saa7115_auto", 0, saa711x_addrs);
2826 "tvp5150", 0, tvp5150_addrs);
2833 .platform_data = &
pdata,
2838 &mt9v011_info,
NULL);
2844 "tvaudio", dev->
board.tvaudio_addr,
NULL);
2846 if (dev->
board.tuner_type != TUNER_ABSENT) {
2849 if (dev->
board.radio.type)
2874 em28xx_tuner_setup(dev);
2891 #if defined(CONFIG_MODULES) && defined(MODULE)
2893 request_module(
"snd-usb-audio");
2895 request_module(
"em28xx-alsa");
2897 if (dev->
board.has_dvb)
2898 request_module(
"em28xx-dvb");
2899 if (dev->
board.ir_codes && !disable_ir)
2900 request_module(
"em28xx-rc");
2940 static int em28xx_init_dev(
struct em28xx *dev,
struct usb_device *
udev,
2957 em28xx_set_model(dev);
3031 em28xx_pre_card_setup(dev);
3033 if (!dev->
board.is_em2800) {
3055 goto unregister_dev;
3066 em28xx_card_setup(dev);
3071 em28xx_errdev(
"%s: Error while setting audio - error [%d]!\n",
3080 INIT_LIST_HEAD(&dev->
vidq.active);
3081 INIT_LIST_HEAD(&dev->
vbiq.active);
3083 if (dev->
board.has_msp34xx) {
3088 "msp34xx(1) failed! error [%d]\n",
3097 "msp34xx(2) failed! error [%d]\n",
3124 #define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3130 static int em28xx_usb_probe(
struct usb_interface *interface,
3133 struct usb_device *
udev;
3136 bool has_audio =
false, has_video =
false, has_dvb =
false;
3138 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
3141 udev =
usb_get_dev(interface_to_usbdev(interface));
3156 if (interface->altsetting[0].desc.bInterfaceClass ==
USB_CLASS_AUDIO) {
3158 "interface %i, class %i\n",
3162 interface->altsetting[0].desc.bInterfaceClass);
3187 for (i = 0; i < interface->num_altsetting; i++) {
3190 for (ep = 0; ep < interface->altsetting[
i].desc.bNumEndpoints; ep++) {
3192 int sizedescr,
size;
3194 e = &interface->altsetting[
i].endpoint[ep].desc;
3197 size = sizedescr & 0x7ff;
3200 size = size *
hb_mult(sizedescr);
3202 if (usb_endpoint_xfer_isoc(e) &&
3203 usb_endpoint_dir_in(e)) {
3224 if (!(has_audio || has_video || has_dvb)) {
3229 switch (udev->speed) {
3245 ": New device %s %s @ %s Mbps "
3246 "(%04x:%04x, interface %d, class %d)\n",
3247 udev->manufacturer ? udev->manufacturer :
"",
3248 udev->product ? udev->product :
"",
3253 interface->altsetting->desc.bInterfaceNumber);
3257 ": Audio Vendor Class interface %i found\n",
3261 ": Video interface %i found\n",
3265 ": DVB interface %i found\n",
3273 if (udev->speed !=
USB_SPEED_HIGH && disable_usb_speed_check == 0) {
3274 printk(DRIVER_NAME
": Device initialization failed.\n");
3275 printk(DRIVER_NAME
": Device must be connected to a high-speed"
3276 " USB 2.0 port.\n");
3283 dev->
model =
id->driver_info;
3290 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
3298 dev->
num_alt = interface->num_altsetting;
3304 usb_set_intfdata(interface, dev);
3309 retval = em28xx_init_dev(dev, udev, interface, nr);
3311 goto unlock_and_free;
3321 goto unlock_and_free;
3354 static void em28xx_usb_disconnect(
struct usb_interface *interface)
3358 dev = usb_get_intfdata(interface);
3359 usb_set_intfdata(interface,
NULL);
3383 (
"device %s is open! Deregistration and memory "
3384 "deallocation are deferred on close.\n",
3385 video_device_node_name(dev->
vdev));
3408 static struct usb_driver em28xx_usb_driver = {
3410 .probe = em28xx_usb_probe,
3411 .disconnect = em28xx_usb_disconnect,