[media] em28xx: add support for Kworld UB435-Q version 3
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 3 Mar 2014 19:28:39 +0000 (16:28 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 4 Mar 2014 17:43:59 +0000 (14:43 -0300)
This device is close to Kworld UB435-Q, but it uses a different
tuner. Add support for it.

Tested with both 8VSB and 256QAM modulations.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.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 cb8706be3dbe0ead3cf13a788fe0c2b33774b71f..e085b1243b451656e0364d07d8c8ddf4bc3a7c85 100644 (file)
@@ -91,3 +91,4 @@
  90 -> KWorld USB ATSC TV Stick UB435-Q V2      (em2874)        [1b80:e346]
  91 -> SpeedLink Vicious And Devine Laplace webcam (em2765)        [1ae7:9003,1ae7:9004]
  92 -> PCTV DVB-S2 Stick (461e)                 (em28178)
+ 93 -> KWorld USB ATSC TV Stick UB435-Q V3      (em2874)        [1b80:e34c]
index 7fb02875a1e6675af59da6e2ff70b27e36a5e9ad..d23a912096f7b7a67a1521992c68d06cb717b873 100644 (file)
@@ -53,6 +53,7 @@ config VIDEO_EM28XX_DVB
        select DVB_MB86A20S if MEDIA_SUBDRV_AUTOSELECT
        select MEDIA_TUNER_QT1010 if MEDIA_SUBDRV_AUTOSELECT
        select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
+       select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT
        select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
        select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
        select DVB_DRX39XYJ if MEDIA_SUBDRV_AUTOSELECT
index 138659b23cbb33aae3e1f49ae03dc7cc99f757f3..5cd2df14bf1a234df79cd8584402aaff8be58ec9 100644 (file)
@@ -189,6 +189,14 @@ static struct em28xx_reg_seq kworld_a340_digital[] = {
        {       -1,             -1,     -1,             -1},
 };
 
+static struct em28xx_reg_seq kworld_ub435q_v3_digital[] = {
+       {EM2874_R80_GPIO_P0_CTRL,       0xff,   0xff,   100},
+       {EM2874_R80_GPIO_P0_CTRL,       0xfe,   0xff,   100},
+       {EM2874_R80_GPIO_P0_CTRL,       0xbe,   0xff,   100},
+       {EM2874_R80_GPIO_P0_CTRL,       0xfe,   0xff,   100},
+       {       -1,                     -1,     -1,     -1},
+};
+
 /* Pinnacle Hybrid Pro eb1a:2881 */
 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
        {EM2820_R08_GPIO_CTRL,  0xfd,   ~EM_GPIO_4,     10},
@@ -2139,6 +2147,19 @@ struct em28xx_board em28xx_boards[] = {
                .tuner_gpio     = default_tuner_gpio,
                .def_i2c_bus    = 1,
        },
+       /*
+        * 1b80:e34c KWorld USB ATSC TV Stick UB435-Q V3
+        * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2
+        */
+       [EM2874_BOARD_KWORLD_UB435Q_V3] = {
+               .name           = "KWorld USB ATSC TV Stick UB435-Q V3",
+               .tuner_type     = TUNER_ABSENT,
+               .has_dvb        = 1,
+               .tuner_gpio     = kworld_ub435q_v3_digital,
+               .def_i2c_bus    = 1,
+               .i2c_speed      = EM28XX_I2C_CLK_WAIT_ENABLE |
+                                 EM28XX_I2C_FREQ_100_KHZ,
+       },
        [EM2874_BOARD_PCTV_HD_MINI_80E] = {
                .name         = "Pinnacle PCTV HD Mini",
                .tuner_type   = TUNER_ABSENT,
@@ -2325,6 +2346,8 @@ struct usb_device_id em28xx_id_table[] = {
                        .driver_info = EM2870_BOARD_KWORLD_A340 },
        { USB_DEVICE(0x1b80, 0xe346),
                        .driver_info = EM2874_BOARD_KWORLD_UB435Q_V2 },
+       { USB_DEVICE(0x1b80, 0xe34c),
+                       .driver_info = EM2874_BOARD_KWORLD_UB435Q_V3 },
        { USB_DEVICE(0x2013, 0x024f),
                        .driver_info = EM28174_BOARD_PCTV_290E },
        { USB_DEVICE(0x2013, 0x024c),
index a63a3a2fbd558a42fd077c147a496ac868481281..d4986bdfbdc33193f8379b1f10ce53c396453c26 100644 (file)
@@ -49,6 +49,7 @@
 #include "tda18271c2dd.h"
 #include "drxk.h"
 #include "tda10071.h"
+#include "tda18212.h"
 #include "a8293.h"
 #include "qt1010.h"
 #include "mb86a20s.h"
@@ -320,6 +321,18 @@ static struct lgdt3305_config em2874_lgdt3305_dev = {
        .qam_if_khz         = 4000,
 };
 
+static struct lgdt3305_config em2874_lgdt3305_nogate_dev = {
+       .i2c_addr           = 0x0e,
+       .demod_chip         = LGDT3305,
+       .spectral_inversion = 1,
+       .deny_i2c_rptr      = 1,
+       .mpeg_mode          = LGDT3305_MPEG_SERIAL,
+       .tpclk_edge         = LGDT3305_TPCLK_FALLING_EDGE,
+       .tpvalid_polarity   = LGDT3305_TP_VALID_HIGH,
+       .vsb_if_khz         = 3600,
+       .qam_if_khz         = 3600,
+};
+
 static struct s921_config sharp_isdbt = {
        .demod_address = 0x30 >> 1
 };
@@ -356,6 +369,12 @@ static struct tda18271_config kworld_ub435q_v2_config = {
        .gate           = TDA18271_GATE_DIGITAL,
 };
 
+static struct tda18212_config kworld_ub435q_v3_config = {
+       .i2c_address    = 0x60,
+       .if_atsc_vsb    = 3600,
+       .if_atsc_qam    = 3600,
+};
+
 static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
        .demod_address = (0x1e >> 1),
        .no_tuner = 1,
@@ -1389,6 +1408,23 @@ static int em28xx_dvb_init(struct em28xx *dev)
                        goto out_free;
                }
                break;
+       case EM2874_BOARD_KWORLD_UB435Q_V3:
+               dvb->fe[0] = dvb_attach(lgdt3305_attach,
+                                       &em2874_lgdt3305_nogate_dev,
+                                       &dev->i2c_adap[dev->def_i2c_bus]);
+               if (!dvb->fe[0]) {
+                       result = -EINVAL;
+                       goto out_free;
+               }
+
+               /* Attach the demodulator. */
+               if (!dvb_attach(tda18212_attach, dvb->fe[0],
+                               &dev->i2c_adap[dev->def_i2c_bus],
+                               &kworld_ub435q_v3_config)) {
+                       result = -EINVAL;
+                       goto out_free;
+               }
+               break;
        case EM2874_BOARD_PCTV_HD_MINI_80E:
                dvb->fe[0] = dvb_attach(drx39xxj_attach, &dev->i2c_adap[dev->def_i2c_bus]);
                if (dvb->fe[0] != NULL) {
index 90e7cec389fbfa847a95358cf4bcb596c9d63a9c..3b08556376e30229933c6418d2c0722237b4a4db 100644 (file)
 #define EM2874_BOARD_KWORLD_UB435Q_V2            90
 #define EM2765_BOARD_SPEEDLINK_VAD_LAPLACE       91
 #define EM28178_BOARD_PCTV_461E                   92
+#define EM2874_BOARD_KWORLD_UB435Q_V3            93
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4