V4L/DVB (10514): em28xx: Add support for Kaiomy TVnPC U2 stick
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 11 Feb 2009 17:13:20 +0000 (14:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:43 +0000 (12:42 -0300)
Thanks to Peter Senna Tschudin <peter.senna@gmail.com> for borrow me one
of those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/video4linux/CARDLIST.em28xx
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx.h

index f7a7f48f4d7431701b37fa489f9414624f2927e8..e914b137434788b59f4cc559a9f5d0440d8bf5a2 100644 (file)
@@ -57,5 +57,6 @@
  57 -> Kworld PlusTV HD Hybrid 330              (em2883)        [eb1a:a316]
  58 -> Compro VideoMate ForYou/Stereo           (em2820/em2840) [185b:2041]
  60 -> Hauppauge WinTV HVR 850                  (em2883)        [2040:651f]
+ 61 -> Kaiomy TVnPC U2                          (em2860)        [eb1a:e303]
  61 -> Pixelview PlayTV Box 4 USB 2.0           (em2820/em2840)
  62 -> Gadmei TVR200                            (em2820/em2840)
index 369db26cd721f60bf33a7ae6a0388d349bd755ed..c62243ef73b43cc0499e25d245936b0d713e19b0 100644 (file)
@@ -1252,6 +1252,33 @@ struct em28xx_board em28xx_boards[] = {
                        .amux     = EM28XX_AMUX_LINE_IN,
                } },
        },
+       [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
+               .name         = "Kaiomy TVnPC U2",
+               .vchannels    = 3,
+               .tuner_type   = TUNER_XC2028,
+               .tuner_addr   = 0x61,
+               .mts_firmware = 1,
+               .decoder      = EM28XX_TVP5150,
+               .tuner_gpio   = default_tuner_gpio,
+               .input          = { {
+                       .type     = EM28XX_VMUX_TELEVISION,
+                       .vmux     = TVP5150_COMPOSITE0,
+                       .amux     = EM28XX_AMUX_VIDEO,
+
+               }, {
+                       .type     = EM28XX_VMUX_COMPOSITE1,
+                       .vmux     = TVP5150_COMPOSITE1,
+                       .amux     = EM28XX_AMUX_LINE_IN,
+               }, {
+                       .type     = EM28XX_VMUX_SVIDEO,
+                       .vmux     = TVP5150_SVIDEO,
+                       .amux     = EM28XX_AMUX_LINE_IN,
+               } },
+               .radio          = {
+                       .type     = EM28XX_RADIO,
+                       .amux     = EM28XX_AMUX_LINE_IN,
+               }
+       }
 };
 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
 
@@ -1279,6 +1306,8 @@ struct usb_device_id em28xx_id_table [] = {
                        .driver_info = EM2820_BOARD_UNKNOWN },
        { USB_DEVICE(0xeb1a, 0xe300),
                        .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
+       { USB_DEVICE(0xeb1a, 0xe303),
+                       .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
        { USB_DEVICE(0xeb1a, 0xe305),
                        .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
        { USB_DEVICE(0xeb1a, 0xe310),
@@ -1524,6 +1553,20 @@ void em28xx_pre_card_setup(struct em28xx *dev)
                /* enables audio for that devices */
                em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
                break;
+
+       case EM2860_BOARD_KAIOMY_TVNPC_U2:
+               em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
+               em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
+               em28xx_write_regs(dev, 0x0d, "\x42", 1);
+               em28xx_write_regs(dev, 0x08, "\xfd", 1);
+               msleep(10);
+               em28xx_write_regs(dev, 0x08, "\xff", 1);
+               msleep(10);
+               em28xx_write_regs(dev, 0x08, "\x7f", 1);
+               msleep(10);
+               em28xx_write_regs(dev, 0x08, "\x6b", 1);
+
+               break;
        }
 
        em28xx_gpio_set(dev, dev->board.tuner_gpio);
index 989e67fdff3e7fab8822ec8ff73ec29a8a43ff8f..24fc8b429466158fe6a53bd3a9a72019693f2a46 100644 (file)
@@ -99,6 +99,7 @@
 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850     60
 #define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2    61
 #define EM2820_BOARD_GADMEI_TVR200               62
+#define EM2860_BOARD_KAIOMY_TVNPC_U2              61
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4