V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_device
[pandora-kernel.git] / drivers / media / video / saa7134 / saa7134-core.c
index 58ab163..75d6184 100644 (file)
@@ -42,23 +42,23 @@ MODULE_LICENSE("GPL");
 
 /* ------------------------------------------------------------------ */
 
-static unsigned int irq_debug = 0;
+static unsigned int irq_debug;
 module_param(irq_debug, int, 0644);
 MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]");
 
-static unsigned int core_debug = 0;
+static unsigned int core_debug;
 module_param(core_debug, int, 0644);
 MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
 
-static unsigned int gpio_tracking = 0;
+static unsigned int gpio_tracking;
 module_param(gpio_tracking, int, 0644);
 MODULE_PARM_DESC(gpio_tracking,"enable debug messages [gpio]");
 
-static unsigned int alsa = 0;
+static unsigned int alsa;
 module_param(alsa, int, 0644);
 MODULE_PARM_DESC(alsa,"enable ALSA DMA sound [dmasound]");
 
-static unsigned int oss = 0;
+static unsigned int oss;
 module_param(oss, int, 0644);
 MODULE_PARM_DESC(oss,"enable OSS DMA sound [dmasound]");
 
@@ -142,39 +142,6 @@ void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value)
        }
 }
 
-int saa7134_tuner_callback(void *ptr, int command, int arg)
-{
-       u8 sync_control;
-       struct saa7134_dev *dev = ptr;
-
-       switch (dev->tuner_type) {
-       case TUNER_PHILIPS_TDA8290:
-               switch (command) {
-               case 0: /* switch LNA gain through GPIO 22*/
-                       saa7134_set_gpio(dev, 22, arg) ;
-                       break;
-               case 1: /* vsync output at GPIO22. 50 / 60Hz */
-                       dprintk("setting GPIO22 to vsync %d\n", arg);
-                       saa_andorb(SAA7134_VIDEO_PORT_CTRL3, 0x80, 0x80);
-                       saa_andorb(SAA7134_VIDEO_PORT_CTRL6, 0x0f, 0x03);
-                       if (arg == 1)
-                               sync_control = 11;
-                       else
-                               sync_control = 17;
-                       saa_writeb(SAA7134_VGATE_START, sync_control);
-                       saa_writeb(SAA7134_VGATE_STOP, sync_control + 1);
-                       saa_andorb(SAA7134_MISC_VGATE_MSB, 0x03, 0x00);
-                       break;
-               default:
-                       return -EINVAL;
-               }
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 0;
-}
-
 /* ------------------------------------------------------------------ */
 
 
@@ -183,7 +150,6 @@ int saa7134_tuner_callback(void *ptr, int command, int arg)
 
 #if defined(CONFIG_MODULES) && defined(MODULE)
 
-
 static void request_module_async(struct work_struct *work){
        struct saa7134_dev* dev = container_of(work, struct saa7134_dev, request_module_wk);
        if (card_is_empress(dev))
@@ -832,7 +798,7 @@ static struct video_device *vdev_init(struct saa7134_dev *dev,
                return NULL;
        *vfd = *template;
        vfd->minor   = -1;
-       vfd->dev     = &dev->pci->dev;
+       vfd->parent  = &dev->pci->dev;
        vfd->release = video_device_release;
        vfd->debug   = video_debug;
        snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)",
@@ -898,6 +864,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        struct saa7134_mpeg_ops *mops;
        int err;
 
+       if (saa7134_devcount == SAA7134_MAXBOARDS)
+               return -ENOMEM;
+
        dev = kzalloc(sizeof(*dev),GFP_KERNEL);
        if (NULL == dev)
                return -ENOMEM;
@@ -976,11 +945,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                dev->board = SAA7134_BOARD_UNKNOWN;
        }
        dev->autodetected = card[dev->nr] != dev->board;
-       dev->tuner_type   = saa7134_boards[dev->board].tuner_type;
+       dev->tuner_type = saa7134_boards[dev->board].tuner_type;
+       dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
        dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
        if (UNSET != tuner[dev->nr])
                dev->tuner_type = tuner[dev->nr];
-               printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
+       printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
                dev->name,pci_dev->subsystem_vendor,
                pci_dev->subsystem_device,saa7134_boards[dev->board].name,
                dev->board, dev->autodetected ?
@@ -1038,11 +1008,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        v4l2_prio_init(&dev->prio);
 
        /* register v4l devices */
-       if (saa7134_no_overlay <= 0) {
-               saa7134_video_template.type |= VID_TYPE_OVERLAY;
-       } else {
-               printk("%s: Overlay support disabled.\n",dev->name);
-       }
+       if (saa7134_no_overlay > 0)
+               printk(KERN_INFO "%s: Overlay support disabled.\n", dev->name);
+
        dev->video_dev = vdev_init(dev,&saa7134_video_template,"video");
        err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
                                    video_nr[dev->nr]);
@@ -1055,7 +1023,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
               dev->name,dev->video_dev->minor & 0x1f);
 
        dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
-       dev->vbi_dev->type = VID_TYPE_TUNER | VID_TYPE_TELETEXT;
 
        err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
                                    vbi_nr[dev->nr]);