V4L/DVB (8244): saa7134: add support for AVerMedia M103
authorMassimo Piccioni <alsa@piccio.org>
Fri, 11 Jul 2008 16:48:02 +0000 (13:48 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:18:29 +0000 (07:18 -0300)
The following patch updates saa7134 driver to add support for AVerMedia
M103 MiniPCI DVB-T Hybrid card.

Signed-off-by: Massimo Piccioni <alsa@piccio.org>
[mchehab@infradead.org: fixed merge conflicts and a small codingstyle]
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Documentation/video4linux/CARDLIST.saa7134
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/saa7134/saa7134.h

index f581922..171905e 100644 (file)
 142 -> Beholder BeholdTV H6                     [5ace:6290]
 143 -> Beholder BeholdTV M63                    [5ace:6191]
 144 -> Beholder BeholdTV M6 Extra               [5ace:6193]
+145 -> AVerMedia MiniPCI DVB-T Hybrid M103      [1461:f636]
index 2511d06..4e6e5cc 100644 (file)
@@ -1287,6 +1287,22 @@ struct saa7134_board saa7134_boards[] = {
                        .vmux = 8,
                }},
        },
+       [SAA7134_BOARD_AVERMEDIA_M103] = {
+               /* Massimo Piccioni <dafastidio@libero.it> */
+               .name           = "AVerMedia MiniPCI DVB-T Hybrid M103",
+               .audio_clock    = 0x187de7,
+               .tuner_type     = TUNER_XC2028,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+                .mpeg           = SAA7134_MPEG_DVB,
+                .inputs         = {{
+                        .name = name_tv,
+                        .vmux = 1,
+                        .amux = TV,
+                        .tv   = 1,
+                } },
+       },
        [SAA7134_BOARD_NOVAC_PRIMETV7133] = {
                /* toshii@netbsd.org */
                .name           = "Noval Prime TV 7133",
@@ -5377,6 +5393,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subdevice    = 0x6290,
                .driver_data  = SAA7134_BOARD_BEHOLD_H6,
        }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1461, /* Avermedia Technologies Inc */
+               .subdevice    = 0xf636,
+               .driver_data  = SAA7134_BOARD_AVERMEDIA_M103,
+       }, {
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -5441,6 +5463,7 @@ static int saa7134_xc2028_callback(struct saa7134_dev *dev,
                saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
                switch (dev->board) {
                case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+               case SAA7134_BOARD_AVERMEDIA_M103:
                        saa7134_set_gpio(dev, 23, 0);
                        msleep(10);
                        saa7134_set_gpio(dev, 23, 1);
@@ -5649,6 +5672,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
                msleep(10);
                break;
        case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+       case SAA7134_BOARD_AVERMEDIA_M103:
                saa7134_set_gpio(dev, 23, 0);
                msleep(10);
                saa7134_set_gpio(dev, 23, 1);
@@ -5774,6 +5798,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
                switch (dev->board) {
                case SAA7134_BOARD_AVERMEDIA_A16D:
                case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+               case SAA7134_BOARD_AVERMEDIA_M103:
                        ctl.demod = XC3028_FE_ZARLINK456;
                        break;
                default:
index 341b101..be48b9b 100644 (file)
@@ -1263,6 +1263,7 @@ static int dvb_init(struct saa7134_dev *dev)
                                                &avermedia_xc3028_mt352_dev,
                                                &dev->i2c_adap);
                attach_xc3028 = 1;
+               break;
        case SAA7134_BOARD_MD7134_BRIDGE_2:
                dev->dvb.frontend = dvb_attach(tda10086_attach,
                                                &sd1878_4m, &dev->i2c_adap);
@@ -1290,6 +1291,15 @@ static int dvb_init(struct saa7134_dev *dev)
                        fe->ops.enable_high_lnb_voltage = md8800_set_high_voltage;
                }
                break;
+       case SAA7134_BOARD_AVERMEDIA_M103:
+               saa7134_set_gpio(dev, 25, 0);
+               msleep(10);
+               saa7134_set_gpio(dev, 25, 1);
+               dev->dvb.frontend = dvb_attach(mt352_attach,
+                                               &avermedia_xc3028_mt352_dev,
+                                               &dev->i2c_adap);
+               attach_xc3028 = 1;
+               break;
        default:
                wprintk("Huh? unknown DVB card?\n");
                break;
index 4e491ad..6e5a409 100644 (file)
@@ -266,6 +266,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_BEHOLD_H6      142
 #define SAA7134_BOARD_BEHOLD_M63      143
 #define SAA7134_BOARD_BEHOLD_M6_EXTRA    144
+#define SAA7134_BOARD_AVERMEDIA_M103    145
 
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8