summaryrefslogtreecommitdiffstats
path: root/drivers/char/radio-sf16fmi.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
commitdb7d4daea91e105e3859cf461d7e53b9b77454b2 (patch)
tree9bb65b95440af09e8aca63abe56970dd3360cc57 /drivers/char/radio-sf16fmi.c
parent9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff)
Merge with Linux 2.2.8.
Diffstat (limited to 'drivers/char/radio-sf16fmi.c')
-rw-r--r--drivers/char/radio-sf16fmi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/char/radio-sf16fmi.c b/drivers/char/radio-sf16fmi.c
index 8840bbc20..53333f082 100644
--- a/drivers/char/radio-sf16fmi.c
+++ b/drivers/char/radio-sf16fmi.c
@@ -4,6 +4,7 @@
* (c) 1998 Petr Vandrovec, vandrove@vc.cvut.cz
*
* Fitted to new interface by Alan Cox <alan.cox@linux.org>
+ * Made working and cleaned up functions <mikael.hedin@irf.se>
*
* Notes on the hardware
*
@@ -74,9 +75,10 @@ static inline void fmi_unmute(int port)
outb(0x08, port);
}
-static inline int fmi_setfreq(struct fmi_device *dev, unsigned long freq)
+static inline int fmi_setfreq(struct fmi_device *dev)
{
int myport = dev->port;
+ unsigned long freq = dev->curfreq;
int i;
outbits(16, RSF16_ENCODE(freq), myport);
@@ -191,8 +193,10 @@ static int fmi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
tmp *= 1000;
if ( tmp<RSF16_MINFREQ || tmp>RSF16_MAXFREQ )
return -EINVAL;
- fmi->curfreq = tmp;
- fmi_setfreq(fmi, fmi->curfreq);
+ /*rounding in steps of 800 to match th freq
+ that will be used */
+ fmi->curfreq = (tmp/800)*800;
+ fmi_setfreq(fmi);
return 0;
}
case VIDIOCGAUDIO:
@@ -204,7 +208,7 @@ static int fmi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
v.treble=0;
v.flags=( (!fmi->curvol)*VIDEO_AUDIO_MUTE | VIDEO_AUDIO_MUTABLE);
strcpy(v.name, "Radio");
- v.mode=VIDEO_SOUND_MONO;
+ v.mode=VIDEO_SOUND_STEREO;
v.balance=0;
v.step=0; /* No volume, just (un)mute */
if(copy_to_user(arg,&v, sizeof(v)))