linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / radio / radio-maestro.c
index fcfa6c9..36c9f5b 100644 (file)
@@ -2,7 +2,7 @@
  * (c) 2000 A. Tlalka, atlka@pg.gda.pl
  * Notes on the hardware
  *
- *  + Frequency control is done digitally
+ *  + Frequency control is done digitally 
  *  + No volume control - only mute/unmute - you have to use Aux line volume
  *  control on Maestro card to set the volume
  *  + Radio status (tuned/not_tuned and stereo/mono) is valid some time after
 #include <linux/sched.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <linux/mutex.h>
+#include <asm/semaphore.h>
 #include <linux/pci.h>
 #include <linux/videodev.h>
-#include <media/v4l2-common.h>
 
 #define DRIVER_VERSION "0.05"
 
@@ -103,9 +102,9 @@ static struct video_device maestro_radio = {
 struct radio_device {
        u16     io,     /* base of Maestro card radio io (GPIO_DATA)*/
                muted,  /* VIDEO_AUDIO_MUTE */
-               stereo, /* VIDEO_TUNER_STEREO_ON */
+               stereo, /* VIDEO_TUNER_STEREO_ON */     
                tuned;  /* signal strength (0 or 0xffff) */
-       struct mutex lock;
+       struct  semaphore lock;
 };
 
 static u32 radio_bits_get(struct radio_device *dev)
@@ -122,14 +121,14 @@ static u32 radio_bits_get(struct radio_device *dev)
        for (l=24;l--;) {
                outw(STR_CLK, io);              /* HI state */
                udelay(2);
-               if(!l)
+               if(!l) 
                        dev->tuned = inw(io) & STR_MOST ? 0 : 0xffff;
                outw(0, io);                    /* LO state */
                udelay(2);
                data <<= 1;                     /* shift data */
                rdata = inw(io);
                if(!l)
-                       dev->stereo =  rdata & STR_MOST ?
+                       dev->stereo =  rdata & STR_MOST ? 
                        0 : VIDEO_TUNER_STEREO_ON;
                else
                        if(rdata & STR_DATA)
@@ -259,9 +258,9 @@ static int radio_ioctl(struct inode *inode, struct file *file,
        struct radio_device *card = video_get_drvdata(dev);
        int ret;
 
-       mutex_lock(&card->lock);
+       down(&card->lock);
        ret = video_usercopy(inode, file, cmd, arg, radio_function);
-       mutex_unlock(&card->lock);
+       up(&card->lock);
 
        return ret;
 }
@@ -312,7 +311,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev,
        }
 
        radio_unit->io = pci_resource_start(pdev, 0) + GPIO_DATA;
-       mutex_init(&radio_unit->lock);
+       init_MUTEX(&radio_unit->lock);
 
        maestro_radio_inst = video_device_alloc();
        if (maestro_radio_inst == NULL) {