aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-terratec.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-04-08 15:06:16 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:57:53 -0400
commit4286c6f65ec01efa8f5108cadea402ecf3b12279 (patch)
tree080fc6a8f55f0ed1c9b06b5ee8421225ebe21b5b /drivers/media/radio/radio-terratec.c
parentdcdda65fd5e70a698dd3d7e65762e178290284b7 (diff)
V4L/DVB (3753): Whitespace cleanups at media/radio
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/radio/radio-terratec.c')
-rw-r--r--drivers/media/radio/radio-terratec.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c
index fcfde2e4f195..3ac0c361b9a2 100644
--- a/drivers/media/radio/radio-terratec.c
+++ b/drivers/media/radio/radio-terratec.c
@@ -2,11 +2,11 @@
2 * (c) 1999 R. Offermanns (rolf@offermanns.de) 2 * (c) 1999 R. Offermanns (rolf@offermanns.de)
3 * based on the aimslab radio driver from M. Kirkwood 3 * based on the aimslab radio driver from M. Kirkwood
4 * many thanks to Michael Becker and Friedhelm Birth (from TerraTec) 4 * many thanks to Michael Becker and Friedhelm Birth (from TerraTec)
5 * 5 *
6 * 6 *
7 * History: 7 * History:
8 * 1999-05-21 First preview release 8 * 1999-05-21 First preview release
9 * 9 *
10 * Notes on the hardware: 10 * Notes on the hardware:
11 * There are two "main" chips on the card: 11 * There are two "main" chips on the card:
12 * - Philips OM5610 (http://www-us.semiconductors.philips.com/acrobat/datasheets/OM5610_2.pdf) 12 * - Philips OM5610 (http://www-us.semiconductors.philips.com/acrobat/datasheets/OM5610_2.pdf)
@@ -20,7 +20,7 @@
20 * (as soon i have understand how to get started :) 20 * (as soon i have understand how to get started :)
21 * If you can help me out with that, please contact me!! 21 * If you can help me out with that, please contact me!!
22 * 22 *
23 * 23 *
24 */ 24 */
25 25
26#include <linux/module.h> /* Modules */ 26#include <linux/module.h> /* Modules */
@@ -49,7 +49,7 @@
49#define WRT_EN 0x10 49#define WRT_EN 0x10
50/*******************************************************************/ 50/*******************************************************************/
51 51
52static int io = CONFIG_RADIO_TERRATEC_PORT; 52static int io = CONFIG_RADIO_TERRATEC_PORT;
53static int radio_nr = -1; 53static int radio_nr = -1;
54static spinlock_t lock; 54static spinlock_t lock;
55 55
@@ -88,15 +88,15 @@ static void tt_mute(struct tt_device *dev)
88 88
89static int tt_setvol(struct tt_device *dev, int vol) 89static int tt_setvol(struct tt_device *dev, int vol)
90{ 90{
91 91
92// printk(KERN_ERR "setvol called, vol = %d\n", vol); 92// printk(KERN_ERR "setvol called, vol = %d\n", vol);
93 93
94 if(vol == dev->curvol) { /* requested volume = current */ 94 if(vol == dev->curvol) { /* requested volume = current */
95 if (dev->muted) { /* user is unmuting the card */ 95 if (dev->muted) { /* user is unmuting the card */
96 dev->muted = 0; 96 dev->muted = 0;
97 cardWriteVol(vol); /* enable card */ 97 cardWriteVol(vol); /* enable card */
98 } 98 }
99 99
100 return 0; 100 return 0;
101 } 101 }
102 102
@@ -107,9 +107,9 @@ static int tt_setvol(struct tt_device *dev, int vol)
107 } 107 }
108 108
109 dev->muted = 0; 109 dev->muted = 0;
110 110
111 cardWriteVol(vol); 111 cardWriteVol(vol);
112 112
113 dev->curvol = vol; 113 dev->curvol = vol;
114 114
115 return 0; 115 return 0;
@@ -121,13 +121,13 @@ static int tt_setvol(struct tt_device *dev, int vol)
121/* many more or less strange things are going on here, but hey, it works :) */ 121/* many more or less strange things are going on here, but hey, it works :) */
122 122
123static int tt_setfreq(struct tt_device *dev, unsigned long freq1) 123static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
124{ 124{
125 int freq; 125 int freq;
126 int i; 126 int i;
127 int p; 127 int p;
128 int temp; 128 int temp;
129 long rest; 129 long rest;
130 130
131 unsigned char buffer[25]; /* we have to bit shift 25 registers */ 131 unsigned char buffer[25]; /* we have to bit shift 25 registers */
132 freq = freq1/160; /* convert the freq. to a nice to handle value */ 132 freq = freq1/160; /* convert the freq. to a nice to handle value */
133 for(i=24;i>-1;i--) 133 for(i=24;i>-1;i--)
@@ -142,9 +142,9 @@ static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
142 { 142 {
143 if (rest%temp == rest) 143 if (rest%temp == rest)
144 buffer[i] = 0; 144 buffer[i] = 0;
145 else 145 else
146 { 146 {
147 buffer[i] = 1; 147 buffer[i] = 1;
148 rest = rest-temp; 148 rest = rest-temp;
149 } 149 }
150 i--; 150 i--;
@@ -153,10 +153,10 @@ static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
153 } 153 }
154 154
155 spin_lock(&lock); 155 spin_lock(&lock);
156 156
157 for (i=24;i>-1;i--) /* bit shift the values to the radiocard */ 157 for (i=24;i>-1;i--) /* bit shift the values to the radiocard */
158 { 158 {
159 if (buffer[i]==1) 159 if (buffer[i]==1)
160 { 160 {
161 outb(WRT_EN|DATA, BASEPORT); 161 outb(WRT_EN|DATA, BASEPORT);
162 outb(WRT_EN|DATA|CLK_ON , BASEPORT); 162 outb(WRT_EN|DATA|CLK_ON , BASEPORT);
@@ -168,11 +168,11 @@ static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
168 outb(WRT_EN|0x00|CLK_ON , BASEPORT); 168 outb(WRT_EN|0x00|CLK_ON , BASEPORT);
169 } 169 }
170 } 170 }
171 outb(0x00, BASEPORT); 171 outb(0x00, BASEPORT);
172 172
173 spin_unlock(&lock); 173 spin_unlock(&lock);
174 174
175 return 0; 175 return 0;
176} 176}
177 177
178static int tt_getsigstr(struct tt_device *dev) /* TODO */ 178static int tt_getsigstr(struct tt_device *dev) /* TODO */
@@ -190,7 +190,7 @@ static int tt_do_ioctl(struct inode *inode, struct file *file,
190{ 190{
191 struct video_device *dev = video_devdata(file); 191 struct video_device *dev = video_devdata(file);
192 struct tt_device *tt=dev->priv; 192 struct tt_device *tt=dev->priv;
193 193
194 switch(cmd) 194 switch(cmd)
195 { 195 {
196 case VIDIOCGCAP: 196 case VIDIOCGCAP:
@@ -206,7 +206,7 @@ static int tt_do_ioctl(struct inode *inode, struct file *file,
206 case VIDIOCGTUNER: 206 case VIDIOCGTUNER:
207 { 207 {
208 struct video_tuner *v = arg; 208 struct video_tuner *v = arg;
209 if(v->tuner) /* Only 1 tuner */ 209 if(v->tuner) /* Only 1 tuner */
210 return -EINVAL; 210 return -EINVAL;
211 v->rangelow=(87*16000); 211 v->rangelow=(87*16000);
212 v->rangehigh=(108*16000); 212 v->rangehigh=(108*16000);
@@ -238,21 +238,21 @@ static int tt_do_ioctl(struct inode *inode, struct file *file,
238 return 0; 238 return 0;
239 } 239 }
240 case VIDIOCGAUDIO: 240 case VIDIOCGAUDIO:
241 { 241 {
242 struct video_audio *v = arg; 242 struct video_audio *v = arg;
243 memset(v,0, sizeof(*v)); 243 memset(v,0, sizeof(*v));
244 v->flags|=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME; 244 v->flags|=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
245 v->volume=tt->curvol * 6554; 245 v->volume=tt->curvol * 6554;
246 v->step=6554; 246 v->step=6554;
247 strcpy(v->name, "Radio"); 247 strcpy(v->name, "Radio");
248 return 0; 248 return 0;
249 } 249 }
250 case VIDIOCSAUDIO: 250 case VIDIOCSAUDIO:
251 { 251 {
252 struct video_audio *v = arg; 252 struct video_audio *v = arg;
253 if(v->audio) 253 if(v->audio)
254 return -EINVAL; 254 return -EINVAL;
255 if(v->flags&VIDEO_AUDIO_MUTE) 255 if(v->flags&VIDEO_AUDIO_MUTE)
256 tt_mute(tt); 256 tt_mute(tt);
257 else 257 else
258 tt_setvol(tt,v->volume/6554); 258 tt_setvol(tt,v->volume/6554);
@@ -296,25 +296,25 @@ static int __init terratec_init(void)
296 printk(KERN_ERR "You must set an I/O address with io=0x???\n"); 296 printk(KERN_ERR "You must set an I/O address with io=0x???\n");
297 return -EINVAL; 297 return -EINVAL;
298 } 298 }
299 if (!request_region(io, 2, "terratec")) 299 if (!request_region(io, 2, "terratec"))
300 { 300 {
301 printk(KERN_ERR "TerraTec: port 0x%x already in use\n", io); 301 printk(KERN_ERR "TerraTec: port 0x%x already in use\n", io);
302 return -EBUSY; 302 return -EBUSY;
303 } 303 }
304 304
305 terratec_radio.priv=&terratec_unit; 305 terratec_radio.priv=&terratec_unit;
306 306
307 spin_lock_init(&lock); 307 spin_lock_init(&lock);
308 308
309 if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1) 309 if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1)
310 { 310 {
311 release_region(io,2); 311 release_region(io,2);
312 return -EINVAL; 312 return -EINVAL;
313 } 313 }
314 314
315 printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n"); 315 printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n");
316 316
317 /* mute card - prevents noisy bootups */ 317 /* mute card - prevents noisy bootups */
318 318
319 /* this ensures that the volume is all the way down */ 319 /* this ensures that the volume is all the way down */
320 cardWriteVol(0); 320 cardWriteVol(0);
@@ -334,7 +334,7 @@ static void __exit terratec_cleanup_module(void)
334{ 334{
335 video_unregister_device(&terratec_radio); 335 video_unregister_device(&terratec_radio);
336 release_region(io,2); 336 release_region(io,2);
337 printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver unloaded.\n"); 337 printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver unloaded.\n");
338} 338}
339 339
340module_init(terratec_init); 340module_init(terratec_init);