Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / drivers / media / radio / radio-gemtek.c
index 6418f03..162f37d 100644 (file)
@@ -6,7 +6,7 @@
  * Besides the protocol changes, this is mostly a copy of:
  *
  *    RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
- * 
+ *
  *    Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
  *    Converted to new API by Alan Cox <Alan.Cox@linux.org>
  *    Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
@@ -22,6 +22,7 @@
 #include <asm/io.h>            /* outb, outb_p                 */
 #include <asm/uaccess.h>       /* copy to/from user            */
 #include <linux/videodev.h>    /* kernel radio structs         */
+#include <media/v4l2-common.h>
 #include <linux/config.h>      /* CONFIG_RADIO_GEMTEK_PORT     */
 #include <linux/spinlock.h>
 
@@ -29,7 +30,7 @@
 #define CONFIG_RADIO_GEMTEK_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_GEMTEK_PORT; 
+static int io = CONFIG_RADIO_GEMTEK_PORT;
 static int radio_nr = -1;
 static spinlock_t lock;
 
@@ -48,7 +49,7 @@ struct gemtek_device
  */
 static void gemtek_mute(struct gemtek_device *dev)
 {
-        if(dev->muted)
+       if(dev->muted)
                return;
        spin_lock(&lock);
        outb(0x10, io);
@@ -94,20 +95,20 @@ static int gemtek_setfreq(struct gemtek_device *dev, unsigned long freq)
        freq /= 100000;
 
        spin_lock(&lock);
-       
+
        /* 2 start bits */
        outb_p(0x03, io);
        udelay(5);
        outb_p(0x07, io);
        udelay(5);
 
-        /* 28 frequency bits (lsb first) */
+       /* 28 frequency bits (lsb first) */
        for (i = 0; i < 14; i++)
                if (freq & (1 << i))
                        one();
                else
                        zero();
-        /* 36 unknown bits */
+       /* 36 unknown bits */
        for (i = 0; i < 11; i++)
                zero();
        one();
@@ -123,7 +124,7 @@ static int gemtek_setfreq(struct gemtek_device *dev, unsigned long freq)
        udelay(5);
 
        spin_unlock(&lock);
-       
+
        return 0;
 }
 
@@ -159,7 +160,7 @@ static int gemtek_do_ioctl(struct inode *inode, struct file *file,
                case VIDIOCGTUNER:
                {
                        struct video_tuner *v = arg;
-                       if(v->tuner)    /* Only 1 tuner */ 
+                       if(v->tuner)    /* Only 1 tuner */
                                return -EINVAL;
                        v->rangelow=87*16000;
                        v->rangehigh=108*16000;
@@ -193,25 +194,25 @@ static int gemtek_do_ioctl(struct inode *inode, struct file *file,
                        return 0;
                }
                case VIDIOCGAUDIO:
-               {       
+               {
                        struct video_audio *v = arg;
                        memset(v,0, sizeof(*v));
                        v->flags|=VIDEO_AUDIO_MUTABLE;
                        v->volume=1;
                        v->step=65535;
                        strcpy(v->name, "Radio");
-                       return 0;                       
+                       return 0;
                }
                case VIDIOCSAUDIO:
                {
                        struct video_audio *v = arg;
-                       if(v->audio) 
+                       if(v->audio)
                                return -EINVAL;
 
-                       if(v->flags&VIDEO_AUDIO_MUTE) 
+                       if(v->flags&VIDEO_AUDIO_MUTE)
                                gemtek_mute(rt);
                        else
-                               gemtek_unmute(rt);
+                               gemtek_unmute(rt);
 
                        return 0;
                }
@@ -233,6 +234,7 @@ static struct file_operations gemtek_fops = {
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
        .ioctl          = gemtek_ioctl,
+       .compat_ioctl   = v4l_compat_ioctl32,
        .llseek         = no_llseek,
 };
 
@@ -253,14 +255,14 @@ static int __init gemtek_init(void)
                return -EINVAL;
        }
 
-       if (!request_region(io, 4, "gemtek")) 
+       if (!request_region(io, 4, "gemtek"))
        {
                printk(KERN_ERR "gemtek: port 0x%x already in use\n", io);
                return -EBUSY;
        }
 
        gemtek_radio.priv=&gemtek_unit;
-       
+
        if(video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr)==-1)
        {
                release_region(io, 4);
@@ -273,7 +275,7 @@ static int __init gemtek_init(void)
        /* this is _maybe_ unnecessary */
        outb(0x01, io);
 
-       /* mute card - prevents noisy bootups */
+       /* mute card - prevents noisy bootups */
        gemtek_unit.muted = 0;
        gemtek_mute(&gemtek_unit);