Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: em28xx: Add support for MyGica UTV3

The MyGica UTV3 Analog USB2.0 TV Box is a USB video capture card
that has analog TV, composite video, and FM radio inputs, an IR
remote, and provides audio only as Line Out, but not over USB.
Mine is prepared for an FM tuner, but not equipped with one.
Support for FM radio is therefore missing. The device contains:
- Empia EM2860 USB bridge
- Philips SAA7113 video decoder
- NXP TDA9801T demodulator
- Tena TNF931D-DFDR1 tuner
- ST HCF4052 demux, switches input audio to Line Out

Signed-off-by: Nils Rothaug <nils.rothaug@gmx.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Nils Rothaug and committed by
Hans Verkuil
ceac017e fbf657d5

+61
+8
Documentation/admin-guide/media/em28xx-cardlist.rst
··· 438 438 - MyGica iGrabber 439 439 - em2860 440 440 - 1f4d:1abe 441 + * - 106 442 + - Hauppauge USB QuadHD ATSC 443 + - em28274 444 + - 2040:846d 445 + * - 107 446 + - MyGica UTV3 Analog USB2.0 TV Box 447 + - em2860 448 + - eb1a:2860
+52
drivers/media/usb/em28xx/em28xx-cards.c
··· 555 555 }; 556 556 557 557 /* 558 + * MyGica USB TV Box 559 + * GPIO_1,0: 00=Composite audio 560 + * 01=Tuner audio 561 + * 10=Mute audio 562 + * 11=FM radio? (if equipped) 563 + * GPIO_2-6: Unused 564 + * GPIO_7: ?? 565 + */ 566 + static const struct em28xx_reg_seq mygica_utv3_composite_audio_gpio[] = { 567 + {EM2820_R08_GPIO_CTRL, 0xfc, 0xff, 0}, 568 + { -1, -1, -1, -1}, 569 + }; 570 + 571 + static const struct em28xx_reg_seq mygica_utv3_tuner_audio_gpio[] = { 572 + {EM2820_R08_GPIO_CTRL, 0xfd, 0xff, 0}, 573 + { -1, -1, -1, -1}, 574 + }; 575 + 576 + static const struct em28xx_reg_seq mygica_utv3_suspend_gpio[] = { 577 + {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 0}, 578 + { -1, -1, -1, -1}, 579 + }; 580 + 581 + /* 558 582 * Button definitions 559 583 */ 560 584 static const struct em28xx_button std_snapshot_button[] = { ··· 2602 2578 .tuner_gpio = hauppauge_usb_quadhd_atsc_reg_seq, 2603 2579 .leds = hauppauge_usb_quadhd_leds, 2604 2580 }, 2581 + /* 2582 + * eb1a:2860 MyGica UTV3 Analog USB2.0 TV Box 2583 + * Empia EM2860, Philips SAA7113, NXP TDA9801T demod, 2584 + * Tena TNF931D-DFDR1 tuner (contains NXP TDA6509A), 2585 + * ST HCF4052 demux (switches audio to line out), 2586 + * no audio over USB 2587 + */ 2588 + [EM2860_BOARD_MYGICA_UTV3] = { 2589 + .name = "MyGica UTV3 Analog USB2.0 TV Box", 2590 + .xclk = EM28XX_XCLK_IR_RC5_MODE | EM28XX_XCLK_FREQUENCY_12MHZ, 2591 + .tuner_type = TUNER_TENA_TNF_931D_DFDR1, 2592 + .ir_codes = RC_MAP_MYGICA_UTV3, 2593 + .decoder = EM28XX_SAA711X, 2594 + .suspend_gpio = mygica_utv3_suspend_gpio, 2595 + .input = { { 2596 + .type = EM28XX_VMUX_COMPOSITE, 2597 + .vmux = SAA7115_COMPOSITE0, 2598 + .amux = EM28XX_AMUX_VIDEO, 2599 + .gpio = mygica_utv3_composite_audio_gpio, 2600 + }, { 2601 + .type = EM28XX_VMUX_TELEVISION, 2602 + .vmux = SAA7115_COMPOSITE2, 2603 + .amux = EM28XX_AMUX_VIDEO, 2604 + .gpio = mygica_utv3_tuner_audio_gpio, 2605 + } }, 2606 + }, 2605 2607 }; 2606 2608 EXPORT_SYMBOL_GPL(em28xx_boards); 2607 2609 ··· 2869 2819 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT}, 2870 2820 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028}, 2871 2821 {0x85dd871e, EM2882_BOARD_ZOLID_HYBRID_TV_STICK, TUNER_XC2028}, 2822 + {0x8f597549, EM2860_BOARD_MYGICA_UTV3, TUNER_TENA_TNF_931D_DFDR1}, 2872 2823 }; 2873 2824 2874 2825 /* I2C devicelist hash table for devices with generic USB IDs */ ··· 2882 2831 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF}, 2883 2832 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT}, 2884 2833 {0x27e10080, EM2882_BOARD_ZOLID_HYBRID_TV_STICK, TUNER_XC2028}, 2834 + {0x840d0484, EM2860_BOARD_MYGICA_UTV3, TUNER_TENA_TNF_931D_DFDR1}, 2885 2835 }; 2886 2836 2887 2837 /* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
+1
drivers/media/usb/em28xx/em28xx.h
··· 143 143 #define EM28178_BOARD_PCTV_461E_V2 104 144 144 #define EM2860_BOARD_MYGICA_IGRABBER 105 145 145 #define EM2874_BOARD_HAUPPAUGE_USB_QUADHD 106 146 + #define EM2860_BOARD_MYGICA_UTV3 107 146 147 147 148 /* Limits minimum and default number of buffers */ 148 149 #define EM28XX_MIN_BUF 4