V4L/DVB (3753): Whitespace cleanups at media/radio

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Mauro Carvalho Chehab
2006-04-08 16:06:16 -03:00
parent dcdda65fd5
commit 4286c6f65e
19 changed files with 414 additions and 414 deletions

View File

@@ -39,18 +39,18 @@ static struct mutex aci_rds_mutex;
#if DEBUG
static void print_matrix(char array[], unsigned int length)
{
int i, j;
int i, j;
for (i=0; i<length; i++) {
printk(KERN_DEBUG "aci-rds: ");
for (j=7; j>=0; j--) {
printk("%d", (array[i] >> j) & 0x1);
}
if (i%8 == 0)
printk(" byte-border\n");
else
printk("\n");
}
for (i=0; i<length; i++) {
printk(KERN_DEBUG "aci-rds: ");
for (j=7; j>=0; j--) {
printk("%d", (array[i] >> j) & 0x1);
}
if (i%8 == 0)
printk(" byte-border\n");
else
printk("\n");
}
}
#endif /* DEBUG */

View File

@@ -48,7 +48,7 @@ static int rds_f_release(struct inode *in, struct file *fi)
static void print_matrix(char *ch, char out[])
{
int j;
int j;
for (j=7; j>=0; j--) {
out[7-j] = ((*ch >> j) & 0x1) + '0';

View File

@@ -298,7 +298,7 @@ static struct file_operations rtrack_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
.ioctl = rt_ioctl,
.ioctl = rt_ioctl,
.compat_ioctl = v4l_compat_ioctl32,
.llseek = no_llseek,
};
@@ -339,7 +339,7 @@ static int __init rtrack_init(void)
mutex_init(&lock);
/* mute card - prevents noisy bootups */
/* mute card - prevents noisy bootups */
/* this ensures that the volume is all the way down */
outb(0x48, io); /* volume down but still "on" */

View File

@@ -53,8 +53,8 @@ struct az_device
static int volconvert(int level)
{
level>>=14; /* Map 16bits down to 2 bit */
level&=3;
level>>=14; /* Map 16bits down to 2 bit */
level&=3;
/* convert to card-friendly values */
switch (level)

View File

@@ -62,22 +62,22 @@ static __u16 sigtable[2][4]={{5,10,30,150},{28,40,63,1000}};
static int cadet_getrds(void)
{
int rdsstat=0;
int rdsstat=0;
spin_lock(&cadet_io_lock);
outb(3,io); /* Select Decoder Control/Status */
outb(3,io); /* Select Decoder Control/Status */
outb(inb(io+1)&0x7f,io+1); /* Reset RDS detection */
spin_unlock(&cadet_io_lock);
msleep(100);
spin_lock(&cadet_io_lock);
outb(3,io); /* Select Decoder Control/Status */
outb(3,io); /* Select Decoder Control/Status */
if((inb(io+1)&0x80)!=0) {
rdsstat|=VIDEO_TUNER_RDS_ON;
rdsstat|=VIDEO_TUNER_RDS_ON;
}
if((inb(io+1)&0x10)!=0) {
rdsstat|=VIDEO_TUNER_MBS_ON;
rdsstat|=VIDEO_TUNER_MBS_ON;
}
spin_unlock(&cadet_io_lock);
return rdsstat;
@@ -86,49 +86,49 @@ static int cadet_getrds(void)
static int cadet_getstereo(void)
{
int ret = 0;
if(curtuner != 0) /* Only FM has stereo capability! */
return 0;
if(curtuner != 0) /* Only FM has stereo capability! */
return 0;
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
outb(7,io); /* Select tuner control */
if( (inb(io+1) & 0x40) == 0)
ret = 1;
spin_unlock(&cadet_io_lock);
return ret;
ret = 1;
spin_unlock(&cadet_io_lock);
return ret;
}
static unsigned cadet_gettune(void)
{
int curvol,i;
int curvol,i;
unsigned fifo=0;
/*
* Prepare for read
*/
/*
* Prepare for read
*/
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
curvol=inb(io+1); /* Save current volume/mute setting */
outb(0x00,io+1); /* Ensure WRITE-ENABLE is LOW */
outb(7,io); /* Select tuner control */
curvol=inb(io+1); /* Save current volume/mute setting */
outb(0x00,io+1); /* Ensure WRITE-ENABLE is LOW */
tunestat=0xffff;
/*
* Read the shift register
*/
for(i=0;i<25;i++) {
fifo=(fifo<<1)|((inb(io+1)>>7)&0x01);
if(i<24) {
outb(0x01,io+1);
/*
* Read the shift register
*/
for(i=0;i<25;i++) {
fifo=(fifo<<1)|((inb(io+1)>>7)&0x01);
if(i<24) {
outb(0x01,io+1);
tunestat&=inb(io+1);
outb(0x00,io+1);
}
}
outb(0x00,io+1);
}
}
/*
* Restore volume/mute setting
*/
outb(curvol,io+1);
/*
* Restore volume/mute setting
*/
outb(curvol,io+1);
spin_unlock(&cadet_io_lock);
return fifo;
@@ -136,39 +136,39 @@ static unsigned cadet_gettune(void)
static unsigned cadet_getfreq(void)
{
int i;
unsigned freq=0,test,fifo=0;
int i;
unsigned freq=0,test,fifo=0;
/*
* Read current tuning
*/
fifo=cadet_gettune();
/*
* Convert to actual frequency
*/
/*
* Convert to actual frequency
*/
if(curtuner==0) { /* FM */
test=12500;
for(i=0;i<14;i++) {
if((fifo&0x01)!=0) {
freq+=test;
}
test=test<<1;
fifo=fifo>>1;
}
freq-=10700000; /* IF frequency is 10.7 MHz */
freq=(freq*16)/1000000; /* Make it 1/16 MHz */
test=12500;
for(i=0;i<14;i++) {
if((fifo&0x01)!=0) {
freq+=test;
}
test=test<<1;
fifo=fifo>>1;
}
freq-=10700000; /* IF frequency is 10.7 MHz */
freq=(freq*16)/1000000; /* Make it 1/16 MHz */
}
if(curtuner==1) { /* AM */
freq=((fifo&0x7fff)-2010)*16;
freq=((fifo&0x7fff)-2010)*16;
}
return freq;
return freq;
}
static void cadet_settune(unsigned fifo)
{
int i;
int i;
unsigned test;
spin_lock(&cadet_io_lock);
@@ -183,7 +183,7 @@ static void cadet_settune(unsigned fifo)
outb(7,io); /* Select tuner control */
outb(test,io+1); /* Initialize for write */
for(i=0;i<25;i++) {
test|=0x01; /* Toggle SCK High */
test|=0x01; /* Toggle SCK High */
outb(test,io+1);
test&=0xfe; /* Toggle SCK Low */
outb(test,io+1);
@@ -196,48 +196,48 @@ static void cadet_settune(unsigned fifo)
static void cadet_setfreq(unsigned freq)
{
unsigned fifo;
int i,j,test;
int curvol;
unsigned fifo;
int i,j,test;
int curvol;
/*
* Formulate a fifo command
*/
/*
* Formulate a fifo command
*/
fifo=0;
if(curtuner==0) { /* FM */
test=102400;
freq=(freq*1000)/16; /* Make it kHz */
freq+=10700; /* IF is 10700 kHz */
for(i=0;i<14;i++) {
fifo=fifo<<1;
if(freq>=test) {
fifo|=0x01;
freq-=test;
}
test=test>>1;
}
test=102400;
freq=(freq*1000)/16; /* Make it kHz */
freq+=10700; /* IF is 10700 kHz */
for(i=0;i<14;i++) {
fifo=fifo<<1;
if(freq>=test) {
fifo|=0x01;
freq-=test;
}
test=test>>1;
}
}
if(curtuner==1) { /* AM */
fifo=(freq/16)+2010; /* Make it kHz */
fifo=(freq/16)+2010; /* Make it kHz */
fifo|=0x100000; /* Select AM Band */
}
/*
* Save current volume/mute setting
*/
/*
* Save current volume/mute setting
*/
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
curvol=inb(io+1);
spin_unlock(&cadet_io_lock);
curvol=inb(io+1);
spin_unlock(&cadet_io_lock);
/*
* Tune the card
*/
for(j=3;j>-1;j--) {
cadet_settune(fifo|(j<<16));
cadet_settune(fifo|(j<<16));
spin_lock(&cadet_io_lock);
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
outb(curvol,io+1);
spin_unlock(&cadet_io_lock);
@@ -246,7 +246,7 @@ static void cadet_setfreq(unsigned freq)
cadet_gettune();
if((tunestat & 0x40) == 0) { /* Tuned */
sigstrength=sigtable[curtuner][j];
sigstrength=sigtable[curtuner][j];
return;
}
}
@@ -260,23 +260,23 @@ static int cadet_getvol(void)
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
if((inb(io + 1) & 0x20) != 0)
ret = 0xffff;
outb(7,io); /* Select tuner control */
if((inb(io + 1) & 0x20) != 0)
ret = 0xffff;
spin_unlock(&cadet_io_lock);
return ret;
spin_unlock(&cadet_io_lock);
return ret;
}
static void cadet_setvol(int vol)
{
spin_lock(&cadet_io_lock);
outb(7,io); /* Select tuner control */
if(vol>0)
outb(0x20,io+1);
else
outb(0x00,io+1);
outb(7,io); /* Select tuner control */
if(vol>0)
outb(0x20,io+1);
else
outb(0x00,io+1);
spin_unlock(&cadet_io_lock);
}
@@ -288,15 +288,15 @@ static void cadet_handler(unsigned long data)
if(spin_trylock(&cadet_io_lock))
{
outb(0x3,io); /* Select RDS Decoder Control */
outb(0x3,io); /* Select RDS Decoder Control */
if((inb(io+1)&0x20)!=0) {
printk(KERN_CRIT "cadet: RDS fifo overflow\n");
printk(KERN_CRIT "cadet: RDS fifo overflow\n");
}
outb(0x80,io); /* Select RDS fifo */
while((inb(io)&0x80)!=0) {
rdsbuf[rdsin]=inb(io+1);
rdsbuf[rdsin]=inb(io+1);
if(rdsin==rdsout)
printk(KERN_WARNING "cadet: RDS buffer overflow\n");
printk(KERN_WARNING "cadet: RDS buffer overflow\n");
else
rdsin++;
}
@@ -307,7 +307,7 @@ static void cadet_handler(unsigned long data)
* Service pending read
*/
if( rdsin!=rdsout)
wake_up_interruptible(&read_queue);
wake_up_interruptible(&read_queue);
/*
* Clean up and exit
@@ -324,12 +324,12 @@ static void cadet_handler(unsigned long data)
static ssize_t cadet_read(struct file *file, char __user *data,
size_t count, loff_t *ppos)
{
int i=0;
int i=0;
unsigned char readbuf[RDS_BUFFER];
if(rdsstat==0) {
if(rdsstat==0) {
spin_lock(&cadet_io_lock);
rdsstat=1;
rdsstat=1;
outb(0x80,io); /* Select RDS fifo */
spin_unlock(&cadet_io_lock);
init_timer(&readtimer);
@@ -339,15 +339,15 @@ static ssize_t cadet_read(struct file *file, char __user *data,
add_timer(&readtimer);
}
if(rdsin==rdsout) {
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
interruptible_sleep_on(&read_queue);
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
interruptible_sleep_on(&read_queue);
}
while( i<count && rdsin!=rdsout)
readbuf[i++]=rdsbuf[rdsout++];
readbuf[i++]=rdsbuf[rdsout++];
if (copy_to_user(data,readbuf,i))
return -EFAULT;
return -EFAULT;
return i;
}
@@ -375,29 +375,29 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file,
return -EINVAL;
}
switch(v->tuner) {
case 0:
strcpy(v->name,"FM");
v->rangelow=1400; /* 87.5 MHz */
v->rangehigh=1728; /* 108.0 MHz */
v->flags=0;
v->mode=0;
v->mode|=VIDEO_MODE_AUTO;
v->signal=sigstrength;
if(cadet_getstereo()==1) {
v->flags|=VIDEO_TUNER_STEREO_ON;
}
case 0:
strcpy(v->name,"FM");
v->rangelow=1400; /* 87.5 MHz */
v->rangehigh=1728; /* 108.0 MHz */
v->flags=0;
v->mode=0;
v->mode|=VIDEO_MODE_AUTO;
v->signal=sigstrength;
if(cadet_getstereo()==1) {
v->flags|=VIDEO_TUNER_STEREO_ON;
}
v->flags|=cadet_getrds();
break;
case 1:
strcpy(v->name,"AM");
v->rangelow=8320; /* 520 kHz */
v->rangehigh=26400; /* 1650 kHz */
v->flags=0;
v->flags|=VIDEO_TUNER_LOW;
v->mode=0;
v->mode|=VIDEO_MODE_AUTO;
v->signal=sigstrength;
break;
break;
case 1:
strcpy(v->name,"AM");
v->rangelow=8320; /* 520 kHz */
v->rangehigh=26400; /* 1650 kHz */
v->flags=0;
v->flags|=VIDEO_TUNER_LOW;
v->mode=0;
v->mode|=VIDEO_MODE_AUTO;
v->signal=sigstrength;
break;
}
return 0;
}
@@ -412,18 +412,18 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file,
}
case VIDIOCGFREQ:
{
unsigned long *freq = arg;
unsigned long *freq = arg;
*freq = cadet_getfreq();
return 0;
}
case VIDIOCSFREQ:
{
unsigned long *freq = arg;
unsigned long *freq = arg;
if((curtuner==0)&&((*freq<1400)||(*freq>1728))) {
return -EINVAL;
return -EINVAL;
}
if((curtuner==1)&&((*freq<8320)||(*freq>26400))) {
return -EINVAL;
return -EINVAL;
}
cadet_setfreq(*freq);
return 0;
@@ -434,7 +434,7 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file,
memset(v,0, sizeof(*v));
v->flags=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
if(cadet_getstereo()==0) {
v->mode=VIDEO_SOUND_MONO;
v->mode=VIDEO_SOUND_MONO;
} else {
v->mode=VIDEO_SOUND_STEREO;
}
@@ -539,16 +539,16 @@ static struct pnp_driver cadet_pnp_driver = {
static int cadet_probe(void)
{
static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
int i;
for(i=0;i<8;i++) {
io=iovals[i];
io=iovals[i];
if (request_region(io, 2, "cadet-probe")) {
cadet_setfreq(1410);
cadet_setfreq(1410);
if(cadet_getfreq()==1410) {
release_region(io, 2);
return io;
return io;
}
release_region(io, 2);
}
@@ -580,11 +580,11 @@ static int __init cadet_init(void)
* Else we bail out
*/
if(io < 0) {
if(io < 0) {
#ifdef MODULE
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
#endif
goto fail;
goto fail;
}
if (!request_region(io,2,"cadet"))
goto fail;

View File

@@ -48,7 +48,7 @@ struct gemtek_device
*/
static void gemtek_mute(struct gemtek_device *dev)
{
if(dev->muted)
if(dev->muted)
return;
spin_lock(&lock);
outb(0x10, io);
@@ -101,13 +101,13 @@ static int gemtek_setfreq(struct gemtek_device *dev, unsigned long freq)
outb_p(0x07, io);
udelay(5);
/* 28 frequency bits (lsb first) */
/* 28 frequency bits (lsb first) */
for (i = 0; i < 14; i++)
if (freq & (1 << i))
one();
else
zero();
/* 36 unknown bits */
/* 36 unknown bits */
for (i = 0; i < 11; i++)
zero();
one();
@@ -211,7 +211,7 @@ static int gemtek_do_ioctl(struct inode *inode, struct file *file,
if(v->flags&VIDEO_AUDIO_MUTE)
gemtek_mute(rt);
else
gemtek_unmute(rt);
gemtek_unmute(rt);
return 0;
}
@@ -274,7 +274,7 @@ static int __init gemtek_init(void)
/* this is _maybe_ unnecessary */
outb(0x01, io);
/* mute card - prevents noisy bootups */
/* mute card - prevents noisy bootups */
gemtek_unit.muted = 0;
gemtek_mute(&gemtek_unit);

View File

@@ -80,7 +80,7 @@ static struct file_operations maxiradio_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
.ioctl = radio_ioctl,
.ioctl = radio_ioctl,
.compat_ioctl = v4l_compat_ioctl32,
.llseek = no_llseek,
};
@@ -282,21 +282,21 @@ MODULE_LICENSE("GPL");
static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
if(!request_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
goto err_out;
pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
goto err_out;
}
if (pci_enable_device(pdev))
goto err_out_free_region;
goto err_out_free_region;
radio_unit.io = pci_resource_start(pdev, 0);
mutex_init(&radio_unit.lock);
maxiradio_radio.priv = &radio_unit;
if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
printk("radio-maxiradio: can't register device!");
goto err_out_free_region;
printk("radio-maxiradio: can't register device!");
goto err_out_free_region;
}
printk(KERN_INFO "radio-maxiradio: version "

View File

@@ -38,7 +38,7 @@ struct rt_device
static void rt_mute(struct rt_device *dev)
{
if(dev->muted)
if(dev->muted)
return;
spin_lock(&lock);
outb(1, io);
@@ -58,14 +58,14 @@ static void rt_unmute(struct rt_device *dev)
static void zero(void)
{
outb_p(1, io);
outb_p(1, io);
outb_p(3, io);
outb_p(1, io);
}
static void one(void)
{
outb_p(5, io);
outb_p(5, io);
outb_p(7, io);
outb_p(5, io);
}
@@ -177,7 +177,7 @@ static int rt_do_ioctl(struct inode *inode, struct file *file,
if(v->flags&VIDEO_AUDIO_MUTE)
rt_mute(rt);
else
rt_unmute(rt);
rt_unmute(rt);
return 0;
}
@@ -236,7 +236,7 @@ static int __init rtrack2_init(void)
printk(KERN_INFO "AIMSlab Radiotrack II card driver.\n");
/* mute card - prevents noisy bootups */
/* mute card - prevents noisy bootups */
outb(1, io);
rtrack2_unit.muted = 1;

View File

@@ -29,9 +29,9 @@
struct fmi_device
{
int port;
int curvol; /* 1 or 0 */
unsigned long curfreq; /* freq in kHz */
__u32 flags;
int curvol; /* 1 or 0 */
unsigned long curfreq; /* freq in kHz */
__u32 flags;
};
static int io = -1;
@@ -51,7 +51,7 @@ static struct mutex lock;
static void outbits(int bits, unsigned int data, int port)
{
while(bits--) {
if(data & 1) {
if(data & 1) {
outb(5, port);
udelay(6);
outb(7, port);
@@ -197,9 +197,9 @@ static int fmi_do_ioctl(struct inode *inode, struct file *file,
fmi_unmute(fmi->port) : fmi_mute(fmi->port);
return 0;
}
case VIDIOCGUNIT:
case VIDIOCGUNIT:
{
struct video_unit *v = arg;
struct video_unit *v = arg;
v->video=VIDEO_NO_UNIT;
v->vbi=VIDEO_NO_UNIT;
v->radio=dev->minor;

View File

@@ -202,7 +202,7 @@ static int fmr2_setvolume(struct fmr2_device *dev)
}
static int fmr2_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
unsigned int cmd, void *arg)
{
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = dev->priv;
@@ -344,7 +344,7 @@ static int fmr2_do_ioctl(struct inode *inode, struct file *file,
}
static int fmr2_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
unsigned int cmd, unsigned long arg)
{
return video_usercopy(inode, file, cmd, arg, fmr2_do_ioctl);
}

View File

@@ -172,7 +172,7 @@ static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
spin_unlock(&lock);
return 0;
return 0;
}
static int tt_getsigstr(struct tt_device *dev) /* TODO */
@@ -314,7 +314,7 @@ static int __init terratec_init(void)
printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n");
/* mute card - prevents noisy bootups */
/* mute card - prevents noisy bootups */
/* this ensures that the volume is all the way down */
cardWriteVol(0);

View File

@@ -216,7 +216,7 @@ static int tr_do_ioctl(struct inode *inode, struct file *file,
memset(v,0, sizeof(*v));
v->flags = VIDEO_AUDIO_MUTABLE | VIDEO_AUDIO_VOLUME |
VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE;
VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE;
v->mode = curstereo? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
v->volume = curvol * 2048;
v->step = 2048;

View File

@@ -14,7 +14,7 @@
*
* 1999-05-06 - (C. van Schaik)
* - Make signal strength and stereo scans
* kinder to cpu while in delay
* kinder to cpu while in delay
* 1999-01-05 - (C. van Schaik)
* - Changed tuning to 1/160Mhz accuracy
* - Added stereo support
@@ -139,7 +139,7 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq)
udelay(1000);
inb(io+2);
udelay(1000);
udelay(1000);
if (dev->muted)
{
@@ -153,7 +153,7 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq)
if(!dev->muted)
{
zol_setvol(dev, dev->curvol);
zol_setvol(dev, dev->curvol);
}
return 0;
}
@@ -178,10 +178,10 @@ static int zol_getsigstr(struct zol_device *dev)
if (a != b)
return (0);
if ((a == 0xcf) || (a == 0xdf) /* I found this out by playing */
if ((a == 0xcf) || (a == 0xdf) /* I found this out by playing */
|| (a == 0xef)) /* with a binary scanner on the card io */
return (1);
return (0);
return (0);
}
static int zol_is_stereo (struct zol_device *dev)

View File

@@ -67,10 +67,10 @@ MODULE_SUPPORTED_DEVICE("video");
static unsigned short colorspace_conv;
module_param(colorspace_conv, ushort, 0444);
MODULE_PARM_DESC(colorspace_conv,
" Colorspace conversion:"
"\n 0 = disable, 1 = enable"
"\n Default value is 0"
);
" Colorspace conversion:"
"\n 0 = disable, 1 = enable"
"\n Default value is 0"
);
#define ABOUT "V4L-Driver for Vision CPiA based cameras"