[media] em28xx: support for 1b80:e425 MaxMedia UB425-TC
authorAntti Palosaari <crope@iki.fi>
Sun, 18 Mar 2012 21:09:01 +0000 (18:09 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 20 Mar 2012 01:22:53 +0000 (22:22 -0300)
Hardware is based of:
Empia EM2874B
Micronas DRX 3913KA2
NXP TDA18271HDC2

Only DVB-C supported currently since missing firmware.
According to my tests, DRX 3913KA2 demodulator requires firmware
in order to support DVB-T mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-dvb.c
drivers/media/video/em28xx/em28xx.h

index d328616519e75700027df7dd36c1a6a3632e8602..70dfd3a7242d52e9d19e18c466d787af22918d33 100644 (file)
@@ -353,6 +353,17 @@ static struct em28xx_reg_seq hauppauge_930c_digital[] = {
 };
 #endif
 
+/* 1b80:e425 MaxMedia UB425-TC
+ * GPIO_6 - demod reset, 0=active
+ * GPIO_7 - LED, 0=active
+ */
+static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
+       {EM2874_R80_GPIO,  0x83,  0xff,  100},
+       {EM2874_R80_GPIO,  0xc3,  0xff,  100}, /* GPIO_6 = 1 */
+       {EM2874_R80_GPIO,  0x43,  0xff,  000}, /* GPIO_7 = 0 */
+       {-1,                 -1,    -1,   -1},
+};
+
 /*
  *  Board definitions
  */
@@ -1908,6 +1919,17 @@ struct em28xx_board em28xx_boards[] = {
                        .amux     = EM28XX_AMUX_LINE_IN,
                } },
        },
+       /* 1b80:e425 MaxMedia UB425-TC
+        * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
+       [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
+               .name          = "MaxMedia UB425-TC",
+               .tuner_type    = TUNER_ABSENT,
+               .tuner_gpio    = maxmedia_ub425_tc,
+               .has_dvb       = 1,
+               .i2c_speed     = EM2874_I2C_SECONDARY_BUS_SELECT |
+                               EM28XX_I2C_CLK_WAIT_ENABLE |
+                               EM28XX_I2C_FREQ_400_KHZ,
+       },
 };
 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
 
@@ -2059,6 +2081,8 @@ struct usb_device_id em28xx_id_table[] = {
                        .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
        { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
                        .driver_info = EM2860_BOARD_EASYCAP },
+       { USB_DEVICE(0x1b80, 0xe425),
+                       .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
        { },
 };
 MODULE_DEVICE_TABLE(usb, em28xx_id_table);
index fbd90104323dbac14bb7934fb73e45390be3814c..0b3e301adde9d47614adc6483167f56550575ab8 100644 (file)
@@ -325,6 +325,12 @@ struct drxk_config hauppauge_930c_drxk = {
        .chunk_size = 56,
 };
 
+struct drxk_config maxmedia_ub425_tc_drxk = {
+       .adr = 0x29,
+       .single_master = 1,
+       .no_i2c_bridge = 1,
+};
+
 static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
 {
        struct em28xx_dvb *dvb = fe->sec_priv;
@@ -936,6 +942,29 @@ static int em28xx_dvb_init(struct em28xx *dev)
                        dvb_attach(a8293_attach, dvb->fe[0], &dev->i2c_adap,
                                &em28xx_a8293_config);
                break;
+       case EM2874_BOARD_MAXMEDIA_UB425_TC:
+               /* attach demodulator */
+               dvb->fe[0] = dvb_attach(drxk_attach, &maxmedia_ub425_tc_drxk,
+                               &dev->i2c_adap);
+
+               if (dvb->fe[0]) {
+                       /* disable I2C-gate */
+                       dvb->fe[0]->ops.i2c_gate_ctrl = NULL;
+
+                       /* attach tuner */
+                       if (!dvb_attach(tda18271c2dd_attach, dvb->fe[0],
+                                       &dev->i2c_adap, 0x60)) {
+                               dvb_frontend_detach(dvb->fe[0]);
+                               result = -EINVAL;
+                               goto out_free;
+                       }
+               }
+
+               /* TODO: we need drx-3913k firmware in order to support DVB-T */
+               em28xx_info("MaxMedia UB425-TC: only DVB-C supported by that " \
+                               "driver version\n");
+
+               break;
        default:
                em28xx_errdev("/2: The frontend of your DVB/ATSC card"
                                " isn't supported yet\n");
index 6a27e6109b878707c652c3890fb9af2c50c9f2d4..ca90a4dcc93f4a26a1c043ae6be8ccfc63f425f2 100644 (file)
 #define EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C    81
 #define EM2884_BOARD_CINERGY_HTC_STICK           82
 #define EM2860_BOARD_HT_VIDBOX_NW03              83
+#define EM2874_BOARD_MAXMEDIA_UB425_TC            84
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4