]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: em28xx: Add support for MyGica UTV3
authorNils Rothaug <nils.rothaug@gmx.de>
Sun, 23 Jun 2024 10:46:46 +0000 (12:46 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 29 Jun 2024 10:20:05 +0000 (12:20 +0200)
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>
Documentation/admin-guide/media/em28xx-cardlist.rst
drivers/media/usb/em28xx/em28xx-cards.c
drivers/media/usb/em28xx/em28xx.h

index ace65718ea22ff0412af39f861be9a5ccfd5f110..7dac07986d91775bd340ce039fa503c1d144831f 100644 (file)
@@ -438,3 +438,11 @@ EM28xx cards list
      - MyGica iGrabber
      - em2860
      - 1f4d:1abe
+   * - 106
+     - Hauppauge USB QuadHD ATSC
+     - em28274
+     - 2040:846d
+   * - 107
+     - MyGica UTV3 Analog USB2.0 TV Box
+     - em2860
+     - eb1a:2860
index bae76023cf71d33cc7a85cdc4402c6d3a26f0d4b..a51cbcf429e130ff7f2e0e139759b91a4f1cc828 100644 (file)
@@ -554,6 +554,30 @@ static struct em28xx_reg_seq hauppauge_usb_quadhd_atsc_reg_seq[] = {
        {-1,                           -1,   -1,       -1},
 };
 
+/*
+ * MyGica USB TV Box
+ * GPIO_1,0: 00=Composite audio
+ *           01=Tuner audio
+ *           10=Mute audio
+ *           11=FM radio? (if equipped)
+ * GPIO_2-6: Unused
+ * GPIO_7:   ??
+ */
+static const struct em28xx_reg_seq mygica_utv3_composite_audio_gpio[] = {
+       {EM2820_R08_GPIO_CTRL, 0xfc, 0xff, 0},
+       { -1, -1, -1, -1},
+};
+
+static const struct em28xx_reg_seq mygica_utv3_tuner_audio_gpio[] = {
+       {EM2820_R08_GPIO_CTRL, 0xfd, 0xff, 0},
+       { -1, -1, -1, -1},
+};
+
+static const struct em28xx_reg_seq mygica_utv3_suspend_gpio[] = {
+       {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 0},
+       { -1, -1, -1, -1},
+};
+
 /*
  *  Button definitions
  */
@@ -2578,6 +2602,32 @@ const struct em28xx_board em28xx_boards[] = {
                .tuner_gpio    = hauppauge_usb_quadhd_atsc_reg_seq,
                .leds          = hauppauge_usb_quadhd_leds,
        },
+       /*
+        * eb1a:2860 MyGica UTV3 Analog USB2.0 TV Box
+        * Empia EM2860, Philips SAA7113, NXP TDA9801T demod,
+        * Tena TNF931D-DFDR1 tuner (contains NXP TDA6509A),
+        * ST HCF4052 demux (switches audio to line out),
+        * no audio over USB
+        */
+       [EM2860_BOARD_MYGICA_UTV3] = {
+               .name         = "MyGica UTV3 Analog USB2.0 TV Box",
+               .xclk         = EM28XX_XCLK_IR_RC5_MODE | EM28XX_XCLK_FREQUENCY_12MHZ,
+               .tuner_type   = TUNER_TENA_TNF_931D_DFDR1,
+               .ir_codes     = RC_MAP_MYGICA_UTV3,
+               .decoder      = EM28XX_SAA711X,
+               .suspend_gpio = mygica_utv3_suspend_gpio,
+               .input        = { {
+                       .type     = EM28XX_VMUX_COMPOSITE,
+                       .vmux     = SAA7115_COMPOSITE0,
+                       .amux     = EM28XX_AMUX_VIDEO,
+                       .gpio     = mygica_utv3_composite_audio_gpio,
+               }, {
+                       .type     = EM28XX_VMUX_TELEVISION,
+                       .vmux     = SAA7115_COMPOSITE2,
+                       .amux     = EM28XX_AMUX_VIDEO,
+                       .gpio     = mygica_utv3_tuner_audio_gpio,
+               } },
+       },
 };
 EXPORT_SYMBOL_GPL(em28xx_boards);
 
@@ -2819,6 +2869,7 @@ static const struct em28xx_hash_table em28xx_eeprom_hash[] = {
        {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
        {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
        {0x85dd871e, EM2882_BOARD_ZOLID_HYBRID_TV_STICK, TUNER_XC2028},
+       {0x8f597549, EM2860_BOARD_MYGICA_UTV3, TUNER_TENA_TNF_931D_DFDR1},
 };
 
 /* I2C devicelist hash table for devices with generic USB IDs */
@@ -2831,6 +2882,7 @@ static const struct em28xx_hash_table em28xx_i2c_hash[] = {
        {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
        {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
        {0x27e10080, EM2882_BOARD_ZOLID_HYBRID_TV_STICK, TUNER_XC2028},
+       {0x840d0484, EM2860_BOARD_MYGICA_UTV3, TUNER_TENA_TNF_931D_DFDR1},
 };
 
 /* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
index db18dd814a67ed27724b2fc948d3af69ac81be1d..f3449c240d21773eff7349697195314c4eb09ef5 100644 (file)
 #define EM28178_BOARD_PCTV_461E_V2                104
 #define EM2860_BOARD_MYGICA_IGRABBER              105
 #define EM2874_BOARD_HAUPPAUGE_USB_QUADHD         106
+#define EM2860_BOARD_MYGICA_UTV3                  107
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4