]> err.no Git - linux-2.6/blobdiff - drivers/media/video/meye.c
V4L/DVB (7402): add macro validation for v4l_compat_ioctl32
[linux-2.6] / drivers / media / video / meye.c
index 7533fc2033195b97e2648a82225514e7663007b1..61c980193c10c0a8cc32cf9eec3807c2ad8298fa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
  *
- * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
  *
  * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
  *
@@ -789,7 +789,7 @@ static irqreturn_t meye_irq(int irq, void *dev_id)
 {
        u32 v;
        int reqnr;
-       static int sequence = 0;
+       static int sequence;
 
        v = mchip_read(MCHIP_MM_INTA);
 
@@ -1239,6 +1239,7 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
                        c->default_value = 48;
                        c->flags = 0;
                        break;
+               case V4L2_CID_MEYE_SHARPNESS:
                case V4L2_CID_SHARPNESS:
                        c->type = V4L2_CTRL_TYPE_INTEGER;
                        strcpy(c->name, "Sharpness");
@@ -1246,7 +1247,12 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
                        c->maximum = 63;
                        c->step = 1;
                        c->default_value = 32;
-                       c->flags = 0;
+
+                       /* Continue to report legacy private SHARPNESS ctrl but
+                        * say it is disabled in preference to ctrl in the spec
+                        */
+                       c->flags = (c->id == V4L2_CID_SHARPNESS) ? 0 :
+                                                       V4L2_CTRL_FLAG_DISABLED;
                        break;
                case V4L2_CID_PICTURE:
                        c->type = V4L2_CTRL_TYPE_INTEGER;
@@ -1312,6 +1318,7 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
                        meye.params.agc = c->value;
                        break;
                case V4L2_CID_SHARPNESS:
+               case V4L2_CID_MEYE_SHARPNESS:
                        sony_pic_camera_command(
                                SONY_PIC_COMMAND_SETCAMERASHARPNESS, c->value);
                        meye.params.sharpness = c->value;
@@ -1356,6 +1363,7 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
                        c->value = meye.params.agc;
                        break;
                case V4L2_CID_SHARPNESS:
+               case V4L2_CID_MEYE_SHARPNESS:
                        c->value = meye.params.sharpness;
                        break;
                case V4L2_CID_PICTURE:
@@ -1753,7 +1761,9 @@ static const struct file_operations meye_fops = {
        .release        = meye_release,
        .mmap           = meye_mmap,
        .ioctl          = meye_ioctl,
+#ifdef CONFIG_COMPAT
        .compat_ioctl   = v4l_compat_ioctl32,
+#endif
        .poll           = meye_poll,
        .llseek         = no_llseek,
 };
@@ -1762,7 +1772,6 @@ static struct video_device meye_template = {
        .owner          = THIS_MODULE,
        .name           = "meye",
        .type           = VID_TYPE_CAPTURE,
-       .hardware       = VID_HARDWARE_MEYE,
        .fops           = &meye_fops,
        .release        = video_device_release,
        .minor          = -1,
@@ -2024,7 +2033,7 @@ static int __init meye_init(void)
        if (gbufsize < 0 || gbufsize > MEYE_MAX_BUFSIZE)
                gbufsize = MEYE_MAX_BUFSIZE;
        gbufsize = PAGE_ALIGN(gbufsize);
-       printk(KERN_INFO "meye: using %d buffers with %dk (%dk total)"
+       printk(KERN_INFO "meye: using %d buffers with %dk (%dk total) "
                         "for capture\n",
                         gbuffers,
                         gbufsize / 1024, gbuffers * gbufsize / 1024);