[PATCH] v4l: 663: add new rtd cards
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Wed, 9 Nov 2005 05:36:35 +0000 (21:36 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:56:10 +0000 (07:56 -0800)
- Add new RTD cards

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/video4linux/CARDLIST.saa7134
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-reg.h
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h

index b2643051339e8f51183c534e5215f71ac76a5f4d..82b5f7c73c8326d01a678c5e655caf4f9099224c 100644 (file)
@@ -70,3 +70,5 @@
  69 -> Philips EUROPA V3 reference design       [1131:2004]
  70 -> Compro Videomate DVB-T300                [185b:c900]
  71 -> Compro Videomate DVB-T200                [185b:c901]
+ 72 -> RTD Embedded Technologies VFG7350        [1435:7350]
+ 73 -> RTD Embedded Technologies VFG7330        [1435:7330]
index 8291ed709736449f393fde9cca77acfa83d1d0bb..8bb2faf2635a534f142098753ebf95346f75ad2a 100644 (file)
@@ -2251,6 +2251,74 @@ struct saa7134_board saa7134_boards[] = {
                        .amux   = LINE1,
                }},
        },
+       [SAA7134_BOARD_RTD_VFG7350] = {
+               .name           = "RTD Embedded Technologies VFG7350",
+               .audio_clock    = 0x00200000,
+               .tuner_type     = TUNER_ABSENT,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .inputs         = {{
+                       .name   = "Composite 0",
+                       .vmux   = 0,
+                       .amux   = LINE1,
+               },{
+                       .name   = "Composite 1",
+                       .vmux   = 1,
+                       .amux   = LINE2,
+               },{
+                       .name   = "Composite 2",
+                       .vmux   = 2,
+                       .amux   = LINE1,
+               },{
+                       .name   = "Composite 3",
+                       .vmux   = 3,
+                       .amux   = LINE2,
+               },{
+                       .name   = "S-Video 0",
+                       .vmux   = 8,
+                       .amux   = LINE1,
+               },{
+                       .name   = "S-Video 1",
+                       .vmux   = 9,
+                       .amux   = LINE2,
+               }},
+               .mpeg           = SAA7134_MPEG_EMPRESS,
+               .video_out      = CCIR656,
+       },
+       [SAA7134_BOARD_RTD_VFG7330] = {
+               .name           = "RTD Embedded Technologies VFG7330",
+               .audio_clock    = 0x00200000,
+               .tuner_type     = TUNER_ABSENT,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .inputs         = {{
+                       .name   = "Composite 0",
+                       .vmux   = 0,
+                       .amux   = LINE1,
+               },{
+                       .name   = "Composite 1",
+                       .vmux   = 1,
+                       .amux   = LINE2,
+               },{
+                       .name   = "Composite 2",
+                       .vmux   = 2,
+                       .amux   = LINE1,
+               },{
+                       .name   = "Composite 3",
+                       .vmux   = 3,
+                       .amux   = LINE2,
+               },{
+                       .name   = "S-Video 0",
+                       .vmux   = 8,
+                       .amux   = LINE1,
+               },{
+                       .name   = "S-Video 1",
+                       .vmux   = 9,
+                       .amux   = LINE2,
+               }},
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -2639,6 +2707,18 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subdevice    = 0xc901,
                .driver_data  = SAA7134_BOARD_VIDEOMATE_DVBT_200,
        },{
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1435,
+               .subdevice    = 0x7350,
+               .driver_data  = SAA7134_BOARD_RTD_VFG7350,
+       },{
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1435,
+               .subdevice    = 0x7330,
+               .driver_data  = SAA7134_BOARD_RTD_VFG7330,
+       },{
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
                .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -2758,6 +2838,17 @@ int saa7134_board_init1(struct saa7134_dev *dev)
                saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
                msleep(1);
                break;
+       case SAA7134_BOARD_RTD_VFG7350:
+
+               /*
+                * Make sure Production Test Register at offset 0x1D1 is cleared
+                * to take chip out of test mode.  Clearing bit 4 (TST_EN_AOUT)
+                * prevents pin 105 from remaining low; keeping pin 105 low
+                * continually resets the SAA6752 chip.
+                */
+
+               saa_writeb (SAA7134_PRODUCTION_TEST_MODE, 0x00);
+               break;
        }
        return 0;
 }
index ae0c7a165390a2f88fd1a7326eec51738c524710..fce4f185ef92bdb1f0fbb5c818f08735b83a577e 100644 (file)
 
 /* test modes */
 #define SAA7134_SPECIAL_MODE                    0x1d0
+#define SAA7134_PRODUCTION_TEST_MODE            0x1d1
 
 /* audio -- saa7133 + saa7135 only */
 #define SAA7135_DSP_RWSTATE                     0x580
index 35e5e85f669a4056534ddab47d70438045572557..d395403afe5ad8a0a767c43b3425ae932e901323 100644 (file)
@@ -1666,6 +1666,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
        case VIDIOC_QUERYCAP:
        {
                struct v4l2_capability *cap = arg;
+               unsigned int tuner_type = dev->tuner_type;
 
                memset(cap,0,sizeof(*cap));
                 strcpy(cap->driver, "saa7134");
@@ -1677,9 +1678,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                        V4L2_CAP_VIDEO_CAPTURE |
                        V4L2_CAP_VIDEO_OVERLAY |
                        V4L2_CAP_VBI_CAPTURE |
-                       V4L2_CAP_TUNER |
                        V4L2_CAP_READWRITE |
-                       V4L2_CAP_STREAMING;
+                       V4L2_CAP_STREAMING |
+                       V4L2_CAP_TUNER;
+
+               if ((tuner_type == TUNER_ABSENT) || (tuner_type == UNSET))
+                       cap->capabilities &= ~V4L2_CAP_TUNER;
+
                return 0;
        }
 
index 69a2cebe8860903f86c35b25f1fa2a8568e37ed4..ad8e89d6bf50fb9b426104e2283670ab4aeeabbe 100644 (file)
@@ -192,6 +192,8 @@ struct saa7134_format {
 #define SAA7134_BOARD_PHILIPS_EUROPA  69
 #define SAA7134_BOARD_VIDEOMATE_DVBT_300 70
 #define SAA7134_BOARD_VIDEOMATE_DVBT_200 71
+#define SAA7134_BOARD_RTD_VFG7350 72
+#define SAA7134_BOARD_RTD_VFG7330 73
 
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8