[media] em28xx: add support for PCTV DVB-S2 Stick 460e [2013:024f]
authorAntti Palosaari <crope@iki.fi>
Mon, 1 Aug 2011 04:15:30 +0000 (01:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 21 Sep 2011 13:01:47 +0000 (10:01 -0300)
It is based of...
* Empia EM28174
* NXP TDA10071 & Conexant CX24118A combo
* Allegro A8293

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

index 281ee42..f6f622e 100644 (file)
@@ -41,6 +41,8 @@ config VIDEO_EM28XX_DVB
        select DVB_CXD2820R if !DVB_FE_CUSTOMISE
        select DVB_DRXK if !DVB_FE_CUSTOMISE
        select DVB_TDA18271C2DD if !DVB_FE_CUSTOMISE
+       select DVB_TDA10071 if !DVB_FE_CUSTOMISE
+       select DVB_A8293 if !DVB_FE_CUSTOMISE
        select VIDEOBUF_DVB
        ---help---
          This adds support for DVB cards based on the
index 013e946..8845ff8 100644 (file)
@@ -317,6 +317,25 @@ static struct em28xx_reg_seq terratec_h5_digital[] = {
 };
 #endif
 
+/* 2013:024f PCTV DVB-S2 Stick 460e
+ * GPIO_0 - POWER_ON
+ * GPIO_1 - BOOST
+ * GPIO_2 - VUV_LNB (red LED)
+ * GPIO_3 - EXT_12V
+ * GPIO_4 - INT_DEM (DEMOD GPIO_0)
+ * GPIO_5 - INT_LNB
+ * GPIO_6 - RESET_DEM
+ * GPIO_7 - LED (green LED)
+ */
+static struct em28xx_reg_seq pctv_460e[] = {
+       {EM2874_R80_GPIO, 0x01, 0xff,  50},
+       {0x0d,            0xff, 0xff,  50},
+       {EM2874_R80_GPIO, 0x41, 0xff,  50}, /* GPIO_6=1 */
+       {0x0d,            0x42, 0xff,  50},
+       {EM2874_R80_GPIO, 0x61, 0xff,  50}, /* GPIO_5=1 */
+       {             -1,   -1,   -1,  -1},
+};
+
 /*
  *  Board definitions
  */
@@ -1810,6 +1829,17 @@ struct em28xx_board em28xx_boards[] = {
                .has_dvb       = 1,
                .ir_codes      = RC_MAP_PINNACLE_PCTV_HD,
        },
+       /* 2013:024f PCTV DVB-S2 Stick 460e
+        * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
+       [EM28174_BOARD_PCTV_460E] = {
+               .i2c_speed     = EM2874_I2C_SECONDARY_BUS_SELECT |
+                       EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
+               .name          = "PCTV DVB-S2 Stick (460e)",
+               .tuner_type    = TUNER_ABSENT,
+               .tuner_gpio    = pctv_460e,
+               .has_dvb       = 1,
+               .ir_codes      = RC_MAP_PINNACLE_PCTV_HD,
+       },
 };
 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
 
@@ -1941,6 +1971,8 @@ struct usb_device_id em28xx_id_table[] = {
                        .driver_info = EM2870_BOARD_KWORLD_A340 },
        { USB_DEVICE(0x2013, 0x024f),
                        .driver_info = EM28174_BOARD_PCTV_290E },
+       { USB_DEVICE(0x2013, 0x024c),
+                       .driver_info = EM28174_BOARD_PCTV_460E },
        { },
 };
 MODULE_DEVICE_TABLE(usb, em28xx_id_table);
index 62b558d..cef7a2d 100644 (file)
@@ -42,6 +42,8 @@
 #include "cxd2820r.h"
 #include "tda18271c2dd.h"
 #include "drxk.h"
+#include "tda10071.h"
+#include "a8293.h"
 
 MODULE_DESCRIPTION("driver for em28xx based DVB cards");
 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
@@ -441,6 +443,19 @@ static struct tda18271_config em28xx_cxd2820r_tda18271_config = {
        .gate = TDA18271_GATE_DIGITAL,
 };
 
+static const struct tda10071_config em28xx_tda10071_config = {
+       .i2c_address = 0x55, /* (0xaa >> 1) */
+       .i2c_wr_max = 64,
+       .ts_mode = TDA10071_TS_SERIAL,
+       .spec_inv = 0,
+       .xtal = 40444000, /* 40.444 MHz */
+       .pll_multiplier = 20,
+};
+
+static const struct a8293_config em28xx_a8293_config = {
+       .i2c_addr = 0x08, /* (0x10 >> 1) */
+};
+
 /* ------------------------------------------------------------------ */
 
 static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
@@ -808,6 +823,16 @@ static int em28xx_dvb_init(struct em28xx *dev)
                       sizeof(dvb->fe[0]->ops.tuner_ops));
 
                break;
+       case EM28174_BOARD_PCTV_460E:
+               /* attach demod */
+               dvb->fe[0] = dvb_attach(tda10071_attach,
+                       &em28xx_tda10071_config, &dev->i2c_adap);
+
+               /* attach SEC */
+               if (dvb->fe[0])
+                       dvb_attach(a8293_attach, dvb->fe[0], &dev->i2c_adap,
+                               &em28xx_a8293_config);
+               break;
        default:
                em28xx_errdev("/2: The frontend of your DVB/ATSC card"
                                " isn't supported yet\n");
index d80658b..1626e4a 100644 (file)
 #define EM2874_BOARD_LEADERSHIP_ISDBT            77
 #define EM28174_BOARD_PCTV_290E                   78
 #define EM2884_BOARD_TERRATEC_H5                 79
+#define EM28174_BOARD_PCTV_460E                   80
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4