i2c: Declare more i2c_adapter parent devices
[safe/jmp/linux-2.6] / drivers / media / video / bt8xx / bttv-driver.c
index 63e8316..41fd09d 100644 (file)
@@ -1793,7 +1793,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
                memset(i,0,sizeof(*i));
                i->index    = n;
                i->type     = V4L2_INPUT_TYPE_CAMERA;
-               i->audioset = 0;
+               i->audioset = 1;
                if (i->index == bttv_tvcards[btv->c.type].tuner) {
                        sprintf(i->name, "Television");
                        i->type  = V4L2_INPUT_TYPE_TUNER;
@@ -2431,6 +2431,14 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                fbuf->bytesperline  = btv->fbuf.fmt.bytesperline;
                if (fh->ovfmt)
                        fbuf->depth = fh->ovfmt->depth;
+               else {
+                       if (fbuf->width)
+                               fbuf->depth   = ((fbuf->bytesperline<<3)
+                                                 + (fbuf->width-1) )
+                                                 /fbuf->width;
+                       else
+                               fbuf->depth = 0;
+               }
                return 0;
        }
        case VIDIOCSFBUF:
@@ -3166,7 +3174,7 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
        return videobuf_mmap_mapper(bttv_queue(fh),vma);
 }
 
-static struct file_operations bttv_fops =
+static const struct file_operations bttv_fops =
 {
        .owner    = THIS_MODULE,
        .open     = bttv_open,
@@ -3324,7 +3332,7 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
        return cmd.result;
 }
 
-static struct file_operations radio_fops =
+static const struct file_operations radio_fops =
 {
        .owner    = THIS_MODULE,
        .open     = radio_open,
@@ -3745,7 +3753,7 @@ bttv_irq_switch_vbi(struct bttv *btv)
        spin_unlock(&btv->s_lock);
 }
 
-static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t bttv_irq(int irq, void *dev_id)
 {
        u32 stat,astat;
        u32 dstat;
@@ -3909,8 +3917,6 @@ static void bttv_unregister_video(struct bttv *btv)
 /* register video4linux devices */
 static int __devinit bttv_register_video(struct bttv *btv)
 {
-       int ret;
-
        if (no_overlay <= 0) {
                bttv_video_template.type |= VID_TYPE_OVERLAY;
        } else {
@@ -3925,10 +3931,12 @@ static int __devinit bttv_register_video(struct bttv *btv)
                goto err;
        printk(KERN_INFO "bttv%d: registered device video%d\n",
               btv->c.nr,btv->video_dev->minor & 0x1f);
-       ret = video_device_create_file(btv->video_dev, &class_device_attr_card);
-       if (ret < 0)
-               printk(KERN_WARNING "bttv: video_device_create_file error: "
-                       "%d\n", ret);
+       if (class_device_create_file(&btv->video_dev->class_dev,
+                                    &class_device_attr_card)<0) {
+               printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
+                      "failed\n", btv->c.nr);
+               goto err;
+       }
 
        /* vbi */
        btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
@@ -4042,8 +4050,8 @@ static int __devinit bttv_probe(struct pci_dev *dev,
               (unsigned long long)pci_resource_start(dev,0));
        schedule();
 
-       btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000);
-       if (NULL == ioremap(pci_resource_start(dev,0), 0x1000)) {
+       btv->bt848_mmio = ioremap(pci_resource_start(dev, 0), 0x1000);
+       if (NULL == btv->bt848_mmio) {
                printk("bttv%d: ioremap() failed\n", btv->c.nr);
                result = -EIO;
                goto fail1;
@@ -4186,6 +4194,7 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
        return;
 }
 
+#ifdef CONFIG_PM
 static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
 {
        struct bttv *btv = pci_get_drvdata(pci_dev);
@@ -4266,6 +4275,7 @@ static int bttv_resume(struct pci_dev *pci_dev)
        spin_unlock_irqrestore(&btv->s_lock,flags);
        return 0;
 }
+#endif
 
 static struct pci_device_id bttv_pci_tbl[] = {
        {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848,
@@ -4286,8 +4296,10 @@ static struct pci_driver bttv_pci_driver = {
        .id_table = bttv_pci_tbl,
        .probe    = bttv_probe,
        .remove   = __devexit_p(bttv_remove),
+#ifdef CONFIG_PM
        .suspend  = bttv_suspend,
        .resume   = bttv_resume,
+#endif
 };
 
 static int bttv_init_module(void)