aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2009-12-10 15:06:44 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:39 -0500
commit4b8303747474033d6d73828607eafab77c620d96 (patch)
tree067d5436767f3e08a7bca5cdda1de30234860f9b /drivers
parent0b0a860fec1a6d4cdcd0dc5241390d083a82c00d (diff)
V4L/DVB (13608): radio-sf16fmi: fix mute, add SF16-FMP to texts
Fix completely broken mute handling radio-sf16fmi. The sound was muted immediately after tuning in KRadio. Also fix typos and add SF16-FMP to the texts. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Acked-by: Petr Vandrovec <petr@vandrovec.name> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/radio/Kconfig2
-rw-r--r--drivers/media/radio/radio-sf16fmi.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index 4c2b8a246772..0fe93f2b48bd 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -215,7 +215,7 @@ config RADIO_MIROPCM20
215 module will be called radio-miropcm20. 215 module will be called radio-miropcm20.
216 216
217config RADIO_SF16FMI 217config RADIO_SF16FMI
218 tristate "SF16FMI Radio" 218 tristate "SF16-FMI/SF16-FMP Radio"
219 depends on ISA && VIDEO_V4L2 219 depends on ISA && VIDEO_V4L2
220 ---help--- 220 ---help---
221 Choose Y here if you have one of these FM radio cards. If you 221 Choose Y here if you have one of these FM radio cards. If you
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 93990b7899ec..e9ecfe11cda5 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -1,4 +1,4 @@
1/* SF16FMI radio driver for Linux radio support 1/* SF16-FMI and SF16-FMP radio driver for Linux radio support
2 * heavily based on rtrack driver... 2 * heavily based on rtrack driver...
3 * (c) 1997 M. Kirkwood 3 * (c) 1997 M. Kirkwood
4 * (c) 1998 Petr Vandrovec, vandrove@vc.cvut.cz 4 * (c) 1998 Petr Vandrovec, vandrove@vc.cvut.cz
@@ -11,7 +11,7 @@
11 * 11 *
12 * Frequency control is done digitally -- ie out(port,encodefreq(95.8)); 12 * Frequency control is done digitally -- ie out(port,encodefreq(95.8));
13 * No volume control - only mute/unmute - you have to use line volume 13 * No volume control - only mute/unmute - you have to use line volume
14 * control on SB-part of SF16FMI 14 * control on SB-part of SF16-FMI/SF16-FMP
15 * 15 *
16 * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> 16 * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
17 */ 17 */
@@ -30,14 +30,14 @@
30#include <media/v4l2-ioctl.h> 30#include <media/v4l2-ioctl.h>
31 31
32MODULE_AUTHOR("Petr Vandrovec, vandrove@vc.cvut.cz and M. Kirkwood"); 32MODULE_AUTHOR("Petr Vandrovec, vandrove@vc.cvut.cz and M. Kirkwood");
33MODULE_DESCRIPTION("A driver for the SF16MI radio."); 33MODULE_DESCRIPTION("A driver for the SF16-FMI and SF16-FMP radio.");
34MODULE_LICENSE("GPL"); 34MODULE_LICENSE("GPL");
35 35
36static int io = -1; 36static int io = -1;
37static int radio_nr = -1; 37static int radio_nr = -1;
38 38
39module_param(io, int, 0); 39module_param(io, int, 0);
40MODULE_PARM_DESC(io, "I/O address of the SF16MI card (0x284 or 0x384)"); 40MODULE_PARM_DESC(io, "I/O address of the SF16-FMI or SF16-FMP card (0x284 or 0x384)");
41module_param(radio_nr, int, 0); 41module_param(radio_nr, int, 0);
42 42
43#define RADIO_VERSION KERNEL_VERSION(0, 0, 2) 43#define RADIO_VERSION KERNEL_VERSION(0, 0, 2)
@@ -47,7 +47,7 @@ struct fmi
47 struct v4l2_device v4l2_dev; 47 struct v4l2_device v4l2_dev;
48 struct video_device vdev; 48 struct video_device vdev;
49 int io; 49 int io;
50 int curvol; /* 1 or 0 */ 50 bool mute;
51 unsigned long curfreq; /* freq in kHz */ 51 unsigned long curfreq; /* freq in kHz */
52 struct mutex lock; 52 struct mutex lock;
53}; 53};
@@ -105,7 +105,7 @@ static inline int fmi_setfreq(struct fmi *fmi, unsigned long freq)
105 outbits(8, 0xC0, fmi->io); 105 outbits(8, 0xC0, fmi->io);
106 msleep(143); /* was schedule_timeout(HZ/7) */ 106 msleep(143); /* was schedule_timeout(HZ/7) */
107 mutex_unlock(&fmi->lock); 107 mutex_unlock(&fmi->lock);
108 if (fmi->curvol) 108 if (!fmi->mute)
109 fmi_unmute(fmi); 109 fmi_unmute(fmi);
110 return 0; 110 return 0;
111} 111}
@@ -116,7 +116,7 @@ static inline int fmi_getsigstr(struct fmi *fmi)
116 int res; 116 int res;
117 117
118 mutex_lock(&fmi->lock); 118 mutex_lock(&fmi->lock);
119 val = fmi->curvol ? 0x08 : 0x00; /* unmute/mute */ 119 val = fmi->mute ? 0x00 : 0x08; /* mute/unmute */
120 outb(val, fmi->io); 120 outb(val, fmi->io);
121 outb(val | 0x10, fmi->io); 121 outb(val | 0x10, fmi->io);
122 msleep(143); /* was schedule_timeout(HZ/7) */ 122 msleep(143); /* was schedule_timeout(HZ/7) */
@@ -208,7 +208,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
208 208
209 switch (ctrl->id) { 209 switch (ctrl->id) {
210 case V4L2_CID_AUDIO_MUTE: 210 case V4L2_CID_AUDIO_MUTE:
211 ctrl->value = fmi->curvol; 211 ctrl->value = fmi->mute;
212 return 0; 212 return 0;
213 } 213 }
214 return -EINVAL; 214 return -EINVAL;
@@ -225,7 +225,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
225 fmi_mute(fmi); 225 fmi_mute(fmi);
226 else 226 else
227 fmi_unmute(fmi); 227 fmi_unmute(fmi);
228 fmi->curvol = ctrl->value; 228 fmi->mute = ctrl->value;
229 return 0; 229 return 0;
230 } 230 }
231 return -EINVAL; 231 return -EINVAL;