1 /* 2 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB 3 video capture devices 4 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> 9 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> 10 11 This program is free software; you can redistribute it and/or modify 12 it under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2 of the License, or 14 (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 */ 25 26 #include <linux/init.h> 27 #include <linux/module.h> 28 #include <linux/slab.h> 29 #include <linux/delay.h> 30 #include <linux/i2c.h> 31 #include <linux/usb.h> 32 #include <media/tuner.h> 33 #include <media/msp3400.h> 34 #include <media/saa7115.h> 35 #include <media/tvp5150.h> 36 #include <media/tvaudio.h> 37 #include <media/i2c-addr.h> 38 #include <media/tveeprom.h> 39 #include <media/v4l2-clk.h> 40 #include <media/v4l2-common.h> 41 42 #include "em28xx.h" 43 44 #define DRIVER_NAME "em28xx" 45 46 static int tuner = -1; 47 module_param(tuner, int, 0444); 48 MODULE_PARM_DESC(tuner, "tuner type"); 49 50 static unsigned int disable_ir; 51 module_param(disable_ir, int, 0444); 52 MODULE_PARM_DESC(disable_ir, "disable infrared remote support"); 53 54 static unsigned int disable_usb_speed_check; 55 module_param(disable_usb_speed_check, int, 0444); 56 MODULE_PARM_DESC(disable_usb_speed_check, 57 "override min bandwidth requirement of 480M bps"); 58 59 static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U }; 60 module_param_array(card, int, NULL, 0444); 61 MODULE_PARM_DESC(card, "card type"); 62 63 static int usb_xfer_mode = -1; 64 module_param(usb_xfer_mode, int, 0444); 65 MODULE_PARM_DESC(usb_xfer_mode, 66 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)"); 67 68 69 /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */ 70 static unsigned long em28xx_devused; 71 72 struct em28xx_hash_table { 73 unsigned long hash; 74 unsigned int model; 75 unsigned int tuner; 76 }; 77 78 static void em28xx_pre_card_setup(struct em28xx *dev); 79 80 /* 81 * Reset sequences for analog/digital modes 82 */ 83 84 /* Reset for the most [analog] boards */ 85 static struct em28xx_reg_seq default_analog[] = { 86 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 87 { -1, -1, -1, -1}, 88 }; 89 90 /* Reset for the most [digital] boards */ 91 static struct em28xx_reg_seq default_digital[] = { 92 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 93 { -1, -1, -1, -1}, 94 }; 95 96 /* Board Hauppauge WinTV HVR 900 analog */ 97 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { 98 {EM2820_R08_GPIO_CTRL, 0x2d, ~EM_GPIO_4, 10}, 99 { 0x05, 0xff, 0x10, 10}, 100 { -1, -1, -1, -1}, 101 }; 102 103 /* Board Hauppauge WinTV HVR 900 digital */ 104 static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { 105 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10}, 106 {EM2880_R04_GPO, 0x04, 0x0f, 10}, 107 {EM2880_R04_GPO, 0x0c, 0x0f, 10}, 108 { -1, -1, -1, -1}, 109 }; 110 111 /* Board Hauppauge WinTV HVR 900 (R2) digital */ 112 static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = { 113 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10}, 114 {EM2880_R04_GPO, 0x0c, 0x0f, 10}, 115 { -1, -1, -1, -1}, 116 }; 117 118 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ 119 static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { 120 {EM2820_R08_GPIO_CTRL, 0x69, ~EM_GPIO_4, 10}, 121 { -1, -1, -1, -1}, 122 }; 123 124 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ 125 126 /* Board - EM2870 Kworld 355u 127 Analog - No input analog */ 128 129 /* Board - EM2882 Kworld 315U digital */ 130 static struct em28xx_reg_seq em2882_kworld_315u_digital[] = { 131 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 132 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, 133 {EM2880_R04_GPO, 0x04, 0xff, 10}, 134 {EM2880_R04_GPO, 0x0c, 0xff, 10}, 135 {EM2820_R08_GPIO_CTRL, 0x7e, 0xff, 10}, 136 { -1, -1, -1, -1}, 137 }; 138 139 static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = { 140 {EM2880_R04_GPO, 0x08, 0xff, 10}, 141 {EM2880_R04_GPO, 0x0c, 0xff, 10}, 142 {EM2880_R04_GPO, 0x08, 0xff, 10}, 143 {EM2880_R04_GPO, 0x0c, 0xff, 10}, 144 { -1, -1, -1, -1}, 145 }; 146 147 static struct em28xx_reg_seq kworld_330u_analog[] = { 148 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 149 {EM2880_R04_GPO, 0x00, 0xff, 10}, 150 { -1, -1, -1, -1}, 151 }; 152 153 static struct em28xx_reg_seq kworld_330u_digital[] = { 154 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 155 {EM2880_R04_GPO, 0x08, 0xff, 10}, 156 { -1, -1, -1, -1}, 157 }; 158 159 /* Evga inDtube 160 GPIO0 - Enable digital power (s5h1409) - low to enable 161 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable 162 GPIO4 - xc3028 reset 163 GOP3 - s5h1409 reset 164 */ 165 static struct em28xx_reg_seq evga_indtube_analog[] = { 166 {EM2820_R08_GPIO_CTRL, 0x79, 0xff, 60}, 167 { -1, -1, -1, -1}, 168 }; 169 170 static struct em28xx_reg_seq evga_indtube_digital[] = { 171 {EM2820_R08_GPIO_CTRL, 0x7a, 0xff, 1}, 172 {EM2880_R04_GPO, 0x04, 0xff, 10}, 173 {EM2880_R04_GPO, 0x0c, 0xff, 1}, 174 { -1, -1, -1, -1}, 175 }; 176 177 /* 178 * KWorld PlusTV 340U, UB435-Q and UB435-Q V2 (ATSC) GPIOs map: 179 * EM_GPIO_0 - currently unknown 180 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on) 181 * EM_GPIO_2 - currently unknown 182 * EM_GPIO_3 - currently unknown 183 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset) 184 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset) 185 * EM_GPIO_6 - currently unknown 186 * EM_GPIO_7 - currently unknown 187 */ 188 static struct em28xx_reg_seq kworld_a340_digital[] = { 189 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 190 { -1, -1, -1, -1}, 191 }; 192 193 /* Pinnacle Hybrid Pro eb1a:2881 */ 194 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = { 195 {EM2820_R08_GPIO_CTRL, 0xfd, ~EM_GPIO_4, 10}, 196 { -1, -1, -1, -1}, 197 }; 198 199 static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = { 200 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 201 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */ 202 {EM2880_R04_GPO, 0x0c, 0xff, 1}, 203 { -1, -1, -1, -1}, 204 }; 205 206 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = { 207 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 208 {EM2880_R04_GPO, 0x00, 0xff, 10}, 209 { -1, -1, -1, -1}, 210 }; 211 212 static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = { 213 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 214 {EM2880_R04_GPO, 0x08, 0xff, 10}, 215 { -1, -1, -1, -1}, 216 }; 217 218 /* eb1a:2868 Reddo DVB-C USB TV Box 219 GPIO4 - CU1216L NIM 220 Other GPIOs seems to be don't care. */ 221 static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = { 222 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, 223 {EM2820_R08_GPIO_CTRL, 0xde, 0xff, 10}, 224 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, 225 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 226 {EM2820_R08_GPIO_CTRL, 0x7f, 0xff, 10}, 227 {EM2820_R08_GPIO_CTRL, 0x6f, 0xff, 10}, 228 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 229 { -1, -1, -1, -1}, 230 }; 231 232 /* Callback for the most boards */ 233 static struct em28xx_reg_seq default_tuner_gpio[] = { 234 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10}, 235 {EM2820_R08_GPIO_CTRL, 0, EM_GPIO_4, 10}, 236 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10}, 237 { -1, -1, -1, -1}, 238 }; 239 240 /* Mute/unmute */ 241 static struct em28xx_reg_seq compro_unmute_tv_gpio[] = { 242 {EM2820_R08_GPIO_CTRL, 5, 7, 10}, 243 { -1, -1, -1, -1}, 244 }; 245 246 static struct em28xx_reg_seq compro_unmute_svid_gpio[] = { 247 {EM2820_R08_GPIO_CTRL, 4, 7, 10}, 248 { -1, -1, -1, -1}, 249 }; 250 251 static struct em28xx_reg_seq compro_mute_gpio[] = { 252 {EM2820_R08_GPIO_CTRL, 6, 7, 10}, 253 { -1, -1, -1, -1}, 254 }; 255 256 /* Terratec AV350 */ 257 static struct em28xx_reg_seq terratec_av350_mute_gpio[] = { 258 {EM2820_R08_GPIO_CTRL, 0xff, 0x7f, 10}, 259 { -1, -1, -1, -1}, 260 }; 261 262 static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = { 263 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 264 { -1, -1, -1, -1}, 265 }; 266 267 static struct em28xx_reg_seq silvercrest_reg_seq[] = { 268 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 269 {EM2820_R08_GPIO_CTRL, 0x01, 0xf7, 10}, 270 { -1, -1, -1, -1}, 271 }; 272 273 static struct em28xx_reg_seq vc211a_enable[] = { 274 {EM2820_R08_GPIO_CTRL, 0xff, 0x07, 10}, 275 {EM2820_R08_GPIO_CTRL, 0xff, 0x0f, 10}, 276 {EM2820_R08_GPIO_CTRL, 0xff, 0x0b, 10}, 277 { -1, -1, -1, -1}, 278 }; 279 280 static struct em28xx_reg_seq dikom_dk300_digital[] = { 281 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 282 {EM2880_R04_GPO, 0x08, 0xff, 10}, 283 { -1, -1, -1, -1}, 284 }; 285 286 287 /* Reset for the most [digital] boards */ 288 static struct em28xx_reg_seq leadership_digital[] = { 289 {EM2874_R80_GPIO_P0_CTRL, 0x70, 0xff, 10}, 290 { -1, -1, -1, -1}, 291 }; 292 293 static struct em28xx_reg_seq leadership_reset[] = { 294 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10}, 295 {EM2874_R80_GPIO_P0_CTRL, 0xb0, 0xff, 10}, 296 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10}, 297 { -1, -1, -1, -1}, 298 }; 299 300 /* 2013:024f PCTV nanoStick T2 290e 301 * GPIO_6 - demod reset 302 * GPIO_7 - LED 303 */ 304 static struct em28xx_reg_seq pctv_290e[] = { 305 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 80}, 306 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 80}, /* GPIO_6 = 1 */ 307 {EM2874_R80_GPIO_P0_CTRL, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */ 308 { -1, -1, -1, -1}, 309 }; 310 311 #if 0 312 static struct em28xx_reg_seq terratec_h5_gpio[] = { 313 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 314 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, 315 {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50}, 316 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 50}, 317 { -1, -1, -1, -1}, 318 }; 319 320 static struct em28xx_reg_seq terratec_h5_digital[] = { 321 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10}, 322 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, 323 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10}, 324 { -1, -1, -1, -1}, 325 }; 326 #endif 327 328 /* 2013:024f PCTV DVB-S2 Stick 460e 329 * GPIO_0 - POWER_ON 330 * GPIO_1 - BOOST 331 * GPIO_2 - VUV_LNB (red LED) 332 * GPIO_3 - EXT_12V 333 * GPIO_4 - INT_DEM (DEMOD GPIO_0) 334 * GPIO_5 - INT_LNB 335 * GPIO_6 - RESET_DEM 336 * GPIO_7 - LED (green LED) 337 */ 338 static struct em28xx_reg_seq pctv_460e[] = { 339 {EM2874_R80_GPIO_P0_CTRL, 0x01, 0xff, 50}, 340 { 0x0d, 0xff, 0xff, 50}, 341 {EM2874_R80_GPIO_P0_CTRL, 0x41, 0xff, 50}, /* GPIO_6=1 */ 342 { 0x0d, 0x42, 0xff, 50}, 343 {EM2874_R80_GPIO_P0_CTRL, 0x61, 0xff, 50}, /* GPIO_5=1 */ 344 { -1, -1, -1, -1}, 345 }; 346 347 static struct em28xx_reg_seq c3tech_digital_duo_digital[] = { 348 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10}, 349 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, /* xc5000 reset */ 350 {EM2874_R80_GPIO_P0_CTRL, 0xf9, 0xff, 35}, 351 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, 352 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10}, 353 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 10}, 354 {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 10}, 355 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 20}, 356 { -1, -1, -1, -1}, 357 }; 358 359 /* 360 * 2013:0258 PCTV DVB-S2 Stick (461e) 361 * GPIO 0 = POWER_ON 362 * GPIO 1 = BOOST 363 * GPIO 2 = VUV_LNB (red LED) 364 * GPIO 3 = #EXT_12V 365 * GPIO 4 = INT_DEM 366 * GPIO 5 = INT_LNB 367 * GPIO 6 = #RESET_DEM 368 * GPIO 7 = P07_LED (green LED) 369 */ 370 static struct em28xx_reg_seq pctv_461e[] = { 371 {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 0}, 372 {0x0d, 0xff, 0xff, 0}, 373 {EM2874_R80_GPIO_P0_CTRL, 0x3f, 0xff, 100}, /* reset demod */ 374 {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 200}, /* reset demod */ 375 {0x0d, 0x42, 0xff, 0}, 376 {EM2874_R80_GPIO_P0_CTRL, 0xeb, 0xff, 0}, 377 {EM2874_R5F_TS_ENABLE, 0x84, 0x84, 0}, /* parallel? | null discard */ 378 { -1, -1, -1, -1}, 379 }; 380 381 #if 0 382 static struct em28xx_reg_seq hauppauge_930c_gpio[] = { 383 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10}, 384 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, /* xc5000 reset */ 385 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10}, 386 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, 387 { -1, -1, -1, -1}, 388 }; 389 390 static struct em28xx_reg_seq hauppauge_930c_digital[] = { 391 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10}, 392 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, 393 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10}, 394 { -1, -1, -1, -1}, 395 }; 396 #endif 397 398 /* 1b80:e425 MaxMedia UB425-TC 399 * 1b80:e1cc Delock 61959 400 * GPIO_6 - demod reset, 0=active 401 * GPIO_7 - LED, 0=active 402 */ 403 static struct em28xx_reg_seq maxmedia_ub425_tc[] = { 404 {EM2874_R80_GPIO_P0_CTRL, 0x83, 0xff, 100}, 405 {EM2874_R80_GPIO_P0_CTRL, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */ 406 {EM2874_R80_GPIO_P0_CTRL, 0x43, 0xff, 000}, /* GPIO_7 = 0 */ 407 { -1, -1, -1, -1}, 408 }; 409 410 /* 2304:0242 PCTV QuatroStick (510e) 411 * GPIO_2: decoder reset, 0=active 412 * GPIO_4: decoder suspend, 0=active 413 * GPIO_6: demod reset, 0=active 414 * GPIO_7: LED, 1=active 415 */ 416 static struct em28xx_reg_seq pctv_510e[] = { 417 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100}, 418 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */ 419 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */ 420 { -1, -1, -1, -1}, 421 }; 422 423 /* 2013:0251 PCTV QuatroStick nano (520e) 424 * GPIO_2: decoder reset, 0=active 425 * GPIO_4: decoder suspend, 0=active 426 * GPIO_6: demod reset, 0=active 427 * GPIO_7: LED, 1=active 428 */ 429 static struct em28xx_reg_seq pctv_520e[] = { 430 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100}, 431 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */ 432 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */ 433 {EM2874_R80_GPIO_P0_CTRL, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */ 434 { -1, -1, -1, -1}, 435 }; 436 437 /* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam 438 * reg 0x80/0x84: 439 * GPIO_0: capturing LED, 0=on, 1=off 440 * GPIO_2: AV mute button, 0=pressed, 1=unpressed 441 * GPIO 3: illumination button, 0=pressed, 1=unpressed 442 * GPIO_6: illumination/flash LED, 0=on, 1=off 443 * reg 0x81/0x85: 444 * GPIO_7: snapshot button, 0=pressed, 1=unpressed 445 */ 446 static struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = { 447 {EM2820_R08_GPIO_CTRL, 0xf7, 0xff, 10}, 448 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xb2, 10}, 449 { -1, -1, -1, -1}, 450 }; 451 452 /* 453 * Button definitions 454 */ 455 static struct em28xx_button std_snapshot_button[] = { 456 { 457 .role = EM28XX_BUTTON_SNAPSHOT, 458 .reg_r = EM28XX_R0C_USBSUSP, 459 .reg_clearing = EM28XX_R0C_USBSUSP, 460 .mask = EM28XX_R0C_USBSUSP_SNAPSHOT, 461 .inverted = 0, 462 }, 463 {-1, 0, 0, 0, 0}, 464 }; 465 466 static struct em28xx_button speedlink_vad_laplace_buttons[] = { 467 { 468 .role = EM28XX_BUTTON_SNAPSHOT, 469 .reg_r = EM2874_R85_GPIO_P1_STATE, 470 .mask = 0x80, 471 .inverted = 1, 472 }, 473 { 474 .role = EM28XX_BUTTON_ILLUMINATION, 475 .reg_r = EM2874_R84_GPIO_P0_STATE, 476 .mask = 0x08, 477 .inverted = 1, 478 }, 479 {-1, 0, 0, 0, 0}, 480 }; 481 482 /* 483 * LED definitions 484 */ 485 static struct em28xx_led speedlink_vad_laplace_leds[] = { 486 { 487 .role = EM28XX_LED_ANALOG_CAPTURING, 488 .gpio_reg = EM2874_R80_GPIO_P0_CTRL, 489 .gpio_mask = 0x01, 490 .inverted = 1, 491 }, 492 { 493 .role = EM28XX_LED_ILLUMINATION, 494 .gpio_reg = EM2874_R80_GPIO_P0_CTRL, 495 .gpio_mask = 0x40, 496 .inverted = 1, 497 }, 498 {-1, 0, 0, 0}, 499 }; 500 501 /* 502 * Board definitions 503 */ 504 struct em28xx_board em28xx_boards[] = { 505 [EM2750_BOARD_UNKNOWN] = { 506 .name = "EM2710/EM2750/EM2751 webcam grabber", 507 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ, 508 .tuner_type = TUNER_ABSENT, 509 .is_webcam = 1, 510 .input = { { 511 .type = EM28XX_VMUX_COMPOSITE1, 512 .vmux = 0, 513 .amux = EM28XX_AMUX_VIDEO, 514 .gpio = silvercrest_reg_seq, 515 } }, 516 }, 517 [EM2800_BOARD_UNKNOWN] = { 518 .name = "Unknown EM2800 video grabber", 519 .is_em2800 = 1, 520 .tda9887_conf = TDA9887_PRESENT, 521 .decoder = EM28XX_SAA711X, 522 .tuner_type = TUNER_ABSENT, 523 .input = { { 524 .type = EM28XX_VMUX_COMPOSITE1, 525 .vmux = SAA7115_COMPOSITE0, 526 .amux = EM28XX_AMUX_LINE_IN, 527 }, { 528 .type = EM28XX_VMUX_SVIDEO, 529 .vmux = SAA7115_SVIDEO3, 530 .amux = EM28XX_AMUX_LINE_IN, 531 } }, 532 }, 533 [EM2820_BOARD_UNKNOWN] = { 534 .name = "Unknown EM2750/28xx video grabber", 535 .tuner_type = TUNER_ABSENT, 536 .is_webcam = 1, /* To enable sensor probe */ 537 }, 538 [EM2750_BOARD_DLCW_130] = { 539 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 540 .name = "Huaqi DLCW-130", 541 .valid = EM28XX_BOARD_NOT_VALIDATED, 542 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, 543 .tuner_type = TUNER_ABSENT, 544 .is_webcam = 1, 545 .input = { { 546 .type = EM28XX_VMUX_COMPOSITE1, 547 .vmux = 0, 548 .amux = EM28XX_AMUX_VIDEO, 549 } }, 550 }, 551 [EM2820_BOARD_KWORLD_PVRTV2800RF] = { 552 .name = "Kworld PVR TV 2800 RF", 553 .tuner_type = TUNER_TEMIC_PAL, 554 .tda9887_conf = TDA9887_PRESENT, 555 .decoder = EM28XX_SAA711X, 556 .input = { { 557 .type = EM28XX_VMUX_COMPOSITE1, 558 .vmux = SAA7115_COMPOSITE0, 559 .amux = EM28XX_AMUX_LINE_IN, 560 }, { 561 .type = EM28XX_VMUX_SVIDEO, 562 .vmux = SAA7115_SVIDEO3, 563 .amux = EM28XX_AMUX_LINE_IN, 564 } }, 565 }, 566 [EM2820_BOARD_GADMEI_TVR200] = { 567 .name = "Gadmei TVR200", 568 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 569 .tda9887_conf = TDA9887_PRESENT, 570 .decoder = EM28XX_SAA711X, 571 .input = { { 572 .type = EM28XX_VMUX_TELEVISION, 573 .vmux = SAA7115_COMPOSITE2, 574 .amux = EM28XX_AMUX_LINE_IN, 575 }, { 576 .type = EM28XX_VMUX_COMPOSITE1, 577 .vmux = SAA7115_COMPOSITE0, 578 .amux = EM28XX_AMUX_LINE_IN, 579 }, { 580 .type = EM28XX_VMUX_SVIDEO, 581 .vmux = SAA7115_SVIDEO3, 582 .amux = EM28XX_AMUX_LINE_IN, 583 } }, 584 }, 585 [EM2820_BOARD_TERRATEC_CINERGY_250] = { 586 .name = "Terratec Cinergy 250 USB", 587 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 588 .has_ir_i2c = 1, 589 .tda9887_conf = TDA9887_PRESENT, 590 .decoder = EM28XX_SAA711X, 591 .input = { { 592 .type = EM28XX_VMUX_TELEVISION, 593 .vmux = SAA7115_COMPOSITE2, 594 .amux = EM28XX_AMUX_VIDEO, 595 }, { 596 .type = EM28XX_VMUX_COMPOSITE1, 597 .vmux = SAA7115_COMPOSITE0, 598 .amux = EM28XX_AMUX_LINE_IN, 599 }, { 600 .type = EM28XX_VMUX_SVIDEO, 601 .vmux = SAA7115_SVIDEO3, 602 .amux = EM28XX_AMUX_LINE_IN, 603 } }, 604 }, 605 [EM2820_BOARD_PINNACLE_USB_2] = { 606 .name = "Pinnacle PCTV USB 2", 607 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 608 .has_ir_i2c = 1, 609 .tda9887_conf = TDA9887_PRESENT, 610 .decoder = EM28XX_SAA711X, 611 .input = { { 612 .type = EM28XX_VMUX_TELEVISION, 613 .vmux = SAA7115_COMPOSITE2, 614 .amux = EM28XX_AMUX_VIDEO, 615 }, { 616 .type = EM28XX_VMUX_COMPOSITE1, 617 .vmux = SAA7115_COMPOSITE0, 618 .amux = EM28XX_AMUX_LINE_IN, 619 }, { 620 .type = EM28XX_VMUX_SVIDEO, 621 .vmux = SAA7115_SVIDEO3, 622 .amux = EM28XX_AMUX_LINE_IN, 623 } }, 624 }, 625 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = { 626 .name = "Hauppauge WinTV USB 2", 627 .tuner_type = TUNER_PHILIPS_FM1236_MK3, 628 .tda9887_conf = TDA9887_PRESENT | 629 TDA9887_PORT1_ACTIVE | 630 TDA9887_PORT2_ACTIVE, 631 .decoder = EM28XX_TVP5150, 632 .has_msp34xx = 1, 633 .has_ir_i2c = 1, 634 .input = { { 635 .type = EM28XX_VMUX_TELEVISION, 636 .vmux = TVP5150_COMPOSITE0, 637 .amux = MSP_INPUT_DEFAULT, 638 }, { 639 .type = EM28XX_VMUX_SVIDEO, 640 .vmux = TVP5150_SVIDEO, 641 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 642 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), 643 } }, 644 }, 645 [EM2820_BOARD_DLINK_USB_TV] = { 646 .name = "D-Link DUB-T210 TV Tuner", 647 .valid = EM28XX_BOARD_NOT_VALIDATED, 648 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 649 .tda9887_conf = TDA9887_PRESENT, 650 .decoder = EM28XX_SAA711X, 651 .input = { { 652 .type = EM28XX_VMUX_TELEVISION, 653 .vmux = SAA7115_COMPOSITE2, 654 .amux = EM28XX_AMUX_LINE_IN, 655 }, { 656 .type = EM28XX_VMUX_COMPOSITE1, 657 .vmux = SAA7115_COMPOSITE0, 658 .amux = EM28XX_AMUX_LINE_IN, 659 }, { 660 .type = EM28XX_VMUX_SVIDEO, 661 .vmux = SAA7115_SVIDEO3, 662 .amux = EM28XX_AMUX_LINE_IN, 663 } }, 664 }, 665 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = { 666 .name = "Hercules Smart TV USB 2.0", 667 .valid = EM28XX_BOARD_NOT_VALIDATED, 668 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 669 .tda9887_conf = TDA9887_PRESENT, 670 .decoder = EM28XX_SAA711X, 671 .input = { { 672 .type = EM28XX_VMUX_TELEVISION, 673 .vmux = SAA7115_COMPOSITE2, 674 .amux = EM28XX_AMUX_LINE_IN, 675 }, { 676 .type = EM28XX_VMUX_COMPOSITE1, 677 .vmux = SAA7115_COMPOSITE0, 678 .amux = EM28XX_AMUX_LINE_IN, 679 }, { 680 .type = EM28XX_VMUX_SVIDEO, 681 .vmux = SAA7115_SVIDEO3, 682 .amux = EM28XX_AMUX_LINE_IN, 683 } }, 684 }, 685 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = { 686 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)", 687 .valid = EM28XX_BOARD_NOT_VALIDATED, 688 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 689 .tda9887_conf = TDA9887_PRESENT, 690 .decoder = EM28XX_SAA711X, 691 .input = { { 692 .type = EM28XX_VMUX_TELEVISION, 693 .vmux = SAA7115_COMPOSITE2, 694 .amux = EM28XX_AMUX_VIDEO, 695 }, { 696 .type = EM28XX_VMUX_COMPOSITE1, 697 .vmux = SAA7115_COMPOSITE0, 698 .amux = EM28XX_AMUX_LINE_IN, 699 }, { 700 .type = EM28XX_VMUX_SVIDEO, 701 .vmux = SAA7115_SVIDEO3, 702 .amux = EM28XX_AMUX_LINE_IN, 703 } }, 704 }, 705 [EM2820_BOARD_GADMEI_UTV310] = { 706 .name = "Gadmei UTV310", 707 .valid = EM28XX_BOARD_NOT_VALIDATED, 708 .tuner_type = TUNER_TNF_5335MF, 709 .tda9887_conf = TDA9887_PRESENT, 710 .decoder = EM28XX_SAA711X, 711 .input = { { 712 .type = EM28XX_VMUX_TELEVISION, 713 .vmux = SAA7115_COMPOSITE1, 714 .amux = EM28XX_AMUX_LINE_IN, 715 }, { 716 .type = EM28XX_VMUX_COMPOSITE1, 717 .vmux = SAA7115_COMPOSITE0, 718 .amux = EM28XX_AMUX_LINE_IN, 719 }, { 720 .type = EM28XX_VMUX_SVIDEO, 721 .vmux = SAA7115_SVIDEO3, 722 .amux = EM28XX_AMUX_LINE_IN, 723 } }, 724 }, 725 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = { 726 .name = "Leadtek Winfast USB II Deluxe", 727 .valid = EM28XX_BOARD_NOT_VALIDATED, 728 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 729 .has_ir_i2c = 1, 730 .tvaudio_addr = 0x58, 731 .tda9887_conf = TDA9887_PRESENT | 732 TDA9887_PORT2_ACTIVE | 733 TDA9887_QSS, 734 .decoder = EM28XX_SAA711X, 735 .adecoder = EM28XX_TVAUDIO, 736 .input = { { 737 .type = EM28XX_VMUX_TELEVISION, 738 .vmux = SAA7115_COMPOSITE4, 739 .amux = EM28XX_AMUX_AUX, 740 }, { 741 .type = EM28XX_VMUX_COMPOSITE1, 742 .vmux = SAA7115_COMPOSITE5, 743 .amux = EM28XX_AMUX_LINE_IN, 744 }, { 745 .type = EM28XX_VMUX_SVIDEO, 746 .vmux = SAA7115_SVIDEO3, 747 .amux = EM28XX_AMUX_LINE_IN, 748 } }, 749 .radio = { 750 .type = EM28XX_RADIO, 751 .amux = EM28XX_AMUX_AUX, 752 } 753 }, 754 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { 755 .name = "Videology 20K14XUSB USB2.0", 756 .valid = EM28XX_BOARD_NOT_VALIDATED, 757 .tuner_type = TUNER_ABSENT, 758 .is_webcam = 1, 759 .input = { { 760 .type = EM28XX_VMUX_COMPOSITE1, 761 .vmux = 0, 762 .amux = EM28XX_AMUX_VIDEO, 763 } }, 764 }, 765 [EM2820_BOARD_SILVERCREST_WEBCAM] = { 766 .name = "Silvercrest Webcam 1.3mpix", 767 .tuner_type = TUNER_ABSENT, 768 .is_webcam = 1, 769 .input = { { 770 .type = EM28XX_VMUX_COMPOSITE1, 771 .vmux = 0, 772 .amux = EM28XX_AMUX_VIDEO, 773 .gpio = silvercrest_reg_seq, 774 } }, 775 }, 776 [EM2821_BOARD_SUPERCOMP_USB_2] = { 777 .name = "Supercomp USB 2.0 TV", 778 .valid = EM28XX_BOARD_NOT_VALIDATED, 779 .tuner_type = TUNER_PHILIPS_FM1236_MK3, 780 .tda9887_conf = TDA9887_PRESENT | 781 TDA9887_PORT1_ACTIVE | 782 TDA9887_PORT2_ACTIVE, 783 .decoder = EM28XX_SAA711X, 784 .input = { { 785 .type = EM28XX_VMUX_TELEVISION, 786 .vmux = SAA7115_COMPOSITE2, 787 .amux = EM28XX_AMUX_LINE_IN, 788 }, { 789 .type = EM28XX_VMUX_COMPOSITE1, 790 .vmux = SAA7115_COMPOSITE0, 791 .amux = EM28XX_AMUX_VIDEO, 792 }, { 793 .type = EM28XX_VMUX_SVIDEO, 794 .vmux = SAA7115_SVIDEO3, 795 .amux = EM28XX_AMUX_LINE_IN, 796 } }, 797 }, 798 [EM2821_BOARD_USBGEAR_VD204] = { 799 .name = "Usbgear VD204v9", 800 .valid = EM28XX_BOARD_NOT_VALIDATED, 801 .tuner_type = TUNER_ABSENT, /* Capture only device */ 802 .decoder = EM28XX_SAA711X, 803 .input = { { 804 .type = EM28XX_VMUX_COMPOSITE1, 805 .vmux = SAA7115_COMPOSITE0, 806 .amux = EM28XX_AMUX_LINE_IN, 807 }, { 808 .type = EM28XX_VMUX_SVIDEO, 809 .vmux = SAA7115_SVIDEO3, 810 .amux = EM28XX_AMUX_LINE_IN, 811 } }, 812 }, 813 [EM2860_BOARD_NETGMBH_CAM] = { 814 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 815 .name = "NetGMBH Cam", 816 .valid = EM28XX_BOARD_NOT_VALIDATED, 817 .tuner_type = TUNER_ABSENT, 818 .is_webcam = 1, 819 .input = { { 820 .type = EM28XX_VMUX_COMPOSITE1, 821 .vmux = 0, 822 .amux = EM28XX_AMUX_VIDEO, 823 } }, 824 }, 825 [EM2860_BOARD_TYPHOON_DVD_MAKER] = { 826 .name = "Typhoon DVD Maker", 827 .decoder = EM28XX_SAA711X, 828 .tuner_type = TUNER_ABSENT, /* Capture only device */ 829 .input = { { 830 .type = EM28XX_VMUX_COMPOSITE1, 831 .vmux = SAA7115_COMPOSITE0, 832 .amux = EM28XX_AMUX_LINE_IN, 833 }, { 834 .type = EM28XX_VMUX_SVIDEO, 835 .vmux = SAA7115_SVIDEO3, 836 .amux = EM28XX_AMUX_LINE_IN, 837 } }, 838 }, 839 [EM2860_BOARD_GADMEI_UTV330] = { 840 .name = "Gadmei UTV330", 841 .valid = EM28XX_BOARD_NOT_VALIDATED, 842 .tuner_type = TUNER_TNF_5335MF, 843 .tda9887_conf = TDA9887_PRESENT, 844 .decoder = EM28XX_SAA711X, 845 .input = { { 846 .type = EM28XX_VMUX_TELEVISION, 847 .vmux = SAA7115_COMPOSITE2, 848 .amux = EM28XX_AMUX_VIDEO, 849 }, { 850 .type = EM28XX_VMUX_COMPOSITE1, 851 .vmux = SAA7115_COMPOSITE0, 852 .amux = EM28XX_AMUX_LINE_IN, 853 }, { 854 .type = EM28XX_VMUX_SVIDEO, 855 .vmux = SAA7115_SVIDEO3, 856 .amux = EM28XX_AMUX_LINE_IN, 857 } }, 858 }, 859 [EM2861_BOARD_GADMEI_UTV330PLUS] = { 860 .name = "Gadmei UTV330+", 861 .tuner_type = TUNER_TNF_5335MF, 862 .tda9887_conf = TDA9887_PRESENT, 863 .ir_codes = RC_MAP_GADMEI_RM008Z, 864 .decoder = EM28XX_SAA711X, 865 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 866 .input = { { 867 .type = EM28XX_VMUX_TELEVISION, 868 .vmux = SAA7115_COMPOSITE2, 869 .amux = EM28XX_AMUX_VIDEO, 870 }, { 871 .type = EM28XX_VMUX_COMPOSITE1, 872 .vmux = SAA7115_COMPOSITE0, 873 .amux = EM28XX_AMUX_LINE_IN, 874 }, { 875 .type = EM28XX_VMUX_SVIDEO, 876 .vmux = SAA7115_SVIDEO3, 877 .amux = EM28XX_AMUX_LINE_IN, 878 } }, 879 }, 880 [EM2860_BOARD_TERRATEC_HYBRID_XS] = { 881 .name = "Terratec Cinergy A Hybrid XS", 882 .valid = EM28XX_BOARD_NOT_VALIDATED, 883 .tuner_type = TUNER_XC2028, 884 .tuner_gpio = default_tuner_gpio, 885 .decoder = EM28XX_TVP5150, 886 887 .input = { { 888 .type = EM28XX_VMUX_TELEVISION, 889 .vmux = TVP5150_COMPOSITE0, 890 .amux = EM28XX_AMUX_VIDEO, 891 .gpio = hauppauge_wintv_hvr_900_analog, 892 }, { 893 .type = EM28XX_VMUX_COMPOSITE1, 894 .vmux = TVP5150_COMPOSITE1, 895 .amux = EM28XX_AMUX_LINE_IN, 896 .gpio = hauppauge_wintv_hvr_900_analog, 897 }, { 898 .type = EM28XX_VMUX_SVIDEO, 899 .vmux = TVP5150_SVIDEO, 900 .amux = EM28XX_AMUX_LINE_IN, 901 .gpio = hauppauge_wintv_hvr_900_analog, 902 } }, 903 }, 904 [EM2861_BOARD_KWORLD_PVRTV_300U] = { 905 .name = "KWorld PVRTV 300U", 906 .valid = EM28XX_BOARD_NOT_VALIDATED, 907 .tuner_type = TUNER_XC2028, 908 .tuner_gpio = default_tuner_gpio, 909 .decoder = EM28XX_TVP5150, 910 .input = { { 911 .type = EM28XX_VMUX_TELEVISION, 912 .vmux = TVP5150_COMPOSITE0, 913 .amux = EM28XX_AMUX_VIDEO, 914 }, { 915 .type = EM28XX_VMUX_COMPOSITE1, 916 .vmux = TVP5150_COMPOSITE1, 917 .amux = EM28XX_AMUX_LINE_IN, 918 }, { 919 .type = EM28XX_VMUX_SVIDEO, 920 .vmux = TVP5150_SVIDEO, 921 .amux = EM28XX_AMUX_LINE_IN, 922 } }, 923 }, 924 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { 925 .name = "Yakumo MovieMixer", 926 .tuner_type = TUNER_ABSENT, /* Capture only device */ 927 .decoder = EM28XX_TVP5150, 928 .input = { { 929 .type = EM28XX_VMUX_TELEVISION, 930 .vmux = TVP5150_COMPOSITE0, 931 .amux = EM28XX_AMUX_VIDEO, 932 }, { 933 .type = EM28XX_VMUX_COMPOSITE1, 934 .vmux = TVP5150_COMPOSITE1, 935 .amux = EM28XX_AMUX_LINE_IN, 936 }, { 937 .type = EM28XX_VMUX_SVIDEO, 938 .vmux = TVP5150_SVIDEO, 939 .amux = EM28XX_AMUX_LINE_IN, 940 } }, 941 }, 942 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = { 943 .name = "EM2860/TVP5150 Reference Design", 944 .tuner_type = TUNER_ABSENT, /* Capture only device */ 945 .decoder = EM28XX_TVP5150, 946 .input = { { 947 .type = EM28XX_VMUX_COMPOSITE1, 948 .vmux = TVP5150_COMPOSITE1, 949 .amux = EM28XX_AMUX_LINE_IN, 950 }, { 951 .type = EM28XX_VMUX_SVIDEO, 952 .vmux = TVP5150_SVIDEO, 953 .amux = EM28XX_AMUX_LINE_IN, 954 } }, 955 }, 956 [EM2861_BOARD_PLEXTOR_PX_TV100U] = { 957 .name = "Plextor ConvertX PX-TV100U", 958 .tuner_type = TUNER_TNF_5335MF, 959 .xclk = EM28XX_XCLK_I2S_MSB_TIMING | 960 EM28XX_XCLK_FREQUENCY_12MHZ, 961 .tda9887_conf = TDA9887_PRESENT, 962 .decoder = EM28XX_TVP5150, 963 .has_msp34xx = 1, 964 .input = { { 965 .type = EM28XX_VMUX_TELEVISION, 966 .vmux = TVP5150_COMPOSITE0, 967 .amux = EM28XX_AMUX_LINE_IN, 968 .gpio = pinnacle_hybrid_pro_analog, 969 }, { 970 .type = EM28XX_VMUX_COMPOSITE1, 971 .vmux = TVP5150_COMPOSITE1, 972 .amux = EM28XX_AMUX_LINE_IN, 973 .gpio = pinnacle_hybrid_pro_analog, 974 }, { 975 .type = EM28XX_VMUX_SVIDEO, 976 .vmux = TVP5150_SVIDEO, 977 .amux = EM28XX_AMUX_LINE_IN, 978 .gpio = pinnacle_hybrid_pro_analog, 979 } }, 980 }, 981 982 /* Those boards with em2870 are DVB Only*/ 983 984 [EM2870_BOARD_TERRATEC_XS] = { 985 .name = "Terratec Cinergy T XS", 986 .valid = EM28XX_BOARD_NOT_VALIDATED, 987 .tuner_type = TUNER_XC2028, 988 .tuner_gpio = default_tuner_gpio, 989 }, 990 [EM2870_BOARD_TERRATEC_XS_MT2060] = { 991 .name = "Terratec Cinergy T XS (MT2060)", 992 .valid = EM28XX_BOARD_NOT_VALIDATED, 993 .tuner_type = TUNER_ABSENT, /* MT2060 */ 994 }, 995 [EM2870_BOARD_KWORLD_350U] = { 996 .name = "Kworld 350 U DVB-T", 997 .valid = EM28XX_BOARD_NOT_VALIDATED, 998 .tuner_type = TUNER_XC2028, 999 .tuner_gpio = default_tuner_gpio, 1000 }, 1001 [EM2870_BOARD_KWORLD_355U] = { 1002 .name = "Kworld 355 U DVB-T", 1003 .valid = EM28XX_BOARD_NOT_VALIDATED, 1004 .tuner_type = TUNER_ABSENT, 1005 .tuner_gpio = default_tuner_gpio, 1006 .has_dvb = 1, 1007 .dvb_gpio = default_digital, 1008 }, 1009 [EM2870_BOARD_PINNACLE_PCTV_DVB] = { 1010 .name = "Pinnacle PCTV DVB-T", 1011 .valid = EM28XX_BOARD_NOT_VALIDATED, 1012 .tuner_type = TUNER_ABSENT, /* MT2060 */ 1013 /* djh - I have serious doubts this is right... */ 1014 .xclk = EM28XX_XCLK_IR_RC5_MODE | 1015 EM28XX_XCLK_FREQUENCY_10MHZ, 1016 }, 1017 [EM2870_BOARD_COMPRO_VIDEOMATE] = { 1018 .name = "Compro, VideoMate U3", 1019 .valid = EM28XX_BOARD_NOT_VALIDATED, 1020 .tuner_type = TUNER_ABSENT, /* MT2060 */ 1021 }, 1022 1023 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = { 1024 .name = "Terratec Hybrid XS Secam", 1025 .has_msp34xx = 1, 1026 .tuner_type = TUNER_XC2028, 1027 .tuner_gpio = default_tuner_gpio, 1028 .decoder = EM28XX_TVP5150, 1029 .has_dvb = 1, 1030 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital, 1031 .input = { { 1032 .type = EM28XX_VMUX_TELEVISION, 1033 .vmux = TVP5150_COMPOSITE0, 1034 .amux = EM28XX_AMUX_VIDEO, 1035 .gpio = terratec_cinergy_USB_XS_FR_analog, 1036 }, { 1037 .type = EM28XX_VMUX_COMPOSITE1, 1038 .vmux = TVP5150_COMPOSITE1, 1039 .amux = EM28XX_AMUX_LINE_IN, 1040 .gpio = terratec_cinergy_USB_XS_FR_analog, 1041 }, { 1042 .type = EM28XX_VMUX_SVIDEO, 1043 .vmux = TVP5150_SVIDEO, 1044 .amux = EM28XX_AMUX_LINE_IN, 1045 .gpio = terratec_cinergy_USB_XS_FR_analog, 1046 } }, 1047 }, 1048 [EM2884_BOARD_TERRATEC_H5] = { 1049 .name = "Terratec Cinergy H5", 1050 .has_dvb = 1, 1051 #if 0 1052 .tuner_type = TUNER_PHILIPS_TDA8290, 1053 .tuner_addr = 0x41, 1054 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */ 1055 .tuner_gpio = terratec_h5_gpio, 1056 #else 1057 .tuner_type = TUNER_ABSENT, 1058 #endif 1059 .def_i2c_bus = 1, 1060 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 1061 EM28XX_I2C_FREQ_400_KHZ, 1062 }, 1063 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = { 1064 .name = "Hauppauge WinTV HVR 930C", 1065 .has_dvb = 1, 1066 #if 0 /* FIXME: Add analog support */ 1067 .tuner_type = TUNER_XC5000, 1068 .tuner_addr = 0x41, 1069 .dvb_gpio = hauppauge_930c_digital, 1070 .tuner_gpio = hauppauge_930c_gpio, 1071 #else 1072 .tuner_type = TUNER_ABSENT, 1073 #endif 1074 .ir_codes = RC_MAP_HAUPPAUGE, 1075 .def_i2c_bus = 1, 1076 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 1077 EM28XX_I2C_FREQ_400_KHZ, 1078 }, 1079 [EM2884_BOARD_C3TECH_DIGITAL_DUO] = { 1080 .name = "C3 Tech Digital Duo HDTV/SDTV USB", 1081 .has_dvb = 1, 1082 /* FIXME: Add analog support - need a saa7136 driver */ 1083 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */ 1084 .ir_codes = RC_MAP_EMPTY, 1085 .def_i2c_bus = 1, 1086 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE, 1087 .dvb_gpio = c3tech_digital_duo_digital, 1088 }, 1089 [EM2884_BOARD_CINERGY_HTC_STICK] = { 1090 .name = "Terratec Cinergy HTC Stick", 1091 .has_dvb = 1, 1092 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, 1093 .tuner_type = TUNER_ABSENT, 1094 .def_i2c_bus = 1, 1095 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 1096 EM28XX_I2C_FREQ_400_KHZ, 1097 }, 1098 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = { 1099 .name = "Hauppauge WinTV HVR 900", 1100 .tda9887_conf = TDA9887_PRESENT, 1101 .tuner_type = TUNER_XC2028, 1102 .tuner_gpio = default_tuner_gpio, 1103 .mts_firmware = 1, 1104 .has_dvb = 1, 1105 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1106 .ir_codes = RC_MAP_HAUPPAUGE, 1107 .decoder = EM28XX_TVP5150, 1108 .input = { { 1109 .type = EM28XX_VMUX_TELEVISION, 1110 .vmux = TVP5150_COMPOSITE0, 1111 .amux = EM28XX_AMUX_VIDEO, 1112 .gpio = hauppauge_wintv_hvr_900_analog, 1113 }, { 1114 .type = EM28XX_VMUX_COMPOSITE1, 1115 .vmux = TVP5150_COMPOSITE1, 1116 .amux = EM28XX_AMUX_LINE_IN, 1117 .gpio = hauppauge_wintv_hvr_900_analog, 1118 }, { 1119 .type = EM28XX_VMUX_SVIDEO, 1120 .vmux = TVP5150_SVIDEO, 1121 .amux = EM28XX_AMUX_LINE_IN, 1122 .gpio = hauppauge_wintv_hvr_900_analog, 1123 } }, 1124 }, 1125 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = { 1126 .name = "Hauppauge WinTV HVR 900 (R2)", 1127 .tda9887_conf = TDA9887_PRESENT, 1128 .tuner_type = TUNER_XC2028, 1129 .tuner_gpio = default_tuner_gpio, 1130 .mts_firmware = 1, 1131 .has_dvb = 1, 1132 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital, 1133 .ir_codes = RC_MAP_HAUPPAUGE, 1134 .decoder = EM28XX_TVP5150, 1135 .input = { { 1136 .type = EM28XX_VMUX_TELEVISION, 1137 .vmux = TVP5150_COMPOSITE0, 1138 .amux = EM28XX_AMUX_VIDEO, 1139 .gpio = hauppauge_wintv_hvr_900_analog, 1140 }, { 1141 .type = EM28XX_VMUX_COMPOSITE1, 1142 .vmux = TVP5150_COMPOSITE1, 1143 .amux = EM28XX_AMUX_LINE_IN, 1144 .gpio = hauppauge_wintv_hvr_900_analog, 1145 }, { 1146 .type = EM28XX_VMUX_SVIDEO, 1147 .vmux = TVP5150_SVIDEO, 1148 .amux = EM28XX_AMUX_LINE_IN, 1149 .gpio = hauppauge_wintv_hvr_900_analog, 1150 } }, 1151 }, 1152 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = { 1153 .name = "Hauppauge WinTV HVR 850", 1154 .tuner_type = TUNER_XC2028, 1155 .tuner_gpio = default_tuner_gpio, 1156 .mts_firmware = 1, 1157 .has_dvb = 1, 1158 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1159 .ir_codes = RC_MAP_HAUPPAUGE, 1160 .decoder = EM28XX_TVP5150, 1161 .input = { { 1162 .type = EM28XX_VMUX_TELEVISION, 1163 .vmux = TVP5150_COMPOSITE0, 1164 .amux = EM28XX_AMUX_VIDEO, 1165 .gpio = hauppauge_wintv_hvr_900_analog, 1166 }, { 1167 .type = EM28XX_VMUX_COMPOSITE1, 1168 .vmux = TVP5150_COMPOSITE1, 1169 .amux = EM28XX_AMUX_LINE_IN, 1170 .gpio = hauppauge_wintv_hvr_900_analog, 1171 }, { 1172 .type = EM28XX_VMUX_SVIDEO, 1173 .vmux = TVP5150_SVIDEO, 1174 .amux = EM28XX_AMUX_LINE_IN, 1175 .gpio = hauppauge_wintv_hvr_900_analog, 1176 } }, 1177 }, 1178 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = { 1179 .name = "Hauppauge WinTV HVR 950", 1180 .tuner_type = TUNER_XC2028, 1181 .tuner_gpio = default_tuner_gpio, 1182 .mts_firmware = 1, 1183 .has_dvb = 1, 1184 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1185 .ir_codes = RC_MAP_HAUPPAUGE, 1186 .decoder = EM28XX_TVP5150, 1187 .input = { { 1188 .type = EM28XX_VMUX_TELEVISION, 1189 .vmux = TVP5150_COMPOSITE0, 1190 .amux = EM28XX_AMUX_VIDEO, 1191 .gpio = hauppauge_wintv_hvr_900_analog, 1192 }, { 1193 .type = EM28XX_VMUX_COMPOSITE1, 1194 .vmux = TVP5150_COMPOSITE1, 1195 .amux = EM28XX_AMUX_LINE_IN, 1196 .gpio = hauppauge_wintv_hvr_900_analog, 1197 }, { 1198 .type = EM28XX_VMUX_SVIDEO, 1199 .vmux = TVP5150_SVIDEO, 1200 .amux = EM28XX_AMUX_LINE_IN, 1201 .gpio = hauppauge_wintv_hvr_900_analog, 1202 } }, 1203 }, 1204 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { 1205 .name = "Pinnacle PCTV HD Pro Stick", 1206 .tuner_type = TUNER_XC2028, 1207 .tuner_gpio = default_tuner_gpio, 1208 .mts_firmware = 1, 1209 .has_dvb = 1, 1210 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1211 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 1212 .decoder = EM28XX_TVP5150, 1213 .input = { { 1214 .type = EM28XX_VMUX_TELEVISION, 1215 .vmux = TVP5150_COMPOSITE0, 1216 .amux = EM28XX_AMUX_VIDEO, 1217 .gpio = hauppauge_wintv_hvr_900_analog, 1218 }, { 1219 .type = EM28XX_VMUX_COMPOSITE1, 1220 .vmux = TVP5150_COMPOSITE1, 1221 .amux = EM28XX_AMUX_LINE_IN, 1222 .gpio = hauppauge_wintv_hvr_900_analog, 1223 }, { 1224 .type = EM28XX_VMUX_SVIDEO, 1225 .vmux = TVP5150_SVIDEO, 1226 .amux = EM28XX_AMUX_LINE_IN, 1227 .gpio = hauppauge_wintv_hvr_900_analog, 1228 } }, 1229 }, 1230 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = { 1231 .name = "AMD ATI TV Wonder HD 600", 1232 .tuner_type = TUNER_XC2028, 1233 .tuner_gpio = default_tuner_gpio, 1234 .mts_firmware = 1, 1235 .has_dvb = 1, 1236 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1237 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600, 1238 .decoder = EM28XX_TVP5150, 1239 .input = { { 1240 .type = EM28XX_VMUX_TELEVISION, 1241 .vmux = TVP5150_COMPOSITE0, 1242 .amux = EM28XX_AMUX_VIDEO, 1243 .gpio = hauppauge_wintv_hvr_900_analog, 1244 }, { 1245 .type = EM28XX_VMUX_COMPOSITE1, 1246 .vmux = TVP5150_COMPOSITE1, 1247 .amux = EM28XX_AMUX_LINE_IN, 1248 .gpio = hauppauge_wintv_hvr_900_analog, 1249 }, { 1250 .type = EM28XX_VMUX_SVIDEO, 1251 .vmux = TVP5150_SVIDEO, 1252 .amux = EM28XX_AMUX_LINE_IN, 1253 .gpio = hauppauge_wintv_hvr_900_analog, 1254 } }, 1255 }, 1256 [EM2880_BOARD_TERRATEC_HYBRID_XS] = { 1257 .name = "Terratec Hybrid XS", 1258 .tuner_type = TUNER_XC2028, 1259 .tuner_gpio = default_tuner_gpio, 1260 .decoder = EM28XX_TVP5150, 1261 .has_dvb = 1, 1262 .dvb_gpio = default_digital, 1263 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS, 1264 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ 1265 .input = { { 1266 .type = EM28XX_VMUX_TELEVISION, 1267 .vmux = TVP5150_COMPOSITE0, 1268 .amux = EM28XX_AMUX_VIDEO, 1269 .gpio = default_analog, 1270 }, { 1271 .type = EM28XX_VMUX_COMPOSITE1, 1272 .vmux = TVP5150_COMPOSITE1, 1273 .amux = EM28XX_AMUX_LINE_IN, 1274 .gpio = default_analog, 1275 }, { 1276 .type = EM28XX_VMUX_SVIDEO, 1277 .vmux = TVP5150_SVIDEO, 1278 .amux = EM28XX_AMUX_LINE_IN, 1279 .gpio = default_analog, 1280 } }, 1281 }, 1282 /* maybe there's a reason behind it why Terratec sells the Hybrid XS 1283 as Prodigy XS with a different PID, let's keep it separated for now 1284 maybe we'll need it lateron */ 1285 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { 1286 .name = "Terratec Prodigy XS", 1287 .tuner_type = TUNER_XC2028, 1288 .tuner_gpio = default_tuner_gpio, 1289 .decoder = EM28XX_TVP5150, 1290 .input = { { 1291 .type = EM28XX_VMUX_TELEVISION, 1292 .vmux = TVP5150_COMPOSITE0, 1293 .amux = EM28XX_AMUX_VIDEO, 1294 .gpio = hauppauge_wintv_hvr_900_analog, 1295 }, { 1296 .type = EM28XX_VMUX_COMPOSITE1, 1297 .vmux = TVP5150_COMPOSITE1, 1298 .amux = EM28XX_AMUX_LINE_IN, 1299 .gpio = hauppauge_wintv_hvr_900_analog, 1300 }, { 1301 .type = EM28XX_VMUX_SVIDEO, 1302 .vmux = TVP5150_SVIDEO, 1303 .amux = EM28XX_AMUX_LINE_IN, 1304 .gpio = hauppauge_wintv_hvr_900_analog, 1305 } }, 1306 }, 1307 [EM2820_BOARD_MSI_VOX_USB_2] = { 1308 .name = "MSI VOX USB 2.0", 1309 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 1310 .tda9887_conf = TDA9887_PRESENT | 1311 TDA9887_PORT1_ACTIVE | 1312 TDA9887_PORT2_ACTIVE, 1313 .max_range_640_480 = 1, 1314 .decoder = EM28XX_SAA711X, 1315 .input = { { 1316 .type = EM28XX_VMUX_TELEVISION, 1317 .vmux = SAA7115_COMPOSITE4, 1318 .amux = EM28XX_AMUX_VIDEO, 1319 }, { 1320 .type = EM28XX_VMUX_COMPOSITE1, 1321 .vmux = SAA7115_COMPOSITE0, 1322 .amux = EM28XX_AMUX_LINE_IN, 1323 }, { 1324 .type = EM28XX_VMUX_SVIDEO, 1325 .vmux = SAA7115_SVIDEO3, 1326 .amux = EM28XX_AMUX_LINE_IN, 1327 } }, 1328 }, 1329 [EM2800_BOARD_TERRATEC_CINERGY_200] = { 1330 .name = "Terratec Cinergy 200 USB", 1331 .is_em2800 = 1, 1332 .has_ir_i2c = 1, 1333 .tuner_type = TUNER_LG_TALN, 1334 .tda9887_conf = TDA9887_PRESENT, 1335 .decoder = EM28XX_SAA711X, 1336 .input = { { 1337 .type = EM28XX_VMUX_TELEVISION, 1338 .vmux = SAA7115_COMPOSITE2, 1339 .amux = EM28XX_AMUX_VIDEO, 1340 }, { 1341 .type = EM28XX_VMUX_COMPOSITE1, 1342 .vmux = SAA7115_COMPOSITE0, 1343 .amux = EM28XX_AMUX_LINE_IN, 1344 }, { 1345 .type = EM28XX_VMUX_SVIDEO, 1346 .vmux = SAA7115_SVIDEO3, 1347 .amux = EM28XX_AMUX_LINE_IN, 1348 } }, 1349 }, 1350 [EM2800_BOARD_GRABBEEX_USB2800] = { 1351 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", 1352 .is_em2800 = 1, 1353 .decoder = EM28XX_SAA711X, 1354 .tuner_type = TUNER_ABSENT, /* capture only board */ 1355 .input = { { 1356 .type = EM28XX_VMUX_COMPOSITE1, 1357 .vmux = SAA7115_COMPOSITE0, 1358 .amux = EM28XX_AMUX_LINE_IN, 1359 }, { 1360 .type = EM28XX_VMUX_SVIDEO, 1361 .vmux = SAA7115_SVIDEO3, 1362 .amux = EM28XX_AMUX_LINE_IN, 1363 } }, 1364 }, 1365 [EM2800_BOARD_VC211A] = { 1366 .name = "Actionmaster/LinXcel/Digitus VC211A", 1367 .is_em2800 = 1, 1368 .tuner_type = TUNER_ABSENT, /* Capture-only board */ 1369 .decoder = EM28XX_SAA711X, 1370 .input = { { 1371 .type = EM28XX_VMUX_COMPOSITE1, 1372 .vmux = SAA7115_COMPOSITE0, 1373 .amux = EM28XX_AMUX_LINE_IN, 1374 .gpio = vc211a_enable, 1375 }, { 1376 .type = EM28XX_VMUX_SVIDEO, 1377 .vmux = SAA7115_SVIDEO3, 1378 .amux = EM28XX_AMUX_LINE_IN, 1379 .gpio = vc211a_enable, 1380 } }, 1381 }, 1382 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = { 1383 .name = "Leadtek Winfast USB II", 1384 .is_em2800 = 1, 1385 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 1386 .tda9887_conf = TDA9887_PRESENT, 1387 .decoder = EM28XX_SAA711X, 1388 .input = { { 1389 .type = EM28XX_VMUX_TELEVISION, 1390 .vmux = SAA7115_COMPOSITE2, 1391 .amux = EM28XX_AMUX_VIDEO, 1392 }, { 1393 .type = EM28XX_VMUX_COMPOSITE1, 1394 .vmux = SAA7115_COMPOSITE0, 1395 .amux = EM28XX_AMUX_LINE_IN, 1396 }, { 1397 .type = EM28XX_VMUX_SVIDEO, 1398 .vmux = SAA7115_SVIDEO3, 1399 .amux = EM28XX_AMUX_LINE_IN, 1400 } }, 1401 }, 1402 [EM2800_BOARD_KWORLD_USB2800] = { 1403 .name = "Kworld USB2800", 1404 .is_em2800 = 1, 1405 .tuner_type = TUNER_PHILIPS_FCV1236D, 1406 .tda9887_conf = TDA9887_PRESENT, 1407 .decoder = EM28XX_SAA711X, 1408 .input = { { 1409 .type = EM28XX_VMUX_TELEVISION, 1410 .vmux = SAA7115_COMPOSITE2, 1411 .amux = EM28XX_AMUX_VIDEO, 1412 }, { 1413 .type = EM28XX_VMUX_COMPOSITE1, 1414 .vmux = SAA7115_COMPOSITE0, 1415 .amux = EM28XX_AMUX_LINE_IN, 1416 }, { 1417 .type = EM28XX_VMUX_SVIDEO, 1418 .vmux = SAA7115_SVIDEO3, 1419 .amux = EM28XX_AMUX_LINE_IN, 1420 } }, 1421 }, 1422 [EM2820_BOARD_PINNACLE_DVC_90] = { 1423 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker " 1424 "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U", 1425 .tuner_type = TUNER_ABSENT, /* capture only board */ 1426 .decoder = EM28XX_SAA711X, 1427 .input = { { 1428 .type = EM28XX_VMUX_COMPOSITE1, 1429 .vmux = SAA7115_COMPOSITE0, 1430 .amux = EM28XX_AMUX_LINE_IN, 1431 }, { 1432 .type = EM28XX_VMUX_SVIDEO, 1433 .vmux = SAA7115_SVIDEO3, 1434 .amux = EM28XX_AMUX_LINE_IN, 1435 } }, 1436 }, 1437 [EM2800_BOARD_VGEAR_POCKETTV] = { 1438 .name = "V-Gear PocketTV", 1439 .is_em2800 = 1, 1440 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 1441 .tda9887_conf = TDA9887_PRESENT, 1442 .decoder = EM28XX_SAA711X, 1443 .input = { { 1444 .type = EM28XX_VMUX_TELEVISION, 1445 .vmux = SAA7115_COMPOSITE2, 1446 .amux = EM28XX_AMUX_VIDEO, 1447 }, { 1448 .type = EM28XX_VMUX_COMPOSITE1, 1449 .vmux = SAA7115_COMPOSITE0, 1450 .amux = EM28XX_AMUX_LINE_IN, 1451 }, { 1452 .type = EM28XX_VMUX_SVIDEO, 1453 .vmux = SAA7115_SVIDEO3, 1454 .amux = EM28XX_AMUX_LINE_IN, 1455 } }, 1456 }, 1457 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = { 1458 .name = "Pixelview PlayTV Box 4 USB 2.0", 1459 .tda9887_conf = TDA9887_PRESENT, 1460 .tuner_type = TUNER_YMEC_TVF_5533MF, 1461 .decoder = EM28XX_SAA711X, 1462 .input = { { 1463 .type = EM28XX_VMUX_TELEVISION, 1464 .vmux = SAA7115_COMPOSITE2, 1465 .amux = EM28XX_AMUX_VIDEO, 1466 .aout = EM28XX_AOUT_MONO | /* I2S */ 1467 EM28XX_AOUT_MASTER, /* Line out pin */ 1468 }, { 1469 .type = EM28XX_VMUX_COMPOSITE1, 1470 .vmux = SAA7115_COMPOSITE0, 1471 .amux = EM28XX_AMUX_LINE_IN, 1472 }, { 1473 .type = EM28XX_VMUX_SVIDEO, 1474 .vmux = SAA7115_SVIDEO3, 1475 .amux = EM28XX_AMUX_LINE_IN, 1476 } }, 1477 }, 1478 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { 1479 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0", 1480 .buttons = std_snapshot_button, 1481 .tda9887_conf = TDA9887_PRESENT, 1482 .tuner_type = TUNER_YMEC_TVF_5533MF, 1483 .decoder = EM28XX_SAA711X, 1484 .input = { { 1485 .type = EM28XX_VMUX_TELEVISION, 1486 .vmux = SAA7115_COMPOSITE2, 1487 .amux = EM28XX_AMUX_VIDEO, 1488 .aout = EM28XX_AOUT_MONO | /* I2S */ 1489 EM28XX_AOUT_MASTER, /* Line out pin */ 1490 }, { 1491 .type = EM28XX_VMUX_COMPOSITE1, 1492 .vmux = SAA7115_COMPOSITE0, 1493 .amux = EM28XX_AMUX_LINE_IN, 1494 }, { 1495 .type = EM28XX_VMUX_SVIDEO, 1496 .vmux = SAA7115_SVIDEO3, 1497 .amux = EM28XX_AMUX_LINE_IN, 1498 } }, 1499 }, 1500 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = { 1501 .name = "EM2860/SAA711X Reference Design", 1502 .buttons = std_snapshot_button, 1503 .tuner_type = TUNER_ABSENT, 1504 .decoder = EM28XX_SAA711X, 1505 .input = { { 1506 .type = EM28XX_VMUX_SVIDEO, 1507 .vmux = SAA7115_SVIDEO3, 1508 }, { 1509 .type = EM28XX_VMUX_COMPOSITE1, 1510 .vmux = SAA7115_COMPOSITE0, 1511 } }, 1512 }, 1513 1514 [EM2874_BOARD_LEADERSHIP_ISDBT] = { 1515 .def_i2c_bus = 1, 1516 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 1517 EM28XX_I2C_FREQ_100_KHZ, 1518 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ, 1519 .name = "EM2874 Leadership ISDBT", 1520 .tuner_type = TUNER_ABSENT, 1521 .tuner_gpio = leadership_reset, 1522 .dvb_gpio = leadership_digital, 1523 .has_dvb = 1, 1524 }, 1525 1526 [EM2880_BOARD_MSI_DIGIVOX_AD] = { 1527 .name = "MSI DigiVox A/D", 1528 .valid = EM28XX_BOARD_NOT_VALIDATED, 1529 .tuner_type = TUNER_XC2028, 1530 .tuner_gpio = default_tuner_gpio, 1531 .decoder = EM28XX_TVP5150, 1532 .input = { { 1533 .type = EM28XX_VMUX_TELEVISION, 1534 .vmux = TVP5150_COMPOSITE0, 1535 .amux = EM28XX_AMUX_VIDEO, 1536 .gpio = em2880_msi_digivox_ad_analog, 1537 }, { 1538 .type = EM28XX_VMUX_COMPOSITE1, 1539 .vmux = TVP5150_COMPOSITE1, 1540 .amux = EM28XX_AMUX_LINE_IN, 1541 .gpio = em2880_msi_digivox_ad_analog, 1542 }, { 1543 .type = EM28XX_VMUX_SVIDEO, 1544 .vmux = TVP5150_SVIDEO, 1545 .amux = EM28XX_AMUX_LINE_IN, 1546 .gpio = em2880_msi_digivox_ad_analog, 1547 } }, 1548 }, 1549 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = { 1550 .name = "MSI DigiVox A/D II", 1551 .valid = EM28XX_BOARD_NOT_VALIDATED, 1552 .tuner_type = TUNER_XC2028, 1553 .tuner_gpio = default_tuner_gpio, 1554 .decoder = EM28XX_TVP5150, 1555 .input = { { 1556 .type = EM28XX_VMUX_TELEVISION, 1557 .vmux = TVP5150_COMPOSITE0, 1558 .amux = EM28XX_AMUX_VIDEO, 1559 .gpio = em2880_msi_digivox_ad_analog, 1560 }, { 1561 .type = EM28XX_VMUX_COMPOSITE1, 1562 .vmux = TVP5150_COMPOSITE1, 1563 .amux = EM28XX_AMUX_LINE_IN, 1564 .gpio = em2880_msi_digivox_ad_analog, 1565 }, { 1566 .type = EM28XX_VMUX_SVIDEO, 1567 .vmux = TVP5150_SVIDEO, 1568 .amux = EM28XX_AMUX_LINE_IN, 1569 .gpio = em2880_msi_digivox_ad_analog, 1570 } }, 1571 }, 1572 [EM2880_BOARD_KWORLD_DVB_305U] = { 1573 .name = "KWorld DVB-T 305U", 1574 .tuner_type = TUNER_XC2028, 1575 .tuner_gpio = default_tuner_gpio, 1576 .decoder = EM28XX_TVP5150, 1577 .input = { { 1578 .type = EM28XX_VMUX_TELEVISION, 1579 .vmux = TVP5150_COMPOSITE0, 1580 .amux = EM28XX_AMUX_VIDEO, 1581 }, { 1582 .type = EM28XX_VMUX_COMPOSITE1, 1583 .vmux = TVP5150_COMPOSITE1, 1584 .amux = EM28XX_AMUX_LINE_IN, 1585 }, { 1586 .type = EM28XX_VMUX_SVIDEO, 1587 .vmux = TVP5150_SVIDEO, 1588 .amux = EM28XX_AMUX_LINE_IN, 1589 } }, 1590 }, 1591 [EM2880_BOARD_KWORLD_DVB_310U] = { 1592 .name = "KWorld DVB-T 310U", 1593 .tuner_type = TUNER_XC2028, 1594 .tuner_gpio = default_tuner_gpio, 1595 .has_dvb = 1, 1596 .dvb_gpio = default_digital, 1597 .mts_firmware = 1, 1598 .decoder = EM28XX_TVP5150, 1599 .input = { { 1600 .type = EM28XX_VMUX_TELEVISION, 1601 .vmux = TVP5150_COMPOSITE0, 1602 .amux = EM28XX_AMUX_VIDEO, 1603 .gpio = default_analog, 1604 }, { 1605 .type = EM28XX_VMUX_COMPOSITE1, 1606 .vmux = TVP5150_COMPOSITE1, 1607 .amux = EM28XX_AMUX_LINE_IN, 1608 .gpio = default_analog, 1609 }, { /* S-video has not been tested yet */ 1610 .type = EM28XX_VMUX_SVIDEO, 1611 .vmux = TVP5150_SVIDEO, 1612 .amux = EM28XX_AMUX_LINE_IN, 1613 .gpio = default_analog, 1614 } }, 1615 }, 1616 [EM2882_BOARD_KWORLD_ATSC_315U] = { 1617 .name = "KWorld ATSC 315U HDTV TV Box", 1618 .valid = EM28XX_BOARD_NOT_VALIDATED, 1619 .tuner_type = TUNER_THOMSON_DTT761X, 1620 .tuner_gpio = em2882_kworld_315u_tuner_gpio, 1621 .tda9887_conf = TDA9887_PRESENT, 1622 .decoder = EM28XX_SAA711X, 1623 .has_dvb = 1, 1624 .dvb_gpio = em2882_kworld_315u_digital, 1625 .ir_codes = RC_MAP_KWORLD_315U, 1626 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1627 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE, 1628 /* Analog mode - still not ready */ 1629 /*.input = { { 1630 .type = EM28XX_VMUX_TELEVISION, 1631 .vmux = SAA7115_COMPOSITE2, 1632 .amux = EM28XX_AMUX_VIDEO, 1633 .gpio = em2882_kworld_315u_analog, 1634 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, 1635 }, { 1636 .type = EM28XX_VMUX_COMPOSITE1, 1637 .vmux = SAA7115_COMPOSITE0, 1638 .amux = EM28XX_AMUX_LINE_IN, 1639 .gpio = em2882_kworld_315u_analog1, 1640 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, 1641 }, { 1642 .type = EM28XX_VMUX_SVIDEO, 1643 .vmux = SAA7115_SVIDEO3, 1644 .amux = EM28XX_AMUX_LINE_IN, 1645 .gpio = em2882_kworld_315u_analog1, 1646 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, 1647 } }, */ 1648 }, 1649 [EM2880_BOARD_EMPIRE_DUAL_TV] = { 1650 .name = "Empire dual TV", 1651 .tuner_type = TUNER_XC2028, 1652 .tuner_gpio = default_tuner_gpio, 1653 .has_dvb = 1, 1654 .dvb_gpio = default_digital, 1655 .mts_firmware = 1, 1656 .decoder = EM28XX_TVP5150, 1657 .input = { { 1658 .type = EM28XX_VMUX_TELEVISION, 1659 .vmux = TVP5150_COMPOSITE0, 1660 .amux = EM28XX_AMUX_VIDEO, 1661 .gpio = default_analog, 1662 }, { 1663 .type = EM28XX_VMUX_COMPOSITE1, 1664 .vmux = TVP5150_COMPOSITE1, 1665 .amux = EM28XX_AMUX_LINE_IN, 1666 .gpio = default_analog, 1667 }, { 1668 .type = EM28XX_VMUX_SVIDEO, 1669 .vmux = TVP5150_SVIDEO, 1670 .amux = EM28XX_AMUX_LINE_IN, 1671 .gpio = default_analog, 1672 } }, 1673 }, 1674 [EM2881_BOARD_DNT_DA2_HYBRID] = { 1675 .name = "DNT DA2 Hybrid", 1676 .valid = EM28XX_BOARD_NOT_VALIDATED, 1677 .tuner_type = TUNER_XC2028, 1678 .tuner_gpio = default_tuner_gpio, 1679 .decoder = EM28XX_TVP5150, 1680 .input = { { 1681 .type = EM28XX_VMUX_TELEVISION, 1682 .vmux = TVP5150_COMPOSITE0, 1683 .amux = EM28XX_AMUX_VIDEO, 1684 .gpio = default_analog, 1685 }, { 1686 .type = EM28XX_VMUX_COMPOSITE1, 1687 .vmux = TVP5150_COMPOSITE1, 1688 .amux = EM28XX_AMUX_LINE_IN, 1689 .gpio = default_analog, 1690 }, { 1691 .type = EM28XX_VMUX_SVIDEO, 1692 .vmux = TVP5150_SVIDEO, 1693 .amux = EM28XX_AMUX_LINE_IN, 1694 .gpio = default_analog, 1695 } }, 1696 }, 1697 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { 1698 .name = "Pinnacle Hybrid Pro", 1699 .tuner_type = TUNER_XC2028, 1700 .tuner_gpio = default_tuner_gpio, 1701 .decoder = EM28XX_TVP5150, 1702 .has_dvb = 1, 1703 .dvb_gpio = pinnacle_hybrid_pro_digital, 1704 .input = { { 1705 .type = EM28XX_VMUX_TELEVISION, 1706 .vmux = TVP5150_COMPOSITE0, 1707 .amux = EM28XX_AMUX_VIDEO, 1708 .gpio = pinnacle_hybrid_pro_analog, 1709 }, { 1710 .type = EM28XX_VMUX_COMPOSITE1, 1711 .vmux = TVP5150_COMPOSITE1, 1712 .amux = EM28XX_AMUX_LINE_IN, 1713 .gpio = pinnacle_hybrid_pro_analog, 1714 }, { 1715 .type = EM28XX_VMUX_SVIDEO, 1716 .vmux = TVP5150_SVIDEO, 1717 .amux = EM28XX_AMUX_LINE_IN, 1718 .gpio = pinnacle_hybrid_pro_analog, 1719 } }, 1720 }, 1721 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = { 1722 .name = "Pinnacle Hybrid Pro (330e)", 1723 .tuner_type = TUNER_XC2028, 1724 .tuner_gpio = default_tuner_gpio, 1725 .mts_firmware = 1, 1726 .has_dvb = 1, 1727 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital, 1728 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 1729 .decoder = EM28XX_TVP5150, 1730 .input = { { 1731 .type = EM28XX_VMUX_TELEVISION, 1732 .vmux = TVP5150_COMPOSITE0, 1733 .amux = EM28XX_AMUX_VIDEO, 1734 .gpio = hauppauge_wintv_hvr_900_analog, 1735 }, { 1736 .type = EM28XX_VMUX_COMPOSITE1, 1737 .vmux = TVP5150_COMPOSITE1, 1738 .amux = EM28XX_AMUX_LINE_IN, 1739 .gpio = hauppauge_wintv_hvr_900_analog, 1740 }, { 1741 .type = EM28XX_VMUX_SVIDEO, 1742 .vmux = TVP5150_SVIDEO, 1743 .amux = EM28XX_AMUX_LINE_IN, 1744 .gpio = hauppauge_wintv_hvr_900_analog, 1745 } }, 1746 }, 1747 [EM2882_BOARD_KWORLD_VS_DVBT] = { 1748 .name = "Kworld VS-DVB-T 323UR", 1749 .tuner_type = TUNER_XC2028, 1750 .tuner_gpio = default_tuner_gpio, 1751 .decoder = EM28XX_TVP5150, 1752 .mts_firmware = 1, 1753 .has_dvb = 1, 1754 .dvb_gpio = kworld_330u_digital, 1755 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ 1756 .ir_codes = RC_MAP_KWORLD_315U, 1757 .input = { { 1758 .type = EM28XX_VMUX_TELEVISION, 1759 .vmux = TVP5150_COMPOSITE0, 1760 .amux = EM28XX_AMUX_VIDEO, 1761 }, { 1762 .type = EM28XX_VMUX_COMPOSITE1, 1763 .vmux = TVP5150_COMPOSITE1, 1764 .amux = EM28XX_AMUX_LINE_IN, 1765 }, { 1766 .type = EM28XX_VMUX_SVIDEO, 1767 .vmux = TVP5150_SVIDEO, 1768 .amux = EM28XX_AMUX_LINE_IN, 1769 } }, 1770 }, 1771 [EM2882_BOARD_TERRATEC_HYBRID_XS] = { 1772 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)", 1773 .tuner_type = TUNER_XC2028, 1774 .tuner_gpio = default_tuner_gpio, 1775 .mts_firmware = 1, 1776 .decoder = EM28XX_TVP5150, 1777 .has_dvb = 1, 1778 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1779 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS, 1780 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1781 .input = { { 1782 .type = EM28XX_VMUX_TELEVISION, 1783 .vmux = TVP5150_COMPOSITE0, 1784 .amux = EM28XX_AMUX_VIDEO, 1785 .gpio = hauppauge_wintv_hvr_900_analog, 1786 }, { 1787 .type = EM28XX_VMUX_COMPOSITE1, 1788 .vmux = TVP5150_COMPOSITE1, 1789 .amux = EM28XX_AMUX_LINE_IN, 1790 .gpio = hauppauge_wintv_hvr_900_analog, 1791 }, { 1792 .type = EM28XX_VMUX_SVIDEO, 1793 .vmux = TVP5150_SVIDEO, 1794 .amux = EM28XX_AMUX_LINE_IN, 1795 .gpio = hauppauge_wintv_hvr_900_analog, 1796 } }, 1797 }, 1798 [EM2882_BOARD_DIKOM_DK300] = { 1799 .name = "Dikom DK300", 1800 .tuner_type = TUNER_XC2028, 1801 .tuner_gpio = default_tuner_gpio, 1802 .decoder = EM28XX_TVP5150, 1803 .mts_firmware = 1, 1804 .has_dvb = 1, 1805 .dvb_gpio = dikom_dk300_digital, 1806 .input = { { 1807 .type = EM28XX_VMUX_TELEVISION, 1808 .vmux = TVP5150_COMPOSITE0, 1809 .amux = EM28XX_AMUX_VIDEO, 1810 .gpio = default_analog, 1811 } }, 1812 }, 1813 [EM2883_BOARD_KWORLD_HYBRID_330U] = { 1814 .name = "Kworld PlusTV HD Hybrid 330", 1815 .tuner_type = TUNER_XC2028, 1816 .tuner_gpio = default_tuner_gpio, 1817 .decoder = EM28XX_TVP5150, 1818 .mts_firmware = 1, 1819 .has_dvb = 1, 1820 .dvb_gpio = kworld_330u_digital, 1821 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1822 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 1823 EM28XX_I2C_EEPROM_ON_BOARD | 1824 EM28XX_I2C_EEPROM_KEY_VALID, 1825 .input = { { 1826 .type = EM28XX_VMUX_TELEVISION, 1827 .vmux = TVP5150_COMPOSITE0, 1828 .amux = EM28XX_AMUX_VIDEO, 1829 .gpio = kworld_330u_analog, 1830 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, 1831 }, { 1832 .type = EM28XX_VMUX_COMPOSITE1, 1833 .vmux = TVP5150_COMPOSITE1, 1834 .amux = EM28XX_AMUX_LINE_IN, 1835 .gpio = kworld_330u_analog, 1836 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, 1837 }, { 1838 .type = EM28XX_VMUX_SVIDEO, 1839 .vmux = TVP5150_SVIDEO, 1840 .amux = EM28XX_AMUX_LINE_IN, 1841 .gpio = kworld_330u_analog, 1842 } }, 1843 }, 1844 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { 1845 .name = "Compro VideoMate ForYou/Stereo", 1846 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 1847 .tvaudio_addr = 0xb0, 1848 .tda9887_conf = TDA9887_PRESENT, 1849 .decoder = EM28XX_TVP5150, 1850 .adecoder = EM28XX_TVAUDIO, 1851 .mute_gpio = compro_mute_gpio, 1852 .input = { { 1853 .type = EM28XX_VMUX_TELEVISION, 1854 .vmux = TVP5150_COMPOSITE0, 1855 .amux = EM28XX_AMUX_VIDEO, 1856 .gpio = compro_unmute_tv_gpio, 1857 }, { 1858 .type = EM28XX_VMUX_SVIDEO, 1859 .vmux = TVP5150_SVIDEO, 1860 .amux = EM28XX_AMUX_LINE_IN, 1861 .gpio = compro_unmute_svid_gpio, 1862 } }, 1863 }, 1864 [EM2860_BOARD_KAIOMY_TVNPC_U2] = { 1865 .name = "Kaiomy TVnPC U2", 1866 .vchannels = 3, 1867 .tuner_type = TUNER_XC2028, 1868 .tuner_addr = 0x61, 1869 .mts_firmware = 1, 1870 .decoder = EM28XX_TVP5150, 1871 .tuner_gpio = default_tuner_gpio, 1872 .ir_codes = RC_MAP_KAIOMY, 1873 .input = { { 1874 .type = EM28XX_VMUX_TELEVISION, 1875 .vmux = TVP5150_COMPOSITE0, 1876 .amux = EM28XX_AMUX_VIDEO, 1877 1878 }, { 1879 .type = EM28XX_VMUX_COMPOSITE1, 1880 .vmux = TVP5150_COMPOSITE1, 1881 .amux = EM28XX_AMUX_LINE_IN, 1882 }, { 1883 .type = EM28XX_VMUX_SVIDEO, 1884 .vmux = TVP5150_SVIDEO, 1885 .amux = EM28XX_AMUX_LINE_IN, 1886 } }, 1887 .radio = { 1888 .type = EM28XX_RADIO, 1889 .amux = EM28XX_AMUX_LINE_IN, 1890 } 1891 }, 1892 [EM2860_BOARD_EASYCAP] = { 1893 .name = "Easy Cap Capture DC-60", 1894 .vchannels = 2, 1895 .tuner_type = TUNER_ABSENT, 1896 .decoder = EM28XX_SAA711X, 1897 .input = { { 1898 .type = EM28XX_VMUX_COMPOSITE1, 1899 .vmux = SAA7115_COMPOSITE0, 1900 .amux = EM28XX_AMUX_LINE_IN, 1901 }, { 1902 .type = EM28XX_VMUX_SVIDEO, 1903 .vmux = SAA7115_SVIDEO3, 1904 .amux = EM28XX_AMUX_LINE_IN, 1905 } }, 1906 }, 1907 [EM2820_BOARD_IODATA_GVMVP_SZ] = { 1908 .name = "IO-DATA GV-MVP/SZ", 1909 .tuner_type = TUNER_PHILIPS_FM1236_MK3, 1910 .tuner_gpio = default_tuner_gpio, 1911 .tda9887_conf = TDA9887_PRESENT, 1912 .decoder = EM28XX_TVP5150, 1913 .input = { { 1914 .type = EM28XX_VMUX_TELEVISION, 1915 .vmux = TVP5150_COMPOSITE0, 1916 .amux = EM28XX_AMUX_VIDEO, 1917 }, { /* Composite has not been tested yet */ 1918 .type = EM28XX_VMUX_COMPOSITE1, 1919 .vmux = TVP5150_COMPOSITE1, 1920 .amux = EM28XX_AMUX_VIDEO, 1921 }, { /* S-video has not been tested yet */ 1922 .type = EM28XX_VMUX_SVIDEO, 1923 .vmux = TVP5150_SVIDEO, 1924 .amux = EM28XX_AMUX_VIDEO, 1925 } }, 1926 }, 1927 [EM2860_BOARD_TERRATEC_GRABBY] = { 1928 .name = "Terratec Grabby", 1929 .vchannels = 2, 1930 .tuner_type = TUNER_ABSENT, 1931 .decoder = EM28XX_SAA711X, 1932 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1933 .input = { { 1934 .type = EM28XX_VMUX_COMPOSITE1, 1935 .vmux = SAA7115_COMPOSITE0, 1936 .amux = EM28XX_AMUX_LINE_IN, 1937 }, { 1938 .type = EM28XX_VMUX_SVIDEO, 1939 .vmux = SAA7115_SVIDEO3, 1940 .amux = EM28XX_AMUX_LINE_IN, 1941 } }, 1942 }, 1943 [EM2860_BOARD_TERRATEC_AV350] = { 1944 .name = "Terratec AV350", 1945 .vchannels = 2, 1946 .tuner_type = TUNER_ABSENT, 1947 .decoder = EM28XX_TVP5150, 1948 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1949 .mute_gpio = terratec_av350_mute_gpio, 1950 .input = { { 1951 .type = EM28XX_VMUX_COMPOSITE1, 1952 .vmux = TVP5150_COMPOSITE1, 1953 .amux = EM28XX_AUDIO_SRC_LINE, 1954 .gpio = terratec_av350_unmute_gpio, 1955 1956 }, { 1957 .type = EM28XX_VMUX_SVIDEO, 1958 .vmux = TVP5150_SVIDEO, 1959 .amux = EM28XX_AUDIO_SRC_LINE, 1960 .gpio = terratec_av350_unmute_gpio, 1961 } }, 1962 }, 1963 1964 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = { 1965 .name = "Elgato Video Capture", 1966 .decoder = EM28XX_SAA711X, 1967 .tuner_type = TUNER_ABSENT, /* Capture only device */ 1968 .input = { { 1969 .type = EM28XX_VMUX_COMPOSITE1, 1970 .vmux = SAA7115_COMPOSITE0, 1971 .amux = EM28XX_AMUX_LINE_IN, 1972 }, { 1973 .type = EM28XX_VMUX_SVIDEO, 1974 .vmux = SAA7115_SVIDEO3, 1975 .amux = EM28XX_AMUX_LINE_IN, 1976 } }, 1977 }, 1978 1979 [EM2882_BOARD_EVGA_INDTUBE] = { 1980 .name = "Evga inDtube", 1981 .tuner_type = TUNER_XC2028, 1982 .tuner_gpio = default_tuner_gpio, 1983 .decoder = EM28XX_TVP5150, 1984 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ 1985 .mts_firmware = 1, 1986 .has_dvb = 1, 1987 .dvb_gpio = evga_indtube_digital, 1988 .ir_codes = RC_MAP_EVGA_INDTUBE, 1989 .input = { { 1990 .type = EM28XX_VMUX_TELEVISION, 1991 .vmux = TVP5150_COMPOSITE0, 1992 .amux = EM28XX_AMUX_VIDEO, 1993 .gpio = evga_indtube_analog, 1994 }, { 1995 .type = EM28XX_VMUX_COMPOSITE1, 1996 .vmux = TVP5150_COMPOSITE1, 1997 .amux = EM28XX_AMUX_LINE_IN, 1998 .gpio = evga_indtube_analog, 1999 }, { 2000 .type = EM28XX_VMUX_SVIDEO, 2001 .vmux = TVP5150_SVIDEO, 2002 .amux = EM28XX_AMUX_LINE_IN, 2003 .gpio = evga_indtube_analog, 2004 } }, 2005 }, 2006 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 + 2007 Infineon TUA6034) */ 2008 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = { 2009 .name = "Reddo DVB-C USB TV Box", 2010 .tuner_type = TUNER_ABSENT, 2011 .tuner_gpio = reddo_dvb_c_usb_box, 2012 .has_dvb = 1, 2013 }, 2014 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold 2015 * initially as the KWorld PlusTV 340U, then as the UB435-Q. 2016 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */ 2017 [EM2870_BOARD_KWORLD_A340] = { 2018 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)", 2019 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */ 2020 .has_dvb = 1, 2021 .dvb_gpio = kworld_a340_digital, 2022 .tuner_gpio = default_tuner_gpio, 2023 }, 2024 /* 2013:024f PCTV nanoStick T2 290e. 2025 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */ 2026 [EM28174_BOARD_PCTV_290E] = { 2027 .name = "PCTV nanoStick T2 290e", 2028 .def_i2c_bus = 1, 2029 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ, 2030 .tuner_type = TUNER_ABSENT, 2031 .tuner_gpio = pctv_290e, 2032 .has_dvb = 1, 2033 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 2034 }, 2035 /* 2013:024f PCTV DVB-S2 Stick 460e 2036 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */ 2037 [EM28174_BOARD_PCTV_460E] = { 2038 .def_i2c_bus = 1, 2039 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ, 2040 .name = "PCTV DVB-S2 Stick (460e)", 2041 .tuner_type = TUNER_ABSENT, 2042 .tuner_gpio = pctv_460e, 2043 .has_dvb = 1, 2044 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 2045 }, 2046 /* eb1a:5006 Honestech VIDBOX NW03 2047 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */ 2048 [EM2860_BOARD_HT_VIDBOX_NW03] = { 2049 .name = "Honestech Vidbox NW03", 2050 .tuner_type = TUNER_ABSENT, 2051 .decoder = EM28XX_SAA711X, 2052 .input = { { 2053 .type = EM28XX_VMUX_COMPOSITE1, 2054 .vmux = SAA7115_COMPOSITE0, 2055 .amux = EM28XX_AMUX_LINE_IN, 2056 }, { 2057 .type = EM28XX_VMUX_SVIDEO, 2058 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */ 2059 .amux = EM28XX_AMUX_LINE_IN, 2060 } }, 2061 }, 2062 /* 1b80:e425 MaxMedia UB425-TC 2063 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */ 2064 [EM2874_BOARD_MAXMEDIA_UB425_TC] = { 2065 .name = "MaxMedia UB425-TC", 2066 .tuner_type = TUNER_ABSENT, 2067 .tuner_gpio = maxmedia_ub425_tc, 2068 .has_dvb = 1, 2069 .ir_codes = RC_MAP_REDDO, 2070 .def_i2c_bus = 1, 2071 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2072 EM28XX_I2C_FREQ_400_KHZ, 2073 }, 2074 /* 2304:0242 PCTV QuatroStick (510e) 2075 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ 2076 [EM2884_BOARD_PCTV_510E] = { 2077 .name = "PCTV QuatroStick (510e)", 2078 .tuner_type = TUNER_ABSENT, 2079 .tuner_gpio = pctv_510e, 2080 .has_dvb = 1, 2081 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 2082 .def_i2c_bus = 1, 2083 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2084 EM28XX_I2C_FREQ_400_KHZ, 2085 }, 2086 /* 2013:0251 PCTV QuatroStick nano (520e) 2087 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ 2088 [EM2884_BOARD_PCTV_520E] = { 2089 .name = "PCTV QuatroStick nano (520e)", 2090 .tuner_type = TUNER_ABSENT, 2091 .tuner_gpio = pctv_520e, 2092 .has_dvb = 1, 2093 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 2094 .def_i2c_bus = 1, 2095 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2096 EM28XX_I2C_FREQ_400_KHZ, 2097 }, 2098 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = { 2099 .name = "Terratec Cinergy HTC USB XS", 2100 .has_dvb = 1, 2101 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, 2102 .tuner_type = TUNER_ABSENT, 2103 .def_i2c_bus = 1, 2104 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2105 EM28XX_I2C_FREQ_400_KHZ, 2106 }, 2107 /* 1b80:e1cc Delock 61959 2108 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 2109 * mostly the same as MaxMedia UB-425-TC but different remote */ 2110 [EM2874_BOARD_DELOCK_61959] = { 2111 .name = "Delock 61959", 2112 .tuner_type = TUNER_ABSENT, 2113 .tuner_gpio = maxmedia_ub425_tc, 2114 .has_dvb = 1, 2115 .ir_codes = RC_MAP_DELOCK_61959, 2116 .def_i2c_bus = 1, 2117 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2118 EM28XX_I2C_FREQ_400_KHZ, 2119 }, 2120 /* 2121 * 1b80:e346 KWorld USB ATSC TV Stick UB435-Q V2 2122 * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2 2123 */ 2124 [EM2874_BOARD_KWORLD_UB435Q_V2] = { 2125 .name = "KWorld USB ATSC TV Stick UB435-Q V2", 2126 .tuner_type = TUNER_ABSENT, 2127 .has_dvb = 1, 2128 .dvb_gpio = kworld_a340_digital, 2129 .tuner_gpio = default_tuner_gpio, 2130 .def_i2c_bus = 1, 2131 }, 2132 /* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam 2133 * Empia EM2765 + OmniVision OV2640 */ 2134 [EM2765_BOARD_SPEEDLINK_VAD_LAPLACE] = { 2135 .name = "SpeedLink Vicious And Devine Laplace webcam", 2136 .xclk = EM28XX_XCLK_FREQUENCY_24MHZ, 2137 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2138 EM28XX_I2C_FREQ_100_KHZ, 2139 .def_i2c_bus = 1, 2140 .tuner_type = TUNER_ABSENT, 2141 .is_webcam = 1, 2142 .input = { { 2143 .type = EM28XX_VMUX_COMPOSITE1, 2144 .amux = EM28XX_AMUX_VIDEO, 2145 .gpio = speedlink_vad_laplace_reg_seq, 2146 } }, 2147 .buttons = speedlink_vad_laplace_buttons, 2148 .leds = speedlink_vad_laplace_leds, 2149 }, 2150 /* 2013:0258 PCTV DVB-S2 Stick (461e) 2151 * Empia EM28178, Montage M88DS3103, Montage M88TS2022, Allegro A8293 */ 2152 [EM28178_BOARD_PCTV_461E] = { 2153 .def_i2c_bus = 1, 2154 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ, 2155 .name = "PCTV DVB-S2 Stick (461e)", 2156 .tuner_type = TUNER_ABSENT, 2157 .tuner_gpio = pctv_461e, 2158 .has_dvb = 1, 2159 .ir_codes = RC_MAP_PINNACLE_PCTV_HD, 2160 }, 2161 }; 2162 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); 2163 2164 /* table of devices that work with this driver */ 2165 struct usb_device_id em28xx_id_table[] = { 2166 { USB_DEVICE(0xeb1a, 0x2750), 2167 .driver_info = EM2750_BOARD_UNKNOWN }, 2168 { USB_DEVICE(0xeb1a, 0x2751), 2169 .driver_info = EM2750_BOARD_UNKNOWN }, 2170 { USB_DEVICE(0xeb1a, 0x2800), 2171 .driver_info = EM2800_BOARD_UNKNOWN }, 2172 { USB_DEVICE(0xeb1a, 0x2710), 2173 .driver_info = EM2820_BOARD_UNKNOWN }, 2174 { USB_DEVICE(0xeb1a, 0x2820), 2175 .driver_info = EM2820_BOARD_UNKNOWN }, 2176 { USB_DEVICE(0xeb1a, 0x2821), 2177 .driver_info = EM2820_BOARD_UNKNOWN }, 2178 { USB_DEVICE(0xeb1a, 0x2860), 2179 .driver_info = EM2820_BOARD_UNKNOWN }, 2180 { USB_DEVICE(0xeb1a, 0x2861), 2181 .driver_info = EM2820_BOARD_UNKNOWN }, 2182 { USB_DEVICE(0xeb1a, 0x2862), 2183 .driver_info = EM2820_BOARD_UNKNOWN }, 2184 { USB_DEVICE(0xeb1a, 0x2863), 2185 .driver_info = EM2820_BOARD_UNKNOWN }, 2186 { USB_DEVICE(0xeb1a, 0x2870), 2187 .driver_info = EM2820_BOARD_UNKNOWN }, 2188 { USB_DEVICE(0xeb1a, 0x2881), 2189 .driver_info = EM2820_BOARD_UNKNOWN }, 2190 { USB_DEVICE(0xeb1a, 0x2883), 2191 .driver_info = EM2820_BOARD_UNKNOWN }, 2192 { USB_DEVICE(0xeb1a, 0x2868), 2193 .driver_info = EM2820_BOARD_UNKNOWN }, 2194 { USB_DEVICE(0xeb1a, 0x2875), 2195 .driver_info = EM2820_BOARD_UNKNOWN }, 2196 { USB_DEVICE(0xeb1a, 0xe300), 2197 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U }, 2198 { USB_DEVICE(0xeb1a, 0xe303), 2199 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 }, 2200 { USB_DEVICE(0xeb1a, 0xe305), 2201 .driver_info = EM2880_BOARD_KWORLD_DVB_305U }, 2202 { USB_DEVICE(0xeb1a, 0xe310), 2203 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD }, 2204 { USB_DEVICE(0xeb1a, 0xa313), 2205 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U }, 2206 { USB_DEVICE(0xeb1a, 0xa316), 2207 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U }, 2208 { USB_DEVICE(0xeb1a, 0xe320), 2209 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II }, 2210 { USB_DEVICE(0xeb1a, 0xe323), 2211 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT }, 2212 { USB_DEVICE(0xeb1a, 0xe350), 2213 .driver_info = EM2870_BOARD_KWORLD_350U }, 2214 { USB_DEVICE(0xeb1a, 0xe355), 2215 .driver_info = EM2870_BOARD_KWORLD_355U }, 2216 { USB_DEVICE(0xeb1a, 0x2801), 2217 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 }, 2218 { USB_DEVICE(0xeb1a, 0xe357), 2219 .driver_info = EM2870_BOARD_KWORLD_355U }, 2220 { USB_DEVICE(0xeb1a, 0xe359), 2221 .driver_info = EM2870_BOARD_KWORLD_355U }, 2222 { USB_DEVICE(0x1b80, 0xe302), 2223 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */ 2224 { USB_DEVICE(0x1b80, 0xe304), 2225 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */ 2226 { USB_DEVICE(0x0ccd, 0x0036), 2227 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 }, 2228 { USB_DEVICE(0x0ccd, 0x004c), 2229 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR }, 2230 { USB_DEVICE(0x0ccd, 0x004f), 2231 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS }, 2232 { USB_DEVICE(0x0ccd, 0x005e), 2233 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, 2234 { USB_DEVICE(0x0ccd, 0x0042), 2235 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, 2236 { USB_DEVICE(0x0ccd, 0x0043), 2237 .driver_info = EM2870_BOARD_TERRATEC_XS }, 2238 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */ 2239 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS }, 2240 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */ 2241 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS }, 2242 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */ 2243 .driver_info = EM2884_BOARD_TERRATEC_H5 }, 2244 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */ 2245 .driver_info = EM2884_BOARD_TERRATEC_H5 }, 2246 { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */ 2247 .driver_info = EM2884_BOARD_TERRATEC_H5 }, 2248 { USB_DEVICE(0x0ccd, 0x0084), 2249 .driver_info = EM2860_BOARD_TERRATEC_AV350 }, 2250 { USB_DEVICE(0x0ccd, 0x0096), 2251 .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, 2252 { USB_DEVICE(0x0ccd, 0x10AF), 2253 .driver_info = EM2860_BOARD_TERRATEC_GRABBY }, 2254 { USB_DEVICE(0x0ccd, 0x00b2), 2255 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK }, 2256 { USB_DEVICE(0x0fd9, 0x0033), 2257 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE}, 2258 { USB_DEVICE(0x185b, 0x2870), 2259 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE }, 2260 { USB_DEVICE(0x185b, 0x2041), 2261 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU }, 2262 { USB_DEVICE(0x2040, 0x4200), 2263 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, 2264 { USB_DEVICE(0x2040, 0x4201), 2265 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 }, 2266 { USB_DEVICE(0x2040, 0x6500), 2267 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, 2268 { USB_DEVICE(0x2040, 0x6502), 2269 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 }, 2270 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */ 2271 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, 2272 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */ 2273 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, 2274 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ 2275 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 }, 2276 { USB_DEVICE(0x2040, 0x651f), 2277 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 }, 2278 { USB_DEVICE(0x0438, 0xb002), 2279 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, 2280 { USB_DEVICE(0x2001, 0xf112), 2281 .driver_info = EM2820_BOARD_DLINK_USB_TV }, 2282 { USB_DEVICE(0x2304, 0x0207), 2283 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, 2284 { USB_DEVICE(0x2304, 0x0208), 2285 .driver_info = EM2820_BOARD_PINNACLE_USB_2 }, 2286 { USB_DEVICE(0x2304, 0x021a), 2287 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, 2288 { USB_DEVICE(0x2304, 0x0226), 2289 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E }, 2290 { USB_DEVICE(0x2304, 0x0227), 2291 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO }, 2292 { USB_DEVICE(0x0413, 0x6023), 2293 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII }, 2294 { USB_DEVICE(0x093b, 0xa003), 2295 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, 2296 { USB_DEVICE(0x093b, 0xa005), 2297 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U }, 2298 { USB_DEVICE(0x04bb, 0x0515), 2299 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ }, 2300 { USB_DEVICE(0xeb1a, 0x50a6), 2301 .driver_info = EM2860_BOARD_GADMEI_UTV330 }, 2302 { USB_DEVICE(0x1b80, 0xa340), 2303 .driver_info = EM2870_BOARD_KWORLD_A340 }, 2304 { USB_DEVICE(0x1b80, 0xe346), 2305 .driver_info = EM2874_BOARD_KWORLD_UB435Q_V2 }, 2306 { USB_DEVICE(0x2013, 0x024f), 2307 .driver_info = EM28174_BOARD_PCTV_290E }, 2308 { USB_DEVICE(0x2013, 0x024c), 2309 .driver_info = EM28174_BOARD_PCTV_460E }, 2310 { USB_DEVICE(0x2040, 0x1605), 2311 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C }, 2312 { USB_DEVICE(0x1b80, 0xe755), 2313 .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO }, 2314 { USB_DEVICE(0xeb1a, 0x5006), 2315 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 }, 2316 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */ 2317 .driver_info = EM2860_BOARD_EASYCAP }, 2318 { USB_DEVICE(0x1b80, 0xe425), 2319 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC }, 2320 { USB_DEVICE(0x2304, 0x0242), 2321 .driver_info = EM2884_BOARD_PCTV_510E }, 2322 { USB_DEVICE(0x2013, 0x0251), 2323 .driver_info = EM2884_BOARD_PCTV_520E }, 2324 { USB_DEVICE(0x1b80, 0xe1cc), 2325 .driver_info = EM2874_BOARD_DELOCK_61959 }, 2326 { USB_DEVICE(0x1ae7, 0x9003), 2327 .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE }, 2328 { USB_DEVICE(0x1ae7, 0x9004), 2329 .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE }, 2330 { USB_DEVICE(0x2013, 0x0258), 2331 .driver_info = EM28178_BOARD_PCTV_461E }, 2332 { }, 2333 }; 2334 MODULE_DEVICE_TABLE(usb, em28xx_id_table); 2335 2336 /* 2337 * EEPROM hash table for devices with generic USB IDs 2338 */ 2339 static struct em28xx_hash_table em28xx_eeprom_hash[] = { 2340 /* P/N: SA 60002070465 Tuner: TVF7533-MF */ 2341 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, 2342 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF}, 2343 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028}, 2344 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028}, 2345 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028}, 2346 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028}, 2347 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT}, 2348 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028}, 2349 }; 2350 2351 /* I2C devicelist hash table for devices with generic USB IDs */ 2352 static struct em28xx_hash_table em28xx_i2c_hash[] = { 2353 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC}, 2354 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC}, 2355 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT}, 2356 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT}, 2357 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC}, 2358 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF}, 2359 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT}, 2360 }; 2361 /* NOTE: introduce a separate hash table for devices with 16 bit eeproms */ 2362 2363 int em28xx_tuner_callback(void *ptr, int component, int command, int arg) 2364 { 2365 struct em28xx_i2c_bus *i2c_bus = ptr; 2366 struct em28xx *dev = i2c_bus->dev; 2367 int rc = 0; 2368 2369 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000) 2370 return 0; 2371 2372 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET) 2373 return 0; 2374 2375 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio); 2376 2377 return rc; 2378 } 2379 EXPORT_SYMBOL_GPL(em28xx_tuner_callback); 2380 2381 static inline void em28xx_set_model(struct em28xx *dev) 2382 { 2383 dev->board = em28xx_boards[dev->model]; 2384 2385 /* Those are the default values for the majority of boards 2386 Use those values if not specified otherwise at boards entry 2387 */ 2388 if (!dev->board.xclk) 2389 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE | 2390 EM28XX_XCLK_FREQUENCY_12MHZ; 2391 2392 if (!dev->board.i2c_speed) 2393 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 2394 EM28XX_I2C_FREQ_100_KHZ; 2395 2396 /* Should be initialized early, for I2C to work */ 2397 dev->def_i2c_bus = dev->board.def_i2c_bus; 2398 } 2399 2400 /* Since em28xx_pre_card_setup() requires a proper dev->model, 2401 * this won't work for boards with generic PCI IDs 2402 */ 2403 static void em28xx_pre_card_setup(struct em28xx *dev) 2404 { 2405 /* Set the initial XCLK and I2C clock values based on the board 2406 definition */ 2407 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f); 2408 if (!dev->board.is_em2800) 2409 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); 2410 msleep(50); 2411 2412 /* request some modules */ 2413 switch (dev->model) { 2414 case EM2861_BOARD_PLEXTOR_PX_TV100U: 2415 /* Sets the msp34xx I2S speed */ 2416 dev->i2s_speed = 2048000; 2417 break; 2418 case EM2861_BOARD_KWORLD_PVRTV_300U: 2419 case EM2880_BOARD_KWORLD_DVB_305U: 2420 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x6d); 2421 msleep(10); 2422 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x7d); 2423 msleep(10); 2424 break; 2425 case EM2870_BOARD_COMPRO_VIDEOMATE: 2426 /* TODO: someone can do some cleanup here... 2427 not everything's needed */ 2428 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00); 2429 msleep(10); 2430 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01); 2431 msleep(10); 2432 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); 2433 mdelay(70); 2434 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc); 2435 mdelay(70); 2436 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xdc); 2437 mdelay(70); 2438 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc); 2439 mdelay(70); 2440 break; 2441 case EM2870_BOARD_TERRATEC_XS_MT2060: 2442 /* this device needs some gpio writes to get the DVB-T 2443 demod work */ 2444 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2445 mdelay(70); 2446 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde); 2447 mdelay(70); 2448 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2449 mdelay(70); 2450 break; 2451 case EM2870_BOARD_PINNACLE_PCTV_DVB: 2452 /* this device needs some gpio writes to get the 2453 DVB-T demod work */ 2454 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2455 mdelay(70); 2456 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde); 2457 mdelay(70); 2458 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2459 mdelay(70); 2460 break; 2461 case EM2820_BOARD_GADMEI_UTV310: 2462 case EM2820_BOARD_MSI_VOX_USB_2: 2463 /* enables audio for that devices */ 2464 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); 2465 break; 2466 2467 case EM2882_BOARD_KWORLD_ATSC_315U: 2468 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff); 2469 msleep(10); 2470 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2471 msleep(10); 2472 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00); 2473 msleep(10); 2474 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08); 2475 msleep(10); 2476 break; 2477 2478 case EM2860_BOARD_KAIOMY_TVNPC_U2: 2479 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1); 2480 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1); 2481 em28xx_write_regs(dev, 0x0d, "\x42", 1); 2482 em28xx_write_regs(dev, 0x08, "\xfd", 1); 2483 msleep(10); 2484 em28xx_write_regs(dev, 0x08, "\xff", 1); 2485 msleep(10); 2486 em28xx_write_regs(dev, 0x08, "\x7f", 1); 2487 msleep(10); 2488 em28xx_write_regs(dev, 0x08, "\x6b", 1); 2489 2490 break; 2491 case EM2860_BOARD_EASYCAP: 2492 em28xx_write_regs(dev, 0x08, "\xf8", 1); 2493 break; 2494 2495 case EM2820_BOARD_IODATA_GVMVP_SZ: 2496 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff); 2497 msleep(70); 2498 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7); 2499 msleep(10); 2500 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe); 2501 msleep(70); 2502 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); 2503 msleep(70); 2504 break; 2505 } 2506 2507 em28xx_gpio_set(dev, dev->board.tuner_gpio); 2508 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2509 2510 /* Unlock device */ 2511 em28xx_set_mode(dev, EM28XX_SUSPEND); 2512 } 2513 2514 static int em28xx_hint_board(struct em28xx *dev) 2515 { 2516 int i; 2517 2518 if (dev->board.is_webcam) { 2519 if (dev->em28xx_sensor == EM28XX_MT9V011) { 2520 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM; 2521 } else if (dev->em28xx_sensor == EM28XX_MT9M001 || 2522 dev->em28xx_sensor == EM28XX_MT9M111) { 2523 dev->model = EM2750_BOARD_UNKNOWN; 2524 } 2525 /* FIXME: IMPROVE ! */ 2526 2527 return 0; 2528 } 2529 2530 /* HINT method: EEPROM 2531 * 2532 * This method works only for boards with eeprom. 2533 * Uses a hash of all eeprom bytes. The hash should be 2534 * unique for a vendor/tuner pair. 2535 * There are a high chance that tuners for different 2536 * video standards produce different hashes. 2537 */ 2538 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) { 2539 if (dev->hash == em28xx_eeprom_hash[i].hash) { 2540 dev->model = em28xx_eeprom_hash[i].model; 2541 dev->tuner_type = em28xx_eeprom_hash[i].tuner; 2542 2543 em28xx_errdev("Your board has no unique USB ID.\n"); 2544 em28xx_errdev("A hint were successfully done, " 2545 "based on eeprom hash.\n"); 2546 em28xx_errdev("This method is not 100%% failproof.\n"); 2547 em28xx_errdev("If the board were missdetected, " 2548 "please email this log to:\n"); 2549 em28xx_errdev("\tV4L Mailing List " 2550 " <linux-media@vger.kernel.org>\n"); 2551 em28xx_errdev("Board detected as %s\n", 2552 em28xx_boards[dev->model].name); 2553 2554 return 0; 2555 } 2556 } 2557 2558 /* HINT method: I2C attached devices 2559 * 2560 * This method works for all boards. 2561 * Uses a hash of i2c scanned devices. 2562 * Devices with the same i2c attached chips will 2563 * be considered equal. 2564 * This method is less precise than the eeprom one. 2565 */ 2566 2567 /* user did not request i2c scanning => do it now */ 2568 if (!dev->i2c_hash) 2569 em28xx_do_i2c_scan(dev, dev->def_i2c_bus); 2570 2571 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) { 2572 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { 2573 dev->model = em28xx_i2c_hash[i].model; 2574 dev->tuner_type = em28xx_i2c_hash[i].tuner; 2575 em28xx_errdev("Your board has no unique USB ID.\n"); 2576 em28xx_errdev("A hint were successfully done, " 2577 "based on i2c devicelist hash.\n"); 2578 em28xx_errdev("This method is not 100%% failproof.\n"); 2579 em28xx_errdev("If the board were missdetected, " 2580 "please email this log to:\n"); 2581 em28xx_errdev("\tV4L Mailing List " 2582 " <linux-media@vger.kernel.org>\n"); 2583 em28xx_errdev("Board detected as %s\n", 2584 em28xx_boards[dev->model].name); 2585 2586 return 0; 2587 } 2588 } 2589 2590 em28xx_errdev("Your board has no unique USB ID and thus need a " 2591 "hint to be detected.\n"); 2592 em28xx_errdev("You may try to use card=<n> insmod option to " 2593 "workaround that.\n"); 2594 em28xx_errdev("Please send an email with this log to:\n"); 2595 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n"); 2596 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); 2597 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash); 2598 2599 em28xx_errdev("Here is a list of valid choices for the card=<n>" 2600 " insmod option:\n"); 2601 for (i = 0; i < em28xx_bcount; i++) { 2602 em28xx_errdev(" card=%d -> %s\n", 2603 i, em28xx_boards[i].name); 2604 } 2605 return -1; 2606 } 2607 2608 static void em28xx_card_setup(struct em28xx *dev) 2609 { 2610 /* 2611 * If the device can be a webcam, seek for a sensor. 2612 * If sensor is not found, then it isn't a webcam. 2613 */ 2614 if (dev->board.is_webcam) { 2615 if (em28xx_detect_sensor(dev) < 0) 2616 dev->board.is_webcam = 0; 2617 else 2618 dev->progressive = 1; 2619 } 2620 2621 switch (dev->model) { 2622 case EM2750_BOARD_UNKNOWN: 2623 case EM2820_BOARD_UNKNOWN: 2624 case EM2800_BOARD_UNKNOWN: 2625 /* 2626 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. 2627 * 2628 * This occurs because they share identical USB vendor and 2629 * product IDs. 2630 * 2631 * What we do here is look up the EEPROM hash of the K-WORLD 2632 * and if it is found then we decide that we do not have 2633 * a DIGIVOX and reset the device to the K-WORLD instead. 2634 * 2635 * This solution is only valid if they do not share eeprom 2636 * hash identities which has not been determined as yet. 2637 */ 2638 if (em28xx_hint_board(dev) < 0) 2639 em28xx_errdev("Board not discovered\n"); 2640 else { 2641 em28xx_set_model(dev); 2642 em28xx_pre_card_setup(dev); 2643 } 2644 break; 2645 default: 2646 em28xx_set_model(dev); 2647 } 2648 2649 em28xx_info("Identified as %s (card=%d)\n", 2650 dev->board.name, dev->model); 2651 2652 dev->tuner_type = em28xx_boards[dev->model].tuner_type; 2653 if (em28xx_boards[dev->model].tuner_addr) 2654 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr; 2655 2656 if (em28xx_boards[dev->model].tda9887_conf) 2657 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; 2658 2659 /* request some modules */ 2660 switch (dev->model) { 2661 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: 2662 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: 2663 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: 2664 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: 2665 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: 2666 case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: 2667 { 2668 struct tveeprom tv; 2669 2670 if (dev->eedata == NULL) 2671 break; 2672 #if defined(CONFIG_MODULES) && defined(MODULE) 2673 request_module("tveeprom"); 2674 #endif 2675 /* Call first TVeeprom */ 2676 2677 dev->i2c_client[dev->def_i2c_bus].addr = 0xa0 >> 1; 2678 tveeprom_hauppauge_analog(&dev->i2c_client[dev->def_i2c_bus], &tv, dev->eedata); 2679 2680 dev->tuner_type = tv.tuner_type; 2681 2682 if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) { 2683 dev->i2s_speed = 2048000; 2684 dev->board.has_msp34xx = 1; 2685 } 2686 break; 2687 } 2688 case EM2882_BOARD_KWORLD_ATSC_315U: 2689 em28xx_write_reg(dev, 0x0d, 0x42); 2690 msleep(10); 2691 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); 2692 msleep(10); 2693 break; 2694 case EM2820_BOARD_KWORLD_PVRTV2800RF: 2695 /* GPIO enables sound on KWORLD PVR TV 2800RF */ 2696 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9); 2697 break; 2698 case EM2820_BOARD_UNKNOWN: 2699 case EM2800_BOARD_UNKNOWN: 2700 /* 2701 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. 2702 * 2703 * This occurs because they share identical USB vendor and 2704 * product IDs. 2705 * 2706 * What we do here is look up the EEPROM hash of the K-WORLD 2707 * and if it is found then we decide that we do not have 2708 * a DIGIVOX and reset the device to the K-WORLD instead. 2709 * 2710 * This solution is only valid if they do not share eeprom 2711 * hash identities which has not been determined as yet. 2712 */ 2713 case EM2880_BOARD_MSI_DIGIVOX_AD: 2714 if (!em28xx_hint_board(dev)) 2715 em28xx_set_model(dev); 2716 2717 /* In cases where we had to use a board hint, the call to 2718 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, 2719 so make the call now so the analog GPIOs are set properly 2720 before probing the i2c bus. */ 2721 em28xx_gpio_set(dev, dev->board.tuner_gpio); 2722 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2723 break; 2724 2725 /* 2726 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR. 2727 * 2728 * This occurs because they share identical USB vendor and 2729 * product IDs. 2730 * 2731 * What we do here is look up the EEPROM hash of the Dikom 2732 * and if it is found then we decide that we do not have 2733 * a Kworld and reset the device to the Dikom instead. 2734 * 2735 * This solution is only valid if they do not share eeprom 2736 * hash identities which has not been determined as yet. 2737 */ 2738 case EM2882_BOARD_KWORLD_VS_DVBT: 2739 if (!em28xx_hint_board(dev)) 2740 em28xx_set_model(dev); 2741 2742 /* In cases where we had to use a board hint, the call to 2743 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, 2744 so make the call now so the analog GPIOs are set properly 2745 before probing the i2c bus. */ 2746 em28xx_gpio_set(dev, dev->board.tuner_gpio); 2747 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2748 break; 2749 } 2750 2751 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { 2752 em28xx_errdev("\n\n"); 2753 em28xx_errdev("The support for this board weren't " 2754 "valid yet.\n"); 2755 em28xx_errdev("Please send a report of having this working\n"); 2756 em28xx_errdev("not to V4L mailing list (and/or to other " 2757 "addresses)\n\n"); 2758 } 2759 2760 /* Free eeprom data memory */ 2761 kfree(dev->eedata); 2762 dev->eedata = NULL; 2763 2764 /* Allow override tuner type by a module parameter */ 2765 if (tuner >= 0) 2766 dev->tuner_type = tuner; 2767 } 2768 2769 static void request_module_async(struct work_struct *work) 2770 { 2771 struct em28xx *dev = container_of(work, 2772 struct em28xx, request_module_wk); 2773 2774 /* 2775 * The em28xx extensions can be modules or builtin. If the 2776 * modules are already loaded or are built in, those extensions 2777 * can be initialised right now. Otherwise, the module init 2778 * code will do it. 2779 */ 2780 em28xx_init_extension(dev); 2781 2782 #if defined(CONFIG_MODULES) && defined(MODULE) 2783 if (dev->has_audio_class) 2784 request_module("snd-usb-audio"); 2785 else if (dev->has_alsa_audio) 2786 request_module("em28xx-alsa"); 2787 2788 if (dev->board.has_dvb) 2789 request_module("em28xx-dvb"); 2790 if (dev->board.buttons || 2791 ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)) 2792 request_module("em28xx-rc"); 2793 #endif /* CONFIG_MODULES */ 2794 } 2795 2796 static void request_modules(struct em28xx *dev) 2797 { 2798 INIT_WORK(&dev->request_module_wk, request_module_async); 2799 schedule_work(&dev->request_module_wk); 2800 } 2801 2802 static void flush_request_modules(struct em28xx *dev) 2803 { 2804 flush_work(&dev->request_module_wk); 2805 } 2806 2807 /* 2808 * em28xx_release_resources() 2809 * unregisters the v4l2,i2c and usb devices 2810 * called when the device gets disconnected or at module unload 2811 */ 2812 void em28xx_release_resources(struct em28xx *dev) 2813 { 2814 /*FIXME: I2C IR should be disconnected */ 2815 2816 em28xx_release_analog_resources(dev); 2817 2818 if (dev->def_i2c_bus) 2819 em28xx_i2c_unregister(dev, 1); 2820 em28xx_i2c_unregister(dev, 0); 2821 if (dev->clk) 2822 v4l2_clk_unregister_fixed(dev->clk); 2823 2824 v4l2_ctrl_handler_free(&dev->ctrl_handler); 2825 2826 v4l2_device_unregister(&dev->v4l2_dev); 2827 2828 usb_put_dev(dev->udev); 2829 2830 /* Mark device as unused */ 2831 clear_bit(dev->devno, &em28xx_devused); 2832 }; 2833 2834 /* 2835 * em28xx_init_dev() 2836 * allocates and inits the device structs, registers i2c bus and v4l device 2837 */ 2838 static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, 2839 struct usb_interface *interface, 2840 int minor) 2841 { 2842 int retval; 2843 static const char *default_chip_name = "em28xx"; 2844 const char *chip_name = default_chip_name; 2845 2846 dev->udev = udev; 2847 mutex_init(&dev->vb_queue_lock); 2848 mutex_init(&dev->vb_vbi_queue_lock); 2849 mutex_init(&dev->ctrl_urb_lock); 2850 spin_lock_init(&dev->slock); 2851 2852 dev->em28xx_write_regs = em28xx_write_regs; 2853 dev->em28xx_read_reg = em28xx_read_reg; 2854 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len; 2855 dev->em28xx_write_regs_req = em28xx_write_regs_req; 2856 dev->em28xx_read_reg_req = em28xx_read_reg_req; 2857 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800; 2858 2859 em28xx_set_model(dev); 2860 2861 dev->wait_after_write = 5; 2862 2863 /* Based on the Chip ID, set the device configuration */ 2864 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID); 2865 if (retval > 0) { 2866 dev->chip_id = retval; 2867 2868 switch (dev->chip_id) { 2869 case CHIP_ID_EM2800: 2870 chip_name = "em2800"; 2871 break; 2872 case CHIP_ID_EM2710: 2873 chip_name = "em2710"; 2874 break; 2875 case CHIP_ID_EM2750: 2876 chip_name = "em2750"; 2877 break; 2878 case CHIP_ID_EM2765: 2879 chip_name = "em2765"; 2880 dev->wait_after_write = 0; 2881 dev->is_em25xx = 1; 2882 dev->eeprom_addrwidth_16bit = 1; 2883 break; 2884 case CHIP_ID_EM2820: 2885 chip_name = "em2710/2820"; 2886 if (le16_to_cpu(dev->udev->descriptor.idVendor) 2887 == 0xeb1a) { 2888 __le16 idProd = dev->udev->descriptor.idProduct; 2889 if (le16_to_cpu(idProd) == 0x2710) 2890 chip_name = "em2710"; 2891 else if (le16_to_cpu(idProd) == 0x2820) 2892 chip_name = "em2820"; 2893 } 2894 /* NOTE: the em2820 is used in webcams, too ! */ 2895 break; 2896 case CHIP_ID_EM2840: 2897 chip_name = "em2840"; 2898 break; 2899 case CHIP_ID_EM2860: 2900 chip_name = "em2860"; 2901 break; 2902 case CHIP_ID_EM2870: 2903 chip_name = "em2870"; 2904 dev->wait_after_write = 0; 2905 break; 2906 case CHIP_ID_EM2874: 2907 chip_name = "em2874"; 2908 dev->wait_after_write = 0; 2909 dev->eeprom_addrwidth_16bit = 1; 2910 break; 2911 case CHIP_ID_EM28174: 2912 chip_name = "em28174"; 2913 dev->wait_after_write = 0; 2914 dev->eeprom_addrwidth_16bit = 1; 2915 break; 2916 case CHIP_ID_EM28178: 2917 chip_name = "em28178"; 2918 dev->wait_after_write = 0; 2919 dev->eeprom_addrwidth_16bit = 1; 2920 break; 2921 case CHIP_ID_EM2883: 2922 chip_name = "em2882/3"; 2923 dev->wait_after_write = 0; 2924 break; 2925 case CHIP_ID_EM2884: 2926 chip_name = "em2884"; 2927 dev->wait_after_write = 0; 2928 dev->eeprom_addrwidth_16bit = 1; 2929 break; 2930 default: 2931 printk(KERN_INFO DRIVER_NAME 2932 ": unknown em28xx chip ID (%d)\n", dev->chip_id); 2933 } 2934 } 2935 2936 if (chip_name != default_chip_name) 2937 printk(KERN_INFO DRIVER_NAME 2938 ": chip ID is %s\n", chip_name); 2939 2940 /* 2941 * For em2820/em2710, the name may change latter, after checking 2942 * if the device has a sensor (so, it is em2710) or not. 2943 */ 2944 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno); 2945 2946 if (dev->is_audio_only) { 2947 retval = em28xx_audio_setup(dev); 2948 if (retval) 2949 return -ENODEV; 2950 em28xx_init_extension(dev); 2951 2952 return 0; 2953 } 2954 2955 em28xx_pre_card_setup(dev); 2956 2957 if (!dev->board.is_em2800) { 2958 /* Resets I2C speed */ 2959 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); 2960 if (retval < 0) { 2961 em28xx_errdev("%s: em28xx_write_reg failed!" 2962 " retval [%d]\n", 2963 __func__, retval); 2964 return retval; 2965 } 2966 } 2967 2968 rt_mutex_init(&dev->i2c_bus_lock); 2969 2970 /* register i2c bus 0 */ 2971 if (dev->board.is_em2800) 2972 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800); 2973 else 2974 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); 2975 if (retval < 0) { 2976 em28xx_errdev("%s: em28xx_i2c_register bus 0 - error [%d]!\n", 2977 __func__, retval); 2978 return retval; 2979 } 2980 2981 /* register i2c bus 1 */ 2982 if (dev->def_i2c_bus) { 2983 if (dev->is_em25xx) 2984 retval = em28xx_i2c_register(dev, 1, 2985 EM28XX_I2C_ALGO_EM25XX_BUS_B); 2986 else 2987 retval = em28xx_i2c_register(dev, 1, 2988 EM28XX_I2C_ALGO_EM28XX); 2989 if (retval < 0) { 2990 em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n", 2991 __func__, retval); 2992 2993 em28xx_i2c_unregister(dev, 0); 2994 2995 return retval; 2996 } 2997 } 2998 2999 /* Do board specific init and eeprom reading */ 3000 em28xx_card_setup(dev); 3001 3002 retval = em28xx_register_analog_devices(dev); 3003 if (retval < 0) 3004 goto fail; 3005 3006 return 0; 3007 3008 fail: 3009 if (dev->def_i2c_bus) 3010 em28xx_i2c_unregister(dev, 1); 3011 em28xx_i2c_unregister(dev, 0); 3012 3013 return retval; 3014 } 3015 3016 /* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */ 3017 #define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) 3018 3019 /* 3020 * em28xx_usb_probe() 3021 * checks for supported devices 3022 */ 3023 static int em28xx_usb_probe(struct usb_interface *interface, 3024 const struct usb_device_id *id) 3025 { 3026 struct usb_device *udev; 3027 struct em28xx *dev = NULL; 3028 int retval; 3029 bool has_audio = false, has_video = false, has_dvb = false; 3030 int i, nr, try_bulk; 3031 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber; 3032 char *speed; 3033 3034 udev = usb_get_dev(interface_to_usbdev(interface)); 3035 3036 /* Check to see next free device and mark as used */ 3037 do { 3038 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS); 3039 if (nr >= EM28XX_MAXBOARDS) { 3040 /* No free device slots */ 3041 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", 3042 EM28XX_MAXBOARDS); 3043 retval = -ENOMEM; 3044 goto err_no_slot; 3045 } 3046 } while (test_and_set_bit(nr, &em28xx_devused)); 3047 3048 /* Don't register audio interfaces */ 3049 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { 3050 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): " 3051 "interface %i, class %i\n", 3052 le16_to_cpu(udev->descriptor.idVendor), 3053 le16_to_cpu(udev->descriptor.idProduct), 3054 ifnum, 3055 interface->altsetting[0].desc.bInterfaceClass); 3056 3057 retval = -ENODEV; 3058 goto err; 3059 } 3060 3061 /* allocate memory for our device state and initialize it */ 3062 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 3063 if (dev == NULL) { 3064 em28xx_err(DRIVER_NAME ": out of memory!\n"); 3065 retval = -ENOMEM; 3066 goto err; 3067 } 3068 3069 /* compute alternate max packet sizes */ 3070 dev->alt_max_pkt_size_isoc = 3071 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) * 3072 interface->num_altsetting, GFP_KERNEL); 3073 if (dev->alt_max_pkt_size_isoc == NULL) { 3074 em28xx_errdev("out of memory!\n"); 3075 kfree(dev); 3076 retval = -ENOMEM; 3077 goto err; 3078 } 3079 3080 /* Get endpoints */ 3081 for (i = 0; i < interface->num_altsetting; i++) { 3082 int ep; 3083 3084 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) { 3085 const struct usb_endpoint_descriptor *e; 3086 int sizedescr, size; 3087 3088 e = &interface->altsetting[i].endpoint[ep].desc; 3089 3090 sizedescr = le16_to_cpu(e->wMaxPacketSize); 3091 size = sizedescr & 0x7ff; 3092 3093 if (udev->speed == USB_SPEED_HIGH) 3094 size = size * hb_mult(sizedescr); 3095 3096 if (usb_endpoint_dir_in(e)) { 3097 switch (e->bEndpointAddress) { 3098 case 0x82: 3099 has_video = true; 3100 if (usb_endpoint_xfer_isoc(e)) { 3101 dev->analog_ep_isoc = 3102 e->bEndpointAddress; 3103 dev->alt_max_pkt_size_isoc[i] = size; 3104 } else if (usb_endpoint_xfer_bulk(e)) { 3105 dev->analog_ep_bulk = 3106 e->bEndpointAddress; 3107 } 3108 break; 3109 case 0x83: 3110 if (usb_endpoint_xfer_isoc(e)) { 3111 has_audio = true; 3112 } else { 3113 printk(KERN_INFO DRIVER_NAME 3114 ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); 3115 } 3116 break; 3117 case 0x84: 3118 if (has_video && 3119 (usb_endpoint_xfer_bulk(e))) { 3120 dev->analog_ep_bulk = 3121 e->bEndpointAddress; 3122 } else { 3123 if (usb_endpoint_xfer_isoc(e)) { 3124 if (size > dev->dvb_max_pkt_size_isoc) { 3125 has_dvb = true; /* see NOTE (~) */ 3126 dev->dvb_ep_isoc = e->bEndpointAddress; 3127 dev->dvb_max_pkt_size_isoc = size; 3128 dev->dvb_alt_isoc = i; 3129 } 3130 } else { 3131 has_dvb = true; 3132 dev->dvb_ep_bulk = e->bEndpointAddress; 3133 } 3134 } 3135 break; 3136 } 3137 } 3138 /* NOTE: 3139 * Old logic with support for isoc transfers only was: 3140 * 0x82 isoc => analog 3141 * 0x83 isoc => audio 3142 * 0x84 isoc => digital 3143 * 3144 * New logic with support for bulk transfers 3145 * 0x82 isoc => analog 3146 * 0x82 bulk => analog 3147 * 0x83 isoc* => audio 3148 * 0x84 isoc => digital 3149 * 0x84 bulk => analog or digital** 3150 * (*: audio should always be isoc) 3151 * (**: analog, if ep 0x82 is isoc, otherwise digital) 3152 * 3153 * The new logic preserves backwards compatibility and 3154 * reflects the endpoint configurations we have seen 3155 * so far. But there might be devices for which this 3156 * logic is not sufficient... 3157 */ 3158 /* 3159 * NOTE (~): some manufacturers (e.g. Terratec) disable 3160 * endpoints by setting wMaxPacketSize to 0 bytes for 3161 * all alt settings. So far, we've seen this for 3162 * DVB isoc endpoints only. 3163 */ 3164 } 3165 } 3166 3167 if (!(has_audio || has_video || has_dvb)) { 3168 retval = -ENODEV; 3169 goto err_free; 3170 } 3171 3172 switch (udev->speed) { 3173 case USB_SPEED_LOW: 3174 speed = "1.5"; 3175 break; 3176 case USB_SPEED_UNKNOWN: 3177 case USB_SPEED_FULL: 3178 speed = "12"; 3179 break; 3180 case USB_SPEED_HIGH: 3181 speed = "480"; 3182 break; 3183 default: 3184 speed = "unknown"; 3185 } 3186 3187 printk(KERN_INFO DRIVER_NAME 3188 ": New device %s %s @ %s Mbps " 3189 "(%04x:%04x, interface %d, class %d)\n", 3190 udev->manufacturer ? udev->manufacturer : "", 3191 udev->product ? udev->product : "", 3192 speed, 3193 le16_to_cpu(udev->descriptor.idVendor), 3194 le16_to_cpu(udev->descriptor.idProduct), 3195 ifnum, 3196 interface->altsetting->desc.bInterfaceNumber); 3197 3198 /* 3199 * Make sure we have 480 Mbps of bandwidth, otherwise things like 3200 * video stream wouldn't likely work, since 12 Mbps is generally 3201 * not enough even for most Digital TV streams. 3202 */ 3203 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { 3204 printk(DRIVER_NAME ": Device initialization failed.\n"); 3205 printk(DRIVER_NAME ": Device must be connected to a high-speed" 3206 " USB 2.0 port.\n"); 3207 retval = -ENODEV; 3208 goto err_free; 3209 } 3210 3211 dev->devno = nr; 3212 dev->model = id->driver_info; 3213 dev->alt = -1; 3214 dev->is_audio_only = has_audio && !(has_video || has_dvb); 3215 dev->has_alsa_audio = has_audio; 3216 dev->audio_ifnum = ifnum; 3217 3218 /* Checks if audio is provided by some interface */ 3219 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { 3220 struct usb_interface *uif = udev->config->interface[i]; 3221 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { 3222 dev->has_audio_class = 1; 3223 break; 3224 } 3225 } 3226 3227 if (has_audio) 3228 printk(KERN_INFO DRIVER_NAME 3229 ": Audio interface %i found %s\n", 3230 ifnum, 3231 dev->has_audio_class ? "(USB Audio Class)" : "(Vendor Class)"); 3232 if (has_video) 3233 printk(KERN_INFO DRIVER_NAME 3234 ": Video interface %i found:%s%s\n", 3235 ifnum, 3236 dev->analog_ep_bulk ? " bulk" : "", 3237 dev->analog_ep_isoc ? " isoc" : ""); 3238 if (has_dvb) 3239 printk(KERN_INFO DRIVER_NAME 3240 ": DVB interface %i found:%s%s\n", 3241 ifnum, 3242 dev->dvb_ep_bulk ? " bulk" : "", 3243 dev->dvb_ep_isoc ? " isoc" : ""); 3244 3245 dev->num_alt = interface->num_altsetting; 3246 3247 if ((unsigned)card[nr] < em28xx_bcount) 3248 dev->model = card[nr]; 3249 3250 /* save our data pointer in this interface device */ 3251 usb_set_intfdata(interface, dev); 3252 3253 /* allocate device struct */ 3254 mutex_init(&dev->lock); 3255 mutex_lock(&dev->lock); 3256 retval = em28xx_init_dev(dev, udev, interface, nr); 3257 if (retval) { 3258 goto unlock_and_free; 3259 } 3260 3261 if (usb_xfer_mode < 0) { 3262 if (dev->board.is_webcam) 3263 try_bulk = 1; 3264 else 3265 try_bulk = 0; 3266 } else { 3267 try_bulk = usb_xfer_mode > 0; 3268 } 3269 3270 /* Select USB transfer types to use */ 3271 if (has_video) { 3272 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) 3273 dev->analog_xfer_bulk = 1; 3274 em28xx_info("analog set to %s mode.\n", 3275 dev->analog_xfer_bulk ? "bulk" : "isoc"); 3276 } 3277 if (has_dvb) { 3278 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) 3279 dev->dvb_xfer_bulk = 1; 3280 3281 em28xx_info("dvb set to %s mode.\n", 3282 dev->dvb_xfer_bulk ? "bulk" : "isoc"); 3283 3284 /* pre-allocate DVB usb transfer buffers */ 3285 if (dev->dvb_xfer_bulk) { 3286 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE, 3287 dev->dvb_xfer_bulk, 3288 EM28XX_DVB_NUM_BUFS, 3289 512, 3290 EM28XX_DVB_BULK_PACKET_MULTIPLIER); 3291 } else { 3292 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE, 3293 dev->dvb_xfer_bulk, 3294 EM28XX_DVB_NUM_BUFS, 3295 dev->dvb_max_pkt_size_isoc, 3296 EM28XX_DVB_NUM_ISOC_PACKETS); 3297 } 3298 if (retval) { 3299 printk(DRIVER_NAME 3300 ": Failed to pre-allocate USB transfer buffers for DVB.\n"); 3301 goto unlock_and_free; 3302 } 3303 } 3304 3305 request_modules(dev); 3306 3307 /* Should be the last thing to do, to avoid newer udev's to 3308 open the device before fully initializing it 3309 */ 3310 mutex_unlock(&dev->lock); 3311 3312 return 0; 3313 3314 unlock_and_free: 3315 mutex_unlock(&dev->lock); 3316 3317 err_free: 3318 kfree(dev->alt_max_pkt_size_isoc); 3319 kfree(dev); 3320 3321 err: 3322 clear_bit(nr, &em28xx_devused); 3323 3324 err_no_slot: 3325 usb_put_dev(udev); 3326 return retval; 3327 } 3328 3329 /* 3330 * em28xx_usb_disconnect() 3331 * called when the device gets disconnected 3332 * video device will be unregistered on v4l2_close in case it is still open 3333 */ 3334 static void em28xx_usb_disconnect(struct usb_interface *interface) 3335 { 3336 struct em28xx *dev; 3337 3338 dev = usb_get_intfdata(interface); 3339 usb_set_intfdata(interface, NULL); 3340 3341 if (!dev) 3342 return; 3343 3344 dev->disconnected = 1; 3345 3346 if (dev->is_audio_only) { 3347 em28xx_close_extension(dev); 3348 return; 3349 } 3350 3351 em28xx_info("disconnecting %s\n", dev->vdev->name); 3352 3353 flush_request_modules(dev); 3354 3355 mutex_lock(&dev->lock); 3356 3357 v4l2_device_disconnect(&dev->v4l2_dev); 3358 3359 if (dev->users) { 3360 em28xx_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n", 3361 video_device_node_name(dev->vdev)); 3362 3363 em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE); 3364 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE); 3365 } 3366 mutex_unlock(&dev->lock); 3367 3368 em28xx_close_extension(dev); 3369 3370 /* NOTE: must be called BEFORE the resources are released */ 3371 3372 mutex_lock(&dev->lock); 3373 if (!dev->users) 3374 em28xx_release_resources(dev); 3375 3376 mutex_unlock(&dev->lock); 3377 3378 if (!dev->users) { 3379 kfree(dev->alt_max_pkt_size_isoc); 3380 kfree(dev); 3381 } 3382 } 3383 3384 static struct usb_driver em28xx_usb_driver = { 3385 .name = "em28xx", 3386 .probe = em28xx_usb_probe, 3387 .disconnect = em28xx_usb_disconnect, 3388 .id_table = em28xx_id_table, 3389 }; 3390 3391 module_usb_driver(em28xx_usb_driver); 3392