aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-trust.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/radio-trust.c')
-rw-r--r--drivers/media/radio/radio-trust.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c
index 5a099a50d4d0..8da4badc22b4 100644
--- a/drivers/media/radio/radio-trust.c
+++ b/drivers/media/radio/radio-trust.c
@@ -1,14 +1,14 @@
1/* radio-trust.c - Trust FM Radio card driver for Linux 2.2 1/* radio-trust.c - Trust FM Radio card driver for Linux 2.2
2 * by Eric Lammerts <eric@scintilla.utwente.nl> 2 * by Eric Lammerts <eric@scintilla.utwente.nl>
3 * 3 *
4 * Based on radio-aztech.c. Original notes: 4 * Based on radio-aztech.c. Original notes:
5 * 5 *
6 * Adapted to support the Video for Linux API by 6 * Adapted to support the Video for Linux API by
7 * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by: 7 * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by:
8 * 8 *
9 * Quay Ly 9 * Quay Ly
10 * Donald Song 10 * Donald Song
11 * Jason Lewis (jlewis@twilight.vtc.vsc.edu) 11 * Jason Lewis (jlewis@twilight.vtc.vsc.edu)
12 * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) 12 * Scott McGrath (smcgrath@twilight.vtc.vsc.edu)
13 * William McGrath (wmcgrath@twilight.vtc.vsc.edu) 13 * William McGrath (wmcgrath@twilight.vtc.vsc.edu)
14 * 14 *
@@ -22,6 +22,7 @@
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <linux/videodev.h> 24#include <linux/videodev.h>
25#include <media/v4l2-common.h>
25#include <linux/config.h> /* CONFIG_RADIO_TRUST_PORT */ 26#include <linux/config.h> /* CONFIG_RADIO_TRUST_PORT */
26 27
27/* acceptable ports: 0x350 (JP3 shorted), 0x358 (JP3 open) */ 28/* acceptable ports: 0x350 (JP3 shorted), 0x358 (JP3 open) */
@@ -30,7 +31,7 @@
30#define CONFIG_RADIO_TRUST_PORT -1 31#define CONFIG_RADIO_TRUST_PORT -1
31#endif 32#endif
32 33
33static int io = CONFIG_RADIO_TRUST_PORT; 34static int io = CONFIG_RADIO_TRUST_PORT;
34static int radio_nr = -1; 35static int radio_nr = -1;
35static int ioval = 0xf; 36static int ioval = 0xf;
36static __u16 curvol; 37static __u16 curvol;
@@ -135,7 +136,7 @@ static void tr_setmute(int mute)
135static int tr_getsigstr(void) 136static int tr_getsigstr(void)
136{ 137{
137 int i, v; 138 int i, v;
138 139
139 for(i = 0, v = 0; i < 100; i++) v |= inb(io); 140 for(i = 0, v = 0; i < 100; i++) v |= inb(io);
140 return (v & 1)? 0 : 0xffff; 141 return (v & 1)? 0 : 0xffff;
141} 142}
@@ -175,7 +176,7 @@ static int tr_do_ioctl(struct inode *inode, struct file *file,
175 { 176 {
176 struct video_tuner *v = arg; 177 struct video_tuner *v = arg;
177 178
178 if(v->tuner) /* Only 1 tuner */ 179 if(v->tuner) /* Only 1 tuner */
179 return -EINVAL; 180 return -EINVAL;
180 181
181 v->rangelow = 87500 * 16; 182 v->rangelow = 87500 * 16;
@@ -211,28 +212,28 @@ static int tr_do_ioctl(struct inode *inode, struct file *file,
211 return 0; 212 return 0;
212 } 213 }
213 case VIDIOCGAUDIO: 214 case VIDIOCGAUDIO:
214 { 215 {
215 struct video_audio *v = arg; 216 struct video_audio *v = arg;
216 217
217 memset(v,0, sizeof(*v)); 218 memset(v,0, sizeof(*v));
218 v->flags = VIDEO_AUDIO_MUTABLE | VIDEO_AUDIO_VOLUME | 219 v->flags = VIDEO_AUDIO_MUTABLE | VIDEO_AUDIO_VOLUME |
219 VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE; 220 VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE;
220 v->mode = curstereo? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; 221 v->mode = curstereo? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
221 v->volume = curvol * 2048; 222 v->volume = curvol * 2048;
222 v->step = 2048; 223 v->step = 2048;
223 v->bass = curbass * 4370; 224 v->bass = curbass * 4370;
224 v->treble = curtreble * 4370; 225 v->treble = curtreble * 4370;
225 226
226 strcpy(v->name, "Trust FM Radio"); 227 strcpy(v->name, "Trust FM Radio");
227 return 0; 228 return 0;
228 } 229 }
229 case VIDIOCSAUDIO: 230 case VIDIOCSAUDIO:
230 { 231 {
231 struct video_audio *v = arg; 232 struct video_audio *v = arg;
232 233
233 if(v->audio) 234 if(v->audio)
234 return -EINVAL; 235 return -EINVAL;
235 tr_setvol(v->volume); 236 tr_setvol(v->volume);
236 tr_setbass(v->bass); 237 tr_setbass(v->bass);
237 tr_settreble(v->treble); 238 tr_settreble(v->treble);
238 tr_setstereo(v->mode & VIDEO_SOUND_STEREO); 239 tr_setstereo(v->mode & VIDEO_SOUND_STEREO);
@@ -292,7 +293,7 @@ static int __init trust_init(void)
292 write_i2c(2, TDA7318_ADDR, 0xe0); /* speaker att. RR = 0 dB */ 293 write_i2c(2, TDA7318_ADDR, 0xe0); /* speaker att. RR = 0 dB */
293 write_i2c(2, TDA7318_ADDR, 0x40); /* stereo 1 input, gain = 18.75 dB */ 294 write_i2c(2, TDA7318_ADDR, 0x40); /* stereo 1 input, gain = 18.75 dB */
294 295
295 tr_setvol(0x8000); 296 tr_setvol(0x8000);
296 tr_setbass(0x8000); 297 tr_setbass(0x8000);
297 tr_settreble(0x8000); 298 tr_settreble(0x8000);
298 tr_setstereo(1); 299 tr_setstereo(1);