Lines Matching +full:sdtv +full:- +full:standards

1 // SPDX-License-Identifier: GPL-2.0+
3 // em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
31 #include <media/drv-intf/msp3400.h>
33 #include <dt-bindings/media/tvp5150.h>
36 #include <media/v4l2-common.h>
41 static int tuner = -1;
54 static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
58 static int usb_xfer_mode = -1;
61 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
63 /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
81 { -1, -1, -1, -1},
87 { -1, -1, -1, -1},
94 { -1, -1, -1, -1},
102 { -1, -1, -1, -1},
109 { -1, -1, -1, -1},
117 { -1, -1, -1, -1},
124 { -1, -1, -1, -1},
127 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
130 { -1, -1, -1, -1},
133 /* Board - EM2882 Kworld 315U digital */
140 { -1, -1, -1, -1},
148 { -1, -1, -1, -1},
154 { -1, -1, -1, -1},
160 { -1, -1, -1, -1},
165 * GPIO0 - Enable digital power (s5h1409) - low to enable
166 * GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
167 * GPIO4 - xc3028 reset
168 * GOP3 - s5h1409 reset
172 { -1, -1, -1, -1},
179 { -1, -1, -1, -1},
183 * KWorld PlusTV 340U, UB435-Q and UB435-Q V2 (ATSC) GPIOs map:
184 * EM_GPIO_0 - currently unknown
185 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
186 * EM_GPIO_2 - currently unknown
187 * EM_GPIO_3 - currently unknown
188 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
189 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
190 * EM_GPIO_6 - currently unknown
191 * EM_GPIO_7 - currently unknown
195 { -1, -1, -1, -1},
203 { -1, -1, -1, -1},
209 { -1, -1, -1, -1},
216 { -1, -1, -1, -1},
222 { -1, -1, -1, -1},
228 { -1, -1, -1, -1},
233 * 0-5: not used
241 { -1, -1, -1, -1},
245 * eb1a:2868 Reddo DVB-C USB TV Box
246 * GPIO4 - CU1216L NIM
257 { -1, -1, -1, -1},
265 { -1, -1, -1, -1},
271 { -1, -1, -1, -1},
276 { -1, -1, -1, -1},
281 { -1, -1, -1, -1},
287 { -1, -1, -1, -1},
292 { -1, -1, -1, -1},
298 { -1, -1, -1, -1},
305 { -1, -1, -1, -1},
311 { -1, -1, -1, -1},
317 { -1, -1, -1, -1},
324 { -1, -1, -1, -1},
329 * GPIO_6 - demod reset
330 * GPIO_7 - LED
336 { -1, -1, -1, -1},
345 { -1, -1, -1, -1},
352 { -1, -1, -1, -1},
357 * 2013:024f PCTV DVB-S2 Stick 460e
358 * GPIO_0 - POWER_ON
359 * GPIO_1 - BOOST
360 * GPIO_2 - VUV_LNB (red LED)
361 * GPIO_3 - EXT_12V
362 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
363 * GPIO_5 - INT_LNB
364 * GPIO_6 - RESET_DEM
365 * GPIO_7 - LED (green LED)
373 { -1, -1, -1, -1},
385 { -1, -1, -1, -1},
389 * 2013:0258 PCTV DVB-S2 Stick (461e)
407 { -1, -1, -1, -1},
416 { -1, -1, -1, -1},
423 { -1, -1, -1, -1},
428 * 1b80:e425 MaxMedia UB425-TC
430 * GPIO_6 - demod reset, 0=active
431 * GPIO_7 - LED, 0=active
437 { -1, -1, -1, -1},
451 { -1, -1, -1, -1},
466 { -1, -1, -1, -1},
482 { -1, -1, -1, -1},
494 {-1, -1, -1, -1},
508 {-1, -1, -1, -1},
522 {-1, -1, -1, -1},
526 * 2040:0265 Hauppauge WinTV-dualHD DVB Isoc
527 * 2040:8265 Hauppauge WinTV-dualHD DVB Bulk
528 * 2040:026d Hauppauge WinTV-dualHD ATSC/QAM Isoc
529 * 2040:826d Hauppauge WinTV-dualHD ATSC/QAM Bulk
549 {-1, -1, -1, -1},
563 {-1, 0, 0, 0, 0},
579 {-1, 0, 0, 0, 0},
598 {-1, 0, 0, 0},
608 {-1, 0, 0, 0},
618 {-1, 0, 0, 0},
628 {-1, 0, 0, 0},
644 {-1, 0, 0, 0},
696 .name = "Huaqi DLCW-130",
802 .name = "D-Link DUB-T210 TV Tuner",
1113 .name = "Plextor ConvertX PX-TV100U",
1156 .name = "Kworld 350 U DVB-T",
1162 .name = "Kworld 355 U DVB-T",
1170 .name = "Pinnacle PCTV DVB-T",
1173 /* djh - I have serious doubts this is right... */
1256 .name = "C3 Tech Digital Duo HDTV/SDTV USB",
1258 /* FIXME: Add analog support - need a saa7136 driver */
1259 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1555 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1610 …90/100/101/107 / Kaiser Baas Video to DVD maker / Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
1624 .name = "V-Gear PocketTV",
1665 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
1760 .name = "KWorld DVB-T 305U",
1779 .name = "KWorld DVB-T 310U",
1796 }, { /* S-video has not been tested yet */
1816 /* FIXME: Analog mode - still not ready */
1937 .name = "Kworld VS-DVB-T 323UR",
2082 .name = "Easy Cap Capture DC-60",
2097 .name = "IO-DATA GV-MVP/SZ",
2110 }, { /* S-video has not been tested yet */
2202 .name = "Reddo DVB-C USB TV Box",
2208 * 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
2209 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
2213 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
2214 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
2234 * 2013:024f PCTV DVB-S2 Stick 460e
2241 .name = "PCTV DVB-S2 Stick (460e)",
2261 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs check */
2266 * 1b80:e425 MaxMedia UB425-TC
2270 .name = "MaxMedia UB425-TC",
2319 * mostly the same as MaxMedia UB-425-TC but different remote
2332 * 1b80:e346 KWorld USB ATSC TV Stick UB435-Q V2
2336 .name = "KWorld USB ATSC TV Stick UB435-Q V2",
2344 * 1b80:e34c KWorld USB ATSC TV Stick UB435-Q V3
2348 .name = "KWorld USB ATSC TV Stick UB435-Q V3",
2387 * 2013:0258 PCTV DVB-S2 Stick (461e)
2394 .name = "PCTV DVB-S2 Stick (461e)",
2401 * 2013:0259 PCTV DVB-S2 Stick (461e_v2)
2408 .name = "PCTV DVB-S2 Stick (461e v2)",
2458 * 3275:0085 PLEX PX-BCUD.
2462 .name = "PLEX PX-BCUD",
2471 * 2040:0265 Hauppauge WinTV-dualHD (DVB version) Isoc.
2472 * 2040:8265 Hauppauge WinTV-dualHD (DVB version) Bulk.
2476 .name = "Hauppauge WinTV-dualHD DVB",
2488 * 2040:026d Hauppauge WinTV-dualHD (model 01595 - ATSC/QAM) Isoc.
2489 * 2040:826d Hauppauge WinTV-dualHD (model 01595 - ATSC/QAM) Bulk.
2493 .name = "Hauppauge WinTV-dualHD 01595 ATSC/QAM",
2505 * 1b80:e349 Magix USB Videowandler-2
2510 .name = "Magix USB Videowandler-2",
2659 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
2661 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
2663 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
2741 { USB_DEVICE(0x2013, 0x0264), /* Hauppauge WinTV-soloHD 292e SE */
2743 { USB_DEVICE(0x2040, 0x0264), /* Hauppauge WinTV-soloHD Isoc */
2745 { USB_DEVICE(0x2040, 0x8264), /* Hauppauge OEM Generic WinTV-soloHD Bulk */
2747 { USB_DEVICE(0x2040, 0x8268), /* Hauppauge Retail WinTV-soloHD Bulk */
2755 { USB_DEVICE(0xeb1a, 0x5051), /* Ion Video 2 PC MKII / Startech svid2usb23 / Raygo R12-41373 */
2757 { USB_DEVICE(0x1b80, 0xe349), /* Magix USB Videowandler-2 */
2767 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
2796 struct em28xx *dev = i2c_bus->dev; in em28xx_tuner_callback()
2799 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000) in em28xx_tuner_callback()
2805 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio); in em28xx_tuner_callback()
2813 const struct em28xx_board *board = &em28xx_boards[dev->model]; in em28xx_set_xclk_i2c_speed()
2814 u8 xclk = board->xclk, i2c_speed = board->i2c_speed; in em28xx_set_xclk_i2c_speed()
2830 dev->i2c_speed = i2c_speed & 0x03; in em28xx_set_xclk_i2c_speed()
2832 if (!dev->board.is_em2800) in em28xx_set_xclk_i2c_speed()
2839 dev->board = em28xx_boards[dev->model]; in em28xx_set_model()
2840 dev->has_msp34xx = dev->board.has_msp34xx; in em28xx_set_model()
2841 dev->is_webcam = dev->board.is_webcam; in em28xx_set_model()
2846 dev->def_i2c_bus = dev->board.def_i2c_bus; in em28xx_set_model()
2876 dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n"); in em28xx_wait_until_ac97_features_equals()
2877 return -ETIMEDOUT; in em28xx_wait_until_ac97_features_equals()
2881 * Since em28xx_pre_card_setup() requires a proper dev->model,
2893 switch (dev->model) { in em28xx_pre_card_setup()
2896 dev->i2s_speed = 2048000; in em28xx_pre_card_setup()
2925 * this device needs some gpio writes to get the DVB-T in em28xx_pre_card_setup()
2938 * DVB-T demod work in em28xx_pre_card_setup()
3001 em28xx_gpio_set(dev, dev->board.tuner_gpio); in em28xx_pre_card_setup()
3012 if (dev->is_webcam) { in em28xx_hint_board()
3013 if (dev->em28xx_sensor == EM28XX_MT9V011) { in em28xx_hint_board()
3014 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM; in em28xx_hint_board()
3015 } else if (dev->em28xx_sensor == EM28XX_MT9M001 || in em28xx_hint_board()
3016 dev->em28xx_sensor == EM28XX_MT9M111) { in em28xx_hint_board()
3017 dev->model = EM2750_BOARD_UNKNOWN; in em28xx_hint_board()
3031 * video standards produce different hashes. in em28xx_hint_board()
3034 if (dev->hash == em28xx_eeprom_hash[i].hash) { in em28xx_hint_board()
3035 dev->model = em28xx_eeprom_hash[i].model; in em28xx_hint_board()
3036 dev->tuner_type = em28xx_eeprom_hash[i].tuner; in em28xx_hint_board()
3038 dev_err(&dev->intf->dev, in em28xx_hint_board()
3043 "\tV4L Mailing List <linux-media@vger.kernel.org>\n" in em28xx_hint_board()
3045 em28xx_boards[dev->model].name); in em28xx_hint_board()
3062 if (!dev->i2c_hash) in em28xx_hint_board()
3063 em28xx_do_i2c_scan(dev, dev->def_i2c_bus); in em28xx_hint_board()
3066 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { in em28xx_hint_board()
3067 dev->model = em28xx_i2c_hash[i].model; in em28xx_hint_board()
3068 dev->tuner_type = em28xx_i2c_hash[i].tuner; in em28xx_hint_board()
3069 dev_err(&dev->intf->dev, in em28xx_hint_board()
3074 "\tV4L Mailing List <linux-media@vger.kernel.org>\n" in em28xx_hint_board()
3076 em28xx_boards[dev->model].name); in em28xx_hint_board()
3082 dev_err(&dev->intf->dev, in em28xx_hint_board()
3086 "\tV4L Mailing List <linux-media@vger.kernel.org>\n" in em28xx_hint_board()
3089 dev->hash, dev->i2c_hash); in em28xx_hint_board()
3091 dev_err(&dev->intf->dev, in em28xx_hint_board()
3094 dev_err(&dev->intf->dev, in em28xx_hint_board()
3095 " card=%d -> %s\n", i, em28xx_boards[i].name); in em28xx_hint_board()
3097 return -1; in em28xx_hint_board()
3109 if (dev->is_webcam) { in em28xx_card_setup()
3111 if (dev->em28xx_sensor == EM28XX_NOSENSOR) in em28xx_card_setup()
3113 dev->is_webcam = 0; in em28xx_card_setup()
3116 switch (dev->model) { in em28xx_card_setup()
3121 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. in em28xx_card_setup()
3126 * What we do here is look up the EEPROM hash of the K-WORLD in em28xx_card_setup()
3128 * a DIGIVOX and reset the device to the K-WORLD instead. in em28xx_card_setup()
3134 dev_err(&dev->intf->dev, "Board not discovered\n"); in em28xx_card_setup()
3144 dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", in em28xx_card_setup()
3145 dev->board.name, dev->model); in em28xx_card_setup()
3147 dev->tuner_type = em28xx_boards[dev->model].tuner_type; in em28xx_card_setup()
3150 switch (dev->model) { in em28xx_card_setup()
3162 if (!dev->eedata) in em28xx_card_setup()
3169 tveeprom_hauppauge_analog(&tv, dev->eedata); in em28xx_card_setup()
3171 dev->tuner_type = tv.tuner_type; in em28xx_card_setup()
3174 dev->i2s_speed = 2048000; in em28xx_card_setup()
3175 dev->has_msp34xx = 1; in em28xx_card_setup()
3192 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. in em28xx_card_setup()
3197 * What we do here is look up the EEPROM hash of the K-WORLD in em28xx_card_setup()
3199 * a DIGIVOX and reset the device to the K-WORLD instead. in em28xx_card_setup()
3210 * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, in em28xx_card_setup()
3214 em28xx_gpio_set(dev, dev->board.tuner_gpio); in em28xx_card_setup()
3219 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR. in em28xx_card_setup()
3237 * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, in em28xx_card_setup()
3241 em28xx_gpio_set(dev, dev->board.tuner_gpio); in em28xx_card_setup()
3246 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { in em28xx_card_setup()
3247 dev_err(&dev->intf->dev, in em28xx_card_setup()
3255 kfree(dev->eedata); in em28xx_card_setup()
3256 dev->eedata = NULL; in em28xx_card_setup()
3260 dev->tuner_type = tuner; in em28xx_card_setup()
3269 if (!INPUT(i)->type) in em28xx_card_setup()
3275 if (INPUT(i)->amux == dev->amux_map[j]) { in em28xx_card_setup()
3283 dev->amux_map[idx++] = INPUT(i)->amux; in em28xx_card_setup()
3286 dev->amux_map[idx] = EM28XX_AMUX_UNUSED; in em28xx_card_setup()
3293 ctl->fname = XC2028_DEFAULT_FIRMWARE; in em28xx_setup_xc3028()
3294 ctl->max_len = 64; in em28xx_setup_xc3028()
3295 ctl->mts = em28xx_boards[dev->model].mts_firmware; in em28xx_setup_xc3028()
3297 switch (dev->model) { in em28xx_setup_xc3028()
3305 ctl->demod = XC3028_FE_ZARLINK456; in em28xx_setup_xc3028()
3309 ctl->demod = XC3028_FE_DEFAULT; in em28xx_setup_xc3028()
3312 ctl->demod = XC3028_FE_DEFAULT; in em28xx_setup_xc3028()
3313 ctl->fname = XC3028L_DEFAULT_FIRMWARE; in em28xx_setup_xc3028()
3319 ctl->demod = XC3028_FE_DEFAULT; in em28xx_setup_xc3028()
3324 ctl->demod = XC3028_FE_CHINA; in em28xx_setup_xc3028()
3325 ctl->fname = XC2028_DEFAULT_FIRMWARE; in em28xx_setup_xc3028()
3328 ctl->demod = XC3028_FE_CHINA; in em28xx_setup_xc3028()
3329 ctl->fname = XC3028L_DEFAULT_FIRMWARE; in em28xx_setup_xc3028()
3332 ctl->demod = XC3028_FE_OREN538; in em28xx_setup_xc3028()
3350 * Devices with an audio-only intf also have a V4L/DVB/RC in request_module_async()
3353 if (dev->is_audio_only) { in request_module_async()
3355 request_module("em28xx-alsa"); in request_module_async()
3363 if (dev->has_video) in request_module_async()
3364 request_module("em28xx-v4l"); in request_module_async()
3365 if (dev->usb_audio_type == EM28XX_USB_AUDIO_CLASS) in request_module_async()
3366 request_module("snd-usb-audio"); in request_module_async()
3367 else if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) in request_module_async()
3368 request_module("em28xx-alsa"); in request_module_async()
3369 if (dev->board.has_dvb) in request_module_async()
3370 request_module("em28xx-dvb"); in request_module_async()
3371 if (dev->board.buttons || in request_module_async()
3372 ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)) in request_module_async()
3373 request_module("em28xx-rc"); in request_module_async()
3379 INIT_WORK(&dev->request_module_wk, request_module_async); in request_modules()
3380 schedule_work(&dev->request_module_wk); in request_modules()
3385 flush_work(&dev->request_module_wk); in flush_request_modules()
3396 return -ENOMEM; in em28xx_media_device_init()
3398 if (udev->product) in em28xx_media_device_init()
3399 media_device_usb_init(mdev, udev, udev->product); in em28xx_media_device_init()
3400 else if (udev->manufacturer) in em28xx_media_device_init()
3401 media_device_usb_init(mdev, udev, udev->manufacturer); in em28xx_media_device_init()
3403 media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev)); in em28xx_media_device_init()
3405 dev->media_dev = mdev; in em28xx_media_device_init()
3413 if (dev->media_dev) { in em28xx_unregister_media_device()
3414 media_device_unregister(dev->media_dev); in em28xx_unregister_media_device()
3415 media_device_cleanup(dev->media_dev); in em28xx_unregister_media_device()
3416 kfree(dev->media_dev); in em28xx_unregister_media_device()
3417 dev->media_dev = NULL; in em28xx_unregister_media_device()
3429 struct usb_device *udev = interface_to_usbdev(dev->intf); in em28xx_release_resources()
3433 mutex_lock(&dev->lock); in em28xx_release_resources()
3437 if (dev->def_i2c_bus) in em28xx_release_resources()
3441 if (dev->ts == PRIMARY_TS) in em28xx_release_resources()
3445 clear_bit(dev->devno, em28xx_devused); in em28xx_release_resources()
3447 mutex_unlock(&dev->lock); in em28xx_release_resources()
3451 * em28xx_free_device() - Free em28xx device
3461 dev_info(&dev->intf->dev, "Freeing device\n"); in em28xx_free_device()
3463 if (!dev->disconnected) in em28xx_free_device()
3466 if (dev->ts == PRIMARY_TS) in em28xx_free_device()
3467 kfree(dev->alt_max_pkt_size_isoc); in em28xx_free_device()
3484 dev->intf = intf; in em28xx_init_dev()
3485 mutex_init(&dev->ctrl_urb_lock); in em28xx_init_dev()
3486 spin_lock_init(&dev->slock); in em28xx_init_dev()
3488 dev->em28xx_write_regs = em28xx_write_regs; in em28xx_init_dev()
3489 dev->em28xx_read_reg = em28xx_read_reg; in em28xx_init_dev()
3490 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len; in em28xx_init_dev()
3491 dev->em28xx_write_regs_req = em28xx_write_regs_req; in em28xx_init_dev()
3492 dev->em28xx_read_reg_req = em28xx_read_reg_req; in em28xx_init_dev()
3493 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800; in em28xx_init_dev()
3497 dev->wait_after_write = 5; in em28xx_init_dev()
3502 dev->chip_id = retval; in em28xx_init_dev()
3504 switch (dev->chip_id) { in em28xx_init_dev()
3516 dev->wait_after_write = 0; in em28xx_init_dev()
3517 dev->is_em25xx = 1; in em28xx_init_dev()
3518 dev->eeprom_addrwidth_16bit = 1; in em28xx_init_dev()
3522 if (le16_to_cpu(udev->descriptor.idVendor) == 0xeb1a) { in em28xx_init_dev()
3523 __le16 idProd = udev->descriptor.idProduct; in em28xx_init_dev()
3540 dev->wait_after_write = 0; in em28xx_init_dev()
3544 dev->wait_after_write = 0; in em28xx_init_dev()
3545 dev->eeprom_addrwidth_16bit = 1; in em28xx_init_dev()
3549 dev->wait_after_write = 0; in em28xx_init_dev()
3550 dev->eeprom_addrwidth_16bit = 1; in em28xx_init_dev()
3554 dev->wait_after_write = 0; in em28xx_init_dev()
3555 dev->eeprom_addrwidth_16bit = 1; in em28xx_init_dev()
3559 dev->wait_after_write = 0; in em28xx_init_dev()
3563 dev->wait_after_write = 0; in em28xx_init_dev()
3564 dev->eeprom_addrwidth_16bit = 1; in em28xx_init_dev()
3569 dev_info(&dev->intf->dev, in em28xx_init_dev()
3570 "unknown em28xx chip ID (%d)\n", dev->chip_id); in em28xx_init_dev()
3572 dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name); in em28xx_init_dev()
3576 if (dev->is_audio_only) { in em28xx_init_dev()
3579 retval = -ENODEV; in em28xx_init_dev()
3589 rt_mutex_init(&dev->i2c_bus_lock); in em28xx_init_dev()
3592 if (dev->board.is_em2800) in em28xx_init_dev()
3597 dev_err(&dev->intf->dev, in em28xx_init_dev()
3598 "%s: em28xx_i2c_register bus 0 - error [%d]!\n", in em28xx_init_dev()
3604 if (dev->def_i2c_bus) { in em28xx_init_dev()
3605 if (dev->is_em25xx) in em28xx_init_dev()
3612 dev_err(&dev->intf->dev, in em28xx_init_dev()
3613 "%s: em28xx_i2c_register bus 1 - error [%d]!\n", in em28xx_init_dev()
3638 dev->dev_next = NULL; in em28xx_duplicate_dev()
3639 return -ENOMEM; in em28xx_duplicate_dev()
3646 dev_warn(&dev->intf->dev, ": Supports only %i em28xx boards.\n", in em28xx_duplicate_dev()
3649 dev->dev_next = NULL; in em28xx_duplicate_dev()
3650 return -ENOMEM; in em28xx_duplicate_dev()
3653 sec_dev->devno = nr; in em28xx_duplicate_dev()
3654 snprintf(sec_dev->name, 28, "em28xx #%d", nr); in em28xx_duplicate_dev()
3655 sec_dev->dev_next = NULL; in em28xx_duplicate_dev()
3656 dev->dev_next = sec_dev; in em28xx_duplicate_dev()
3699 e = &intf->altsetting[alt].endpoint[ep].desc; in em28xx_check_usb_descriptor()
3704 sizedescr = le16_to_cpu(e->wMaxPacketSize); in em28xx_check_usb_descriptor()
3707 if (udev->speed == USB_SPEED_HIGH) in em28xx_check_usb_descriptor()
3712 switch (e->bEndpointAddress) { in em28xx_check_usb_descriptor()
3716 dev->analog_ep_isoc = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3717 dev->alt_max_pkt_size_isoc[alt] = size; in em28xx_check_usb_descriptor()
3719 dev->analog_ep_bulk = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3726 dev_err(&intf->dev, in em28xx_check_usb_descriptor()
3731 dev->analog_ep_bulk = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3734 if (size > dev->dvb_max_pkt_size_isoc) { in em28xx_check_usb_descriptor()
3743 dev->dvb_ep_isoc = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3744 dev->dvb_max_pkt_size_isoc = size; in em28xx_check_usb_descriptor()
3745 dev->dvb_alt_isoc = alt; in em28xx_check_usb_descriptor()
3749 dev->dvb_ep_bulk = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3755 if (size > dev->dvb_max_pkt_size_isoc_ts2) { in em28xx_check_usb_descriptor()
3756 dev->dvb_ep_isoc_ts2 = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3757 dev->dvb_max_pkt_size_isoc_ts2 = size; in em28xx_check_usb_descriptor()
3758 dev->dvb_alt_isoc = alt; in em28xx_check_usb_descriptor()
3761 dev->dvb_ep_bulk_ts2 = e->bEndpointAddress; in em28xx_check_usb_descriptor()
3779 const int ifnum = intf->altsetting[0].desc.bInterfaceNumber; in em28xx_usb_probe()
3789 dev_err(&intf->dev, in em28xx_usb_probe()
3792 retval = -ENOMEM; in em28xx_usb_probe()
3798 if (intf->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { in em28xx_usb_probe()
3799 dev_info(&intf->dev, in em28xx_usb_probe()
3801 le16_to_cpu(udev->descriptor.idVendor), in em28xx_usb_probe()
3802 le16_to_cpu(udev->descriptor.idProduct), in em28xx_usb_probe()
3804 intf->altsetting[0].desc.bInterfaceClass); in em28xx_usb_probe()
3806 retval = -ENODEV; in em28xx_usb_probe()
3813 retval = -ENOMEM; in em28xx_usb_probe()
3818 dev->alt_max_pkt_size_isoc = kcalloc(intf->num_altsetting, in em28xx_usb_probe()
3819 sizeof(dev->alt_max_pkt_size_isoc[0]), in em28xx_usb_probe()
3821 if (!dev->alt_max_pkt_size_isoc) { in em28xx_usb_probe()
3823 retval = -ENOMEM; in em28xx_usb_probe()
3828 for (i = 0; i < intf->num_altsetting; i++) { in em28xx_usb_probe()
3832 ep < intf->altsetting[i].desc.bNumEndpoints; in em28xx_usb_probe()
3842 retval = -ENODEV; in em28xx_usb_probe()
3846 switch (udev->speed) { in em28xx_usb_probe()
3861 dev_info(&intf->dev, in em28xx_usb_probe()
3863 udev->manufacturer ? udev->manufacturer : "", in em28xx_usb_probe()
3864 udev->product ? udev->product : "", in em28xx_usb_probe()
3866 le16_to_cpu(udev->descriptor.idVendor), in em28xx_usb_probe()
3867 le16_to_cpu(udev->descriptor.idProduct), in em28xx_usb_probe()
3869 intf->altsetting->desc.bInterfaceNumber); in em28xx_usb_probe()
3876 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { in em28xx_usb_probe()
3877 dev_err(&intf->dev, "Device initialization failed.\n"); in em28xx_usb_probe()
3878 dev_err(&intf->dev, in em28xx_usb_probe()
3879 "Device must be connected to a high-speed USB 2.0 port.\n"); in em28xx_usb_probe()
3880 retval = -ENODEV; in em28xx_usb_probe()
3884 kref_init(&dev->ref); in em28xx_usb_probe()
3886 dev->devno = nr; in em28xx_usb_probe()
3887 dev->model = id->driver_info; in em28xx_usb_probe()
3888 dev->alt = -1; in em28xx_usb_probe()
3889 dev->is_audio_only = has_vendor_audio && !(has_video || has_dvb); in em28xx_usb_probe()
3890 dev->has_video = has_video; in em28xx_usb_probe()
3891 dev->ifnum = ifnum; in em28xx_usb_probe()
3893 dev->ts = PRIMARY_TS; in em28xx_usb_probe()
3894 snprintf(dev->name, 28, "em28xx"); in em28xx_usb_probe()
3895 dev->dev_next = NULL; in em28xx_usb_probe()
3898 dev_info(&intf->dev, in em28xx_usb_probe()
3900 dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; in em28xx_usb_probe()
3903 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { in em28xx_usb_probe()
3904 struct usb_interface *uif = udev->config->interface[i]; in em28xx_usb_probe()
3906 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { in em28xx_usb_probe()
3908 dev_err(&intf->dev, in em28xx_usb_probe()
3910 …"\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.… in em28xx_usb_probe()
3911 dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; in em28xx_usb_probe()
3917 dev_info(&intf->dev, "Video interface %i found:%s%s\n", in em28xx_usb_probe()
3919 dev->analog_ep_bulk ? " bulk" : "", in em28xx_usb_probe()
3920 dev->analog_ep_isoc ? " isoc" : ""); in em28xx_usb_probe()
3922 dev_info(&intf->dev, "DVB interface %i found:%s%s\n", in em28xx_usb_probe()
3924 dev->dvb_ep_bulk ? " bulk" : "", in em28xx_usb_probe()
3925 dev->dvb_ep_isoc ? " isoc" : ""); in em28xx_usb_probe()
3927 dev->num_alt = intf->num_altsetting; in em28xx_usb_probe()
3930 dev->model = card[nr]; in em28xx_usb_probe()
3936 mutex_init(&dev->lock); in em28xx_usb_probe()
3942 if (dev->is_webcam) in em28xx_usb_probe()
3952 dev->board.decoder == EM28XX_NODECODER && in em28xx_usb_probe()
3953 dev->em28xx_sensor == EM28XX_NOSENSOR) { in em28xx_usb_probe()
3954 dev_err(&intf->dev, in em28xx_usb_probe()
3957 dev->has_video = false; in em28xx_usb_probe()
3960 if (dev->board.has_dual_ts && in em28xx_usb_probe()
3961 (dev->tuner_type != TUNER_ABSENT || INPUT(0)->type)) { in em28xx_usb_probe()
3963 * The logic with sets alternate is not ready for dual-tuners in em28xx_usb_probe()
3966 dev_err(&intf->dev, in em28xx_usb_probe()
3973 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) in em28xx_usb_probe()
3974 dev->analog_xfer_bulk = 1; in em28xx_usb_probe()
3975 dev_info(&intf->dev, "analog set to %s mode.\n", in em28xx_usb_probe()
3976 dev->analog_xfer_bulk ? "bulk" : "isoc"); in em28xx_usb_probe()
3979 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) in em28xx_usb_probe()
3980 dev->dvb_xfer_bulk = 1; in em28xx_usb_probe()
3981 dev_info(&intf->dev, "dvb set to %s mode.\n", in em28xx_usb_probe()
3982 dev->dvb_xfer_bulk ? "bulk" : "isoc"); in em28xx_usb_probe()
3985 if (dev->board.has_dual_ts && em28xx_duplicate_dev(dev) == 0) { in em28xx_usb_probe()
3986 kref_init(&dev->dev_next->ref); in em28xx_usb_probe()
3988 dev->dev_next->ts = SECONDARY_TS; in em28xx_usb_probe()
3989 dev->dev_next->alt = -1; in em28xx_usb_probe()
3990 dev->dev_next->is_audio_only = has_vendor_audio && in em28xx_usb_probe()
3992 dev->dev_next->has_video = false; in em28xx_usb_probe()
3993 dev->dev_next->ifnum = ifnum; in em28xx_usb_probe()
3994 dev->dev_next->model = id->driver_info; in em28xx_usb_probe()
3996 mutex_init(&dev->dev_next->lock); in em28xx_usb_probe()
3997 retval = em28xx_init_dev(dev->dev_next, udev, intf, in em28xx_usb_probe()
3998 dev->dev_next->devno); in em28xx_usb_probe()
4002 dev->dev_next->board.ir_codes = NULL; /* No IR for 2nd tuner */ in em28xx_usb_probe()
4003 dev->dev_next->board.has_ir_i2c = 0; /* No IR for 2nd tuner */ in em28xx_usb_probe()
4006 if (dev->dev_next->is_webcam) in em28xx_usb_probe()
4016 if (!dev->dvb_ep_isoc_ts2 || in em28xx_usb_probe()
4017 (try_bulk && dev->dvb_ep_bulk_ts2)) in em28xx_usb_probe()
4018 dev->dev_next->dvb_xfer_bulk = 1; in em28xx_usb_probe()
4019 dev_info(&dev->intf->dev, "dvb ts2 set to %s mode.\n", in em28xx_usb_probe()
4020 dev->dev_next->dvb_xfer_bulk ? "bulk" : "isoc"); in em28xx_usb_probe()
4023 dev->dev_next->dvb_ep_isoc = dev->dvb_ep_isoc_ts2; in em28xx_usb_probe()
4024 dev->dev_next->dvb_ep_bulk = dev->dvb_ep_bulk_ts2; in em28xx_usb_probe()
4025 dev->dev_next->dvb_max_pkt_size_isoc = dev->dvb_max_pkt_size_isoc_ts2; in em28xx_usb_probe()
4026 dev->dev_next->dvb_alt_isoc = dev->dvb_alt_isoc; in em28xx_usb_probe()
4029 if (dev->dvb_xfer_bulk) { in em28xx_usb_probe()
4052 retval = media_device_register(dev->media_dev); in em28xx_usb_probe()
4058 kfree(dev->alt_max_pkt_size_isoc); in em28xx_usb_probe()
4084 if (dev->dev_next) { in em28xx_usb_disconnect()
4085 dev->dev_next->disconnected = 1; in em28xx_usb_disconnect()
4086 dev_info(&dev->intf->dev, "Disconnecting %s\n", in em28xx_usb_disconnect()
4087 dev->dev_next->name); in em28xx_usb_disconnect()
4090 dev->disconnected = 1; in em28xx_usb_disconnect()
4092 dev_info(&dev->intf->dev, "Disconnecting %s\n", dev->name); in em28xx_usb_disconnect()
4098 if (dev->dev_next) in em28xx_usb_disconnect()
4099 em28xx_release_resources(dev->dev_next); in em28xx_usb_disconnect()
4102 if (dev->dev_next) { in em28xx_usb_disconnect()
4103 kref_put(&dev->dev_next->ref, em28xx_free_device); in em28xx_usb_disconnect()
4104 dev->dev_next = NULL; in em28xx_usb_disconnect()
4106 kref_put(&dev->ref, em28xx_free_device); in em28xx_usb_disconnect()