[media] em28xx: Add ISDB support for c3tech Digital duo
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 28 Feb 2013 13:35:56 +0000 (10:35 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 19 Mar 2013 18:13:50 +0000 (15:13 -0300)
This is an hybrid board. However, for analog, it requires
a new driver for saa7136. So, for now, let's just add
support for Digital TV.

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

index 3f12865b2a882dfb69998e44000d0d6ce98c0e83..c59181431df5be228660adecf46b9f827b684b75 100644 (file)
@@ -85,3 +85,4 @@
  85 -> PCTV QuatroStick (510e)                  (em2884)        [2304:0242]
  86 -> PCTV QuatroStick nano (520e)             (em2884)        [2013:0251]
  87 -> Terratec Cinergy HTC USB XS              (em2884)        [0ccd:008e,0ccd:00ac]
+ 88 -> C3 Tech Digital Duo HDTV/SDTV USB        (em2884)        [1b80:e755]
index c754a80a8d8b67d8064f2a4afd33c1f85a827782..ca5ee6aceb62c52466248bd58d3fb4bd3ef1ae49 100644 (file)
@@ -46,6 +46,7 @@ config VIDEO_EM28XX_DVB
        select DVB_A8293 if MEDIA_SUBDRV_AUTOSELECT
        select DVB_MT352 if MEDIA_SUBDRV_AUTOSELECT
        select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT
+       select DVB_MB86A20S if MEDIA_SUBDRV_AUTOSELECT
        select MEDIA_TUNER_QT1010 if MEDIA_SUBDRV_AUTOSELECT
        select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
        ---help---
index 6e62b72376b039699515d12af38ef5ac3c1f586f..46fff5c3335b297ddec7049073af8a7041712e25 100644 (file)
@@ -345,6 +345,18 @@ static struct em28xx_reg_seq pctv_460e[] = {
        {             -1,   -1,   -1,  -1},
 };
 
+static struct em28xx_reg_seq c3tech_digital_duo_digital[] = {
+       {EM2874_R80_GPIO,       0xff,   0xff,   10},
+       {EM2874_R80_GPIO,       0xfd,   0xff,   10}, /* xc5000 reset */
+       {EM2874_R80_GPIO,       0xf9,   0xff,   35},
+       {EM2874_R80_GPIO,       0xfd,   0xff,   10},
+       {EM2874_R80_GPIO,       0xff,   0xff,   10},
+       {EM2874_R80_GPIO,       0xfe,   0xff,   10},
+       {EM2874_R80_GPIO,       0xbe,   0xff,   10},
+       {EM2874_R80_GPIO,       0xfe,   0xff,   20},
+       { -1,                   -1,     -1,     -1},
+};
+
 #if 0
 static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
        {EM2874_R80_GPIO,       0x6f,   0xff,   10},
@@ -978,6 +990,16 @@ struct em28xx_board em28xx_boards[] = {
                .i2c_speed    = EM28XX_I2C_CLK_WAIT_ENABLE |
                                EM28XX_I2C_FREQ_400_KHZ,
        },
+       [EM2884_BOARD_C3TECH_DIGITAL_DUO] = {
+               .name         = "C3 Tech Digital Duo HDTV/SDTV USB",
+               .has_dvb      = 1,
+               /* FIXME: Add analog support - need a saa7136 driver */
+               .tuner_type = TUNER_ABSENT,     /* Digital-only TDA18271HD */
+               .ir_codes     = RC_MAP_EMPTY,
+               .def_i2c_bus  = 1,
+               .i2c_speed    = EM28XX_I2C_CLK_WAIT_ENABLE,
+               .dvb_gpio     = c3tech_digital_duo_digital,
+       },
        [EM2884_BOARD_CINERGY_HTC_STICK] = {
                .name         = "Terratec Cinergy HTC Stick",
                .has_dvb      = 1,
@@ -2144,6 +2166,8 @@ struct usb_device_id em28xx_id_table[] = {
                        .driver_info = EM28174_BOARD_PCTV_460E },
        { USB_DEVICE(0x2040, 0x1605),
                        .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
+       { USB_DEVICE(0x1b80, 0xe755),
+                       .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO },
        { USB_DEVICE(0xeb1a, 0x5006),
                        .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
        { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
index 98b95be3be6e8e872a34e072e32fe92c94e7a96f..42a6a26962249af1bf6c6c271b83c2f044dc179f 100644 (file)
@@ -50,6 +50,7 @@
 #include "tda10071.h"
 #include "a8293.h"
 #include "qt1010.h"
+#include "mb86a20s.h"
 
 MODULE_DESCRIPTION("driver for em28xx based DVB cards");
 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
@@ -766,9 +767,25 @@ static struct zl10353_config em28xx_zl10353_no_i2c_gate_dev = {
 };
 static struct qt1010_config em28xx_qt1010_config = {
        .i2c_address = 0x62
+};
+
+static const struct mb86a20s_config c3tech_duo_mb86a20s_config = {
+       .demod_address = 0x10,
+       .is_serial = true,
+};
+
+static struct tda18271_std_map mb86a20s_tda18271_config = {
+       .dvbt_6   = { .if_freq = 4000, .agc_mode = 3, .std = 4,
+                     .if_lvl = 1, .rfagc_top = 0x37, },
+};
 
+static struct tda18271_config c3tech_duo_tda18271_config = {
+       .std_map = &mb86a20s_tda18271_config,
+       .gate    = TDA18271_GATE_DIGITAL,
+       .small_i2c = TDA18271_03_BYTE_CHUNK_INIT,
 };
 
+
 /* ------------------------------------------------------------------ */
 
 static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
@@ -1177,6 +1194,15 @@ static int em28xx_dvb_init(struct em28xx *dev)
                        dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0);
 
                break;
+       case EM2884_BOARD_C3TECH_DIGITAL_DUO:
+               dvb->fe[0] = dvb_attach(mb86a20s_attach,
+                                          &c3tech_duo_mb86a20s_config,
+                                          &dev->i2c_adap[dev->def_i2c_bus]);
+               if (dvb->fe[0] != NULL)
+                       dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
+                                  &dev->i2c_adap[dev->def_i2c_bus],
+                                  &c3tech_duo_tda18271_config);
+               break;
        case EM28174_BOARD_PCTV_460E:
                /* attach demod */
                dvb->fe[0] = dvb_attach(tda10071_attach,
index f6ac1df838163e3274b973af535a246ebbff63f0..4c667fd1661d9b423408b29fb1eaa7c281c0c0a8 100644 (file)
 #define EM2884_BOARD_PCTV_510E                   85
 #define EM2884_BOARD_PCTV_520E                   86
 #define EM2884_BOARD_TERRATEC_HTC_USB_XS         87
+#define EM2884_BOARD_C3TECH_DIGITAL_DUO                  88
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4