From 4ac97914c6c35f6bf132071c718e034d0846b9f5 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 8 Nov 2005 21:37:43 -0800 Subject: [PATCH] v4l: 800: whitespace cleanups - Whitespace Cleanups. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/video4linux/README.cx88 | 6 +- Documentation/video4linux/bttv/Cards | 18 +- Documentation/video4linux/bttv/README | 6 +- Documentation/video4linux/bttv/Sound-FAQ | 6 +- Documentation/video4linux/lifeview.txt | 58 +-- drivers/media/common/ir-common.c | 4 +- drivers/media/video/bt832.c | 88 ++--- drivers/media/video/bt832.h | 4 +- drivers/media/video/bttv-cards.c | 260 ++++++------- drivers/media/video/bttv-driver.c | 342 ++++++++--------- drivers/media/video/bttv-gpio.c | 2 +- drivers/media/video/bttv-i2c.c | 42 +-- drivers/media/video/bttv-if.c | 4 +- drivers/media/video/bttv-risc.c | 110 +++--- drivers/media/video/bttv.h | 20 +- drivers/media/video/bttvp.h | 14 +- drivers/media/video/cx88/cx88-blackbird.c | 40 +- drivers/media/video/cx88/cx88-cards.c | 340 ++++++++--------- drivers/media/video/cx88/cx88-core.c | 40 +- drivers/media/video/cx88/cx88-dvb.c | 16 +- drivers/media/video/cx88/cx88-i2c.c | 22 +- drivers/media/video/cx88/cx88-input.c | 2 +- drivers/media/video/cx88/cx88-mpeg.c | 18 +- drivers/media/video/cx88/cx88-reg.h | 12 +- drivers/media/video/cx88/cx88-video.c | 22 +- drivers/media/video/cx88/cx88.h | 4 +- drivers/media/video/em28xx/em28xx-cards.c | 4 +- drivers/media/video/em28xx/em28xx-core.c | 28 +- drivers/media/video/em28xx/em28xx-i2c.c | 4 +- drivers/media/video/em28xx/em28xx-input.c | 52 +-- drivers/media/video/em28xx/em28xx-video.c | 10 +- drivers/media/video/em28xx/em28xx.h | 12 +- drivers/media/video/ir-kbd-gpio.c | 4 +- drivers/media/video/ir-kbd-i2c.c | 22 +- drivers/media/video/msp3400.c | 62 ++-- drivers/media/video/mt20xx.c | 204 +++++------ drivers/media/video/saa711x.c | 4 +- drivers/media/video/saa7134/saa6752hs.c | 62 ++-- drivers/media/video/saa7134/saa7134-alsa.c | 504 +++++++++++++------------- drivers/media/video/saa7134/saa7134-cards.c | 314 ++++++++-------- drivers/media/video/saa7134/saa7134-core.c | 38 +- drivers/media/video/saa7134/saa7134-dvb.c | 4 +- drivers/media/video/saa7134/saa7134-empress.c | 6 +- drivers/media/video/saa7134/saa7134-i2c.c | 14 +- drivers/media/video/saa7134/saa7134-input.c | 100 ++--- drivers/media/video/saa7134/saa7134-oss.c | 68 ++-- drivers/media/video/saa7134/saa7134-reg.h | 18 +- drivers/media/video/saa7134/saa7134-ts.c | 4 +- drivers/media/video/saa7134/saa7134-tvaudio.c | 12 +- drivers/media/video/saa7134/saa7134-video.c | 106 +++--- drivers/media/video/saa7134/saa7134.h | 12 +- drivers/media/video/tda7432.c | 16 +- drivers/media/video/tda8290.c | 2 +- drivers/media/video/tda9875.c | 56 +-- drivers/media/video/tda9887.c | 36 +- drivers/media/video/tea5767.c | 8 +- drivers/media/video/tuner-core.c | 30 +- drivers/media/video/tuner-simple.c | 106 +++--- drivers/media/video/tvaudio.c | 20 +- drivers/media/video/tveeprom.c | 20 +- drivers/media/video/tvmixer.c | 54 +-- drivers/media/video/v4l1-compat.c | 2 +- drivers/media/video/video-buf.c | 18 +- drivers/media/video/wm8775.c | 4 +- include/linux/videodev.h | 6 +- include/linux/videodev2.h | 118 +++--- include/media/audiochip.h | 14 +- include/media/tuner.h | 8 +- include/media/video-buf.h | 2 +- 69 files changed, 1844 insertions(+), 1844 deletions(-) diff --git a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88 index 0b93455bbc17..06a33a4f52fd 100644 --- a/Documentation/video4linux/README.cx88 +++ b/Documentation/video4linux/README.cx88 @@ -17,9 +17,9 @@ audio - The chip specs for the on-chip TV sound decoder are next to useless :-/ - Neverless the builtin TV sound decoder starts working now, - at least for PAL-BG. Other TV norms need other code ... - FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE - USING. + at least for PAL-BG. Other TV norms need other code ... + FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE + USING. - Most tuner chips do provide mono sound, which may or may not be useable depending on the board design. With the Hauppauge cards it works, so there is mono sound available as fallback. diff --git a/Documentation/video4linux/bttv/Cards b/Documentation/video4linux/bttv/Cards index 8f1941ede4da..d3389655ad96 100644 --- a/Documentation/video4linux/bttv/Cards +++ b/Documentation/video4linux/bttv/Cards @@ -149,11 +149,11 @@ Lifeview Flyvideo Series: 2) There is a print on the PCB: LR25 = Flyvideo (Zoran ZR36120, SAA7110A) LR26 Rev.N = Flyvideo II (Bt848) - Rev.O = Flyvideo II (Bt878) + Rev.O = Flyvideo II (Bt878) LR37 Rev.C = Flyvideo EZ (Capture only, ZR36120 + SAA7110) LR38 Rev.A1= Flyvideo II EZ (Bt848 capture only) LR50 Rev.Q = Flyvideo 98 (w/eeprom and PCI subsystem ID) - Rev.W = Flyvideo 98 (no eeprom) + Rev.W = Flyvideo 98 (no eeprom) LR51 Rev.E = Flyvideo 98 EZ (capture only) LR90 = Flyvideo 2000 (Bt878) Flyvideo 2000S (Bt878) w/Stereo TV (Package incl. LR91 daughterboard) @@ -163,7 +163,7 @@ Lifeview Flyvideo Series: LR136 = Flyvideo 2100/3100 (Low profile, SAA7130/SAA7134) LR137 = Flyvideo DV2000/DV3000 (SAA7130/SAA7134 + IEEE1394) LR138 Rev.C= Flyvideo 2000 (SAA7130) - or Flyvideo 3000 (SAA7134) w/Stereo TV + or Flyvideo 3000 (SAA7134) w/Stereo TV These exist in variations w/FM and w/Remote sometimes denoted by suffixes "FM" and "R". 3) You have a laptop (miniPCI card): @@ -197,7 +197,7 @@ Typhoon TV card series: 50680 "TV Tuner Pal BG" (blue package)= Pixelview PV-BT878P+ (Rev 9B) 50681 "TV Tuner PCI Pal I" (variant of 50680) 50682 "TView TV/FM Tuner Pal BG" = Flyvideo 98FM (LR50 Rev.Q) - Note: The package has a picture of CPH05x (which would be a real TView) + Note: The package has a picture of CPH05x (which would be a real TView) 50683 "TV Tuner PCI SECAM" (variant of 50680) 50684 "TV Tuner Pal BG" = Pixelview 878TV(Rev.3D) 50686 "TV Tuner" = KNC1 TV Station @@ -418,9 +418,9 @@ Lifetec/Medion/Tevion/Aldi -------------------------- LT9306/MD9306 = CPH061 LT9415/MD9415 = LR90 Rev.F or Rev.G - MD9592 = Avermedia TVphone98 (PCI_ID=1461:0003), PCB-Rev=M168II-B (w/TDA9873H) - MD9717 = KNC One (Rev D4, saa7134, FM1216 MK2 tuner) - MD5044 = KNC One (Rev D4, saa7134, FM1216ME MK3 tuner) + MD9592 = Avermedia TVphone98 (PCI_ID=1461:0003), PCB-Rev=M168II-B (w/TDA9873H) + MD9717 = KNC One (Rev D4, saa7134, FM1216 MK2 tuner) + MD5044 = KNC One (Rev D4, saa7134, FM1216ME MK3 tuner) Modular Technologies (www.modulartech.com) UK --------------------------------------------- @@ -453,10 +453,10 @@ Technisat Discos ADR PC-Karte ISA (no TV!) Discos ADR PC-Karte PCI (probably no TV?) Techni-PC-Sat (Sat. analog) - Rev 1.2 (zr36120, vpx3220, stv0030, saa5246, BSJE3-494A) + Rev 1.2 (zr36120, vpx3220, stv0030, saa5246, BSJE3-494A) Mediafocus I (zr36120/zr36125, drp3510, Sat. analog + ADR Radio) Mediafocus II (saa7146, Sat. analog) - SatADR Rev 2.1 (saa7146a, saa7113h, stv0056a, msp3400c, drp3510a, BSKE3-307A) + SatADR Rev 2.1 (saa7146a, saa7113h, stv0056a, msp3400c, drp3510a, BSKE3-307A) SkyStar 1 DVB (AV7110) = Technotrend Premium SkyStar 2 DVB (B2C2) (=Sky2PC) diff --git a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README index a72f4c94fb0b..7ca2154c2bf5 100644 --- a/Documentation/video4linux/bttv/README +++ b/Documentation/video4linux/bttv/README @@ -42,9 +42,9 @@ bttv uses the PCI Subsystem ID to autodetect the card type. lspci lists the Subsystem ID in the second line, looks like this: 00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02) - Subsystem: Hauppauge computer works Inc. WinTV/GO - Flags: bus master, medium devsel, latency 32, IRQ 5 - Memory at e2000000 (32-bit, prefetchable) [size=4K] + Subsystem: Hauppauge computer works Inc. WinTV/GO + Flags: bus master, medium devsel, latency 32, IRQ 5 + Memory at e2000000 (32-bit, prefetchable) [size=4K] only bt878-based cards can have a subsystem ID (which does not mean that every card really has one). bt848 cards can't have a Subsystem diff --git a/Documentation/video4linux/bttv/Sound-FAQ b/Documentation/video4linux/bttv/Sound-FAQ index 5c9822492034..1e6328f91083 100644 --- a/Documentation/video4linux/bttv/Sound-FAQ +++ b/Documentation/video4linux/bttv/Sound-FAQ @@ -61,8 +61,8 @@ line for your board. The important fields are these two: struct tvcard { [ ... ] - u32 gpiomask; - u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ + u32 gpiomask; + u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ }; gpiomask specifies which pins are used to control the audio mux chip. @@ -126,7 +126,7 @@ muxsel - video mux, input->registervalue mapping pll - same as pll= insmod option tuner_type - same as tuner= insmod option *_modulename - hint whenever some card needs this or that audio - module loaded to work properly. + module loaded to work properly. has_radio - whenever this TV card has a radio tuner. no_msp34xx - "1" disables loading of msp3400.o module no_tda9875 - "1" disables loading of tda9875.o module diff --git a/Documentation/video4linux/lifeview.txt b/Documentation/video4linux/lifeview.txt index b07ea79c2b7e..f66320bd7b67 100644 --- a/Documentation/video4linux/lifeview.txt +++ b/Documentation/video4linux/lifeview.txt @@ -10,33 +10,33 @@ bt878: ------------------------------------------------------------------------------ saa7134: - /* LifeView FlyTV Platinum FM (LR214WF) */ - /* "Peter Missel */ - .name = "LifeView FlyTV Platinum FM", - /* GP27 MDT2005 PB4 pin 10 */ - /* GP26 MDT2005 PB3 pin 9 */ - /* GP25 MDT2005 PB2 pin 8 */ - /* GP23 MDT2005 PB1 pin 7 */ - /* GP22 MDT2005 PB0 pin 6 */ - /* GP21 MDT2005 PB5 pin 11 */ - /* GP20 MDT2005 PB6 pin 12 */ - /* GP19 MDT2005 PB7 pin 13 */ - /* nc MDT2005 PA3 pin 2 */ - /* Remote MDT2005 PA2 pin 1 */ - /* GP18 MDT2005 PA1 pin 18 */ - /* nc MDT2005 PA0 pin 17 strap low */ + /* LifeView FlyTV Platinum FM (LR214WF) */ + /* "Peter Missel */ + .name = "LifeView FlyTV Platinum FM", + /* GP27 MDT2005 PB4 pin 10 */ + /* GP26 MDT2005 PB3 pin 9 */ + /* GP25 MDT2005 PB2 pin 8 */ + /* GP23 MDT2005 PB1 pin 7 */ + /* GP22 MDT2005 PB0 pin 6 */ + /* GP21 MDT2005 PB5 pin 11 */ + /* GP20 MDT2005 PB6 pin 12 */ + /* GP19 MDT2005 PB7 pin 13 */ + /* nc MDT2005 PA3 pin 2 */ + /* Remote MDT2005 PA2 pin 1 */ + /* GP18 MDT2005 PA1 pin 18 */ + /* nc MDT2005 PA0 pin 17 strap low */ - /* GP17 Strap "GP7"=High */ - /* GP16 Strap "GP6"=High - 0=Radio 1=TV - Drives SA630D ENCH1 and HEF4052 A1 pins - to do FM radio through SIF input */ - /* GP15 nc */ - /* GP14 nc */ - /* GP13 nc */ - /* GP12 Strap "GP5" = High */ - /* GP11 Strap "GP4" = High */ - /* GP10 Strap "GP3" = High */ - /* GP09 Strap "GP2" = Low */ - /* GP08 Strap "GP1" = Low */ - /* GP07.00 nc */ + /* GP17 Strap "GP7"=High */ + /* GP16 Strap "GP6"=High + 0=Radio 1=TV + Drives SA630D ENCH1 and HEF4052 A1 pins + to do FM radio through SIF input */ + /* GP15 nc */ + /* GP14 nc */ + /* GP13 nc */ + /* GP12 Strap "GP5" = High */ + /* GP11 Strap "GP4" = High */ + /* GP10 Strap "GP3" = High */ + /* GP09 Strap "GP2" = Low */ + /* GP08 Strap "GP1" = Low */ + /* GP07.00 nc */ diff --git a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c index 31fccb4f05d6..4b71fd6f7aed 100644 --- a/drivers/media/common/ir-common.c +++ b/drivers/media/common/ir-common.c @@ -116,7 +116,7 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = { [ 46 ] = KEY_BLUE, [ 24 ] = KEY_KPPLUS, /* fine tune + */ [ 25 ] = KEY_KPMINUS, /* fine tune - */ - [ 33 ] = KEY_KPDOT, + [ 33 ] = KEY_KPDOT, [ 19 ] = KEY_KPENTER, [ 34 ] = KEY_BACK, [ 35 ] = KEY_PLAYPAUSE, @@ -239,7 +239,7 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) dprintk(1,"%s: key event code=%d down=%d\n", dev->name,ir->keycode,ir->keypressed); input_report_key(dev,ir->keycode,ir->keypressed); - input_sync(dev); + input_sync(dev); } /* -------------------------------------------------------------------------- */ diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index 76c1b63ebdf2..3e42493a4e0a 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c @@ -54,36 +54,36 @@ static struct i2c_driver driver; static struct i2c_client client_template; struct bt832 { - struct i2c_client client; + struct i2c_client client; }; int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf) { int i,rc; buf[0]=0x80; // start at register 0 with auto-increment - if (1 != (rc = i2c_master_send(i2c_client_s,buf,1))) - printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc); + if (1 != (rc = i2c_master_send(i2c_client_s,buf,1))) + printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc); - for(i=0;i<65;i++) - buf[i]=0; - if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65))) - printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc); + for(i=0;i<65;i++) + buf[i]=0; + if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65))) + printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc); - // Note: On READ the first byte is the current index - // (e.g. 0x80, what we just wrote) + // Note: On READ the first byte is the current index + // (e.g. 0x80, what we just wrote) - if(1) { - int i; - printk("BT832 hexdump:\n"); - for(i=1;i<65;i++) { + if(1) { + int i; + printk("BT832 hexdump:\n"); + for(i=1;i<65;i++) { if(i!=1) { if(((i-1)%8)==0) printk(" "); - if(((i-1)%16)==0) printk("\n"); + if(((i-1)%16)==0) printk("\n"); } - printk(" %02x",buf[i]); - } - printk("\n"); - } + printk(" %02x",buf[i]); + } + printk("\n"); + } return 0; } @@ -102,13 +102,13 @@ int bt832_init(struct i2c_client *i2c_client_s) return 0; } - printk("Write 0 tp VPSTATUS\n"); - buf[0]=BT832_VP_STATUS; // Reg.52 - buf[1]= 0x00; - if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) - printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); + printk("Write 0 tp VPSTATUS\n"); + buf[0]=BT832_VP_STATUS; // Reg.52 + buf[1]= 0x00; + if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) + printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); - bt832_hexdump(i2c_client_s,buf); + bt832_hexdump(i2c_client_s,buf); // Leave low power mode: @@ -116,17 +116,17 @@ int bt832_init(struct i2c_client *i2c_client_s) buf[0]=BT832_CAM_SETUP0; //0x39 57 buf[1]=0x08; if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) - printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc); + printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc); - bt832_hexdump(i2c_client_s,buf); + bt832_hexdump(i2c_client_s,buf); printk("Write 0 tp VPSTATUS\n"); - buf[0]=BT832_VP_STATUS; // Reg.52 - buf[1]= 0x00; - if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) - printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); + buf[0]=BT832_VP_STATUS; // Reg.52 + buf[1]= 0x00; + if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) + printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); - bt832_hexdump(i2c_client_s,buf); + bt832_hexdump(i2c_client_s,buf); // Enable Output @@ -134,22 +134,22 @@ int bt832_init(struct i2c_client *i2c_client_s) buf[0]=BT832_VP_CONTROL1; // Reg.40 buf[1]= 0x27 & (~0x01); // Default | !skip if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) - printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc); + printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc); - bt832_hexdump(i2c_client_s,buf); + bt832_hexdump(i2c_client_s,buf); // for testing (even works when no camera attached) printk("bt832: *** Generate NTSC M Bars *****\n"); buf[0]=BT832_VP_TESTCONTROL0; // Reg. 42 buf[1]=3; // Generate NTSC System M bars, Generate Frame timing internally - if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) - printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc); + if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) + printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc); printk("Bt832: Camera Present: %s\n", (buf[1+BT832_CAM_STATUS] & BT832_56_CAMERA_PRESENT) ? "yes":"no"); - bt832_hexdump(i2c_client_s,buf); + bt832_hexdump(i2c_client_s,buf); kfree(buf); return 1; } @@ -162,17 +162,17 @@ static int bt832_attach(struct i2c_adapter *adap, int addr, int kind) printk("bt832_attach\n"); - client_template.adapter = adap; - client_template.addr = addr; + client_template.adapter = adap; + client_template.addr = addr; - printk("bt832: chip found @ 0x%x\n", addr<<1); + printk("bt832: chip found @ 0x%x\n", addr<<1); - if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) - return -ENOMEM; + if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) + return -ENOMEM; memset(t,0,sizeof(*t)); t->client = client_template; - i2c_set_clientdata(&t->client, t); - i2c_attach_client(&t->client); + i2c_set_clientdata(&t->client, t); + i2c_attach_client(&t->client); if(! bt832_init(&t->client)) { bt832_detach(&t->client); @@ -211,7 +211,7 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) printk("bt832: command %x\n",cmd); - switch (cmd) { + switch (cmd) { case BT832_HEXDUMP: { unsigned char *buf; buf=kmalloc(65,GFP_KERNEL); diff --git a/drivers/media/video/bt832.h b/drivers/media/video/bt832.h index 9b6a8d2c96b5..1ce8fa71f7db 100644 --- a/drivers/media/video/bt832.h +++ b/drivers/media/video/bt832.h @@ -233,8 +233,8 @@ SetInterlaceMode( spec.interlace ); /* from web: Video Sampling Digital video is a sampled form of analog video. The most common sampling schemes in use today are: - Pixel Clock Horiz Horiz Vert - Rate Total Active + Pixel Clock Horiz Horiz Vert + Rate Total Active NTSC square pixel 12.27 MHz 780 640 525 NTSC CCIR-601 13.5 MHz 858 720 525 NTSC 4FSc 14.32 MHz 910 768 525 diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index 3937da065e4f..92bb515fbe4d 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c @@ -6,7 +6,7 @@ like the big tvcards array for the most part Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2001 Gerd Knorr This program is free software; you can redistribute it and/or modify @@ -163,10 +163,10 @@ static struct CARD { { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" }, { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" }, { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" }, - { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" }, + { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" }, { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" }, { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, - { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, + { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" }, /* some cards ship with byteswapped IDs ... */ @@ -277,7 +277,7 @@ static struct CARD { { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"}, { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" }, { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" }, - { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" }, + { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" }, { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" }, { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" }, @@ -1346,17 +1346,17 @@ struct tvcard bttv_tvcards[] = { }, [BTTV_BOARD_GMV1] = { /* Adrian Cox c.type = type; @@ -2929,7 +2929,7 @@ static void flyvideo_gpio(struct bttv *btv) switch(ttype) { case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ break; - case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ + case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ break; case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ break; @@ -2945,7 +2945,7 @@ static void flyvideo_gpio(struct bttv *btv) has_radio = gpio & 0x400000; /* unknown 0x200000; * unknown2 0x100000; */ - is_capture_only = !(gpio & 0x008000); /* GPIO15 */ + is_capture_only = !(gpio & 0x008000); /* GPIO15 */ has_tda9820_tda9821 = !(gpio & 0x004000); is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */ /* @@ -2982,7 +2982,7 @@ static void miro_pinnacle_gpio(struct bttv *btv) char *info; gpio_inout(0xffffff, 0); - gpio = gpio_read(); + gpio = gpio_read(); id = ((gpio>>10) & 63) -1; msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx"); if (id < 32) { @@ -3093,7 +3093,7 @@ static void eagle_muxsel(struct bttv *btv, unsigned int input) static void gvc1100_muxsel(struct bttv *btv, unsigned int input) { - static const int masks[] = {0x30, 0x01, 0x12, 0x23}; + static const int masks[] = {0x30, 0x01, 0x12, 0x23}; gpio_write(masks[input%4]); } @@ -3161,10 +3161,10 @@ void __devinit bttv_init_card1(struct bttv *btv) switch (btv->c.type) { case BTTV_BOARD_HAUPPAUGE: case BTTV_BOARD_HAUPPAUGE878: - boot_msp34xx(btv,5); + boot_msp34xx(btv,5); break; case BTTV_BOARD_VOODOOTV_FM: - boot_msp34xx(btv,20); + boot_msp34xx(btv,20); break; case BTTV_BOARD_AVERMEDIA98: boot_msp34xx(btv,11); @@ -3192,7 +3192,7 @@ void __devinit bttv_init_card2(struct bttv *btv) int tda9887; int addr=ADDR_UNSET, radio_addr=ADDR_UNSET; - btv->tuner_type = -1; + btv->tuner_type = -1; if (BTTV_BOARD_UNKNOWN == btv->c.type) { bttv_readee(btv,eeprom_data,0xa0); @@ -3225,7 +3225,7 @@ void __devinit bttv_init_card2(struct bttv *btv) case BTTV_BOARD_HAUPPAUGEPVR: /* pick up some config infos from the eeprom */ bttv_readee(btv,eeprom_data,0xa0); - hauppauge_eeprom(btv); + hauppauge_eeprom(btv); break; case BTTV_BOARD_AVERMEDIA98: case BTTV_BOARD_AVPHONE98: @@ -3258,7 +3258,7 @@ void __devinit bttv_init_card2(struct bttv *btv) } break; case BTTV_BOARD_STB2: - if (btv->cardid == 0x3060121a) { + if (btv->cardid == 0x3060121a) { /* Fix up entry for 3DFX VoodooTV 100, which is an OEM STB card variant. */ btv->has_radio=0; @@ -3277,7 +3277,7 @@ void __devinit bttv_init_card2(struct bttv *btv) case BTTV_BOARD_OSPREY540: case BTTV_BOARD_OSPREY2000: bttv_readee(btv,eeprom_data,0xa0); - osprey_eeprom(btv); + osprey_eeprom(btv); break; case BTTV_BOARD_IDS_EAGLE: init_ids_eagle(btv); @@ -3298,7 +3298,7 @@ void __devinit bttv_init_card2(struct bttv *btv) } /* pll configuration */ - if (!(btv->id==848 && btv->revision==0x11)) { + if (!(btv->id==848 && btv->revision==0x11)) { /* defaults from card list */ if (PLL_28 == bttv_tvcards[btv->c.type].pll) { btv->pll.pll_ifreq=28636363; @@ -3309,26 +3309,26 @@ void __devinit bttv_init_card2(struct bttv *btv) btv->pll.pll_crystal=BT848_IFORM_XT1; } /* insmod options can override */ - switch (pll[btv->c.nr]) { - case 0: /* none */ + switch (pll[btv->c.nr]) { + case 0: /* none */ btv->pll.pll_crystal = 0; btv->pll.pll_ifreq = 0; btv->pll.pll_ofreq = 0; - break; - case 1: /* 28 MHz */ + break; + case 1: /* 28 MHz */ case 28: - btv->pll.pll_ifreq = 28636363; + btv->pll.pll_ifreq = 28636363; btv->pll.pll_ofreq = 0; - btv->pll.pll_crystal = BT848_IFORM_XT0; - break; - case 2: /* 35 MHz */ + btv->pll.pll_crystal = BT848_IFORM_XT0; + break; + case 2: /* 35 MHz */ case 35: - btv->pll.pll_ifreq = 35468950; + btv->pll.pll_ifreq = 35468950; btv->pll.pll_ofreq = 0; - btv->pll.pll_crystal = BT848_IFORM_XT1; - break; - } - } + btv->pll.pll_crystal = BT848_IFORM_XT1; + break; + } + } btv->pll.pll_current = -1; /* tuner configuration (from card list / autodetect / insmod option) */ @@ -3340,7 +3340,7 @@ void __devinit bttv_init_card2(struct bttv *btv) if (UNSET != bttv_tvcards[btv->c.type].tuner_type) if(UNSET == btv->tuner_type) - btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; + btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; if (UNSET != tuner[btv->c.nr]) btv->tuner_type = tuner[btv->c.nr]; printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type); @@ -3348,14 +3348,14 @@ void __devinit bttv_init_card2(struct bttv *btv) bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE, &btv->pinnacle_id); if (btv->tuner_type != UNSET) { - struct tuner_setup tun_setup; + struct tuner_setup tun_setup; - tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; + tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; tun_setup.type = btv->tuner_type; tun_setup.addr = addr; if (addr == radio_addr) - tun_setup.mode_mask = T_RADIO; + tun_setup.mode_mask = T_RADIO; bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup); } @@ -3433,11 +3433,11 @@ static void modtec_eeprom(struct bttv *btv) } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) { btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I; printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", - btv->c.nr,&eeprom_data[0x1e]); - } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) { - btv->tuner_type=TUNER_PHILIPS_NTSC; - printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", - btv->c.nr,&eeprom_data[0x1e]); + btv->c.nr,&eeprom_data[0x1e]); + } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) { + btv->tuner_type=TUNER_PHILIPS_NTSC; + printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", + btv->c.nr,&eeprom_data[0x1e]); } else { printk("bttv%d: Modtec: Unknown TunerString: %s\n", btv->c.nr,&eeprom_data[0x1e]); @@ -3502,7 +3502,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv) static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen) { u32 n; - u8 bits; + u8 bits; int i; gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG); @@ -3538,19 +3538,19 @@ static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen) static int __devinit pvr_boot(struct bttv *btv) { - const struct firmware *fw_entry; + const struct firmware *fw_entry; int rc; rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev); if (rc != 0) { printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n", btv->c.nr); - return rc; - } + return rc; + } rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size); printk(KERN_INFO "bttv%d: altera firmware upload %s\n", btv->c.nr, (rc < 0) ? "failed" : "ok"); - release_firmware(fw_entry); + release_firmware(fw_entry); return rc; } @@ -3564,33 +3564,33 @@ static void __devinit osprey_eeprom(struct bttv *btv) unsigned long serial = 0; if (btv->c.type == 0) { - /* this might be an antique... check for MMAC label in eeprom */ - if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { - unsigned char checksum = 0; - for (i =0; i<21; i++) + /* this might be an antique... check for MMAC label in eeprom */ + if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { + unsigned char checksum = 0; + for (i =0; i<21; i++) checksum += ee[i]; - if (checksum != ee[21]) + if (checksum != ee[21]) return; btv->c.type = BTTV_BOARD_OSPREY1x0_848; for (i = 12; i < 21; i++) serial *= 10, serial += ee[i] - '0'; - } + } } else { unsigned short type; - int offset = 4*16; - - for(; offset < 8*16; offset += 16) { - unsigned short checksum = 0; - /* verify the checksum */ - for(i = 0; i<14; i++) checksum += ee[i+offset]; - checksum = ~checksum; /* no idea why */ - if ((((checksum>>8)&0x0FF) == ee[offset+14]) && - ((checksum & 0x0FF) == ee[offset+15])) { - break; - } - } - - if (offset >= 8*16) + int offset = 4*16; + + for(; offset < 8*16; offset += 16) { + unsigned short checksum = 0; + /* verify the checksum */ + for(i = 0; i<14; i++) checksum += ee[i+offset]; + checksum = ~checksum; /* no idea why */ + if ((((checksum>>8)&0x0FF) == ee[offset+14]) && + ((checksum & 0x0FF) == ee[offset+15])) { + break; + } + } + + if (offset >= 8*16) return; /* found a valid descriptor */ @@ -3606,7 +3606,7 @@ static void __devinit osprey_eeprom(struct bttv *btv) btv->c.type = BTTV_BOARD_OSPREY101_848; break; - /* 878 based */ + /* 878 based */ case 0x0012: case 0x0013: btv->c.type = BTTV_BOARD_OSPREY1x0; @@ -3662,27 +3662,27 @@ static void __devinit osprey_eeprom(struct bttv *btv) /* AVermedia specific stuff, from bktr_card.c */ static int tuner_0_table[] = { - TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/, - TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/, - TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL, - TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM, - TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL, + TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/, + TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/, + TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL, + TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM, + TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL, TUNER_PHILIPS_FM1216ME_MK3 }; static int tuner_1_table[] = { - TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL, + TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, - TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */ - TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL}; + TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */ + TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL}; static void __devinit avermedia_eeprom(struct bttv *btv) { - int tuner_make,tuner_tv_fm,tuner_format,tuner=0; + int tuner_make,tuner_tv_fm,tuner_format,tuner=0; tuner_make = (eeprom_data[0x41] & 0x7); - tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; - tuner_format = (eeprom_data[0x42] & 0xf0) >> 4; + tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; + tuner_format = (eeprom_data[0x42] & 0xf0) >> 4; btv->has_remote = (eeprom_data[0x42] & 0x01); if (tuner_make == 0 || tuner_make == 2) @@ -3718,8 +3718,8 @@ void bttv_tda9880_setnorm(struct bttv *btv, int norm) dprintk("bttv_tda9880_setnorm to NTSC\n"); } else { - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff; - bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff; + bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff; + bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff; dprintk("bttv_tda9880_setnorm to PAL\n"); } /* set GPIO according */ @@ -3741,7 +3741,7 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin) gpio_inout(mask,mask); gpio_bits(mask,0); - udelay(2500); + udelay(2500); gpio_bits(mask,mask); if (bttv_gpio) @@ -3817,7 +3817,7 @@ static void __devinit init_PXC200(struct bttv *btv) udelay(10); gpio_write(1<<2); - for (i = 0; i < ARRAY_SIZE(vals); i++) { + for (i = 0; i < ARRAY_SIZE(vals); i++) { tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1); if (tmp != -1) { printk(KERN_INFO @@ -4260,30 +4260,30 @@ avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set) static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set) { - int val = 0; + int val = 0; - if (gpio_read() & 0x4000) { + if (gpio_read() & 0x4000) { v->mode = VIDEO_SOUND_MONO; return; } - if (set) { - if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */ - val = 0x0080; + if (set) { + if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */ + val = 0x0080; if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */ - val = 0x0880; - if ((v->mode & VIDEO_SOUND_LANG1) || + val = 0x0880; + if ((v->mode & VIDEO_SOUND_LANG1) || (v->mode & VIDEO_SOUND_MONO)) val = 0; gpio_bits(0x0880, val); - if (bttv_gpio) - bttv_gpio_tracking(btv,"lt9415"); - } else { + if (bttv_gpio) + bttv_gpio_tracking(btv,"lt9415"); + } else { /* autodetect doesn't work with this card :-( */ - v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | + v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; - return; - } + return; + } } /* TDA9821 on TerraTV+ Bt848, Bt878 */ @@ -4406,26 +4406,26 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set) static void windvr_audio(struct bttv *btv, struct video_audio *v, int set) { - unsigned long val = 0; - - if (set) { - if (v->mode & VIDEO_SOUND_MONO) - val = 0x040000; - if (v->mode & VIDEO_SOUND_LANG1) - val = 0; - if (v->mode & VIDEO_SOUND_LANG2) - val = 0x100000; - if (v->mode & VIDEO_SOUND_STEREO) - val = 0; - if (val) { + unsigned long val = 0; + + if (set) { + if (v->mode & VIDEO_SOUND_MONO) + val = 0x040000; + if (v->mode & VIDEO_SOUND_LANG1) + val = 0; + if (v->mode & VIDEO_SOUND_LANG2) + val = 0x100000; + if (v->mode & VIDEO_SOUND_STEREO) + val = 0; + if (val) { gpio_bits(0x140000, val); - if (bttv_gpio) - bttv_gpio_tracking(btv,"windvr"); - } - } else { - v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | - VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; - } + if (bttv_gpio) + bttv_gpio_tracking(btv,"windvr"); + } + } else { + v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | + VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; + } } /* @@ -4668,10 +4668,10 @@ static void kodicom4400r_init(struct bttv *btv) static void xguard_muxsel(struct bttv *btv, unsigned int input) { static const int masks[] = { - ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10, - ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10, - ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11, - ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11, + ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10, + ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10, + ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11, + ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11, }; gpio_write(masks[input%16]); } @@ -4776,10 +4776,10 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input) static void PXC200_muxsel(struct bttv *btv, unsigned int input) { - int rc; + int rc; long mux; int bitmask; - unsigned char buf[2]; + unsigned char buf[2]; /* Read PIC config to determine if this is a PXC200F */ /* PX_I2C_CMD_CFG*/ @@ -4809,14 +4809,14 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input) /* bitmask=0x30f; */ bitmask=0x302; /* check whether we have a PXC200A */ - if (btv->cardid == PX_PXC200A_CARDID) { + if (btv->cardid == PX_PXC200A_CARDID) { bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */ bitmask |= 7<<4; /* the DAC */ } btwrite(bitmask, BT848_GPIO_OUT_EN); bitmask = btread(BT848_GPIO_DATA); - if (btv->cardid == PX_PXC200A_CARDID) + if (btv->cardid == PX_PXC200A_CARDID) bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7); else /* older device */ bitmask = (bitmask & ~0x300) | ((mux & 3) << 8); @@ -4829,7 +4829,7 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input) * * needed because bttv-driver sets mux before calling this function */ - if (btv->cardid == PX_PXC200A_CARDID) + if (btv->cardid == PX_PXC200A_CARDID) btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM); else /* older device */ btand(~BT848_IFORM_MUXSEL,BT848_IFORM); @@ -4875,7 +4875,7 @@ void __devinit bttv_check_chipset(void) printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency); while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, dev))) { - unsigned char b; + unsigned char b; pci_read_config_byte(dev, 0x53, &b); if (bttv_debug) printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, " @@ -4885,7 +4885,7 @@ void __devinit bttv_check_chipset(void) int __devinit bttv_handle_chipset(struct bttv *btv) { - unsigned char command; + unsigned char command; if (!triton1 && !vsfx && UNSET == latency) return 0; @@ -4906,13 +4906,13 @@ int __devinit bttv_handle_chipset(struct bttv *btv) btv->triton1 = BT848_INT_ETBF; } else { /* bt878 has a bit in the pci config space for it */ - pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command); + pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command); if (triton1) command |= BT878_EN_TBFX; if (vsfx) command |= BT878_EN_VSFX; - pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command); - } + pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command); + } if (UNSET != latency) pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency); return 0; diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index f8307407e320..0005741d5514 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c @@ -3,7 +3,7 @@ bttv - Bt848 frame grabber driver Copyright (C) 1996,97,98 Ralph Metzler - & Marcus Metzler + & Marcus Metzler (c) 1999-2002 Gerd Knorr some v4l2 code lines are taken from Justin's bttv2 driver which is @@ -192,8 +192,8 @@ static u8 SRAM_Table[][60] = const struct bttv_tvnorm bttv_tvnorms[] = { /* PAL-BDGHI */ - /* max. active video is actually 922, but 924 is divisible by 4 and 3! */ - /* actually, max active PAL with HSCALE=0 is 948, NTSC is 768 - nil */ + /* max. active video is actually 922, but 924 is divisible by 4 and 3! */ + /* actually, max active PAL with HSCALE=0 is 948, NTSC is 768 - nil */ { .v4l2_id = V4L2_STD_PAL, .name = "PAL", @@ -806,9 +806,9 @@ static void bt848A_set_timing(struct bttv *btv) btv->c.nr,table_idx); /* timing change...reset timing generator address */ - btwrite(0x00, BT848_TGCTRL); - btwrite(0x02, BT848_TGCTRL); - btwrite(0x00, BT848_TGCTRL); + btwrite(0x00, BT848_TGCTRL); + btwrite(0x02, BT848_TGCTRL); + btwrite(0x00, BT848_TGCTRL); len=SRAM_Table[table_idx][0]; for(i = 1; i <= len; i++) @@ -847,7 +847,7 @@ static void bt848_hue(struct bttv *btv, int hue) /* -128 to 127 */ value = (hue >> 8) - 128; - btwrite(value & 0xff, BT848_HUE); + btwrite(value & 0xff, BT848_HUE); } static void bt848_contrast(struct bttv *btv, int cont) @@ -859,9 +859,9 @@ static void bt848_contrast(struct bttv *btv, int cont) /* 0-511 */ value = (cont >> 7); hibit = (value >> 6) & 4; - btwrite(value & 0xff, BT848_CONTRAST_LO); - btaor(hibit, ~4, BT848_E_CONTROL); - btaor(hibit, ~4, BT848_O_CONTROL); + btwrite(value & 0xff, BT848_CONTRAST_LO); + btaor(hibit, ~4, BT848_E_CONTROL); + btaor(hibit, ~4, BT848_O_CONTROL); } static void bt848_sat(struct bttv *btv, int color) @@ -873,12 +873,12 @@ static void bt848_sat(struct bttv *btv, int color) /* 0-511 for the color */ val_u = ((color * btv->opt_uv_ratio) / 50) >> 7; val_v = (((color * (100 - btv->opt_uv_ratio) / 50) >>7)*180L)/254; - hibits = (val_u >> 7) & 2; + hibits = (val_u >> 7) & 2; hibits |= (val_v >> 8) & 1; - btwrite(val_u & 0xff, BT848_SAT_U_LO); - btwrite(val_v & 0xff, BT848_SAT_V_LO); - btaor(hibits, ~3, BT848_E_CONTROL); - btaor(hibits, ~3, BT848_O_CONTROL); + btwrite(val_u & 0xff, BT848_SAT_U_LO); + btwrite(val_v & 0xff, BT848_SAT_V_LO); + btaor(hibits, ~3, BT848_E_CONTROL); + btaor(hibits, ~3, BT848_O_CONTROL); } /* ----------------------------------------------------------------------- */ @@ -891,7 +891,7 @@ video_mux(struct bttv *btv, unsigned int input) if (input >= bttv_tvcards[btv->c.type].video_inputs) return -EINVAL; - /* needed by RemoteVideo MX */ + /* needed by RemoteVideo MX */ mask2 = bttv_tvcards[btv->c.type].gpiomask2; if (mask2) gpio_inout(mask2,mask2); @@ -1055,22 +1055,22 @@ static void init_bt848(struct bttv *btv) btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL); btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM); - /* set planar and packed mode trigger points and */ - /* set rising edge of inverted GPINTR pin as irq trigger */ - btwrite(BT848_GPIO_DMA_CTL_PKTP_32| - BT848_GPIO_DMA_CTL_PLTP1_16| - BT848_GPIO_DMA_CTL_PLTP23_16| - BT848_GPIO_DMA_CTL_GPINTC| - BT848_GPIO_DMA_CTL_GPINTI, - BT848_GPIO_DMA_CTL); + /* set planar and packed mode trigger points and */ + /* set rising edge of inverted GPINTR pin as irq trigger */ + btwrite(BT848_GPIO_DMA_CTL_PKTP_32| + BT848_GPIO_DMA_CTL_PLTP1_16| + BT848_GPIO_DMA_CTL_PLTP23_16| + BT848_GPIO_DMA_CTL_GPINTC| + BT848_GPIO_DMA_CTL_GPINTI, + BT848_GPIO_DMA_CTL); val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0; - btwrite(val, BT848_E_SCLOOP); - btwrite(val, BT848_O_SCLOOP); + btwrite(val, BT848_E_SCLOOP); + btwrite(val, BT848_O_SCLOOP); - btwrite(0x20, BT848_E_VSCALE_HI); - btwrite(0x20, BT848_O_VSCALE_HI); - btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0), + btwrite(0x20, BT848_E_VSCALE_HI); + btwrite(0x20, BT848_O_VSCALE_HI); + btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0), BT848_ADC); btwrite(whitecrush_upper, BT848_WC_UP); @@ -1089,7 +1089,7 @@ static void init_bt848(struct bttv *btv) bt848_contrast(btv, btv->contrast); bt848_sat(btv, btv->saturation); - /* interrupt */ + /* interrupt */ init_irqreg(btv); } @@ -1105,7 +1105,7 @@ static void bttv_reinit_bt848(struct bttv *btv) spin_unlock_irqrestore(&btv->s_lock,flags); init_bt848(btv); - btv->pll.pll_current = -1; + btv->pll.pll_current = -1; set_input(btv,btv->input); } @@ -1398,7 +1398,7 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh, /* video4linux (1) interface */ static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf, - const struct bttv_format *fmt, + const struct bttv_format *fmt, unsigned int width, unsigned int height, enum v4l2_field field) { @@ -1521,8 +1521,8 @@ static const char *v4l1_ioctls[] = { static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) { switch (cmd) { - case BTTV_VERSION: - return BTTV_VERSION_CODE; + case BTTV_VERSION: + return BTTV_VERSION_CODE; /* *** v4l1 *** ************************************************ */ case VIDIOCGFREQ: @@ -1576,32 +1576,32 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) return 0; } - case VIDIOCGCHAN: - { - struct video_channel *v = arg; + case VIDIOCGCHAN: + { + struct video_channel *v = arg; unsigned int channel = v->channel; - if (channel >= bttv_tvcards[btv->c.type].video_inputs) - return -EINVAL; - v->tuners=0; - v->flags = VIDEO_VC_AUDIO; - v->type = VIDEO_TYPE_CAMERA; - v->norm = btv->tvnorm; + if (channel >= bttv_tvcards[btv->c.type].video_inputs) + return -EINVAL; + v->tuners=0; + v->flags = VIDEO_VC_AUDIO; + v->type = VIDEO_TYPE_CAMERA; + v->norm = btv->tvnorm; if (channel == bttv_tvcards[btv->c.type].tuner) { - strcpy(v->name,"Television"); - v->flags|=VIDEO_VC_TUNER; - v->type=VIDEO_TYPE_TV; - v->tuners=1; - } else if (channel == btv->svhs) { - strcpy(v->name,"S-Video"); - } else { - sprintf(v->name,"Composite%d",channel); + strcpy(v->name,"Television"); + v->flags|=VIDEO_VC_TUNER; + v->type=VIDEO_TYPE_TV; + v->tuners=1; + } else if (channel == btv->svhs) { + strcpy(v->name,"S-Video"); + } else { + sprintf(v->name,"Composite%d",channel); } return 0; - } - case VIDIOCSCHAN: - { - struct video_channel *v = arg; + } + case VIDIOCSCHAN: + { + struct video_channel *v = arg; unsigned int channel = v->channel; if (channel >= bttv_tvcards[btv->c.type].video_inputs) @@ -1623,7 +1623,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) return 0; } - case VIDIOCGAUDIO: + case VIDIOCGAUDIO: { struct video_audio *v = arg; @@ -1728,7 +1728,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) } else if (i->index == btv->svhs) { sprintf(i->name, "S-Video"); } else { - sprintf(i->name,"Composite%d",i->index); + sprintf(i->name,"Composite%d",i->index); } if (i->index == btv->input) { __u32 dstatus = btread(BT848_DSTATUS); @@ -2168,7 +2168,7 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv, if (0 != retval) return retval; if (locked_btres(fh->btv, RESOURCE_VBI)) - return -EBUSY; + return -EBUSY; bttv_vbi_try_fmt(fh,f); bttv_vbi_setlines(fh,btv,f->fmt.vbi.count[0]); bttv_vbi_get_fmt(fh,f); @@ -2206,9 +2206,9 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, bttv_reinit_bt848(btv); switch (cmd) { - case VIDIOCSFREQ: - case VIDIOCSTUNER: - case VIDIOCSCHAN: + case VIDIOCSFREQ: + case VIDIOCSTUNER: + case VIDIOCSCHAN: case VIDIOC_S_CTRL: case VIDIOC_S_STD: case VIDIOC_S_INPUT: @@ -2224,10 +2224,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, /* *** v4l1 *** ************************************************ */ case VIDIOCGCAP: { - struct video_capability *cap = arg; + struct video_capability *cap = arg; memset(cap,0,sizeof(*cap)); - strcpy(cap->name,btv->video_dev->name); + strcpy(cap->name,btv->video_dev->name); if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { /* vbi */ cap->type = VID_TYPE_TUNER|VID_TYPE_TELETEXT; @@ -2247,7 +2247,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, } cap->channels = bttv_tvcards[btv->c.type].video_inputs; cap->audios = bttv_tvcards[btv->c.type].audio_inputs; - return 0; + return 0; } case VIDIOCGPICT: @@ -2296,7 +2296,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, bt848_hue(btv,pic->hue); bt848_sat(btv,pic->colour); up(&fh->cap.lock); - return 0; + return 0; } case VIDIOCGWIN: @@ -2357,8 +2357,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, unsigned long end; if(!capable(CAP_SYS_ADMIN) && - !capable(CAP_SYS_RAWIO)) - return -EPERM; + !capable(CAP_SYS_RAWIO)) + return -EPERM; end = (unsigned long)fbuf->base + fbuf->height * fbuf->bytesperline; down(&fh->cap.lock); @@ -2432,7 +2432,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, } /* switch over */ - retval = bttv_switch_overlay(btv,fh,new); + retval = bttv_switch_overlay(btv,fh,new); up(&fh->cap.lock); return retval; } @@ -2571,13 +2571,13 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, return 0; } - case BTTV_VERSION: - case VIDIOCGFREQ: - case VIDIOCSFREQ: - case VIDIOCGTUNER: - case VIDIOCSTUNER: - case VIDIOCGCHAN: - case VIDIOCSCHAN: + case BTTV_VERSION: + case VIDIOCGFREQ: + case VIDIOCSFREQ: + case VIDIOCGTUNER: + case VIDIOCSTUNER: + case VIDIOCGCHAN: + case VIDIOCSCHAN: case VIDIOCGAUDIO: case VIDIOCSAUDIO: return bttv_common_ioctls(btv,cmd,arg); @@ -2589,8 +2589,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, if (0 == v4l2) return -EINVAL; - strcpy(cap->driver,"bttv"); - strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); + strcpy(cap->driver,"bttv"); + strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); cap->version = BTTV_VERSION_CODE; cap->capabilities = @@ -3097,7 +3097,7 @@ static struct video_device bttv_video_template = { .name = "UNSET", .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| - VID_TYPE_CLIPPING|VID_TYPE_SCALES, + VID_TYPE_CLIPPING|VID_TYPE_SCALES, .hardware = VID_HARDWARE_BT848, .fops = &bttv_fops, .minor = -1, @@ -3143,7 +3143,7 @@ static int radio_open(struct inode *inode, struct file *file) audio_mux(btv,AUDIO_RADIO); up(&btv->lock); - return 0; + return 0; } static int radio_release(struct inode *inode, struct file *file) @@ -3166,34 +3166,34 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, switch (cmd) { case VIDIOCGCAP: { - struct video_capability *cap = arg; + struct video_capability *cap = arg; memset(cap,0,sizeof(*cap)); - strcpy(cap->name,btv->radio_dev->name); - cap->type = VID_TYPE_TUNER; + strcpy(cap->name,btv->radio_dev->name); + cap->type = VID_TYPE_TUNER; cap->channels = 1; cap->audios = 1; - return 0; + return 0; } - case VIDIOCGTUNER: - { - struct video_tuner *v = arg; + case VIDIOCGTUNER: + { + struct video_tuner *v = arg; - if(v->tuner) - return -EINVAL; + if(v->tuner) + return -EINVAL; memset(v,0,sizeof(*v)); - strcpy(v->name, "Radio"); - bttv_call_i2c_clients(btv,cmd,v); - return 0; - } - case VIDIOCSTUNER: + strcpy(v->name, "Radio"); + bttv_call_i2c_clients(btv,cmd,v); + return 0; + } + case VIDIOCSTUNER: /* nothing to do */ return 0; case BTTV_VERSION: - case VIDIOCGFREQ: - case VIDIOCSFREQ: + case VIDIOCGFREQ: + case VIDIOCSFREQ: case VIDIOCGAUDIO: case VIDIOCSAUDIO: return bttv_common_ioctls(btv,cmd,arg); @@ -3699,7 +3699,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) } if (astat&BT848_INT_VSYNC) - btv->field_count++; + btv->field_count++; if (astat & BT848_INT_GPINT) { wake_up(&btv->gpioq); @@ -3711,13 +3711,13 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) wake_up(&btv->i2c_queue); } - if ((astat & BT848_INT_RISCI) && (stat & (4<<28))) + if ((astat & BT848_INT_RISCI) && (stat & (4<<28))) bttv_irq_switch_vbi(btv); - if ((astat & BT848_INT_RISCI) && (stat & (2<<28))) + if ((astat & BT848_INT_RISCI) && (stat & (2<<28))) bttv_irq_wakeup_top(btv); - if ((astat & BT848_INT_RISCI) && (stat & (1<<28))) + if ((astat & BT848_INT_RISCI) && (stat & (1<<28))) bttv_irq_switch_video(btv); if ((astat & BT848_INT_HLOCK) && btv->opt_automute) @@ -3744,7 +3744,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) if (count > 4) { if (count > 8 || !(astat & BT848_INT_GPINT)) { - btwrite(0, BT848_INT_MASK); + btwrite(0, BT848_INT_MASK); printk(KERN_ERR "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr); @@ -3826,7 +3826,7 @@ static int __devinit bttv_register_video(struct bttv *btv) /* video */ btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); - if (NULL == btv->video_dev) + if (NULL == btv->video_dev) goto err; if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0) goto err; @@ -3836,18 +3836,18 @@ static int __devinit bttv_register_video(struct bttv *btv) /* vbi */ btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); - if (NULL == btv->vbi_dev) + if (NULL == btv->vbi_dev) goto err; - if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) + if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) goto err; printk(KERN_INFO "bttv%d: registered device vbi%d\n", btv->c.nr,btv->vbi_dev->minor & 0x1f); - if (!btv->has_radio) + if (!btv->has_radio) return 0; /* radio */ btv->radio_dev = vdev_init(btv, &radio_template, "radio"); - if (NULL == btv->radio_dev) + if (NULL == btv->radio_dev) goto err; if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0) goto err; @@ -3868,11 +3868,11 @@ static int __devinit bttv_register_video(struct bttv *btv) static void pci_set_command(struct pci_dev *dev) { #if defined(__powerpc__) - unsigned int cmd; + unsigned int cmd; - pci_read_config_dword(dev, PCI_COMMAND, &cmd); - cmd = (cmd | PCI_COMMAND_MEMORY ); - pci_write_config_dword(dev, PCI_COMMAND, cmd); + pci_read_config_dword(dev, PCI_COMMAND, &cmd); + cmd = (cmd | PCI_COMMAND_MEMORY ); + pci_write_config_dword(dev, PCI_COMMAND, cmd); #endif } @@ -3886,21 +3886,21 @@ static int __devinit bttv_probe(struct pci_dev *dev, if (bttv_num == BTTV_MAX) return -ENOMEM; printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num); - btv=&bttvs[bttv_num]; + btv=&bttvs[bttv_num]; memset(btv,0,sizeof(*btv)); btv->c.nr = bttv_num; sprintf(btv->c.name,"bttv%d",btv->c.nr); /* initialize structs / fill in defaults */ - init_MUTEX(&btv->lock); - init_MUTEX(&btv->reslock); - spin_lock_init(&btv->s_lock); - spin_lock_init(&btv->gpio_lock); - init_waitqueue_head(&btv->gpioq); - init_waitqueue_head(&btv->i2c_queue); - INIT_LIST_HEAD(&btv->c.subs); - INIT_LIST_HEAD(&btv->capture); - INIT_LIST_HEAD(&btv->vcapture); + init_MUTEX(&btv->lock); + init_MUTEX(&btv->reslock); + spin_lock_init(&btv->s_lock); + spin_lock_init(&btv->gpio_lock); + init_waitqueue_head(&btv->gpioq); + init_waitqueue_head(&btv->i2c_queue); + INIT_LIST_HEAD(&btv->c.subs); + INIT_LIST_HEAD(&btv->capture); + INIT_LIST_HEAD(&btv->vcapture); v4l2_prio_init(&btv->prio); init_timer(&btv->timeout); @@ -3921,27 +3921,27 @@ static int __devinit bttv_probe(struct pci_dev *dev, btv->c.nr); return -EIO; } - if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) { - printk(KERN_WARNING "bttv%d: No suitable DMA available.\n", + if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) { + printk(KERN_WARNING "bttv%d: No suitable DMA available.\n", btv->c.nr); return -EIO; - } + } if (!request_mem_region(pci_resource_start(dev,0), pci_resource_len(dev,0), btv->c.name)) { - printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n", + printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n", btv->c.nr, pci_resource_start(dev,0)); return -EBUSY; } - pci_set_master(dev); + pci_set_master(dev); pci_set_command(dev); pci_set_drvdata(dev,btv); - pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); - pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); - printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", - bttv_num,btv->id, btv->revision, pci_name(dev)); - printk("irq: %d, latency: %d, mmio: 0x%lx\n", + pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); + pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); + printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", + bttv_num,btv->id, btv->revision, pci_name(dev)); + printk("irq: %d, latency: %d, mmio: 0x%lx\n", btv->c.pci->irq, lat, pci_resource_start(dev,0)); schedule(); @@ -3952,23 +3952,23 @@ static int __devinit bttv_probe(struct pci_dev *dev, goto fail1; } - /* identify card */ + /* identify card */ bttv_idcard(btv); - /* disable irqs, register irq handler */ + /* disable irqs, register irq handler */ btwrite(0, BT848_INT_MASK); - result = request_irq(btv->c.pci->irq, bttv_irq, - SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv); - if (result < 0) { - printk(KERN_ERR "bttv%d: can't get IRQ %d\n", + result = request_irq(btv->c.pci->irq, bttv_irq, + SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv); + if (result < 0) { + printk(KERN_ERR "bttv%d: can't get IRQ %d\n", bttv_num,btv->c.pci->irq); goto fail1; - } + } if (0 != bttv_handle_chipset(btv)) { result = -EIO; goto fail2; - } + } /* init options from insmod args */ btv->opt_combfilter = combfilter; @@ -3994,29 +3994,29 @@ static int __devinit bttv_probe(struct pci_dev *dev, btv->input = 0; /* initialize hardware */ - if (bttv_gpio) - bttv_gpio_tracking(btv,"pre-init"); + if (bttv_gpio) + bttv_gpio_tracking(btv,"pre-init"); bttv_risc_init_main(btv); init_bt848(btv); /* gpio */ - btwrite(0x00, BT848_GPIO_REG_INP); - btwrite(0x00, BT848_GPIO_OUT_EN); - if (bttv_verbose) - bttv_gpio_tracking(btv,"init"); + btwrite(0x00, BT848_GPIO_REG_INP); + btwrite(0x00, BT848_GPIO_OUT_EN); + if (bttv_verbose) + bttv_gpio_tracking(btv,"init"); - /* needs to be done before i2c is registered */ - bttv_init_card1(btv); + /* needs to be done before i2c is registered */ + bttv_init_card1(btv); - /* register i2c + gpio */ - init_bttv_i2c(btv); + /* register i2c + gpio */ + init_bttv_i2c(btv); - /* some card-specific stuff (needs working i2c) */ - bttv_init_card2(btv); + /* some card-specific stuff (needs working i2c) */ + bttv_init_card2(btv); init_irqreg(btv); - /* register video4linux + input */ + /* register video4linux + input */ if (!bttv_tvcards[btv->c.type].no_video) { bttv_register_video(btv); bt848_bright(btv,32768); @@ -4035,10 +4035,10 @@ static int __devinit bttv_probe(struct pci_dev *dev, /* everything is fine */ bttv_num++; - return 0; + return 0; fail2: - free_irq(btv->c.pci->irq,btv); + free_irq(btv->c.pci->irq,btv); fail1: if (btv->bt848_mmio) @@ -4051,12 +4051,12 @@ static int __devinit bttv_probe(struct pci_dev *dev, static void __devexit bttv_remove(struct pci_dev *pci_dev) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct bttv *btv = pci_get_drvdata(pci_dev); if (bttv_verbose) printk("bttv%d: unloading\n",btv->c.nr); - /* shutdown everything (DMA+IRQs) */ + /* shutdown everything (DMA+IRQs) */ btand(~15, BT848_GPIO_DMA_CTL); btwrite(0, BT848_INT_MASK); btwrite(~0x0, BT848_INT_STAT); @@ -4069,7 +4069,7 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) wake_up(&btv->gpioq); bttv_sub_del_devices(&btv->c); - /* unregister i2c_bus + input */ + /* unregister i2c_bus + input */ fini_bttv_i2c(btv); /* unregister video4linux */ @@ -4079,18 +4079,18 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) btcx_riscmem_free(btv->c.pci,&btv->main); /* free ressources */ - free_irq(btv->c.pci->irq,btv); + free_irq(btv->c.pci->irq,btv); iounmap(btv->bt848_mmio); - release_mem_region(pci_resource_start(btv->c.pci,0), - pci_resource_len(btv->c.pci,0)); + release_mem_region(pci_resource_start(btv->c.pci,0), + pci_resource_len(btv->c.pci,0)); pci_set_drvdata(pci_dev, NULL); - return; + return; } static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct bttv *btv = pci_get_drvdata(pci_dev); struct bttv_buffer_set idle; unsigned long flags; @@ -4125,7 +4125,7 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state) static int bttv_resume(struct pci_dev *pci_dev) { - struct bttv *btv = pci_get_drvdata(pci_dev); + struct bttv *btv = pci_get_drvdata(pci_dev); unsigned long flags; int err; @@ -4170,24 +4170,24 @@ static int bttv_resume(struct pci_dev *pci_dev) } static struct pci_device_id bttv_pci_tbl[] = { - {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT879, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0,} + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0,} }; MODULE_DEVICE_TABLE(pci, bttv_pci_tbl); static struct pci_driver bttv_pci_driver = { - .name = "bttv", - .id_table = bttv_pci_tbl, - .probe = bttv_probe, - .remove = __devexit_p(bttv_remove), + .name = "bttv", + .id_table = bttv_pci_tbl, + .probe = bttv_probe, + .remove = __devexit_p(bttv_remove), .suspend = bttv_suspend, .resume = bttv_resume, }; diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c index 6b280c03e398..575ce8b8e714 100644 --- a/drivers/media/video/bttv-gpio.c +++ b/drivers/media/video/bttv-gpio.c @@ -7,7 +7,7 @@ Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2003 Gerd Knorr This program is free software; you can redistribute it and/or modify diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c index e684df37eb0e..06c5965b5616 100644 --- a/drivers/media/video/bttv-i2c.c +++ b/drivers/media/video/bttv-i2c.c @@ -5,7 +5,7 @@ bttv - Bt848 frame grabber driver Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2003 Gerd Knorr This program is free software; you can redistribute it and/or modify @@ -237,7 +237,7 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last) err: if (i2c_debug) printk(" ERR: %d\n",retval); - return retval; + return retval; } static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) @@ -290,7 +290,7 @@ static struct i2c_adapter bttv_i2c_adap_hw_template = { static int attach_inform(struct i2c_client *client) { - struct bttv *btv = i2c_get_adapdata(client->adapter); + struct bttv *btv = i2c_get_adapdata(client->adapter); if (bttv_debug) printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n", @@ -300,9 +300,9 @@ static int attach_inform(struct i2c_client *client) return 0; if (btv->tuner_type != UNSET) { - struct tuner_setup tun_setup; + struct tuner_setup tun_setup; - tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; + tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; tun_setup.type = btv->tuner_type; tun_setup.addr = ADDR_UNSET; @@ -312,7 +312,7 @@ static int attach_inform(struct i2c_client *client) if (btv->pinnacle_id != UNSET) client->driver->command(client,AUDC_CONFIG_PINNACLE, &btv->pinnacle_id); - return 0; + return 0; } void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) @@ -330,43 +330,43 @@ static struct i2c_client bttv_i2c_client_template = { /* read I2C */ int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) { - unsigned char buffer = 0; + unsigned char buffer = 0; if (0 != btv->i2c_rc) return -1; if (bttv_verbose && NULL != probe_for) printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ", btv->c.nr,probe_for,addr); - btv->i2c_client.addr = addr >> 1; - if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) { + btv->i2c_client.addr = addr >> 1; + if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) { if (NULL != probe_for) { if (bttv_verbose) printk("not found\n"); } else printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n", btv->c.nr,addr); - return -1; + return -1; } if (bttv_verbose && NULL != probe_for) printk("found\n"); - return buffer; + return buffer; } /* write I2C */ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1, - unsigned char b2, int both) + unsigned char b2, int both) { - unsigned char buffer[2]; - int bytes = both ? 2 : 1; + unsigned char buffer[2]; + int bytes = both ? 2 : 1; if (0 != btv->i2c_rc) return -1; - btv->i2c_client.addr = addr >> 1; - buffer[0] = b1; - buffer[1] = b2; - if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes)) + btv->i2c_client.addr = addr >> 1; + buffer[0] = b1; + buffer[1] = b2; + if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes)) return -1; - return 0; + return 0; } /* read EEPROM content */ @@ -431,8 +431,8 @@ int __devinit init_bttv_i2c(struct bttv *btv) "bt%d #%d [%s]", btv->id, btv->c.nr, btv->use_i2c_hw ? "hw" : "sw"); - i2c_set_adapdata(&btv->c.i2c_adap, btv); - btv->i2c_client.adapter = &btv->c.i2c_adap; + i2c_set_adapdata(&btv->c.i2c_adap, btv); + btv->i2c_client.adapter = &btv->c.i2c_adap; #ifdef I2C_CLASS_TV_ANALOG if (bttv_tvcards[btv->c.type].no_video) diff --git a/drivers/media/video/bttv-if.c b/drivers/media/video/bttv-if.c index e8aada772b89..19b564ab0e92 100644 --- a/drivers/media/video/bttv-if.c +++ b/drivers/media/video/bttv-if.c @@ -1,13 +1,13 @@ /* bttv-if.c -- old gpio interface to other kernel modules - don't use in new code, will go away in 2.7 + don't use in new code, will go away in 2.7 have a look at bttv-gpio.c instead. bttv - Bt848 frame grabber driver Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2003 Gerd Knorr This program is free software; you can redistribute it and/or modify diff --git a/drivers/media/video/bttv-risc.c b/drivers/media/video/bttv-risc.c index a5ed99b89445..3028862934dd 100644 --- a/drivers/media/video/bttv-risc.c +++ b/drivers/media/video/bttv-risc.c @@ -74,27 +74,27 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, } if (bpl <= sg_dma_len(sg)-offset) { /* fits into current chunk */ - *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| + *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| BT848_RISC_EOL|bpl); - *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); - offset+=bpl; + *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); + offset+=bpl; } else { /* scanline needs to be splitted */ - todo = bpl; - *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| + todo = bpl; + *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| (sg_dma_len(sg)-offset)); - *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); - todo -= (sg_dma_len(sg)-offset); - offset = 0; - sg++; - while (todo > sg_dma_len(sg)) { - *(rp++)=cpu_to_le32(BT848_RISC_WRITE| + *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); + todo -= (sg_dma_len(sg)-offset); + offset = 0; + sg++; + while (todo > sg_dma_len(sg)) { + *(rp++)=cpu_to_le32(BT848_RISC_WRITE| sg_dma_len(sg)); - *(rp++)=cpu_to_le32(sg_dma_address(sg)); + *(rp++)=cpu_to_le32(sg_dma_address(sg)); todo -= sg_dma_len(sg); sg++; } - *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL| + *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL| todo); *(rp++)=cpu_to_le32(sg_dma_address(sg)); offset += todo; @@ -201,8 +201,8 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc, ri |= BT848_RISC_EOL; /* write risc instruction */ - *(rp++)=cpu_to_le32(ri | ylen); - *(rp++)=cpu_to_le32(((ylen >> hshift) << 16) | + *(rp++)=cpu_to_le32(ri | ylen); + *(rp++)=cpu_to_le32(((ylen >> hshift) << 16) | (ylen >> hshift)); *(rp++)=cpu_to_le32(sg_dma_address(ysg)+yoffset); yoffset += ylen; @@ -319,7 +319,7 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo, int width, int height, int interleaved, int norm) { const struct bttv_tvnorm *tvnorm = &bttv_tvnorms[norm]; - u32 xsf, sr; + u32 xsf, sr; int vdelay; int swidth = tvnorm->swidth; @@ -334,52 +334,52 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo, vdelay = tvnorm->vdelay; - xsf = (width*scaledtwidth)/swidth; - geo->hscale = ((totalwidth*4096UL)/xsf-4096); - geo->hdelay = tvnorm->hdelayx1; - geo->hdelay = (geo->hdelay*width)/swidth; - geo->hdelay &= 0x3fe; - sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512; - geo->vscale = (0x10000UL-sr) & 0x1fff; - geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | - ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0); - geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0; - geo->vdelay = vdelay; - geo->width = width; - geo->sheight = tvnorm->sheight; + xsf = (width*scaledtwidth)/swidth; + geo->hscale = ((totalwidth*4096UL)/xsf-4096); + geo->hdelay = tvnorm->hdelayx1; + geo->hdelay = (geo->hdelay*width)/swidth; + geo->hdelay &= 0x3fe; + sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512; + geo->vscale = (0x10000UL-sr) & 0x1fff; + geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | + ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0); + geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0; + geo->vdelay = vdelay; + geo->width = width; + geo->sheight = tvnorm->sheight; geo->vtotal = tvnorm->vtotal; - if (btv->opt_combfilter) { - geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); - geo->comb = (width < 769) ? 1 : 0; - } else { - geo->vtc = 0; - geo->comb = 0; - } + if (btv->opt_combfilter) { + geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); + geo->comb = (width < 769) ? 1 : 0; + } else { + geo->vtc = 0; + geo->comb = 0; + } } static void bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd) { - int off = odd ? 0x80 : 0x00; + int off = odd ? 0x80 : 0x00; if (geo->comb) btor(BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off); else btand(~BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off); - btwrite(geo->vtc, BT848_E_VTC+off); - btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off); - btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off); - btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off); - btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off); - btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off); - btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off); - btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off); - btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off); - btwrite(geo->crop, BT848_E_CROP+off); + btwrite(geo->vtc, BT848_E_VTC+off); + btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off); + btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off); + btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off); + btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off); + btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off); + btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off); + btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off); + btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off); + btwrite(geo->crop, BT848_E_CROP+off); btwrite(geo->vtotal>>8, BT848_VTOTAL_HI); - btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO); + btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO); } /* ---------------------------------------------------------- */ @@ -420,7 +420,7 @@ bttv_set_dma(struct bttv *btv, int override) } else { del_timer(&btv->timeout); } - btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); + btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); btaor(capctl, ~0x0f, BT848_CAP_CTL); if (capctl) { @@ -432,7 +432,7 @@ bttv_set_dma(struct bttv *btv, int override) } else { if (!btv->dma_on) return; - btand(~3, BT848_GPIO_DMA_CTL); + btand(~3, BT848_GPIO_DMA_CTL); btv->dma_on = 0; } return; @@ -460,19 +460,19 @@ bttv_risc_init_main(struct bttv *btv) btv->main.cpu[6] = cpu_to_le32(BT848_RISC_JUMP); btv->main.cpu[7] = cpu_to_le32(btv->main.dma + (8<<2)); - btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | + btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | BT848_FIFO_STATUS_VRO); - btv->main.cpu[9] = cpu_to_le32(0); + btv->main.cpu[9] = cpu_to_le32(0); /* bottom field */ - btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP); + btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP); btv->main.cpu[11] = cpu_to_le32(btv->main.dma + (12<<2)); - btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP); + btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP); btv->main.cpu[13] = cpu_to_le32(btv->main.dma + (14<<2)); /* jump back to top field */ btv->main.cpu[14] = cpu_to_le32(BT848_RISC_JUMP); - btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2)); + btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2)); return 0; } diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h index 26cd117a6df4..124ea41dada4 100644 --- a/drivers/media/video/bttv.h +++ b/drivers/media/video/bttv.h @@ -202,7 +202,7 @@ struct bttv_core { struct list_head subs; /* struct bttv_sub_device */ /* device config */ - unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ + unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ unsigned int type; /* card type (pointer into tvcards[]) */ char name[8]; /* dev name */ }; @@ -211,16 +211,16 @@ struct bttv; struct tvcard { - char *name; - unsigned int video_inputs; - unsigned int audio_inputs; - unsigned int tuner; - unsigned int svhs; + char *name; + unsigned int video_inputs; + unsigned int audio_inputs; + unsigned int tuner; + unsigned int svhs; unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO - u32 gpiomask; - u32 muxsel[16]; - u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ - u32 gpiomask2; /* GPIO MUX mask */ + u32 gpiomask; + u32 muxsel[16]; + u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ + u32 gpiomask2; /* GPIO MUX mask */ /* i2c audio flags */ unsigned int no_msp34xx:1; diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h index e0e7c7a84bc5..386f546f7d11 100644 --- a/drivers/media/video/bttvp.h +++ b/drivers/media/video/bttvp.h @@ -77,14 +77,14 @@ struct bttv_tvnorm { int v4l2_id; char *name; - u32 Fsc; - u16 swidth, sheight; /* scaled standard width, height */ + u32 Fsc; + u16 swidth, sheight; /* scaled standard width, height */ u16 totalwidth; u8 adelay, bdelay, iform; u32 scaledtwidth; u16 hdelayx1, hactivex1; u16 vdelay; - u8 vbipack; + u8 vbipack; u16 vtotal; int sram; }; @@ -267,8 +267,8 @@ struct bttv { /* card configuration info */ unsigned int cardid; /* pci subsystem id (bt878 based ones) */ - unsigned int tuner_type; /* tuner chip type */ - unsigned int pinnacle_id; + unsigned int tuner_type; /* tuner chip type */ + unsigned int pinnacle_id; unsigned int svhs; struct bttv_pll_info pll; int triton1; @@ -301,9 +301,9 @@ struct bttv { /* locking */ spinlock_t s_lock; - struct semaphore lock; + struct semaphore lock; int resources; - struct semaphore reslock; + struct semaphore reslock; #ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio; #endif diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index fac67d98a745..4ae3f78cccf2 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -436,7 +436,7 @@ static int memory_write(struct cx88_core *core, u32 address, u32 value) static int memory_read(struct cx88_core *core, u32 address, u32 *value) { - int retval; + int retval; u32 val; /* Warning: address is dword address (4 bytes) */ @@ -605,11 +605,11 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) u32 *dataptr; retval = register_write(dev->core, IVTV_REG_VPU, 0xFFFFFFED); - retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); - retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_REFRESH, 0x80000640); - retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_PRECHARGE, 0x1A); + retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); + retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_REFRESH, 0x80000640); + retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_PRECHARGE, 0x1A); msleep(1); - retval |= register_write(dev->core, IVTV_REG_APU, 0); + retval |= register_write(dev->core, IVTV_REG_APU, 0); if (retval < 0) dprintk(0, "Error with register_write\n"); @@ -657,13 +657,13 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) release_firmware(firmware); dprintk(0, "Firmware upload successful.\n"); - retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); - retval |= register_read(dev->core, IVTV_REG_SPU, &value); - retval |= register_write(dev->core, IVTV_REG_SPU, value & 0xFFFFFFFE); + retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); + retval |= register_read(dev->core, IVTV_REG_SPU, &value); + retval |= register_write(dev->core, IVTV_REG_SPU, value & 0xFFFFFFFE); msleep(1); retval |= register_read(dev->core, IVTV_REG_VPU, &value); - retval |= register_write(dev->core, IVTV_REG_VPU, value & 0xFFFFFFE8); + retval |= register_write(dev->core, IVTV_REG_VPU, value & 0xFFFFFFE8); if (retval < 0) dprintk(0, "Error with register_write\n"); @@ -876,7 +876,7 @@ static void blackbird_set_default_params(struct cx8802_dev *dev) au_params |= 0; } else if( params->au_bitrate.target >= - mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) + mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) { /* clamp the bitrate to the max supported by the standard */ params->au_bitrate.target = mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate; @@ -942,7 +942,7 @@ static void blackbird_set_default_params(struct cx8802_dev *dev) /* TODO: implement the stream ID stuff: ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr, ps_size, au_pesid, vi_pesid - */ + */ } #define CHECK_PARAM( name ) ( dev->params.name != params->name ) #define IF_PARAM( name ) if( CHECK_PARAM( name ) ) @@ -1068,7 +1068,7 @@ void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression * au_params |= 0; } else if( params->au_bitrate.target >= - mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) + mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) { /* clamp the bitrate to the max supported by the standard */ params->au_bitrate.target = mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate; @@ -1150,7 +1150,7 @@ void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression * /* TODO: implement the stream ID stuff: ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr, ps_size, au_pesid, vi_pesid - */ + */ UPDATE_PARAM( ts_pid_pmt ); UPDATE_PARAM( ts_pid_audio ); UPDATE_PARAM( ts_pid_video ); @@ -1712,7 +1712,7 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev, static void __devexit blackbird_remove(struct pci_dev *pci_dev) { - struct cx8802_dev *dev = pci_get_drvdata(pci_dev); + struct cx8802_dev *dev = pci_get_drvdata(pci_dev); /* blackbird */ blackbird_unregister_video(dev); @@ -1728,8 +1728,8 @@ static struct pci_device_id cx8802_pci_tbl[] = { { .vendor = 0x14f1, .device = 0x8802, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, },{ /* --- end of list --- */ } @@ -1737,10 +1737,10 @@ static struct pci_device_id cx8802_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl); static struct pci_driver blackbird_pci_driver = { - .name = "cx88-blackbird", - .id_table = cx8802_pci_tbl, - .probe = blackbird_probe, - .remove = __devexit_p(blackbird_remove), + .name = "cx88-blackbird", + .id_table = cx8802_pci_tbl, + .probe = blackbird_probe, + .remove = __devexit_p(blackbird_remove), .suspend = cx8802_suspend_common, .resume = cx8802_resume_common, }; diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index cf17da836914..504917768794 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -126,27 +126,27 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - .gpio0 = 0x03ff, + .gpio0 = 0x03ff, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, - .gpio0 = 0x03fe, + .gpio0 = 0x03fe, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, - .gpio0 = 0x03fe, + .gpio0 = 0x03fe, }}, }, - [CX88_BOARD_WINFAST2000XP_EXPERT] = { - .name = "Leadtek Winfast 2000XP Expert", - .tuner_type = TUNER_PHILIPS_4IN1, + [CX88_BOARD_WINFAST2000XP_EXPERT] = { + .name = "Leadtek Winfast 2000XP Expert", + .tuner_type = TUNER_PHILIPS_4IN1, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .tda9887_conf = TDA9887_PRESENT, - .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, .gpio0 = 0x00F5e700, .gpio1 = 0x00003004, .gpio2 = 0x00F5e700, @@ -165,15 +165,15 @@ struct cx88_board cx88_boards[] = { .gpio1 = 0x00003004, .gpio2 = 0x00F5c700, .gpio3 = 0x02000000, - }}, - .radio = { - .type = CX88_RADIO, + }}, + .radio = { + .type = CX88_RADIO, .gpio0 = 0x00F5d700, .gpio1 = 0x00003004, .gpio2 = 0x00F5d700, .gpio3 = 0x02000000, - }, - }, + }, + }, [CX88_BOARD_AVERTV_303] = { .name = "AverTV Studio 303 (M126)", .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, @@ -214,32 +214,32 @@ struct cx88_board cx88_boards[] = { .gpio1 = 0x000080c0, .gpio2 = 0x0000ff40, },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, .gpio0 = 0x000040bf, .gpio1 = 0x000080c0, .gpio2 = 0x0000ff40, },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, + .type = CX88_VMUX_SVIDEO, + .vmux = 2, .gpio0 = 0x000040bf, .gpio1 = 0x000080c0, .gpio2 = 0x0000ff40, - }}, - .radio = { + }}, + .radio = { .type = CX88_RADIO, - }, + }, }, [CX88_BOARD_WINFAST_DV2000] = { - .name = "Leadtek Winfast DV2000", - .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, + .name = "Leadtek Winfast DV2000", + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .tda9887_conf = TDA9887_PRESENT, - .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, .gpio0 = 0x0035e700, .gpio1 = 0x00003004, .gpio2 = 0x0035e700, @@ -260,14 +260,14 @@ struct cx88_board cx88_boards[] = { .gpio2 = 0x02000000, .gpio3 = 0x02000000, }}, - .radio = { + .radio = { .type = CX88_RADIO, .gpio0 = 0x0035d700, .gpio1 = 0x00007004, .gpio2 = 0x0035d700, .gpio3 = 0x02000000, }, - }, + }, [CX88_BOARD_LEADTEK_PVR2000] = { // gpio values for PAL version from regspy by DScaler .name = "Leadtek PVR 2000", @@ -296,25 +296,25 @@ struct cx88_board cx88_boards[] = { .blackbird = 1, }, [CX88_BOARD_IODATA_GVVCP3PCI] = { - .name = "IODATA GV-VCP3/PCI", + .name = "IODATA GV-VCP3/PCI", .tuner_type = TUNER_ABSENT, - .radio_type = UNSET, + .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .input = {{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 0, - },{ - .type = CX88_VMUX_COMPOSITE2, - .vmux = 1, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - }}, - }, + .type = CX88_VMUX_COMPOSITE1, + .vmux = 0, + },{ + .type = CX88_VMUX_COMPOSITE2, + .vmux = 1, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + }}, + }, [CX88_BOARD_PROLINK_PLAYTVPVR] = { - .name = "Prolink PlayTV PVR", - .tuner_type = TUNER_PHILIPS_FM1236_MK3, + .name = "Prolink PlayTV PVR", + .tuner_type = TUNER_PHILIPS_FM1236_MK3, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, @@ -348,15 +348,15 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x0000fde6, - },{ + },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? }}, - .radio = { - .type = CX88_RADIO, + .radio = { + .type = CX88_RADIO, .gpio0 = 0x0000fde2, - }, + }, .blackbird = 1, }, [CX88_BOARD_MSI_TVANYWHERE] = { @@ -372,34 +372,34 @@ struct cx88_board cx88_boards[] = { .gpio0 = 0x00000fbf, .gpio2 = 0x0000fc08, },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, .gpio0 = 0x00000fbf, .gpio2 = 0x0000fc68, },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, + .type = CX88_VMUX_SVIDEO, + .vmux = 2, .gpio0 = 0x00000fbf, .gpio2 = 0x0000fc68, - }}, + }}, }, - [CX88_BOARD_KWORLD_DVB_T] = { - .name = "KWorld/VStream XPert DVB-T", + [CX88_BOARD_KWORLD_DVB_T] = { + .name = "KWorld/VStream XPert DVB-T", .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .input = {{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, + .input = {{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, .gpio0 = 0x0700, .gpio2 = 0x0101, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, .gpio0 = 0x0700, .gpio2 = 0x0101, - }}, + }}, .dvb = 1, }, [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { @@ -425,27 +425,27 @@ struct cx88_board cx88_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x07f8, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x07f8, },{ .type = CX88_VMUX_DEBUG, .vmux = 0, .gpio0 = 0x07f9, // mono from tuner chip - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x000007fa, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x000007fa, - }}, - .radio = { - .type = CX88_RADIO, - .gpio0 = 0x000007f8, - }, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x000007fa, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000007fa, + }}, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x000007f8, + }, }, [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = { .name = "DViCO FusionHDTV 3 Gold-Q", @@ -489,28 +489,28 @@ struct cx88_board cx88_boards[] = { }}, .dvb = 1, }, - [CX88_BOARD_HAUPPAUGE_DVB_T1] = { + [CX88_BOARD_HAUPPAUGE_DVB_T1] = { .name = "Hauppauge Nova-T DVB-T", .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .input = {{ - .type = CX88_VMUX_DVB, - .vmux = 0, - }}, + .type = CX88_VMUX_DVB, + .vmux = 0, + }}, .dvb = 1, }, - [CX88_BOARD_CONEXANT_DVB_T1] = { + [CX88_BOARD_CONEXANT_DVB_T1] = { .name = "Conexant DVB-T reference design", .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .input = {{ - .type = CX88_VMUX_DVB, - .vmux = 0, - }}, + .input = {{ + .type = CX88_VMUX_DVB, + .vmux = 0, + }}, .dvb = 1, }, [CX88_BOARD_PROVIDEO_PV259] = { @@ -543,12 +543,12 @@ struct cx88_board cx88_boards[] = { .dvb = 1, }, [CX88_BOARD_DNTV_LIVE_DVB_T] = { - .name = "digitalnow DNTV Live! DVB-T", + .name = "digitalnow DNTV Live! DVB-T", .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .input = {{ + .input = {{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x00000700, @@ -705,44 +705,44 @@ struct cx88_board cx88_boards[] = { .gpio0 = 0xbf60, }, }, - [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { + [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { .name = "DViCO FusionHDTV 3 Gold-T", .tuner_type = TUNER_THOMSON_DTT7611, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x97ed, - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x97e9, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x97e9, - }}, + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x97ed, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x97e9, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x97e9, + }}, .dvb = 1, - }, - [CX88_BOARD_ADSTECH_DVB_T_PCI] = { - .name = "ADS Tech Instant TV DVB-T PCI", + }, + [CX88_BOARD_ADSTECH_DVB_T_PCI] = { + .name = "ADS Tech Instant TV DVB-T PCI", .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .input = {{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, .gpio0 = 0x0700, .gpio2 = 0x0101, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, .gpio0 = 0x0700, .gpio2 = 0x0101, - }}, + }}, .dvb = 1, }, [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = { @@ -762,18 +762,18 @@ struct cx88_board cx88_boards[] = { .radio_addr = ADDR_UNSET, .tda9887_conf = TDA9887_PRESENT, .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x87fd, - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x87f9, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x87f9, - }}, + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x87fd, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x87f9, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x87f9, + }}, .dvb = 1, }, [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = { @@ -805,23 +805,23 @@ struct cx88_board cx88_boards[] = { }, [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = { /* Alexander Wold */ - .name = "Kworld V-Stream Xpert DVD", - .tuner_type = UNSET, - .input = {{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x03000000, - .gpio1 = 0x01000000, - .gpio2 = 0x02000000, - .gpio3 = 0x00100000, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x03000000, + .name = "Kworld V-Stream Xpert DVD", + .tuner_type = UNSET, + .input = {{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x03000000, .gpio1 = 0x01000000, .gpio2 = 0x02000000, .gpio3 = 0x00100000, - }}, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x03000000, + .gpio1 = 0x01000000, + .gpio2 = 0x02000000, + .gpio3 = 0x00100000, + }}, }, [CX88_BOARD_ATI_HDTVWONDER] = { .name = "ATI HDTV Wonder", @@ -892,26 +892,26 @@ struct cx88_subid cx88_subids[] = { .subdevice = 0x00f8, .card = CX88_BOARD_ATI_WONDER_PRO, },{ - .subvendor = 0x107d, - .subdevice = 0x6611, - .card = CX88_BOARD_WINFAST2000XP_EXPERT, + .subvendor = 0x107d, + .subdevice = 0x6611, + .card = CX88_BOARD_WINFAST2000XP_EXPERT, + },{ + .subvendor = 0x107d, + .subdevice = 0x6613, /* NTSC */ + .card = CX88_BOARD_WINFAST2000XP_EXPERT, + },{ + .subvendor = 0x107d, + .subdevice = 0x6620, + .card = CX88_BOARD_WINFAST_DV2000, },{ - .subvendor = 0x107d, - .subdevice = 0x6613, /* NTSC */ - .card = CX88_BOARD_WINFAST2000XP_EXPERT, + .subvendor = 0x107d, + .subdevice = 0x663b, + .card = CX88_BOARD_LEADTEK_PVR2000, },{ .subvendor = 0x107d, - .subdevice = 0x6620, - .card = CX88_BOARD_WINFAST_DV2000, - },{ - .subvendor = 0x107d, - .subdevice = 0x663b, - .card = CX88_BOARD_LEADTEK_PVR2000, - },{ - .subvendor = 0x107d, - .subdevice = 0x663C, - .card = CX88_BOARD_LEADTEK_PVR2000, - },{ + .subdevice = 0x663C, + .card = CX88_BOARD_LEADTEK_PVR2000, + },{ .subvendor = 0x1461, .subdevice = 0x000b, .card = CX88_BOARD_AVERTV_303, @@ -920,13 +920,13 @@ struct cx88_subid cx88_subids[] = { .subdevice = 0x8606, .card = CX88_BOARD_MSI_TVANYWHERE_MASTER, },{ - .subvendor = 0x10fc, - .subdevice = 0xd003, - .card = CX88_BOARD_IODATA_GVVCP3PCI, + .subvendor = 0x10fc, + .subdevice = 0xd003, + .card = CX88_BOARD_IODATA_GVVCP3PCI, },{ - .subvendor = 0x1043, - .subdevice = 0x4823, /* with mpeg encoder */ - .card = CX88_BOARD_ASUS_PVR_416, + .subvendor = 0x1043, + .subdevice = 0x4823, /* with mpeg encoder */ + .card = CX88_BOARD_ASUS_PVR_416, },{ .subvendor = 0x17de, .subdevice = 0x08a6, @@ -943,15 +943,15 @@ struct cx88_subid cx88_subids[] = { .subvendor = 0x18ac, .subdevice = 0xdb00, .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1, - },{ + },{ .subvendor = 0x0070, .subdevice = 0x9002, .card = CX88_BOARD_HAUPPAUGE_DVB_T1, - },{ + },{ .subvendor = 0x14f1, .subdevice = 0x0187, .card = CX88_BOARD_CONEXANT_DVB_T1, - },{ + },{ .subvendor = 0x1540, .subdevice = 0x2580, .card = CX88_BOARD_PROVIDEO_PV259, @@ -960,9 +960,9 @@ struct cx88_subid cx88_subids[] = { .subdevice = 0xdb10, .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS, },{ - .subvendor = 0x1554, - .subdevice = 0x4811, - .card = CX88_BOARD_PIXELVIEW, + .subvendor = 0x1554, + .subdevice = 0x4811, + .card = CX88_BOARD_PIXELVIEW, },{ .subvendor = 0x7063, .subdevice = 0x3000, /* HD-3000 card */ @@ -987,23 +987,23 @@ struct cx88_subid cx88_subids[] = { .subvendor = 0x1421, .subdevice = 0x0334, .card = CX88_BOARD_ADSTECH_DVB_T_PCI, - },{ + },{ .subvendor = 0x153b, .subdevice = 0x1166, .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, - },{ + },{ .subvendor = 0x18ac, .subdevice = 0xd500, .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD, - },{ + },{ .subvendor = 0x1461, .subdevice = 0x8011, .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550, - },{ + },{ .subvendor = PCI_VENDOR_ID_ATI, .subdevice = 0xa101, .card = CX88_BOARD_ATI_HDTVWONDER, - },{ + },{ .subvendor = 0x107d, .subdevice = 0x665f, .card = CX88_BOARD_WINFAST_DTV1000, diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index d4d39c1751af..f01a631d0c00 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -153,26 +153,26 @@ static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist, } if (bpl <= sg_dma_len(sg)-offset) { /* fits into current chunk */ - *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|RISC_EOL|bpl); - *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); - offset+=bpl; + *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|RISC_EOL|bpl); + *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); + offset+=bpl; } else { /* scanline needs to be splitted */ - todo = bpl; - *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL| + todo = bpl; + *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL| (sg_dma_len(sg)-offset)); - *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); - todo -= (sg_dma_len(sg)-offset); - offset = 0; - sg++; - while (todo > sg_dma_len(sg)) { - *(rp++)=cpu_to_le32(RISC_WRITE| + *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); + todo -= (sg_dma_len(sg)-offset); + offset = 0; + sg++; + while (todo > sg_dma_len(sg)) { + *(rp++)=cpu_to_le32(RISC_WRITE| sg_dma_len(sg)); - *(rp++)=cpu_to_le32(sg_dma_address(sg)); + *(rp++)=cpu_to_le32(sg_dma_address(sg)); todo -= sg_dma_len(sg); sg++; } - *(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo); + *(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo); *(rp++)=cpu_to_le32(sg_dma_address(sg)); offset += todo; } @@ -309,7 +309,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "video y / packed", .cmds_start = 0x180040, .ctrl_start = 0x180400, - .cdt = 0x180400 + 64, + .cdt = 0x180400 + 64, .fifo_start = 0x180c00, .fifo_size = 0x002800, .ptr1_reg = MO_DMA21_PTR1, @@ -321,7 +321,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "video u", .cmds_start = 0x180080, .ctrl_start = 0x1804a0, - .cdt = 0x1804a0 + 64, + .cdt = 0x1804a0 + 64, .fifo_start = 0x183400, .fifo_size = 0x000800, .ptr1_reg = MO_DMA22_PTR1, @@ -333,7 +333,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "video v", .cmds_start = 0x1800c0, .ctrl_start = 0x180540, - .cdt = 0x180540 + 64, + .cdt = 0x180540 + 64, .fifo_start = 0x183c00, .fifo_size = 0x000800, .ptr1_reg = MO_DMA23_PTR1, @@ -345,7 +345,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "vbi", .cmds_start = 0x180100, .ctrl_start = 0x1805e0, - .cdt = 0x1805e0 + 64, + .cdt = 0x1805e0 + 64, .fifo_start = 0x184400, .fifo_size = 0x001000, .ptr1_reg = MO_DMA24_PTR1, @@ -357,7 +357,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "audio from", .cmds_start = 0x180140, .ctrl_start = 0x180680, - .cdt = 0x180680 + 64, + .cdt = 0x180680 + 64, .fifo_start = 0x185400, .fifo_size = 0x000200, .ptr1_reg = MO_DMA25_PTR1, @@ -369,7 +369,7 @@ struct sram_channel cx88_sram_channels[] = { .name = "audio to", .cmds_start = 0x180180, .ctrl_start = 0x180720, - .cdt = 0x180680 + 64, /* same as audio IN */ + .cdt = 0x180680 + 64, /* same as audio IN */ .fifo_start = 0x185400, /* same as audio IN */ .fifo_size = 0x000200, /* same as audio IN */ .ptr1_reg = MO_DMA26_PTR1, @@ -1137,7 +1137,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) if (!core->radio_addr) core->radio_addr = cx88_boards[core->board].radio_addr; - printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n", + printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n", core->tuner_type, core->tuner_addr<<1, core->radio_type, core->radio_addr<<1); diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 579de88e3081..3be601cfc99b 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -128,7 +128,7 @@ static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe) static u8 reset [] = { 0x50, 0x80 }; static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 }; static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF, - 0x00, 0xFF, 0x00, 0x40, 0x40 }; + 0x00, 0xFF, 0x00, 0x40, 0x40 }; static u8 dntv_extra[] = { 0xB5, 0x7A }; static u8 capt_range_cfg[] = { 0x75, 0x32 }; @@ -464,7 +464,7 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev, static void __devexit dvb_remove(struct pci_dev *pci_dev) { - struct cx8802_dev *dev = pci_get_drvdata(pci_dev); + struct cx8802_dev *dev = pci_get_drvdata(pci_dev); /* dvb */ videobuf_dvb_unregister(&dev->dvb); @@ -479,8 +479,8 @@ static struct pci_device_id cx8802_pci_tbl[] = { { .vendor = 0x14f1, .device = 0x8802, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, },{ /* --- end of list --- */ } @@ -488,10 +488,10 @@ static struct pci_device_id cx8802_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl); static struct pci_driver dvb_pci_driver = { - .name = "cx88-dvb", - .id_table = cx8802_pci_tbl, - .probe = dvb_probe, - .remove = __devexit_p(dvb_remove), + .name = "cx88-dvb", + .id_table = cx8802_pci_tbl, + .probe = dvb_probe, + .remove = __devexit_p(dvb_remove), .suspend = cx8802_suspend_common, .resume = cx8802_resume_common, }; diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 761cebd40dbd..9790d412f192 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c @@ -3,7 +3,7 @@ cx88-i2c.c -- all the i2c code is here Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 2002 Yurij Sysoev (c) 1999-2003 Gerd Knorr @@ -90,7 +90,7 @@ static int cx8800_bit_getsda(void *data) static int attach_inform(struct i2c_client *client) { - struct tuner_setup tun_setup; + struct tuner_setup tun_setup; struct cx88_core *core = i2c_get_adapdata(client->adapter); dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", @@ -98,7 +98,7 @@ static int attach_inform(struct i2c_client *client) if (!client->driver->command) return 0; - if (core->radio_type != UNSET) { + if (core->radio_type != UNSET) { if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) { tun_setup.mode_mask = T_RADIO; tun_setup.type = core->radio_type; @@ -106,8 +106,8 @@ static int attach_inform(struct i2c_client *client) client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup); } - } - if (core->tuner_type != UNSET) { + } + if (core->tuner_type != UNSET) { if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) { tun_setup.mode_mask = T_ANALOG_TV; @@ -116,7 +116,7 @@ static int attach_inform(struct i2c_client *client) client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup); } - } + } if (core->tda9887_conf) client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); @@ -159,7 +159,7 @@ static struct i2c_adapter cx8800_i2c_adap_template = { }; static struct i2c_client cx8800_i2c_client_template = { - .name = "cx88xx internal", + .name = "cx88xx internal", }; static char *i2c_devs[128] = { @@ -202,10 +202,10 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) core->i2c_adap.dev.parent = &pci->dev; strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); - core->i2c_algo.data = core; - i2c_set_adapdata(&core->i2c_adap,core); - core->i2c_adap.algo_data = &core->i2c_algo; - core->i2c_client.adapter = &core->i2c_adap; + core->i2c_algo.data = core; + i2c_set_adapdata(&core->i2c_adap,core); + core->i2c_adap.algo_data = &core->i2c_algo; + core->i2c_client.adapter = &core->i2c_adap; cx8800_bit_setscl(core,1); cx8800_bit_setsda(core,1); diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index c27fe4c36f69..38b12ebaa49e 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -553,7 +553,7 @@ void cx88_ir_irq(struct cx88_core *core) if ((ircode & 0xffff) != 0xeb04) { /* wrong address */ ir_dprintk("pulse distance decoded wrong address\n"); - break; + break; } if (((~ircode >> 24) & 0xff) != ((ircode >> 16) & 0xff)) { /* wrong checksum */ diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index 2c4fbe9258d9..35e6d0c2b872 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c @@ -316,14 +316,14 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev) spin_unlock(&dev->slock); } - /* other general errors */ - if (status & 0x1f0100) { + /* other general errors */ + if (status & 0x1f0100) { dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 ); - spin_lock(&dev->slock); + spin_lock(&dev->slock); cx8802_stop_dma(dev); - cx8802_restart_queue(dev,&dev->mpegq); - spin_unlock(&dev->slock); - } + cx8802_restart_queue(dev,&dev->mpegq); + spin_unlock(&dev->slock); + } } #define MAX_IRQ_LOOP 10 @@ -379,8 +379,8 @@ int cx8802_init_common(struct cx8802_dev *dev) } pci_read_config_byte(dev->pci, PCI_CLASS_REVISION, &dev->pci_rev); - pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); - printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, " + pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); + printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, " "latency: %d, mmio: 0x%lx\n", dev->core->name, pci_name(dev->pci), dev->pci_rev, dev->pci->irq, dev->pci_lat,pci_resource_start(dev->pci,0)); @@ -430,7 +430,7 @@ void cx8802_fini_common(struct cx8802_dev *dev) int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state) { - struct cx8802_dev *dev = pci_get_drvdata(pci_dev); + struct cx8802_dev *dev = pci_get_drvdata(pci_dev); struct cx88_core *core = dev->core; /* stop mpeg dma */ diff --git a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h index 0a3a62fc9bbb..d3bf5b17b1d4 100644 --- a/drivers/media/video/cx88/cx88-reg.h +++ b/drivers/media/video/cx88/cx88-reg.h @@ -3,9 +3,9 @@ cx88x-hw.h - CX2388x register offsets Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - 2001 Michael Eskin - 2002 Yurij Sysoev - 2003 Gerd Knorr + 2001 Michael Eskin + 2002 Yurij Sysoev + 2003 Gerd Knorr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -728,13 +728,13 @@ #define ColorFormatGamma 0x1000 #define Interlaced 0x1 -#define NonInterlaced 0x0 +#define NonInterlaced 0x0 #define FieldEven 0x1 #define FieldOdd 0x0 -#define TGReadWriteMode 0x0 -#define TGEnableMode 0x1 +#define TGReadWriteMode 0x0 +#define TGEnableMode 0x1 #define DV_CbAlign 0x0 #define DV_Y0Align 0x1 diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 4c99fc39bb2a..f22ccb65de1c 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -100,7 +100,7 @@ static struct cx88_tvnorm tvnorms[] = { .id = V4L2_STD_PAL_I, .cxiformat = VideoFormatPAL, .cxoformat = 0x181f0008, - },{ + },{ .name = "PAL-M", .id = V4L2_STD_PAL_M, .cxiformat = VideoFormatPALM, @@ -470,7 +470,7 @@ static int restart_video_queue(struct cx8800_dev *dev, struct list_head *item; if (!list_empty(&q->active)) { - buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); + buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); dprintk(2,"restart_queue [%p/%d]: restart dma\n", buf, buf->vb.i); start_video_dma(dev, q, buf); @@ -486,7 +486,7 @@ static int restart_video_queue(struct cx8800_dev *dev, for (;;) { if (list_empty(&q->queued)) return 0; - buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); + buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); if (NULL == prev) { list_del(&buf->vb.queue); list_add_tail(&buf->vb.queue,&q->active); @@ -783,7 +783,7 @@ static int video_open(struct inode *inode, struct file *file) cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); } - return 0; + return 0; } static ssize_t @@ -922,7 +922,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl) { /* struct cx88_core *core = dev->core; */ struct cx88_ctrl *c = NULL; - u32 v_sat_value; + u32 v_sat_value; u32 value; int i; @@ -1252,7 +1252,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, } int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, - struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl) + struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl) { int err; @@ -1399,7 +1399,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, cx88_get_stereo(core ,t); reg = cx_read(MO_DEVICE_STATUS); - t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; + t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; return 0; } case VIDIOC_S_TUNER: @@ -1486,7 +1486,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, struct v4l2_capability *cap = arg; memset(cap,0,sizeof(*cap)); - strcpy(cap->driver, "cx8800"); + strcpy(cap->driver, "cx8800"); strlcpy(cap->card, cx88_boards[core->board].name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); @@ -1827,8 +1827,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* print pci info */ pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); - pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); - printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " + pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); + printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " "latency: %d, mmio: 0x%lx\n", core->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq, dev->pci_lat,pci_resource_start(pci_dev,0)); @@ -1944,7 +1944,7 @@ fail_free: static void __devexit cx8800_finidev(struct pci_dev *pci_dev) { - struct cx8800_dev *dev = pci_get_drvdata(pci_dev); + struct cx8800_dev *dev = pci_get_drvdata(pci_dev); struct cx88_core *core = dev->core; /* stop thread */ diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index ea5c092a779e..baeae1ac992c 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -259,8 +259,8 @@ struct cx88_core { /* pci stuff */ int pci_bus; int pci_slot; - u32 __iomem *lmmio; - u8 __iomem *bmmio; + u32 __iomem *lmmio; + u8 __iomem *bmmio; u32 shadow[SHADOW_MAX]; int pci_irqmask; diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 59f8fa0bea60..f0860532575a 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c @@ -2,8 +2,8 @@ em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices Copyright (C) 2005 Markus Rechberger - Ludovico Cavedon - Mauro Carvalho Chehab + Ludovico Cavedon + Mauro Carvalho Chehab Based on the em2800 driver from Sascha Sommer diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index f7b8fb035c9e..227a47d6e4bd 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -2,8 +2,8 @@ em2820-core.c - driver for Empia EM2800/EM2820/2840 USB video capture devices Copyright (C) 2005 Markus Rechberger - Ludovico Cavedon - Mauro Carvalho Chehab + Ludovico Cavedon + Mauro Carvalho Chehab Based on the em2800 driver from Sascha Sommer @@ -33,32 +33,32 @@ /* #define ENABLE_DEBUG_ISOC_FRAMES */ -unsigned int core_debug = 0; +unsigned int core_debug; module_param(core_debug,int,0644); MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); #define em2820_coredbg(fmt, arg...) do {\ - if (core_debug) \ - printk(KERN_INFO "%s %s :"fmt, \ - dev->name, __FUNCTION__ , ##arg); } while (0) + if (core_debug) \ + printk(KERN_INFO "%s %s :"fmt, \ + dev->name, __FUNCTION__ , ##arg); } while (0) -unsigned int reg_debug = 0; +unsigned int reg_debug; module_param(reg_debug,int,0644); MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); #define em2820_regdbg(fmt, arg...) do {\ - if (reg_debug) \ - printk(KERN_INFO "%s %s :"fmt, \ - dev->name, __FUNCTION__ , ##arg); } while (0) + if (reg_debug) \ + printk(KERN_INFO "%s %s :"fmt, \ + dev->name, __FUNCTION__ , ##arg); } while (0) -unsigned int isoc_debug = 0; +unsigned int isoc_debug; module_param(isoc_debug,int,0644); MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); #define em2820_isocdbg(fmt, arg...) do {\ - if (isoc_debug) \ - printk(KERN_INFO "%s %s :"fmt, \ - dev->name, __FUNCTION__ , ##arg); } while (0) + if (isoc_debug) \ + printk(KERN_INFO "%s %s :"fmt, \ + dev->name, __FUNCTION__ , ##arg); } while (0) static int alt = EM2820_PINOUT; module_param(alt, int, 0644); diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index f6bfc038777e..bfe0d8795b6d 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c @@ -2,8 +2,8 @@ em2820-i2c.c - driver for Empia EM2800/EM2820/2840 USB video capture devices Copyright (C) 2005 Markus Rechberger - Ludovico Cavedon - Mauro Carvalho Chehab + Ludovico Cavedon + Mauro Carvalho Chehab Based on the em2800 driver from Sascha Sommer diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index ba367a9796e7..8681a793a0bf 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c @@ -43,34 +43,34 @@ MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]"); /* ---------------------------------------------------------------------- */ static IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE] = { - [ 0x01 ] = KEY_CHANNEL, - [ 0x02 ] = KEY_SELECT, - [ 0x03 ] = KEY_MUTE, - [ 0x04 ] = KEY_POWER, - [ 0x05 ] = KEY_KP1, - [ 0x06 ] = KEY_KP2, - [ 0x07 ] = KEY_KP3, - [ 0x08 ] = KEY_CHANNELUP, - [ 0x09 ] = KEY_KP4, - [ 0x0a ] = KEY_KP5, - [ 0x0b ] = KEY_KP6, - [ 0x0c ] = KEY_CHANNELDOWN, - [ 0x0d ] = KEY_KP7, - [ 0x0e ] = KEY_KP8, - [ 0x0f ] = KEY_KP9, - [ 0x10 ] = KEY_VOLUMEUP, - [ 0x11 ] = KEY_KP0, - [ 0x12 ] = KEY_MENU, - [ 0x13 ] = KEY_PRINT, - [ 0x14 ] = KEY_VOLUMEDOWN, - [ 0x16 ] = KEY_PAUSE, - [ 0x18 ] = KEY_RECORD, - [ 0x19 ] = KEY_REWIND, - [ 0x1a ] = KEY_PLAY, + [ 0x01 ] = KEY_CHANNEL, + [ 0x02 ] = KEY_SELECT, + [ 0x03 ] = KEY_MUTE, + [ 0x04 ] = KEY_POWER, + [ 0x05 ] = KEY_KP1, + [ 0x06 ] = KEY_KP2, + [ 0x07 ] = KEY_KP3, + [ 0x08 ] = KEY_CHANNELUP, + [ 0x09 ] = KEY_KP4, + [ 0x0a ] = KEY_KP5, + [ 0x0b ] = KEY_KP6, + [ 0x0c ] = KEY_CHANNELDOWN, + [ 0x0d ] = KEY_KP7, + [ 0x0e ] = KEY_KP8, + [ 0x0f ] = KEY_KP9, + [ 0x10 ] = KEY_VOLUMEUP, + [ 0x11 ] = KEY_KP0, + [ 0x12 ] = KEY_MENU, + [ 0x13 ] = KEY_PRINT, + [ 0x14 ] = KEY_VOLUMEDOWN, + [ 0x16 ] = KEY_PAUSE, + [ 0x18 ] = KEY_RECORD, + [ 0x19 ] = KEY_REWIND, + [ 0x1a ] = KEY_PLAY, [ 0x1b ] = KEY_FORWARD, [ 0x1c ] = KEY_BACKSPACE, - [ 0x1e ] = KEY_STOP, - [ 0x40 ] = KEY_ZOOM, + [ 0x1e ] = KEY_STOP, + [ 0x40 ] = KEY_ZOOM, }; /* ----------------------------------------------------------------------- */ diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 048ad1d77bab..e5066d05697e 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -2,8 +2,8 @@ em2820-video.c - driver for Empia EM2800/EM2820/2840 USB video capture devices Copyright (C) 2005 Markus Rechberger - Ludovico Cavedon - Mauro Carvalho Chehab + Ludovico Cavedon + Mauro Carvalho Chehab Based on the em2800 driver from Sascha Sommer @@ -42,9 +42,9 @@ #define EM2820_VERSION_CODE KERNEL_VERSION(0, 0, 1) #define em2820_videodbg(fmt, arg...) do {\ - if (video_debug) \ - printk(KERN_INFO "%s %s :"fmt, \ - dev->name, __FUNCTION__ , ##arg); } while (0) + if (video_debug) \ + printk(KERN_INFO "%s %s :"fmt, \ + dev->name, __FUNCTION__ , ##arg); } while (0) MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index a11df04a8c3d..c48354062eb6 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h @@ -2,8 +2,8 @@ em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices Copyright (C) 2005 Markus Rechberger - Ludovico Cavedon - Mauro Carvalho Chehab + Ludovico Cavedon + Mauro Carvalho Chehab Based on the em2800 driver from Sascha Sommer @@ -390,17 +390,17 @@ extern const unsigned int em2820_bcount; /* printk macros */ #define em2820_err(fmt, arg...) do {\ - printk(KERN_ERR fmt , ##arg); } while (0) + printk(KERN_ERR fmt , ##arg); } while (0) #define em2820_errdev(fmt, arg...) do {\ - printk(KERN_ERR "%s: "fmt,\ + printk(KERN_ERR "%s: "fmt,\ dev->name , ##arg); } while (0) #define em2820_info(fmt, arg...) do {\ - printk(KERN_INFO "%s: "fmt,\ + printk(KERN_INFO "%s: "fmt,\ dev->name , ##arg); } while (0) #define em2820_warn(fmt, arg...) do {\ - printk(KERN_WARNING "%s: "fmt,\ + printk(KERN_WARNING "%s: "fmt,\ dev->name , ##arg); } while (0) inline static int em2820_audio_source(struct em2820 *dev, int input) diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c index cc5973950c05..ed81934ef3cd 100644 --- a/drivers/media/video/ir-kbd-gpio.c +++ b/drivers/media/video/ir-kbd-gpio.c @@ -369,14 +369,14 @@ static int ir_probe(struct device *dev) ir->mask_keycode = 0x003e00; ir->mask_keyup = 0x010000; ir->polling = 50; // ms - break; + break; case BTTV_BOARD_PV_BT878P_9B: case BTTV_BOARD_PV_BT878P_PLUS: ir_codes = ir_codes_pixelview; ir->mask_keycode = 0x001f00; ir->mask_keyup = 0x008000; ir->polling = 50; // ms - break; + break; case BTTV_BOARD_WINFAST2000: ir_codes = ir_codes_winfast; diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index b0facaa40b2f..12f1053137da 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -163,7 +163,7 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) { - unsigned char b; + unsigned char b; /* poll IR chip */ if (1 != i2c_master_recv(&ir->c,&b,1)) { @@ -177,7 +177,7 @@ static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) { - unsigned char b; + unsigned char b; /* poll IR chip */ if (1 != i2c_master_recv(&ir->c,&b,1)) { @@ -225,7 +225,7 @@ static int get_key_knc1(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) { - unsigned char b; + unsigned char b; /* poll IR chip */ if (1 != i2c_master_recv(&ir->c,&b,1)) { @@ -287,17 +287,17 @@ static int ir_detach(struct i2c_client *client); static int ir_probe(struct i2c_adapter *adap); static struct i2c_driver driver = { - .name = "ir remote kbd driver", - .id = I2C_DRIVERID_EXP3, /* FIXME */ - .flags = I2C_DF_NOTIFY, - .attach_adapter = ir_probe, - .detach_client = ir_detach, + .name = "ir remote kbd driver", + .id = I2C_DRIVERID_EXP3, /* FIXME */ + .flags = I2C_DF_NOTIFY, + .attach_adapter = ir_probe, + .detach_client = ir_detach, }; static struct i2c_client client_template = { - .name = "unset", - .driver = &driver + .name = "unset", + .driver = &driver }; static int ir_attach(struct i2c_adapter *adap, int addr, @@ -398,7 +398,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr, static int ir_detach(struct i2c_client *client) { - struct IR_i2c *ir = i2c_get_clientdata(client); + struct IR_i2c *ir = i2c_get_clientdata(client); /* kill outstanding polls */ del_timer(&ir->timer); diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 5573f68ce457..699cea2cc648 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -192,7 +192,7 @@ static int msp3400c_reset(struct i2c_client *client) (2 != i2c_transfer(client->adapter,test,2)) ) { printk(KERN_ERR "msp3400: chip reset failed\n"); return -1; - } + } return 0; } @@ -200,16 +200,16 @@ static int msp3400c_read(struct i2c_client *client, int dev, int addr) { int err,retval; - unsigned char write[3]; - unsigned char read[2]; - struct i2c_msg msgs[2] = { - { client->addr, 0, 3, write }, - { client->addr, I2C_M_RD, 2, read } - }; + unsigned char write[3]; + unsigned char read[2]; + struct i2c_msg msgs[2] = { + { client->addr, 0, 3, write }, + { client->addr, I2C_M_RD, 2, read } + }; - write[0] = dev+1; - write[1] = addr >> 8; - write[2] = addr & 0xff; + write[0] = dev+1; + write[1] = addr >> 8; + write[2] = addr & 0xff; for (err = 0; err < 3;) { if (2 == i2c_transfer(client->adapter,msgs,2)) @@ -236,13 +236,13 @@ static int msp3400c_read(struct i2c_client *client, int dev, int addr) static int msp3400c_write(struct i2c_client *client, int dev, int addr, int val) { int err; - unsigned char buffer[5]; + unsigned char buffer[5]; - buffer[0] = dev; - buffer[1] = addr >> 8; - buffer[2] = addr & 0xff; - buffer[3] = val >> 8; - buffer[4] = val & 0xff; + buffer[0] = dev; + buffer[1] = addr >> 8; + buffer[2] = addr & 0xff; + buffer[3] = val >> 8; + buffer[4] = val & 0xff; dprintk_trace("trace: msp3400c_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val); @@ -812,7 +812,7 @@ static void watch_stereo(struct i2c_client *client) else if (msp->stereo & VIDEO_SOUND_LANG1) msp3400c_setstereo(client, V4L2_TUNER_MODE_LANG1); else - msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); + msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); } if (once) @@ -1512,21 +1512,21 @@ static struct i2c_client client_template = static int msp_attach(struct i2c_adapter *adap, int addr, int kind) { struct msp3400c *msp; - struct i2c_client *c; + struct i2c_client *c; int (*thread_func)(void *data) = NULL; int i; - client_template.adapter = adap; - client_template.addr = addr; + client_template.adapter = adap; + client_template.addr = addr; - if (-1 == msp3400c_reset(&client_template)) { - dprintk("msp34xx: no chip found\n"); - return -1; - } + if (-1 == msp3400c_reset(&client_template)) { + dprintk("msp34xx: no chip found\n"); + return -1; + } - if (NULL == (c = kmalloc(sizeof(struct i2c_client),GFP_KERNEL))) - return -ENOMEM; - memcpy(c,&client_template,sizeof(struct i2c_client)); + if (NULL == (c = kmalloc(sizeof(struct i2c_client),GFP_KERNEL))) + return -ENOMEM; + memcpy(c,&client_template,sizeof(struct i2c_client)); if (NULL == (msp = kmalloc(sizeof(struct msp3400c),GFP_KERNEL))) { kfree(c); return -ENOMEM; @@ -1618,7 +1618,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) } /* done */ - i2c_attach_client(c); + i2c_attach_client(c); /* update our own array */ for (i = 0; i < MSP3400_MAX; i++) { @@ -1739,7 +1739,7 @@ static void msp_any_set_audmode(struct i2c_client *client, int audmode) static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) { struct msp3400c *msp = i2c_get_clientdata(client); - __u16 *sarg = arg; + __u16 *sarg = arg; int scart = 0; switch (cmd) { @@ -1969,7 +1969,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) } msp_any_detect_stereo(client); - if (msp->audmode == V4L2_TUNER_MODE_STEREO) { + if (msp->audmode == V4L2_TUNER_MODE_STEREO) { a->capability=V4L2_AUDCAP_STEREO; } @@ -2005,7 +2005,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) msp3400c_set_scart(client,scart,0); msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900); } - if (sarg->capability==V4L2_AUDCAP_STEREO) { + if (sarg->capability==V4L2_AUDCAP_STEREO) { msp->audmode = V4L2_TUNER_MODE_STEREO; } else { msp->audmode &= ~V4L2_TUNER_MODE_STEREO; diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c index 972aa5e0aeef..13b61c4dcbf8 100644 --- a/drivers/media/video/mt20xx.c +++ b/drivers/media/video/mt20xx.c @@ -76,17 +76,17 @@ static int mt2032_compute_freq(struct i2c_client *c, unsigned int xogc) //all in Hz { struct tuner *t = i2c_get_clientdata(c); - unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1, + unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1, desired_lo2,lo2,lo2n,lo2a,lo2num,lo2freq; - fref= 5250 *1000; //5.25MHz + fref= 5250 *1000; //5.25MHz desired_lo1=rfin+if1; lo1=(2*(desired_lo1/1000)+(fref/1000)) / (2*fref/1000); - lo1n=lo1/8; - lo1a=lo1-(lo1n*8); + lo1n=lo1/8; + lo1a=lo1-(lo1n*8); - s=rfin/1000/1000+1090; + s=rfin/1000/1000+1090; if(optimize_vco) { if(s>1890) sel=0; @@ -96,34 +96,34 @@ static int mt2032_compute_freq(struct i2c_client *c, else sel=4; // >1090 } else { - if(s>1790) sel=0; // <1958 - else if(s>1617) sel=1; - else if(s>1449) sel=2; - else if(s>1291) sel=3; - else sel=4; // >1090 + if(s>1790) sel=0; // <1958 + else if(s>1617) sel=1; + else if(s>1449) sel=2; + else if(s>1291) sel=3; + else sel=4; // >1090 } *ret_sel=sel; - lo1freq=(lo1a+8*lo1n)*fref; + lo1freq=(lo1a+8*lo1n)*fref; tuner_dbg("mt2032: rfin=%d lo1=%d lo1n=%d lo1a=%d sel=%d, lo1freq=%d\n", rfin,lo1,lo1n,lo1a,sel,lo1freq); - desired_lo2=lo1freq-rfin-if2; - lo2=(desired_lo2)/fref; - lo2n=lo2/8; - lo2a=lo2-(lo2n*8); - lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith - lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000; + desired_lo2=lo1freq-rfin-if2; + lo2=(desired_lo2)/fref; + lo2n=lo2/8; + lo2a=lo2-(lo2n*8); + lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith + lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000; tuner_dbg("mt2032: rfin=%d lo2=%d lo2n=%d lo2a=%d num=%d lo2freq=%d\n", rfin,lo2,lo2n,lo2a,lo2num,lo2freq); - if(lo1a<0 || lo1a>7 || lo1n<17 ||lo1n>48 || lo2a<0 ||lo2a >7 ||lo2n<17 || lo2n>30) { + if(lo1a<0 || lo1a>7 || lo1n<17 ||lo1n>48 || lo2a<0 ||lo2a >7 ||lo2n<17 || lo2n>30) { tuner_info("mt2032: frequency parameters out of range: %d %d %d %d\n", lo1a, lo1n, lo2a,lo2n); - return(-1); - } + return(-1); + } mt2032_spurcheck(c, lo1freq, desired_lo2, spectrum_from, spectrum_to); // should recalculate lo1 (one step up/down) @@ -135,10 +135,10 @@ static int mt2032_compute_freq(struct i2c_client *c, buf[3]=0x0f; //reserved buf[4]=0x1f; buf[5]=(lo2n-1) | (lo2a<<5); - if(rfin >400*1000*1000) - buf[6]=0xe4; - else - buf[6]=0xf4; // set PKEN per rev 1.2 + if(rfin >400*1000*1000) + buf[6]=0xe4; + else + buf[6]=0xf4; // set PKEN per rev 1.2 buf[7]=8+xogc; buf[8]=0xc3; //reserved buf[9]=0x4e; //reserved @@ -168,7 +168,7 @@ static int mt2032_check_lo_lock(struct i2c_client *c) tuner_dbg("mt2032: pll wait 1ms for lock (0x%2x)\n",buf[0]); udelay(1000); } - return lock; + return lock; } static int mt2032_optimize_vco(struct i2c_client *c,int sel,int lock) @@ -202,7 +202,7 @@ static int mt2032_optimize_vco(struct i2c_client *c,int sel,int lock) buf[0]=0x0f; buf[1]=sel; - i2c_master_send(c,buf,2); + i2c_master_send(c,buf,2); lock=mt2032_check_lo_lock(c); return lock; } @@ -219,23 +219,23 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin, tuner_dbg("mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n", rfin,if1,if2,from,to); - buf[0]=0; - ret=i2c_master_send(c,buf,1); - i2c_master_recv(c,buf,21); + buf[0]=0; + ret=i2c_master_send(c,buf,1); + i2c_master_recv(c,buf,21); buf[0]=0; ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,&buf[1],&sel,t->xogc); if (ret<0) return; - // send only the relevant registers per Rev. 1.2 - buf[0]=0; - ret=i2c_master_send(c,buf,4); - buf[5]=5; - ret=i2c_master_send(c,buf+5,4); - buf[11]=11; - ret=i2c_master_send(c,buf+11,3); - if(ret!=3) + // send only the relevant registers per Rev. 1.2 + buf[0]=0; + ret=i2c_master_send(c,buf,4); + buf[5]=5; + ret=i2c_master_send(c,buf+5,4); + buf[11]=11; + ret=i2c_master_send(c,buf+11,3); + if(ret!=3) tuner_warn("i2c i/o error: rc == %d (should be 3)\n",ret); // wait for PLLs to lock (per manual), retry LINT if not. @@ -253,7 +253,7 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin, mdelay(10); buf[1]=8+t->xogc; i2c_master_send(c,buf,2); - } + } if (lock!=6) tuner_warn("MT2032 Fatal Error: PLLs didn't lock.\n"); @@ -284,7 +284,7 @@ static void mt2032_set_tv_freq(struct i2c_client *c, unsigned int freq) if2 = 38900*1000; } - mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */, + mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */, 1090*1000*1000, if2, from, to); } @@ -294,7 +294,7 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq) int if2 = t->radio_if2; // per Manual for FM tuning: first if center freq. 1085 MHz - mt2032_set_if_freq(c, freq * 1000 / 16, + mt2032_set_if_freq(c, freq * 1000 / 16, 1085*1000*1000,if2,if2,if2); } @@ -302,57 +302,57 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq) static int mt2032_init(struct i2c_client *c) { struct tuner *t = i2c_get_clientdata(c); - unsigned char buf[21]; - int ret,xogc,xok=0; + unsigned char buf[21]; + int ret,xogc,xok=0; // Initialize Registers per spec. - buf[1]=2; // Index to register 2 - buf[2]=0xff; - buf[3]=0x0f; - buf[4]=0x1f; - ret=i2c_master_send(c,buf+1,4); - - buf[5]=6; // Index register 6 - buf[6]=0xe4; - buf[7]=0x8f; - buf[8]=0xc3; - buf[9]=0x4e; - buf[10]=0xec; - ret=i2c_master_send(c,buf+5,6); - - buf[12]=13; // Index register 13 - buf[13]=0x32; - ret=i2c_master_send(c,buf+12,2); - - // Adjust XOGC (register 7), wait for XOK - xogc=7; - do { + buf[1]=2; // Index to register 2 + buf[2]=0xff; + buf[3]=0x0f; + buf[4]=0x1f; + ret=i2c_master_send(c,buf+1,4); + + buf[5]=6; // Index register 6 + buf[6]=0xe4; + buf[7]=0x8f; + buf[8]=0xc3; + buf[9]=0x4e; + buf[10]=0xec; + ret=i2c_master_send(c,buf+5,6); + + buf[12]=13; // Index register 13 + buf[13]=0x32; + ret=i2c_master_send(c,buf+12,2); + + // Adjust XOGC (register 7), wait for XOK + xogc=7; + do { + tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); + mdelay(10); + buf[0]=0x0e; + i2c_master_send(c,buf,1); + i2c_master_recv(c,buf,1); + xok=buf[0]&0x01; + tuner_dbg("mt2032: xok = 0x%02x\n",xok); + if (xok == 1) break; + + xogc--; tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); - mdelay(10); - buf[0]=0x0e; - i2c_master_send(c,buf,1); - i2c_master_recv(c,buf,1); - xok=buf[0]&0x01; - tuner_dbg("mt2032: xok = 0x%02x\n",xok); - if (xok == 1) break; - - xogc--; - tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); - if (xogc == 3) { - xogc=4; // min. 4 per spec - break; - } - buf[0]=0x07; - buf[1]=0x88 + xogc; - ret=i2c_master_send(c,buf,2); - if (ret!=2) + if (xogc == 3) { + xogc=4; // min. 4 per spec + break; + } + buf[0]=0x07; + buf[1]=0x88 + xogc; + ret=i2c_master_send(c,buf,2); + if (ret!=2) tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret); - } while (xok != 1 ); + } while (xok != 1 ); t->xogc=xogc; t->tv_freq = mt2032_set_tv_freq; t->radio_freq = mt2032_set_radio_freq; - return(1); + return(1); } static void mt2050_set_antenna(struct i2c_client *c, unsigned char antenna) @@ -426,7 +426,7 @@ static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned } ret=i2c_master_send(c,buf,6); - if (ret!=6) + if (ret!=6) tuner_warn("i2c i/o error: rc == %d (should be 6)\n",ret); } @@ -437,11 +437,11 @@ static void mt2050_set_tv_freq(struct i2c_client *c, unsigned int freq) if (t->std & V4L2_STD_525_60) { // NTSC - if2 = 45750*1000; - } else { - // PAL - if2 = 38900*1000; - } + if2 = 45750*1000; + } else { + // PAL + if2 = 38900*1000; + } if (V4L2_TUNER_DIGITAL_TV == t->mode) { // DVB (pinnacle 300i) if2 = 36150*1000; @@ -487,7 +487,7 @@ int microtune_init(struct i2c_client *c) { struct tuner *t = i2c_get_clientdata(c); char *name; - unsigned char buf[21]; + unsigned char buf[21]; int company_code; memset(buf,0,sizeof(buf)); @@ -496,17 +496,17 @@ int microtune_init(struct i2c_client *c) t->standby = NULL; name = "unknown"; - i2c_master_send(c,buf,1); - i2c_master_recv(c,buf,21); - if (tuner_debug) { - int i; + i2c_master_send(c,buf,1); + i2c_master_recv(c,buf,21); + if (tuner_debug) { + int i; tuner_dbg("MT20xx hexdump:"); - for(i=0;i<21;i++) { - printk(" %02x",buf[i]); - if(((i+1)%8)==0) printk(" "); - } - printk("\n"); - } + for(i=0;i<21;i++) { + printk(" %02x",buf[i]); + if(((i+1)%8)==0) printk(" "); + } + printk("\n"); + } company_code = buf[0x11] << 8 | buf[0x12]; tuner_info("microtune: companycode=%04x part=%02x rev=%02x\n", company_code,buf[0x13],buf[0x14]); @@ -525,8 +525,8 @@ int microtune_init(struct i2c_client *c) default: tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", name); - return 0; - } + return 0; + } strlcpy(c->name, name, sizeof(c->name)); tuner_info("microtune %s found, OK\n",name); diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 37653ee87235..ed16282fca51 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c @@ -464,8 +464,8 @@ saa7113_command (struct i2c_client *client, /* standard i2c insmod options */ static unsigned short normal_i2c[] = { - I2C_SAA7113>>1, /* saa7113 */ - I2C_CLIENT_END + I2C_SAA7113>>1, /* saa7113 */ + I2C_CLIENT_END }; I2C_CLIENT_INSMOD; diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index dac720ea3b06..2bf5cf79eec1 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -169,31 +169,31 @@ static int saa6752hs_chip_command(struct i2c_client* client, /* execute the command */ switch(command) { - case SAA6752HS_COMMAND_RESET: - buf[0] = 0x00; + case SAA6752HS_COMMAND_RESET: + buf[0] = 0x00; break; case SAA6752HS_COMMAND_STOP: - buf[0] = 0x03; + buf[0] = 0x03; break; case SAA6752HS_COMMAND_START: - buf[0] = 0x02; + buf[0] = 0x02; break; case SAA6752HS_COMMAND_PAUSE: - buf[0] = 0x04; + buf[0] = 0x04; break; case SAA6752HS_COMMAND_RECONFIGURE: buf[0] = 0x05; break; - case SAA6752HS_COMMAND_SLEEP: - buf[0] = 0x06; + case SAA6752HS_COMMAND_SLEEP: + buf[0] = 0x06; break; - case SAA6752HS_COMMAND_RECONFIGURE_FORCE: + case SAA6752HS_COMMAND_RECONFIGURE_FORCE: buf[0] = 0x07; break; @@ -201,13 +201,13 @@ static int saa6752hs_chip_command(struct i2c_client* client, return -EINVAL; } - /* set it and wait for it to be so */ + /* set it and wait for it to be so */ i2c_master_send(client, buf, 1); timeout = jiffies + HZ * 3; for (;;) { /* get the current status */ buf[0] = 0x10; - i2c_master_send(client, buf, 1); + i2c_master_send(client, buf, 1); i2c_master_recv(client, buf, 1); if (!(buf[0] & 0x20)) @@ -223,14 +223,14 @@ static int saa6752hs_chip_command(struct i2c_client* client, /* delay a bit to let encoder settle */ msleep(50); - return status; + return status; } static int saa6752hs_set_bitrate(struct i2c_client* client, struct v4l2_mpeg_compression* params) { - u8 buf[3]; + u8 buf[3]; /* set the bitrate mode */ buf[0] = 0x71; @@ -242,31 +242,31 @@ static int saa6752hs_set_bitrate(struct i2c_client* client, /* set the target bitrate */ buf[0] = 0x80; buf[1] = params->vi_bitrate.target >> 8; - buf[2] = params->vi_bitrate.target & 0xff; + buf[2] = params->vi_bitrate.target & 0xff; i2c_master_send(client, buf, 3); /* set the max bitrate */ buf[0] = 0x81; buf[1] = params->vi_bitrate.max >> 8; - buf[2] = params->vi_bitrate.max & 0xff; + buf[2] = params->vi_bitrate.max & 0xff; i2c_master_send(client, buf, 3); } else { /* set the target bitrate (no max bitrate for CBR) */ - buf[0] = 0x81; + buf[0] = 0x81; buf[1] = params->vi_bitrate.target >> 8; - buf[2] = params->vi_bitrate.target & 0xff; + buf[2] = params->vi_bitrate.target & 0xff; i2c_master_send(client, buf, 3); } /* set the audio bitrate */ - buf[0] = 0x94; + buf[0] = 0x94; buf[1] = (256 == params->au_bitrate.target) ? 0 : 1; i2c_master_send(client, buf, 2); /* set the total bitrate */ buf[0] = 0xb1; - buf[1] = params->st_bitrate.target >> 8; - buf[2] = params->st_bitrate.target & 0xff; + buf[1] = params->st_bitrate.target >> 8; + buf[2] = params->st_bitrate.target & 0xff; i2c_master_send(client, buf, 3); return 0; @@ -386,8 +386,8 @@ static int saa6752hs_init(struct i2c_client* client) buf[1] = 0x01; i2c_master_send(client, buf, 2); - /* set bitrate */ - saa6752hs_set_bitrate(client, &h->params); + /* set bitrate */ + saa6752hs_set_bitrate(client, &h->params); /* Set GOP structure {3, 13} */ buf[0] = 0x72; @@ -426,9 +426,9 @@ static int saa6752hs_init(struct i2c_client* client) localPAT[sizeof(PAT) - 1] = crc & 0xFF; /* compute PMT */ - memcpy(localPMT, PMT, sizeof(PMT)); - localPMT[3] = 0x40 | ((h->params.ts_pid_pmt >> 8) & 0x0f); - localPMT[4] = h->params.ts_pid_pmt & 0xff; + memcpy(localPMT, PMT, sizeof(PMT)); + localPMT[3] = 0x40 | ((h->params.ts_pid_pmt >> 8) & 0x0f); + localPMT[4] = h->params.ts_pid_pmt & 0xff; localPMT[15] = 0xE0 | ((h->params.ts_pid_pcr >> 8) & 0x0F); localPMT[16] = h->params.ts_pid_pcr & 0xFF; localPMT[20] = 0xE0 | ((h->params.ts_pid_video >> 8) & 0x0F); @@ -453,7 +453,7 @@ static int saa6752hs_init(struct i2c_client* client) buf[2] = h->params.ts_pid_video & 0xFF; i2c_master_send(client,buf,3); - /* Set PCR PID */ + /* Set PCR PID */ buf[0] = 0xC4; buf[1] = (h->params.ts_pid_pcr >> 8) & 0xFF; buf[2] = h->params.ts_pid_pcr & 0xFF; @@ -467,7 +467,7 @@ static int saa6752hs_init(struct i2c_client* client) buf[0] = 0xa4; buf[1] = 1; i2c_master_send(client, buf, 2); - buf[1] = 0; + buf[1] = 0; i2c_master_send(client, buf, 2); /* start it going */ @@ -510,10 +510,10 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) { struct saa6752hs_state *h; - printk("saa6752hs: chip found @ 0x%x\n", addr<<1); + printk("saa6752hs: chip found @ 0x%x\n", addr<<1); - if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) - return -ENOMEM; + if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) + return -ENOMEM; memset(h,0,sizeof(*h)); h->client = client_template; h->params = param_defaults; @@ -552,7 +552,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) struct v4l2_mpeg_compression *params = arg; int err = 0; - switch (cmd) { + switch (cmd) { case VIDIOC_S_MPEGCOMP: if (NULL == params) { /* apply settings and start encoder */ @@ -566,7 +566,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) break; case VIDIOC_G_FMT: { - struct v4l2_format *f = arg; + struct v4l2_format *f = arg; if (h->video_format == SAA6752HS_VF_UNKNOWN) h->video_format = SAA6752HS_VF_D1; diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 465beac941d7..e9ffe8f144ac 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -80,11 +80,11 @@ typedef struct snd_card_saa7134 { spinlock_t mixer_lock; int mixer_volume[MIXER_ADDR_LAST+1][2]; int capture_source[MIXER_ADDR_LAST+1][2]; - struct pci_dev *pci; - struct saa7134_dev *saadev; + struct pci_dev *pci; + struct saa7134_dev *saadev; - unsigned long iobase; - int irq; + unsigned long iobase; + int irq; spinlock_t lock; } snd_card_saa7134_t; @@ -94,7 +94,7 @@ typedef struct snd_card_saa7134 { */ typedef struct snd_card_saa7134_pcm { - struct saa7134_dev *saadev; + struct saa7134_dev *saadev; spinlock_t lock; unsigned int pcm_size; /* buffer size */ @@ -118,9 +118,9 @@ static snd_card_t *snd_saa7134_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; static void saa7134_dma_stop(struct saa7134_dev *dev) { - dev->oss.dma_blk = -1; - dev->oss.dma_running = 0; - saa7134_set_dmabits(dev); + dev->oss.dma_blk = -1; + dev->oss.dma_running = 0; + saa7134_set_dmabits(dev); } /* @@ -135,9 +135,9 @@ static void saa7134_dma_stop(struct saa7134_dev *dev) static void saa7134_dma_start(struct saa7134_dev *dev) { - dev->oss.dma_blk = 0; - dev->oss.dma_running = 1; - saa7134_set_dmabits(dev); + dev->oss.dma_blk = 0; + dev->oss.dma_running = 1; + saa7134_set_dmabits(dev); } /* @@ -184,28 +184,28 @@ void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status) goto done; } - /* next block addr */ - next_blk = (dev->oss.dma_blk + 2) % dev->oss.blocks; - saa_writel(reg,next_blk * dev->oss.blksize); - if (alsa_debug > 2) - dprintk("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n", - (status & 0x10000000) ? "even" : "odd ", next_blk, - next_blk * dev->oss.blksize, dev->oss.blocks, dev->oss.blksize, dev->oss.read_count); + /* next block addr */ + next_blk = (dev->oss.dma_blk + 2) % dev->oss.blocks; + saa_writel(reg,next_blk * dev->oss.blksize); + if (alsa_debug > 2) + dprintk("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n", + (status & 0x10000000) ? "even" : "odd ", next_blk, + next_blk * dev->oss.blksize, dev->oss.blocks, dev->oss.blksize, dev->oss.read_count); - /* update status & wake waiting readers */ - dev->oss.dma_blk = (dev->oss.dma_blk + 1) % dev->oss.blocks; - dev->oss.read_count += dev->oss.blksize; + /* update status & wake waiting readers */ + dev->oss.dma_blk = (dev->oss.dma_blk + 1) % dev->oss.blocks; + dev->oss.read_count += dev->oss.blksize; - dev->oss.recording_on = reg; + dev->oss.recording_on = reg; if (dev->oss.read_count >= snd_pcm_lib_period_bytes(dev->oss.substream)) { - spin_unlock(&dev->slock); - snd_pcm_period_elapsed(dev->oss.substream); - spin_lock(&dev->slock); + spin_unlock(&dev->slock); + snd_pcm_period_elapsed(dev->oss.substream); + spin_lock(&dev->slock); } done: - spin_unlock(&dev->slock); + spin_unlock(&dev->slock); } @@ -239,23 +239,23 @@ static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream, static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) { - if (blksize < 0x100) - blksize = 0x100; - if (blksize > 0x10000) - blksize = 0x10000; - - if (blocks < 2) - blocks = 2; - if ((blksize * blocks) > 1024*1024) - blocks = 1024*1024 / blksize; - - dev->oss.blocks = blocks; - dev->oss.blksize = blksize; - dev->oss.bufsize = blksize * blocks; - - dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", - blocks,blksize,blksize * blocks / 1024); - return 0; + if (blksize < 0x100) + blksize = 0x100; + if (blksize > 0x10000) + blksize = 0x10000; + + if (blocks < 2) + blocks = 2; + if ((blksize * blocks) > 1024*1024) + blocks = 1024*1024 / blksize; + + dev->oss.blocks = blocks; + dev->oss.blksize = blksize; + dev->oss.bufsize = blksize * blocks; + + dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", + blocks,blksize,blksize * blocks / 1024); + return 0; } /* @@ -271,16 +271,16 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) static int dsp_buffer_init(struct saa7134_dev *dev) { - int err; - - if (!dev->oss.bufsize) - BUG(); - videobuf_dma_init(&dev->oss.dma); - err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE, - (dev->oss.bufsize + PAGE_SIZE) >> PAGE_SHIFT); - if (0 != err) - return err; - return 0; + int err; + + if (!dev->oss.bufsize) + BUG(); + videobuf_dma_init(&dev->oss.dma); + err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE, + (dev->oss.bufsize + PAGE_SIZE) >> PAGE_SHIFT); + if (0 != err) + return err; + return 0; } /* @@ -298,18 +298,18 @@ static int dsp_buffer_init(struct saa7134_dev *dev) static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) { snd_pcm_runtime_t *runtime = substream->runtime; - int err, bswap, sign; - u32 fmt, control; - unsigned long flags; + int err, bswap, sign; + u32 fmt, control; + unsigned long flags; snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev; + struct saa7134_dev *dev; snd_card_saa7134_pcm_t *saapcm = runtime->private_data; unsigned int bps; - unsigned long size; - unsigned count; + unsigned long size; + unsigned count; - size = snd_pcm_lib_buffer_bytes(substream); - count = snd_pcm_lib_period_bytes(substream); + size = snd_pcm_lib_buffer_bytes(substream); + count = snd_pcm_lib_period_bytes(substream); saapcm->saadev->oss.substream = substream; bps = runtime->rate * runtime->channels; @@ -324,123 +324,123 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) dev=saa7134->saadev; - dsp_buffer_conf(dev,saapcm->pcm_count,(saapcm->pcm_size/saapcm->pcm_count)); + dsp_buffer_conf(dev,saapcm->pcm_count,(saapcm->pcm_size/saapcm->pcm_count)); - err = dsp_buffer_init(dev); - if (0 != err) - goto fail2; + err = dsp_buffer_init(dev); + if (0 != err) + goto fail2; - /* prepare buffer */ - if (0 != (err = videobuf_dma_pci_map(dev->pci,&dev->oss.dma))) - return err; - if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->oss.pt))) - goto fail1; - if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->oss.pt, - dev->oss.dma.sglist, - dev->oss.dma.sglen, - 0))) - goto fail2; + /* prepare buffer */ + if (0 != (err = videobuf_dma_pci_map(dev->pci,&dev->oss.dma))) + return err; + if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->oss.pt))) + goto fail1; + if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->oss.pt, + dev->oss.dma.sglist, + dev->oss.dma.sglen, + 0))) + goto fail2; - switch (runtime->format) { - case SNDRV_PCM_FORMAT_U8: - case SNDRV_PCM_FORMAT_S8: + switch (runtime->format) { + case SNDRV_PCM_FORMAT_U8: + case SNDRV_PCM_FORMAT_S8: fmt = 0x00; break; - case SNDRV_PCM_FORMAT_U16_LE: - case SNDRV_PCM_FORMAT_U16_BE: - case SNDRV_PCM_FORMAT_S16_LE: - case SNDRV_PCM_FORMAT_S16_BE: + case SNDRV_PCM_FORMAT_U16_LE: + case SNDRV_PCM_FORMAT_U16_BE: + case SNDRV_PCM_FORMAT_S16_LE: + case SNDRV_PCM_FORMAT_S16_BE: fmt = 0x01; break; - default: - err = -EINVAL; - return 1; - } - - switch (runtime->format) { - case SNDRV_PCM_FORMAT_S8: - case SNDRV_PCM_FORMAT_S16_LE: - case SNDRV_PCM_FORMAT_S16_BE: + default: + err = -EINVAL; + return 1; + } + + switch (runtime->format) { + case SNDRV_PCM_FORMAT_S8: + case SNDRV_PCM_FORMAT_S16_LE: + case SNDRV_PCM_FORMAT_S16_BE: sign = 1; break; - default: + default: sign = 0; break; - } + } - switch (runtime->format) { - case SNDRV_PCM_FORMAT_U16_BE: - case SNDRV_PCM_FORMAT_S16_BE: + switch (runtime->format) { + case SNDRV_PCM_FORMAT_U16_BE: + case SNDRV_PCM_FORMAT_S16_BE: bswap = 1; break; - default: + default: bswap = 0; break; - } - - switch (dev->pci->device) { - case PCI_DEVICE_ID_PHILIPS_SAA7134: - if (1 == runtime->channels) - fmt |= (1 << 3); - if (2 == runtime->channels) - fmt |= (3 << 3); - if (sign) - fmt |= 0x04; - - fmt |= (MIXER_ADDR_TVTUNER == dev->oss.input) ? 0xc0 : 0x80; - saa_writeb(SAA7134_NUM_SAMPLES0, ((dev->oss.blksize - 1) & 0x0000ff)); - saa_writeb(SAA7134_NUM_SAMPLES1, ((dev->oss.blksize - 1) & 0x00ff00) >> 8); - saa_writeb(SAA7134_NUM_SAMPLES2, ((dev->oss.blksize - 1) & 0xff0000) >> 16); - saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt); - - break; - case PCI_DEVICE_ID_PHILIPS_SAA7133: - case PCI_DEVICE_ID_PHILIPS_SAA7135: - if (1 == runtime->channels) - fmt |= (1 << 4); - if (2 == runtime->channels) - fmt |= (2 << 4); - if (!sign) - fmt |= 0x04; - saa_writel(SAA7133_NUM_SAMPLES, dev->oss.blksize -1); - saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210 | (fmt << 24)); - //saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210); - break; - } - - dprintk("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n", - runtime->format, runtime->channels, fmt, - bswap ? 'b' : '-'); - /* dma: setup channel 6 (= AUDIO) */ - control = SAA7134_RS_CONTROL_BURST_16 | - SAA7134_RS_CONTROL_ME | - (dev->oss.pt.dma >> 12); - if (bswap) - control |= SAA7134_RS_CONTROL_BSWAP; + } + + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + if (1 == runtime->channels) + fmt |= (1 << 3); + if (2 == runtime->channels) + fmt |= (3 << 3); + if (sign) + fmt |= 0x04; + + fmt |= (MIXER_ADDR_TVTUNER == dev->oss.input) ? 0xc0 : 0x80; + saa_writeb(SAA7134_NUM_SAMPLES0, ((dev->oss.blksize - 1) & 0x0000ff)); + saa_writeb(SAA7134_NUM_SAMPLES1, ((dev->oss.blksize - 1) & 0x00ff00) >> 8); + saa_writeb(SAA7134_NUM_SAMPLES2, ((dev->oss.blksize - 1) & 0xff0000) >> 16); + saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt); + + break; + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + if (1 == runtime->channels) + fmt |= (1 << 4); + if (2 == runtime->channels) + fmt |= (2 << 4); + if (!sign) + fmt |= 0x04; + saa_writel(SAA7133_NUM_SAMPLES, dev->oss.blksize -1); + saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210 | (fmt << 24)); + //saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210); + break; + } + + dprintk("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n", + runtime->format, runtime->channels, fmt, + bswap ? 'b' : '-'); + /* dma: setup channel 6 (= AUDIO) */ + control = SAA7134_RS_CONTROL_BURST_16 | + SAA7134_RS_CONTROL_ME | + (dev->oss.pt.dma >> 12); + if (bswap) + control |= SAA7134_RS_CONTROL_BSWAP; /* I should be able to use runtime->dma_addr in the control - byte, but it doesn't work. So I allocate the DMA using the - V4L functions, and force ALSA to use that as the DMA area */ + byte, but it doesn't work. So I allocate the DMA using the + V4L functions, and force ALSA to use that as the DMA area */ runtime->dma_area = dev->oss.dma.vmalloc; - saa_writel(SAA7134_RS_BA1(6),0); - saa_writel(SAA7134_RS_BA2(6),dev->oss.blksize); - saa_writel(SAA7134_RS_PITCH(6),0); - saa_writel(SAA7134_RS_CONTROL(6),control); + saa_writel(SAA7134_RS_BA1(6),0); + saa_writel(SAA7134_RS_BA2(6),dev->oss.blksize); + saa_writel(SAA7134_RS_PITCH(6),0); + saa_writel(SAA7134_RS_CONTROL(6),control); dev->oss.rate = runtime->rate; - /* start dma */ - spin_lock_irqsave(&dev->slock,flags); - saa7134_dma_start(dev); - spin_unlock_irqrestore(&dev->slock,flags); + /* start dma */ + spin_lock_irqsave(&dev->slock,flags); + saa7134_dma_start(dev); + spin_unlock_irqrestore(&dev->slock,flags); return 0; fail2: - saa7134_pgtable_free(dev->pci,&dev->oss.pt); + saa7134_pgtable_free(dev->pci,&dev->oss.pt); fail1: - videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); - return err; + videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); + return err; } @@ -465,10 +465,10 @@ static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * if (dev->oss.read_count) { - dev->oss.read_count -= snd_pcm_lib_period_bytes(substream); - dev->oss.read_offset += snd_pcm_lib_period_bytes(substream); - if (dev->oss.read_offset == dev->oss.bufsize) - dev->oss.read_offset = 0; + dev->oss.read_count -= snd_pcm_lib_period_bytes(substream); + dev->oss.read_offset += snd_pcm_lib_period_bytes(substream); + if (dev->oss.read_offset == dev->oss.bufsize) + dev->oss.read_offset = 0; } return bytes_to_frames(runtime, dev->oss.read_offset); @@ -480,9 +480,9 @@ static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * static snd_pcm_hardware_t snd_card_saa7134_capture = { - .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | - SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP_VALID), + .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP_VALID), .formats = USE_FORMATS, .rates = USE_RATE, .rate_min = USE_RATE_MIN, @@ -550,16 +550,16 @@ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) static int dsp_buffer_free(struct saa7134_dev *dev) { - if (!dev->oss.blksize) - BUG(); + if (!dev->oss.blksize) + BUG(); - videobuf_dma_free(&dev->oss.dma); + videobuf_dma_free(&dev->oss.dma); - dev->oss.blocks = 0; - dev->oss.blksize = 0; - dev->oss.bufsize = 0; + dev->oss.blocks = 0; + dev->oss.blksize = 0; + dev->oss.bufsize = 0; - return 0; + return 0; } /* @@ -574,21 +574,21 @@ static int dsp_buffer_free(struct saa7134_dev *dev) static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) { - snd_card_saa7134_t *chip = snd_pcm_substream_chip(substream); + snd_card_saa7134_t *chip = snd_pcm_substream_chip(substream); struct saa7134_dev *dev = chip->saadev; - unsigned long flags; + unsigned long flags; - /* stop dma */ - spin_lock_irqsave(&dev->slock,flags); - saa7134_dma_stop(dev); - spin_unlock_irqrestore(&dev->slock,flags); + /* stop dma */ + spin_lock_irqsave(&dev->slock,flags); + saa7134_dma_stop(dev); + spin_unlock_irqrestore(&dev->slock,flags); - /* unlock buffer */ - saa7134_pgtable_free(dev->pci,&dev->oss.pt); - videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); + /* unlock buffer */ + saa7134_pgtable_free(dev->pci,&dev->oss.pt); + videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); - dsp_buffer_free(dev); - return 0; + dsp_buffer_free(dev); + return 0; } /* @@ -605,18 +605,18 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) { snd_pcm_runtime_t *runtime = substream->runtime; snd_card_saa7134_pcm_t *saapcm; - snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev = saa7134->saadev; + snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); + struct saa7134_dev *dev = saa7134->saadev; int err; down(&dev->oss.lock); - dev->oss.afmt = SNDRV_PCM_FORMAT_U8; - dev->oss.channels = 2; - dev->oss.read_count = 0; - dev->oss.read_offset = 0; + dev->oss.afmt = SNDRV_PCM_FORMAT_U8; + dev->oss.channels = 2; + dev->oss.read_count = 0; + dev->oss.read_offset = 0; - up(&dev->oss.lock); + up(&dev->oss.lock); saapcm = kcalloc(1, sizeof(*saapcm), GFP_KERNEL); if (saapcm == NULL) @@ -630,8 +630,8 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) runtime->private_free = snd_card_saa7134_runtime_free; runtime->hw = snd_card_saa7134_capture; - if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) - return err; + if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) + return err; return 0; } @@ -723,7 +723,7 @@ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ right = 20; spin_lock_irqsave(&chip->mixer_lock, flags); change = chip->mixer_volume[addr][0] != left || - chip->mixer_volume[addr][1] != right; + chip->mixer_volume[addr][1] != right; chip->mixer_volume[addr][0] = left; chip->mixer_volume[addr][1] = right; spin_unlock_irqrestore(&chip->mixer_lock, flags); @@ -764,7 +764,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ unsigned long flags; int change, addr = kcontrol->private_value; int left, right; - u32 anabar, xbarin; + u32 anabar, xbarin; int analog_io, rate; struct saa7134_dev *dev; @@ -775,7 +775,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ spin_lock_irqsave(&chip->mixer_lock, flags); change = chip->capture_source[addr][0] != left || - chip->capture_source[addr][1] != right; + chip->capture_source[addr][1] != right; chip->capture_source[addr][0] = left; chip->capture_source[addr][1] = right; dev->oss.input=addr; @@ -783,57 +783,57 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ if (change) { - switch (dev->pci->device) { + switch (dev->pci->device) { case PCI_DEVICE_ID_PHILIPS_SAA7134: - switch (addr) { - case MIXER_ADDR_TVTUNER: - saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0); - saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00); - break; - case MIXER_ADDR_LINE1: - case MIXER_ADDR_LINE2: - analog_io = (MIXER_ADDR_LINE1 == addr) ? 0x00 : 0x08; - rate = (32000 == dev->oss.rate) ? 0x01 : 0x03; - saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, analog_io); - saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0x80); - saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, rate); - break; - } - - break; + switch (addr) { + case MIXER_ADDR_TVTUNER: + saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0); + saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00); + break; + case MIXER_ADDR_LINE1: + case MIXER_ADDR_LINE2: + analog_io = (MIXER_ADDR_LINE1 == addr) ? 0x00 : 0x08; + rate = (32000 == dev->oss.rate) ? 0x01 : 0x03; + saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, analog_io); + saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0x80); + saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, rate); + break; + } + + break; case PCI_DEVICE_ID_PHILIPS_SAA7133: case PCI_DEVICE_ID_PHILIPS_SAA7135: - xbarin = 0x03; // adc + xbarin = 0x03; // adc anabar = 0; - switch (addr) { - case MIXER_ADDR_TVTUNER: - xbarin = 0; // Demodulator - anabar = 2; // DACs - break; - case MIXER_ADDR_LINE1: - anabar = 0; // aux1, aux1 - break; - case MIXER_ADDR_LINE2: - anabar = 9; // aux2, aux2 - break; - } + switch (addr) { + case MIXER_ADDR_TVTUNER: + xbarin = 0; // Demodulator + anabar = 2; // DACs + break; + case MIXER_ADDR_LINE1: + anabar = 0; // aux1, aux1 + break; + case MIXER_ADDR_LINE2: + anabar = 9; // aux2, aux2 + break; + } /* output xbar always main channel */ - saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL1, 0xbbbb10); + saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL1, 0xbbbb10); if (left || right) { // We've got data, turn the input on - //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); - saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, xbarin); - saa_writel(SAA7133_ANALOG_IO_SELECT, anabar); + //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); + saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, xbarin); + saa_writel(SAA7133_ANALOG_IO_SELECT, anabar); } else { - //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); - saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0); - saa_writel(SAA7133_ANALOG_IO_SELECT, 0); + //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); + saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0); + saa_writel(SAA7133_ANALOG_IO_SELECT, 0); } break; } - } + } return change; } @@ -878,8 +878,8 @@ static int snd_saa7134_free(snd_card_saa7134_t *chip) static int snd_saa7134_dev_free(snd_device_t *device) { - snd_card_saa7134_t *chip = device->device_data; - return snd_saa7134_free(chip); + snd_card_saa7134_t *chip = device->device_data; + return snd_saa7134_free(chip); } /* @@ -896,12 +896,12 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum) snd_card_t *card; snd_card_saa7134_t *chip; int err; - static snd_device_ops_t ops = { - .dev_free = snd_saa7134_dev_free, - }; + static snd_device_ops_t ops = { + .dev_free = snd_saa7134_dev_free, + }; - if (dev >= SNDRV_CARDS) - return -ENODEV; + if (dev >= SNDRV_CARDS) + return -ENODEV; if (!enable[dev]) return -ENODEV; @@ -918,24 +918,24 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum) /* Card "creation" */ chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); - if (chip == NULL) { - return -ENOMEM; - } + if (chip == NULL) { + return -ENOMEM; + } - spin_lock_init(&chip->lock); + spin_lock_init(&chip->lock); - chip->saadev = saadev; + chip->saadev = saadev; - chip->card = card; + chip->card = card; - chip->pci = saadev->pci; - chip->irq = saadev->pci->irq; - chip->iobase = pci_resource_start(saadev->pci, 0); + chip->pci = saadev->pci; + chip->irq = saadev->pci->irq; + chip->iobase = pci_resource_start(saadev->pci, 0); - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { - snd_saa7134_free(chip); - return err; - } + if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { + snd_saa7134_free(chip); + return err; + } if ((err = snd_card_saa7134_new_mixer(chip)) < 0) goto __nodev; @@ -943,15 +943,15 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum) if ((err = snd_card_saa7134_pcm(chip, 0)) < 0) goto __nodev; - spin_lock_init(&chip->mixer_lock); + spin_lock_init(&chip->mixer_lock); snd_card_set_dev(card, &chip->pci->dev); /* End of "creation" */ strcpy(card->shortname, "SAA7134"); - sprintf(card->longname, "%s at 0x%lx irq %d", - chip->saadev->name, chip->iobase, chip->irq); + sprintf(card->longname, "%s at 0x%lx irq %d", + chip->saadev->name, chip->iobase, chip->irq); if ((err = snd_card_register(card)) == 0) { snd_saa7134_cards[dev] = card; @@ -966,8 +966,8 @@ __nodev: void alsa_card_saa7134_exit(void) { - int idx; - for (idx = 0; idx < SNDRV_CARDS; idx++) { - snd_card_free(snd_saa7134_cards[idx]); + int idx; + for (idx = 0; idx < SNDRV_CARDS; idx++) { + snd_card_free(snd_saa7134_cards[idx]); } } diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 17b0549f2e1b..a60d49af341d 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -2114,16 +2114,16 @@ struct saa7134_board saa7134_boards[] = { }, }, [SAA7134_BOARD_BEHOLD_409FM] = { - /* , Sergey */ - .name = "Beholder BeholdTV 409 FM", - .audio_clock = 0x00187de7, - .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, - .inputs = {{ - .name = name_tv, + /* , Sergey */ + .name = "Beholder BeholdTV 409 FM", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .tda9887_conf = TDA9887_PRESENT, + .inputs = {{ + .name = name_tv, .vmux = 3, .amux = TV, .tv = 1, @@ -2131,60 +2131,60 @@ struct saa7134_board saa7134_boards[] = { .name = name_comp1, .vmux = 1, .amux = LINE1, - },{ - .name = name_svideo, + },{ + .name = name_svideo, .vmux = 8, .amux = LINE1, - }}, - .radio = { - .name = name_radio, + }}, + .radio = { + .name = name_radio, .amux = LINE2, - }, - }, - [SAA7134_BOARD_GOTVIEW_7135] = { + }, + }, + [SAA7134_BOARD_GOTVIEW_7135] = { /* Mike Baikov */ /* Andrey Cvetcov */ - .name = "GoTView 7135 PCI", - .audio_clock = 0x00187de7, - .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, - .gpiomask = 0x00200003, - .inputs = {{ - .name = name_tv, - .vmux = 1, - .amux = TV, - .tv = 1, - .gpio = 0x00200003, - },{ - .name = name_tv_mono, - .vmux = 1, - .amux = LINE2, - .gpio = 0x00200003, - },{ - .name = name_comp1, - .vmux = 3, - .amux = LINE1, - .gpio = 0x00200003, - },{ - .name = name_svideo, - .vmux = 8, - .amux = LINE1, - .gpio = 0x00200003, - }}, - .radio = { - .name = name_radio, - .amux = LINE2, - .gpio = 0x00200003, - }, - .mute = { - .name = name_mute, - .amux = TV, - .gpio = 0x00200003, - }, - }, + .name = "GoTView 7135 PCI", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .tda9887_conf = TDA9887_PRESENT, + .gpiomask = 0x00200003, + .inputs = {{ + .name = name_tv, + .vmux = 1, + .amux = TV, + .tv = 1, + .gpio = 0x00200003, + },{ + .name = name_tv_mono, + .vmux = 1, + .amux = LINE2, + .gpio = 0x00200003, + },{ + .name = name_comp1, + .vmux = 3, + .amux = LINE1, + .gpio = 0x00200003, + },{ + .name = name_svideo, + .vmux = 8, + .amux = LINE1, + .gpio = 0x00200003, + }}, + .radio = { + .name = name_radio, + .amux = LINE2, + .gpio = 0x00200003, + }, + .mute = { + .name = name_mute, + .amux = TV, + .gpio = 0x00200003, + }, + }, [SAA7134_BOARD_PHILIPS_EUROPA] = { .name = "Philips EUROPA V3 reference design", .audio_clock = 0x00187de7, @@ -2251,78 +2251,78 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE1, }}, }, - [SAA7134_BOARD_RTD_VFG7350] = { - .name = "RTD Embedded Technologies VFG7350", - .audio_clock = 0x00200000, - .tuner_type = TUNER_ABSENT, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .inputs = {{ - .name = "Composite 0", - .vmux = 0, - .amux = LINE1, - },{ - .name = "Composite 1", - .vmux = 1, - .amux = LINE2, - },{ - .name = "Composite 2", - .vmux = 2, - .amux = LINE1, - },{ - .name = "Composite 3", - .vmux = 3, - .amux = LINE2, - },{ - .name = "S-Video 0", - .vmux = 8, - .amux = LINE1, - },{ - .name = "S-Video 1", - .vmux = 9, - .amux = LINE2, - }}, - .mpeg = SAA7134_MPEG_EMPRESS, - .video_out = CCIR656, + [SAA7134_BOARD_RTD_VFG7350] = { + .name = "RTD Embedded Technologies VFG7350", + .audio_clock = 0x00200000, + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .inputs = {{ + .name = "Composite 0", + .vmux = 0, + .amux = LINE1, + },{ + .name = "Composite 1", + .vmux = 1, + .amux = LINE2, + },{ + .name = "Composite 2", + .vmux = 2, + .amux = LINE1, + },{ + .name = "Composite 3", + .vmux = 3, + .amux = LINE2, + },{ + .name = "S-Video 0", + .vmux = 8, + .amux = LINE1, + },{ + .name = "S-Video 1", + .vmux = 9, + .amux = LINE2, + }}, + .mpeg = SAA7134_MPEG_EMPRESS, + .video_out = CCIR656, .vid_port_opts = ( SET_T_CODE_POLARITY_NON_INVERTED | SET_CLOCK_NOT_DELAYED | SET_CLOCK_INVERTED | SET_VSYNC_OFF ), - }, - [SAA7134_BOARD_RTD_VFG7330] = { - .name = "RTD Embedded Technologies VFG7330", - .audio_clock = 0x00200000, - .tuner_type = TUNER_ABSENT, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .inputs = {{ - .name = "Composite 0", - .vmux = 0, - .amux = LINE1, - },{ - .name = "Composite 1", - .vmux = 1, - .amux = LINE2, - },{ - .name = "Composite 2", - .vmux = 2, - .amux = LINE1, - },{ - .name = "Composite 3", - .vmux = 3, - .amux = LINE2, - },{ - .name = "S-Video 0", - .vmux = 8, - .amux = LINE1, - },{ - .name = "S-Video 1", - .vmux = 9, - .amux = LINE2, - }}, - }, + }, + [SAA7134_BOARD_RTD_VFG7330] = { + .name = "RTD Embedded Technologies VFG7330", + .audio_clock = 0x00200000, + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .inputs = {{ + .name = "Composite 0", + .vmux = 0, + .amux = LINE1, + },{ + .name = "Composite 1", + .vmux = 1, + .amux = LINE2, + },{ + .name = "Composite 2", + .vmux = 2, + .amux = LINE1, + },{ + .name = "Composite 3", + .vmux = 3, + .amux = LINE2, + },{ + .name = "S-Video 0", + .vmux = 8, + .amux = LINE1, + },{ + .name = "S-Video 1", + .vmux = 9, + .amux = LINE2, + }}, + }, [SAA7134_BOARD_FLYTVPLATINUM_MINI2] = { .name = "LifeView FlyTV Platinum Mini2", .audio_clock = 0x00200000, @@ -2760,55 +2760,55 @@ struct pci_device_id saa7134_pci_tbl[] = { .subvendor = 0x0000, /* It shouldn't break anything, since subdevice id seems unique */ .subdevice = 0x4091, .driver_data = SAA7134_BOARD_BEHOLD_409FM, - },{ - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x5456, /* GoTView */ - .subdevice = 0x7135, - .driver_data = SAA7134_BOARD_GOTVIEW_7135, - },{ + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x5456, /* GoTView */ + .subdevice = 0x7135, + .driver_data = SAA7134_BOARD_GOTVIEW_7135, + },{ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, .subvendor = PCI_VENDOR_ID_PHILIPS, .subdevice = 0x2004, .driver_data = SAA7134_BOARD_PHILIPS_EUROPA, - },{ + },{ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, .subvendor = 0x185b, .subdevice = 0xc900, .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_300, - },{ + },{ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, .subvendor = 0x185b, .subdevice = 0xc901, .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_200, },{ - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x1435, - .subdevice = 0x7350, - .driver_data = SAA7134_BOARD_RTD_VFG7350, - },{ - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x1435, - .subdevice = 0x7330, - .driver_data = SAA7134_BOARD_RTD_VFG7330, - },{ - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x1461, - .subdevice = 0x1044, - .driver_data = SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180, - },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1435, + .subdevice = 0x7350, + .driver_data = SAA7134_BOARD_RTD_VFG7350, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1435, + .subdevice = 0x7330, + .driver_data = SAA7134_BOARD_RTD_VFG7330, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1461, + .subdevice = 0x1044, + .driver_data = SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180, + },{ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7133, .subvendor = 0x1131, .subdevice = 0x4ee9, .driver_data = SAA7134_BOARD_MONSTERTV_MOBILE, - },{ + },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, @@ -3051,7 +3051,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) case SAA7134_BOARD_VIDEOMATE_DVBT_300: /* The Philips EUROPA based hybrid boards have the tuner connected through * the channel decoder. We have to make it transparent to find it - */ + */ { struct tuner_setup tun_setup; u8 data[] = { 0x07, 0x02}; @@ -3063,7 +3063,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) tun_setup.addr = dev->tuner_addr; saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); - } + } break; } return 0; diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 907dbd4de7c9..afa0cfce6578 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c @@ -201,10 +201,10 @@ static int pending_call(struct notifier_block *self, unsigned long state, if (module != THIS_MODULE || state != MODULE_STATE_LIVE) return NOTIFY_DONE; - if (need_empress) - request_module("saa7134-empress"); - if (need_dvb) - request_module("saa7134-dvb"); + if (need_empress) + request_module("saa7134-empress"); + if (need_dvb) + request_module("saa7134-dvb"); return NOTIFY_DONE; } @@ -279,8 +279,8 @@ unsigned long saa7134_buffer_base(struct saa7134_buf *buf) int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt) { - __le32 *cpu; - dma_addr_t dma_addr; + __le32 *cpu; + dma_addr_t dma_addr; cpu = pci_alloc_consistent(pci, SAA7134_PGTABLE_SIZE, &dma_addr); if (NULL == cpu) @@ -440,7 +440,7 @@ int saa7134_set_dmabits(struct saa7134_dev *dev) ctrl |= SAA7134_MAIN_CTRL_TE0; irq |= SAA7134_IRQ1_INTE_RA0_1 | SAA7134_IRQ1_INTE_RA0_0; - cap = dev->video_q.curr->vb.field; + cap = dev->video_q.curr->vb.field; } /* video capture -- dma 1+2 (planar modes) */ @@ -646,7 +646,7 @@ static int saa7134_hwinit1(struct saa7134_dev *dev) saa_writel(SAA7134_IRQ1, 0); saa_writel(SAA7134_IRQ2, 0); - init_MUTEX(&dev->lock); + init_MUTEX(&dev->lock); spin_lock_init(&dev->slock); saa7134_track_gpio(dev,"pre-init"); @@ -704,7 +704,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) saa7134_tvaudio_init2(dev); /* enable IRQ's */ - irq2_mask = + irq2_mask = SAA7134_IRQ2_INTE_DEC3 | SAA7134_IRQ2_INTE_DEC2 | SAA7134_IRQ2_INTE_DEC1 | @@ -889,8 +889,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* print pci info */ pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); - pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); - printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, " + pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); + printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, " "latency: %d, mmio: 0x%lx\n", dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq, dev->pci_lat,pci_resource_start(pci_dev,0)); @@ -914,7 +914,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf; if (UNSET != tuner[dev->nr]) dev->tuner_type = tuner[dev->nr]; - printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", + printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", dev->name,pci_dev->subsystem_vendor, pci_dev->subsystem_device,saa7134_boards[dev->board].name, dev->board, card[dev->nr] == dev->board ? @@ -964,12 +964,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, request_module("tuner"); if (dev->tda9887_conf) request_module("tda9887"); - if (card_is_empress(dev)) { + if (card_is_empress(dev)) { request_module("saa6752hs"); request_module_depend("saa7134-empress",&need_empress); } - if (card_is_dvb(dev)) + if (card_is_dvb(dev)) request_module_depend("saa7134-dvb",&need_dvb); v4l2_prio_init(&dev->prio); @@ -1078,7 +1078,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, static void __devexit saa7134_finidev(struct pci_dev *pci_dev) { - struct saa7134_dev *dev = pci_get_drvdata(pci_dev); + struct saa7134_dev *dev = pci_get_drvdata(pci_dev); struct list_head *item; struct saa7134_mpeg_ops *mops; @@ -1173,10 +1173,10 @@ EXPORT_SYMBOL(saa7134_ts_unregister); /* ----------------------------------------------------------- */ static struct pci_driver saa7134_pci_driver = { - .name = "saa7134", - .id_table = saa7134_pci_tbl, - .probe = saa7134_initdev, - .remove = __devexit_p(saa7134_finidev), + .name = "saa7134", + .id_table = saa7134_pci_tbl, + .probe = saa7134_initdev, + .remove = __devexit_p(saa7134_finidev), }; static int saa7134_init(void) diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 87641f7e4322..5aadd44c2fa2 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c @@ -547,7 +547,7 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_ u8 tuner_buf[14]; struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf, - .len = sizeof(tuner_buf) }; + .len = sizeof(tuner_buf) }; int i, tuner_freq, if_freq; u32 N; switch (params->u.ofdm.bandwidth) { @@ -606,7 +606,7 @@ static void philips_tda827x_pll_sleep(struct dvb_frontend *fe) struct saa7134_dev *dev = fe->dvb->priv; static u8 tda827x_sleep[] = { 0x30, 0xd0}; struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, - .len = sizeof(tda827x_sleep) }; + .len = sizeof(tda827x_sleep) }; i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); } diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 77b627eb6483..e9ec69efb4c9 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c @@ -55,7 +55,7 @@ static void ts_reset_encoder(struct saa7134_dev* dev) saa_writeb(SAA7134_SPECIAL_MODE, 0x00); msleep(10); - saa_writeb(SAA7134_SPECIAL_MODE, 0x01); + saa_writeb(SAA7134_SPECIAL_MODE, 0x01); msleep(100); dev->empress_started = 0; } @@ -65,7 +65,7 @@ static int ts_init_encoder(struct saa7134_dev* dev) ts_reset_encoder(dev); saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, NULL); dev->empress_started = 1; - return 0; + return 0; } /* ------------------------------------------------------------------ */ @@ -169,7 +169,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, struct v4l2_capability *cap = arg; memset(cap,0,sizeof(*cap)); - strcpy(cap->driver, "saa7134"); + strcpy(cap->driver, "saa7134"); strlcpy(cap->card, saa7134_boards[dev->board].name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index 711aa8e85fac..2577d03485b8 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c @@ -239,7 +239,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, unsigned char data; int addr,rc,i,byte; - status = i2c_get_status(dev); + status = i2c_get_status(dev); if (!i2c_is_idle(status)) if (!i2c_reset(dev)) return -EIO; @@ -296,7 +296,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, rc = -EIO; if (!i2c_is_busy_wait(dev)) goto err; - status = i2c_get_status(dev); + status = i2c_get_status(dev); if (i2c_is_error(status)) goto err; /* ensure that the bus is idle for at least one bit slot */ @@ -348,12 +348,12 @@ static int attach_inform(struct i2c_client *client) client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup); } - } + } if (tuner != UNSET) { - tun_setup.type = tuner; - tun_setup.addr = saa7134_boards[dev->board].tuner_addr; + tun_setup.type = tuner; + tun_setup.addr = saa7134_boards[dev->board].tuner_addr; if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) { @@ -361,11 +361,11 @@ static int attach_inform(struct i2c_client *client) client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup); } - } + } client->driver->command(client, TDA9887_SET_CONFIG, &conf); - return 0; + return 0; } static struct i2c_algorithm saa7134_algo = { diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index 9dc41c1427a8..7ce0459989b5 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c @@ -114,24 +114,24 @@ static IR_KEYTAB_TYPE cinergy_codes[IR_KEYTAB_SIZE] = { /* Alfons Geser * updates from Job D. R. Borges */ static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = { - [ 18 ] = KEY_POWER, - [ 1 ] = KEY_TV, // DVR - [ 21 ] = KEY_DVD, // DVD - [ 23 ] = KEY_AUDIO, // music - // DVR mode / DVD mode / music mode - - [ 27 ] = KEY_MUTE, // mute - [ 2 ] = KEY_LANGUAGE, // MTS/SAP / audio / autoseek - [ 30 ] = KEY_SUBTITLE, // closed captioning / subtitle / seek - [ 22 ] = KEY_ZOOM, // full screen - [ 28 ] = KEY_VIDEO, // video source / eject / delall - [ 29 ] = KEY_RESTART, // playback / angle / del - [ 47 ] = KEY_SEARCH, // scan / menu / playlist - [ 48 ] = KEY_CHANNEL, // CH surfing / bookmark / memo - - [ 49 ] = KEY_HELP, // help - [ 50 ] = KEY_MODE, // num/memo - [ 51 ] = KEY_ESC, // cancel + [ 18 ] = KEY_POWER, + [ 1 ] = KEY_TV, // DVR + [ 21 ] = KEY_DVD, // DVD + [ 23 ] = KEY_AUDIO, // music + // DVR mode / DVD mode / music mode + + [ 27 ] = KEY_MUTE, // mute + [ 2 ] = KEY_LANGUAGE, // MTS/SAP / audio / autoseek + [ 30 ] = KEY_SUBTITLE, // closed captioning / subtitle / seek + [ 22 ] = KEY_ZOOM, // full screen + [ 28 ] = KEY_VIDEO, // video source / eject / delall + [ 29 ] = KEY_RESTART, // playback / angle / del + [ 47 ] = KEY_SEARCH, // scan / menu / playlist + [ 48 ] = KEY_CHANNEL, // CH surfing / bookmark / memo + + [ 49 ] = KEY_HELP, // help + [ 50 ] = KEY_MODE, // num/memo + [ 51 ] = KEY_ESC, // cancel [ 12 ] = KEY_UP, // up [ 16 ] = KEY_DOWN, // down @@ -148,24 +148,24 @@ static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = { [ 45 ] = KEY_PLAY, // play [ 46 ] = KEY_SHUFFLE, // snapshot / shuffle - [ 0 ] = KEY_KP0, - [ 5 ] = KEY_KP1, - [ 6 ] = KEY_KP2, - [ 7 ] = KEY_KP3, - [ 9 ] = KEY_KP4, - [ 10 ] = KEY_KP5, - [ 11 ] = KEY_KP6, - [ 13 ] = KEY_KP7, - [ 14 ] = KEY_KP8, - [ 15 ] = KEY_KP9, - - [ 42 ] = KEY_VOLUMEUP, - [ 17 ] = KEY_VOLUMEDOWN, - [ 24 ] = KEY_CHANNELUP, // CH.tracking up - [ 25 ] = KEY_CHANNELDOWN, // CH.tracking down - - [ 19 ] = KEY_KPENTER, // enter - [ 33 ] = KEY_KPDOT, // . (decimal dot) + [ 0 ] = KEY_KP0, + [ 5 ] = KEY_KP1, + [ 6 ] = KEY_KP2, + [ 7 ] = KEY_KP3, + [ 9 ] = KEY_KP4, + [ 10 ] = KEY_KP5, + [ 11 ] = KEY_KP6, + [ 13 ] = KEY_KP7, + [ 14 ] = KEY_KP8, + [ 15 ] = KEY_KP9, + + [ 42 ] = KEY_VOLUMEUP, + [ 17 ] = KEY_VOLUMEDOWN, + [ 24 ] = KEY_CHANNELUP, // CH.tracking up + [ 25 ] = KEY_CHANNELDOWN, // CH.tracking down + + [ 19 ] = KEY_KPENTER, // enter + [ 33 ] = KEY_KPDOT, // . (decimal dot) }; static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = { @@ -455,13 +455,13 @@ static int build_key(struct saa7134_dev *dev) saa_setb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN); gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2); - if (ir->polling) { - if (ir->last_gpio == gpio) - return 0; - ir->last_gpio = gpio; - } + if (ir->polling) { + if (ir->last_gpio == gpio) + return 0; + ir->last_gpio = gpio; + } - data = ir_extract_bits(gpio, ir->mask_keycode); + data = ir_extract_bits(gpio, ir->mask_keycode); dprintk("build_key gpio=0x%x mask=0x%x data=%d\n", gpio, ir->mask_keycode, data); @@ -478,9 +478,9 @@ static int build_key(struct saa7134_dev *dev) void saa7134_input_irq(struct saa7134_dev *dev) { - struct saa7134_ir *ir = dev->remote; + struct saa7134_ir *ir = dev->remote; - if (!ir->polling) + if (!ir->polling) build_key(dev); } @@ -515,7 +515,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) switch (dev->board) { case SAA7134_BOARD_FLYVIDEO2000: case SAA7134_BOARD_FLYVIDEO3000: - case SAA7134_BOARD_FLYTVPLATINUM_FM: + case SAA7134_BOARD_FLYTVPLATINUM_FM: case SAA7134_BOARD_FLYTVPLATINUM_MINI2: ir_codes = flyvideo_codes; mask_keycode = 0xEC00000; @@ -557,7 +557,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) saa_setb(SAA7134_GPIO_GPMODE0, 0x4); saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); break; - case SAA7134_BOARD_KWORLD_TERMINATOR: + case SAA7134_BOARD_KWORLD_TERMINATOR: ir_codes = avacssmart_codes; mask_keycode = 0x00001f; mask_keyup = 0x000060; @@ -571,7 +571,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) mask_keyup = 0x004000; polling = 50; // ms break; - case SAA7134_BOARD_GOTVIEW_7135: + case SAA7134_BOARD_GOTVIEW_7135: ir_codes = gotview7135_codes; mask_keycode = 0x0003EC; mask_keyup = 0x008000; @@ -585,8 +585,8 @@ int saa7134_input_init1(struct saa7134_dev *dev) mask_keyup = 0x400000; polling = 50; // ms break; - case SAA7134_BOARD_VIDEOMATE_DVBT_300: - case SAA7134_BOARD_VIDEOMATE_DVBT_200: + case SAA7134_BOARD_VIDEOMATE_DVBT_300: + case SAA7134_BOARD_VIDEOMATE_DVBT_200: ir_codes = videomate_tv_pvr_codes; mask_keycode = 0x003F00; mask_keyup = 0x040000; @@ -610,7 +610,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) ir->mask_keycode = mask_keycode; ir->mask_keydown = mask_keydown; ir->mask_keyup = mask_keyup; - ir->polling = polling; + ir->polling = polling; /* init input device */ snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)", diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index b1dcb4d10788..f1b0e0d93d7b 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c @@ -64,7 +64,7 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) dev->oss.bufsize = blksize * blocks; dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", - blocks,blksize,blksize * blocks / 1024); + blocks,blksize,blksize * blocks / 1024); return 0; } @@ -371,20 +371,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file, if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); - switch (cmd) { - case OSS_GETVERSION: - return put_user(SOUND_VERSION, p); - case SNDCTL_DSP_GETCAPS: + switch (cmd) { + case OSS_GETVERSION: + return put_user(SOUND_VERSION, p); + case SNDCTL_DSP_GETCAPS: return 0; - case SNDCTL_DSP_SPEED: + case SNDCTL_DSP_SPEED: if (get_user(val, p)) return -EFAULT; /* fall through */ - case SOUND_PCM_READ_RATE: + case SOUND_PCM_READ_RATE: return put_user(dev->oss.rate, p); - case SNDCTL_DSP_STEREO: + case SNDCTL_DSP_STEREO: if (get_user(val, p)) return -EFAULT; down(&dev->oss.lock); @@ -396,7 +396,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, up(&dev->oss.lock); return put_user(dev->oss.channels-1, p); - case SNDCTL_DSP_CHANNELS: + case SNDCTL_DSP_CHANNELS: if (get_user(val, p)) return -EFAULT; if (val != 1 && val != 2) @@ -409,15 +409,15 @@ static int dsp_ioctl(struct inode *inode, struct file *file, } up(&dev->oss.lock); /* fall through */ - case SOUND_PCM_READ_CHANNELS: + case SOUND_PCM_READ_CHANNELS: return put_user(dev->oss.channels, p); - case SNDCTL_DSP_GETFMTS: /* Returns a mask */ + case SNDCTL_DSP_GETFMTS: /* Returns a mask */ return put_user(AFMT_U8 | AFMT_S8 | AFMT_U16_LE | AFMT_U16_BE | AFMT_S16_LE | AFMT_S16_BE, p); - case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */ + case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */ if (get_user(val, p)) return -EFAULT; switch (val) { @@ -442,7 +442,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, return -EINVAL; } - case SOUND_PCM_READ_BITS: + case SOUND_PCM_READ_BITS: switch (dev->oss.afmt) { case AFMT_U8: case AFMT_S8: @@ -456,20 +456,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file, return -EINVAL; } - case SNDCTL_DSP_NONBLOCK: - file->f_flags |= O_NONBLOCK; - return 0; + case SNDCTL_DSP_NONBLOCK: + file->f_flags |= O_NONBLOCK; + return 0; - case SNDCTL_DSP_RESET: + case SNDCTL_DSP_RESET: down(&dev->oss.lock); if (dev->oss.recording_on) dsp_rec_stop(dev); up(&dev->oss.lock); return 0; - case SNDCTL_DSP_GETBLKSIZE: + case SNDCTL_DSP_GETBLKSIZE: return put_user(dev->oss.blksize, p); - case SNDCTL_DSP_SETFRAGMENT: + case SNDCTL_DSP_SETFRAGMENT: if (get_user(val, p)) return -EFAULT; if (dev->oss.recording_on) @@ -480,7 +480,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, dsp_buffer_init(dev); return 0; - case SNDCTL_DSP_SYNC: + case SNDCTL_DSP_SYNC: /* NOP */ return 0; @@ -563,7 +563,7 @@ mixer_recsrc_7133(struct saa7134_dev *dev) switch (dev->oss.input) { case TV: xbarin = 0; // Demodulator - anabar = 2; // DACs + anabar = 2; // DACs break; case LINE1: anabar = 0; // aux1, aux1 @@ -667,28 +667,28 @@ static int mixer_ioctl(struct inode *inode, struct file *file, if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); - switch (cmd) { - case OSS_GETVERSION: - return put_user(SOUND_VERSION, p); + switch (cmd) { + case OSS_GETVERSION: + return put_user(SOUND_VERSION, p); case SOUND_MIXER_INFO: { mixer_info info; memset(&info,0,sizeof(info)); - strlcpy(info.id, "TV audio", sizeof(info.id)); - strlcpy(info.name, dev->name, sizeof(info.name)); - info.modify_counter = dev->oss.count; - if (copy_to_user(argp, &info, sizeof(info))) - return -EFAULT; + strlcpy(info.id, "TV audio", sizeof(info.id)); + strlcpy(info.name, dev->name, sizeof(info.name)); + info.modify_counter = dev->oss.count; + if (copy_to_user(argp, &info, sizeof(info))) + return -EFAULT; return 0; } case SOUND_OLD_MIXER_INFO: { _old_mixer_info info; memset(&info,0,sizeof(info)); - strlcpy(info.id, "TV audio", sizeof(info.id)); - strlcpy(info.name, dev->name, sizeof(info.name)); - if (copy_to_user(argp, &info, sizeof(info))) - return -EFAULT; + strlcpy(info.id, "TV audio", sizeof(info.id)); + strlcpy(info.name, dev->name, sizeof(info.name)); + if (copy_to_user(argp, &info, sizeof(info))) + return -EFAULT; return 0; } case MIXER_READ(SOUND_MIXER_CAPS): @@ -771,7 +771,7 @@ struct file_operations saa7134_mixer_fops = { int saa7134_oss_init1(struct saa7134_dev *dev) { /* general */ - init_MUTEX(&dev->oss.lock); + init_MUTEX(&dev->oss.lock); init_waitqueue_head(&dev->oss.wq); switch (dev->pci->device) { diff --git a/drivers/media/video/saa7134/saa7134-reg.h b/drivers/media/video/saa7134/saa7134-reg.h index 58c521fade85..ac6431ba4fc3 100644 --- a/drivers/media/video/saa7134/saa7134-reg.h +++ b/drivers/media/video/saa7134/saa7134-reg.h @@ -27,7 +27,7 @@ /* DMA channels, n = 0 ... 6 */ #define SAA7134_RS_BA1(n) ((0x200 >> 2) + 4*n) -#define SAA7134_RS_BA2(n) ((0x204 >> 2) + 4*n) +#define SAA7134_RS_BA2(n) ((0x204 >> 2) + 4*n) #define SAA7134_RS_PITCH(n) ((0x208 >> 2) + 4*n) #define SAA7134_RS_CONTROL(n) ((0x20c >> 2) + 4*n) #define SAA7134_RS_CONTROL_WSWAP (0x01 << 25) @@ -53,14 +53,14 @@ /* main control */ #define SAA7134_MAIN_CTRL (0x2a8 >> 2) -#define SAA7134_MAIN_CTRL_VPLLE (1 << 15) -#define SAA7134_MAIN_CTRL_APLLE (1 << 14) -#define SAA7134_MAIN_CTRL_EXOSC (1 << 13) -#define SAA7134_MAIN_CTRL_EVFE1 (1 << 12) -#define SAA7134_MAIN_CTRL_EVFE2 (1 << 11) -#define SAA7134_MAIN_CTRL_ESFE (1 << 10) -#define SAA7134_MAIN_CTRL_EBADC (1 << 9) -#define SAA7134_MAIN_CTRL_EBDAC (1 << 8) +#define SAA7134_MAIN_CTRL_VPLLE (1 << 15) +#define SAA7134_MAIN_CTRL_APLLE (1 << 14) +#define SAA7134_MAIN_CTRL_EXOSC (1 << 13) +#define SAA7134_MAIN_CTRL_EVFE1 (1 << 12) +#define SAA7134_MAIN_CTRL_EVFE2 (1 << 11) +#define SAA7134_MAIN_CTRL_ESFE (1 << 10) +#define SAA7134_MAIN_CTRL_EBADC (1 << 9) +#define SAA7134_MAIN_CTRL_EBDAC (1 << 8) #define SAA7134_MAIN_CTRL_TE6 (1 << 6) #define SAA7134_MAIN_CTRL_TE5 (1 << 5) #define SAA7134_MAIN_CTRL_TE4 (1 << 4) diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c index cdfd69873ba9..470903e2f5e5 100644 --- a/drivers/media/video/saa7134/saa7134-ts.c +++ b/drivers/media/video/saa7134/saa7134-ts.c @@ -111,8 +111,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, /* dma: setup channel 5 (= TS) */ control = SAA7134_RS_CONTROL_BURST_16 | - SAA7134_RS_CONTROL_ME | - (buf->pt->dma >> 12); + SAA7134_RS_CONTROL_ME | + (buf->pt->dma >> 12); saa_writeb(SAA7134_TS_DMA0, ((lines-1)&0xff)); saa_writeb(SAA7134_TS_DMA1, (((lines-1)>>8)&0xff)); diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c index fdca6c563b96..3daf1b597958 100644 --- a/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -246,7 +246,7 @@ static void mute_input_7134(struct saa7134_dev *dev) if (PCI_DEVICE_ID_PHILIPS_SAA7134 == dev->pci->device) /* 7134 mute */ saa_writeb(SAA7134_AUDIO_MUTE_CTRL, mute ? - SAA7134_MUTE_MASK | + SAA7134_MUTE_MASK | SAA7134_MUTE_ANALOG | SAA7134_MUTE_I2S : SAA7134_MUTE_MASK); @@ -761,17 +761,17 @@ static int mute_input_7133(struct saa7134_dev *dev) /* switch gpio-connected external audio mux */ - if (0 != card(dev).gpiomask) { - mask = card(dev).gpiomask; + if (0 != card(dev).gpiomask) { + mask = card(dev).gpiomask; if (card(dev).mute.name && dev->ctl_mute) in = &card(dev).mute; else in = dev->input; - saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask); - saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, in->gpio); - saa7134_track_gpio(dev,in->name); + saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask); + saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, in->gpio); + saa7134_track_gpio(dev,in->name); } return 0; diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index cd5545b2d60b..86db7fb96efd 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c @@ -310,12 +310,12 @@ static struct saa7134_tvnorm tvnorms[] = { .h_start = 0, .h_stop = 719, - .video_v_start = 23, - .video_v_stop = 262, - .vbi_v_start_0 = 10, - .vbi_v_stop_0 = 21, - .vbi_v_start_1 = 273, - .src_timing = 7, + .video_v_start = 23, + .video_v_stop = 262, + .vbi_v_start_0 = 10, + .vbi_v_stop_0 = 21, + .vbi_v_start_1 = 273, + .src_timing = 7, .sync_control = 0x18, .luma_control = 0x40, @@ -659,7 +659,7 @@ static void set_size(struct saa7134_dev *dev, int task, prescale = 1; xscale = 1024 * dev->crop_current.width / prescale / width; yscale = 512 * div * dev->crop_current.height / height; - dprintk("prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale); + dprintk("prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale); set_h_prescale(dev,task,prescale); saa_writeb(SAA7134_H_SCALE_INC1(task), xscale & 0xff); saa_writeb(SAA7134_H_SCALE_INC2(task), xscale >> 8); @@ -789,20 +789,20 @@ static int verify_preview(struct saa7134_dev *dev, struct v4l2_window *win) maxh = dev->crop_current.height; if (V4L2_FIELD_ANY == field) { - field = (win->w.height > maxh/2) - ? V4L2_FIELD_INTERLACED - : V4L2_FIELD_TOP; - } - switch (field) { - case V4L2_FIELD_TOP: - case V4L2_FIELD_BOTTOM: - maxh = maxh / 2; - break; - case V4L2_FIELD_INTERLACED: - break; - default: - return -EINVAL; - } + field = (win->w.height > maxh/2) + ? V4L2_FIELD_INTERLACED + : V4L2_FIELD_TOP; + } + switch (field) { + case V4L2_FIELD_TOP: + case V4L2_FIELD_BOTTOM: + maxh = maxh / 2; + break; + case V4L2_FIELD_INTERLACED: + break; + default: + return -EINVAL; + } win->field = field; if (win->w.width > maxw) @@ -1343,13 +1343,13 @@ video_poll(struct file *file, struct poll_table_struct *wait) if (res_locked(fh->dev,RESOURCE_VIDEO)) { up(&fh->cap.lock); return POLLERR; - } - if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { - up(&fh->cap.lock); - return POLLERR; - } - fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); - fh->cap.read_off = 0; + } + if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { + up(&fh->cap.lock); + return POLLERR; + } + fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); + fh->cap.read_off = 0; } up(&fh->cap.lock); buf = fh->cap.read_buf; @@ -1706,7 +1706,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, unsigned int tuner_type = dev->tuner_type; memset(cap,0,sizeof(*cap)); - strcpy(cap->driver, "saa7134"); + strcpy(cap->driver, "saa7134"); strlcpy(cap->card, saa7134_boards[dev->board].name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); @@ -1934,26 +1934,26 @@ static int video_do_ioctl(struct inode *inode, struct file *file, } case VIDIOC_S_AUDIO: return 0; - case VIDIOC_G_PARM: - { - struct v4l2_captureparm *parm = arg; - memset(parm,0,sizeof(*parm)); - return 0; - } - - case VIDIOC_G_PRIORITY: - { - enum v4l2_priority *p = arg; - - *p = v4l2_prio_max(&dev->prio); - return 0; - } - case VIDIOC_S_PRIORITY: - { - enum v4l2_priority *prio = arg; - - return v4l2_prio_change(&dev->prio, &fh->prio, *prio); - } + case VIDIOC_G_PARM: + { + struct v4l2_captureparm *parm = arg; + memset(parm,0,sizeof(*parm)); + return 0; + } + + case VIDIOC_G_PRIORITY: + { + enum v4l2_priority *p = arg; + + *p = v4l2_prio_max(&dev->prio); + return 0; + } + case VIDIOC_S_PRIORITY: + { + enum v4l2_priority *prio = arg; + + return v4l2_prio_change(&dev->prio, &fh->prio, *prio); + } /* --- preview ioctls ---------------------------------------- */ case VIDIOC_ENUM_FMT: @@ -2102,7 +2102,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, { int res = saa7134_resource(fh); - if (!res_get(dev,fh,res)) + if (!res_get(dev,fh,res)) return -EBUSY; return videobuf_streamon(saa7134_queue(fh)); } @@ -2144,7 +2144,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, struct v4l2_capability *cap = arg; memset(cap,0,sizeof(*cap)); - strcpy(cap->driver, "saa7134"); + strcpy(cap->driver, "saa7134"); strlcpy(cap->card, saa7134_boards[dev->board].name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); @@ -2275,7 +2275,7 @@ struct video_device saa7134_video_template = { .name = "saa7134-video", .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| - VID_TYPE_CLIPPING|VID_TYPE_SCALES, + VID_TYPE_CLIPPING|VID_TYPE_SCALES, .hardware = 0, .fops = &video_fops, .minor = -1, @@ -2322,7 +2322,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) dev->tda9887_conf |= TDA9887_AUTOMUTE; dev->automute = 0; - INIT_LIST_HEAD(&dev->video_q.queue); + INIT_LIST_HEAD(&dev->video_q.queue); init_timer(&dev->video_q.timeout); dev->video_q.timeout.function = saa7134_buffer_timeout; dev->video_q.timeout.data = (unsigned long)(&dev->video_q); diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 99bbdcf727c3..064c2f7a8c12 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h @@ -346,7 +346,7 @@ struct saa7134_fh { /* oss dsp status */ struct saa7134_oss { - struct semaphore lock; + struct semaphore lock; int minor_mixer; int minor_dsp; unsigned int users_dsp; @@ -384,9 +384,9 @@ struct saa7134_ir { u32 mask_keycode; u32 mask_keydown; u32 mask_keyup; - int polling; - u32 last_gpio; - struct timer_list timer; + int polling; + u32 last_gpio; + struct timer_list timer; }; /* ts/mpeg status */ @@ -409,8 +409,8 @@ struct saa7134_mpeg_ops { /* global device status */ struct saa7134_dev { struct list_head devlist; - struct semaphore lock; - spinlock_t slock; + struct semaphore lock; + spinlock_t slock; #ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio; #endif diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index 255b6088ebf9..14cf1d357c3b 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c @@ -310,9 +310,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind) memset(t,0,sizeof *t); client = &t->c; - memcpy(client,&client_template,sizeof(struct i2c_client)); - client->adapter = adap; - client->addr = addr; + memcpy(client,&client_template,sizeof(struct i2c_client)); + client->adapter = adap; + client->addr = addr; i2c_set_clientdata(client, t); do_tda7432_init(client); @@ -472,7 +472,7 @@ static int tda7432_command(struct i2c_client *client, } } - t->muted=(va->flags & VIDEO_AUDIO_MUTE); + t->muted=(va->flags & VIDEO_AUDIO_MUTE); if (t->muted) { /* Mute & update balance*/ @@ -503,12 +503,12 @@ static int tda7432_command(struct i2c_client *client, static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "i2c tda7432 driver", + .name = "i2c tda7432 driver", .id = I2C_DRIVERID_TDA7432, - .flags = I2C_DF_NOTIFY, + .flags = I2C_DF_NOTIFY, .attach_adapter = tda7432_probe, - .detach_client = tda7432_detach, - .command = tda7432_command, + .detach_client = tda7432_detach, + .command = tda7432_command, }; static struct i2c_client client_template = diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index 1e2acc4abbe6..e2027dada5d1 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c @@ -48,7 +48,7 @@ static struct freq_entry div_table[] = { { 0x1C34, 3 }, { 0x0D34, 2 }, { 0x067B, 1 }, - { 0x0000, 0 }, + { 0x0000, 0 }, }; static struct freq_entry agc_table[] = { diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index 7e3dcdb262b0..5a9faefc3640 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c @@ -126,20 +126,20 @@ static int tda9875_write(struct i2c_client *client, int subaddr, unsigned char v static int i2c_read_register(struct i2c_adapter *adap, int addr, int reg) { - unsigned char write[1]; - unsigned char read[1]; - struct i2c_msg msgs[2] = { - { addr, 0, 1, write }, - { addr, I2C_M_RD, 1, read } - }; - write[0] = reg; - - if (2 != i2c_transfer(adap,msgs,2)) { - printk(KERN_WARNING "tda9875: I/O error (read2)\n"); - return -1; - } - dprintk("tda9875: chip_read2: reg%d=0x%x\n",reg,read[0]); - return read[0]; + unsigned char write[1]; + unsigned char read[1]; + struct i2c_msg msgs[2] = { + { addr, 0, 1, write }, + { addr, I2C_M_RD, 1, read } + }; + write[0] = reg; + + if (2 != i2c_transfer(adap,msgs,2)) { + printk(KERN_WARNING "tda9875: I/O error (read2)\n"); + return -1; + } + dprintk("tda9875: chip_read2: reg%d=0x%x\n",reg,read[0]); + return read[0]; } static void tda9875_set(struct i2c_client *client) @@ -184,7 +184,7 @@ static void do_tda9875_init(struct i2c_client *client) tda9875_write(client, TDA9875_DACOS, 0x02 ); /* sig DAC i/o(in:nicam)*/ tda9875_write(client, TDA9875_ADCIS, 0x6f ); /* sig ADC input(in:mono)*/ tda9875_write(client, TDA9875_LOSR, 0x00 ); /* line out (in:mono)*/ - tda9875_write(client, TDA9875_AER, 0x00 ); /*06 Effect (AVL+PSEUDO) */ + tda9875_write(client, TDA9875_AER, 0x00 ); /*06 Effect (AVL+PSEUDO) */ tda9875_write(client, TDA9875_MCS, 0x44 ); /* Main ch select (DAC) */ tda9875_write(client, TDA9875_MVL, 0x03 ); /* Vol Main left 10dB */ tda9875_write(client, TDA9875_MVR, 0x03 ); /* Vol Main right 10dB*/ @@ -200,7 +200,7 @@ static void do_tda9875_init(struct i2c_client *client) t->mode=AUDIO_UNMUTE; t->lvol=t->rvol =0; /* 0dB */ - t->bass=0; /* 0dB */ + t->bass=0; /* 0dB */ t->treble=0; /* 0dB */ tda9875_set(client); @@ -239,9 +239,9 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind) memset(t,0,sizeof *t); client = &t->c; - memcpy(client,&client_template,sizeof(struct i2c_client)); - client->adapter = adap; - client->addr = addr; + memcpy(client,&client_template,sizeof(struct i2c_client)); + client->adapter = adap; + client->addr = addr; i2c_set_clientdata(client, t); if(!tda9875_checkit(adap,addr)) { @@ -287,7 +287,7 @@ static int tda9875_command(struct i2c_client *client, dprintk("In tda9875_command...\n"); switch (cmd) { - /* --- v4l ioctls --- */ + /* --- v4l ioctls --- */ /* take care: bttv does userspace copying, we'll get a kernel pointer here... */ case VIDIOCGAUDIO: @@ -355,7 +355,7 @@ static int tda9875_command(struct i2c_client *client, //printk("tda9875 bal:%04x vol:%04x bass:%04x treble:%04x\n",va->balance,va->volume,va->bass,va->treble); - tda9875_set(client); + tda9875_set(client); break; @@ -374,18 +374,18 @@ static int tda9875_command(struct i2c_client *client, static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "i2c tda9875 driver", - .id = I2C_DRIVERID_TDA9875, - .flags = I2C_DF_NOTIFY, + .name = "i2c tda9875 driver", + .id = I2C_DRIVERID_TDA9875, + .flags = I2C_DF_NOTIFY, .attach_adapter = tda9875_probe, - .detach_client = tda9875_detach, - .command = tda9875_command, + .detach_client = tda9875_detach, + .command = tda9875_command, }; static struct i2c_client client_template = { - .name = "tda9875", - .driver = &driver, + .name = "tda9875", + .driver = &driver, }; static int __init tda9875_init(void) diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 6d2914f738f2..9d6b6f57abcd 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -46,11 +46,11 @@ MODULE_LICENSE("GPL"); #define UNSET (-1U) #define tda9887_info(fmt, arg...) do {\ printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \ - i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) + i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ if (debug) \ - printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \ - i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) + printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \ + i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) struct tda9887 { struct i2c_client client; @@ -484,11 +484,11 @@ static int tda9887_set_pinnacle(struct tda9887 *t, char *buf) } } if (t->std & V4L2_STD_525_60) { - if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) { + if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) { bCarrierMode = cIntercarrier; } else { bCarrierMode = cQSS; - } + } } if (bCarrierMode != UNSET) { @@ -568,8 +568,8 @@ static int tda9887_status(struct tda9887 *t) int rc; memset(buf,0,sizeof(buf)); - if (1 != (rc = i2c_master_recv(&t->client,buf,1))) - tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc); + if (1 != (rc = i2c_master_recv(&t->client,buf,1))) + tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc); dump_read_message(t, buf); return 0; } @@ -600,8 +600,8 @@ static int tda9887_configure(struct tda9887 *t) if (debug > 1) dump_write_message(t, t->data); - if (4 != (rc = i2c_master_send(&t->client,t->data,4))) - tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); + if (4 != (rc = i2c_master_send(&t->client,t->data,4))) + tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); if (debug > 2) { msleep_interruptible(1000); @@ -616,11 +616,11 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind) { struct tda9887 *t; - client_template.adapter = adap; - client_template.addr = addr; + client_template.adapter = adap; + client_template.addr = addr; - if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) - return -ENOMEM; + if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) + return -ENOMEM; memset(t,0,sizeof(*t)); t->client = client_template; @@ -628,7 +628,7 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind) t->pinnacle_id = UNSET; t->radio_mode = V4L2_TUNER_MODE_STEREO; - tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name); + tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name); i2c_set_clientdata(&t->client, t); i2c_attach_client(&t->client); @@ -663,18 +663,18 @@ static int tda9887_detach(struct i2c_client *client) } #define SWITCH_V4L2 if (!t->using_v4l2 && debug) \ - tda9887_info("switching to v4l2\n"); \ - t->using_v4l2 = 1; + tda9887_info("switching to v4l2\n"); \ + t->using_v4l2 = 1; #define CHECK_V4L2 if (t->using_v4l2) { if (debug) \ tda9887_info("ignore v4l1 call\n"); \ - return 0; } + return 0; } static int tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) { struct tda9887 *t = i2c_get_clientdata(client); - switch (cmd) { + switch (cmd) { /* --- configuration --- */ case AUDC_SET_RADIO: diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index 38bf50943798..a9375ef05de1 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c @@ -117,10 +117,10 @@ #define TEA5767_RESERVED_MASK 0xff enum tea5767_xtal_freq { - TEA5767_LOW_LO_32768 = 0, - TEA5767_HIGH_LO_32768 = 1, - TEA5767_LOW_LO_13MHz = 2, - TEA5767_HIGH_LO_13MHz = 3, + TEA5767_LOW_LO_32768 = 0, + TEA5767_HIGH_LO_32768 = 1, + TEA5767_LOW_LO_13MHz = 2, + TEA5767_HIGH_LO_13MHz = 3, }; diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 44fa1423c1a9..e677869afcf3 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -432,23 +432,23 @@ static int tuner_detach(struct i2c_client *client) static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd) { - if (mode == t->mode) - return 0; - - t->mode = mode; - - if (check_mode(t, cmd) == EINVAL) { - t->mode = T_STANDBY; - if (t->standby) - t->standby (client); - return EINVAL; - } - return 0; + if (mode == t->mode) + return 0; + + t->mode = mode; + + if (check_mode(t, cmd) == EINVAL) { + t->mode = T_STANDBY; + if (t->standby) + t->standby (client); + return EINVAL; + } + return 0; } #define switch_v4l2() if (!t->using_v4l2) \ - tuner_dbg("switching to v4l2\n"); \ - t->using_v4l2 = 1; + tuner_dbg("switching to v4l2\n"); \ + t->using_v4l2 = 1; static inline int check_v4l2(struct tuner *t) { @@ -623,7 +623,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) switch_v4l2(); if (V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode) { - if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") + if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") == EINVAL) return 0; } diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index e67d9e77c755..84338f1e3038 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c @@ -102,7 +102,7 @@ struct tunertype */ static struct tunertype tuners[] = { /* 0-9 */ - { "Temic PAL (4002 FH5)", TEMIC, PAL, + { "Temic PAL (4002 FH5)", TEMIC, PAL, 16*140.25,16*463.25,0x02,0x04,0x01,0x8e,623}, { "Philips PAL_I (FI1246 and compatibles)", Philips, PAL_I, 16*140.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, @@ -118,41 +118,41 @@ static struct tunertype tuners[] = { 16*157.25,16*463.25,0x02,0x04,0x01,0x8e,732}, { "Temic PAL_I (4062 FY5)", TEMIC, PAL_I, 16*170.00,16*450.00,0x02,0x04,0x01,0x8e,623}, - { "Temic NTSC (4036 FY5)", TEMIC, NTSC, + { "Temic NTSC (4036 FY5)", TEMIC, NTSC, 16*157.25,16*463.25,0xa0,0x90,0x30,0x8e,732}, - { "Alps HSBH1", TEMIC, NTSC, + { "Alps HSBH1", TEMIC, NTSC, 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732}, /* 10-19 */ - { "Alps TSBE1", TEMIC, PAL, + { "Alps TSBE1", TEMIC, PAL, 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732}, - { "Alps TSBB5", Alps, PAL_I, /* tested (UK UHF) with Modulartech MM205 */ + { "Alps TSBB5", Alps, PAL_I, /* tested (UK UHF) with Modulartech MM205 */ 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,632}, - { "Alps TSBE5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ + { "Alps TSBE5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,622}, - { "Alps TSBC5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ + { "Alps TSBC5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,608}, { "Temic PAL_BG (4006FH5)", TEMIC, PAL, 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, - { "Alps TSCH6", Alps, NTSC, - 16*137.25,16*385.25,0x14,0x12,0x11,0x8e,732}, - { "Temic PAL_DK (4016 FY5)", TEMIC, PAL, - 16*168.25,16*456.25,0xa0,0x90,0x30,0x8e,623}, - { "Philips NTSC_M (MK2)", Philips, NTSC, - 16*160.00,16*454.00,0xa0,0x90,0x30,0x8e,732}, - { "Temic PAL_I (4066 FY5)", TEMIC, PAL_I, - 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, - { "Temic PAL* auto (4006 FN5)", TEMIC, PAL, - 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, + { "Alps TSCH6", Alps, NTSC, + 16*137.25,16*385.25,0x14,0x12,0x11,0x8e,732}, + { "Temic PAL_DK (4016 FY5)", TEMIC, PAL, + 16*168.25,16*456.25,0xa0,0x90,0x30,0x8e,623}, + { "Philips NTSC_M (MK2)", Philips, NTSC, + 16*160.00,16*454.00,0xa0,0x90,0x30,0x8e,732}, + { "Temic PAL_I (4066 FY5)", TEMIC, PAL_I, + 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, + { "Temic PAL* auto (4006 FN5)", TEMIC, PAL, + 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, /* 20-29 */ - { "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", TEMIC, PAL, - 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, - { "Temic NTSC (4039 FR5)", TEMIC, NTSC, - 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, - { "Temic PAL/SECAM multi (4046 FM5)", TEMIC, PAL, - 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, - { "Philips PAL_DK (FI1256 and compatibles)", Philips, PAL, + { "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", TEMIC, PAL, + 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, + { "Temic NTSC (4039 FR5)", TEMIC, NTSC, + 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, + { "Temic PAL/SECAM multi (4046 FM5)", TEMIC, PAL, + 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, + { "Philips PAL_DK (FI1256 and compatibles)", Philips, PAL, 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, { "Philips PAL/SECAM multi (FQ1216ME)", Philips, PAL, 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, @@ -173,21 +173,21 @@ static struct tunertype tuners[] = { { "SHARP NTSC_JP (2U5JF5540)", SHARP, NTSC, /* 940=16*58.75 NTSC@Japan */ 16*137.25,16*317.25,0x01,0x02,0x08,0x8e,940 }, { "Samsung PAL TCPM9091PD27", Samsung, PAL, /* from sourceforge v3tv */ - 16*169,16*464,0xA0,0x90,0x30,0x8e,623}, + 16*169,16*464,0xA0,0x90,0x30,0x8e,623}, { "MT20xx universal", Microtune, PAL|NTSC, /* see mt20xx.c for details */ }, { "Temic PAL_BG (4106 FH5)", TEMIC, PAL, - 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, + 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, { "Temic PAL_DK/SECAM_L (4012 FY5)", TEMIC, PAL, - 16*140.25, 16*463.25, 0x02,0x04,0x01,0x8e,623}, + 16*140.25, 16*463.25, 0x02,0x04,0x01,0x8e,623}, { "Temic NTSC (4136 FY5)", TEMIC, NTSC, - 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, - { "LG PAL (newer TAPC series)", LGINNOTEK, PAL, - 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,623}, + 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, + { "LG PAL (newer TAPC series)", LGINNOTEK, PAL, + 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,623}, { "Philips PAL/SECAM multi (FM1216ME MK3)", Philips, PAL, 16*158.00,16*442.00,0x01,0x02,0x04,0x8e,623 }, { "LG NTSC (newer TAPC series)", LGINNOTEK, NTSC, - 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,732}, + 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,732}, /* 40-49 */ { "HITACHI V7-J180AT", HITACHI, NTSC, @@ -196,24 +196,24 @@ static struct tunertype tuners[] = { 16*140.25,16*463.25,0x01,0xc2,0xcf,0x8e,623}, { "Philips 1236D ATSC/NTSC daul in", Philips, ATSC, 16*157.25,16*454.00,0xa0,0x90,0x30,0x8e,732}, - { "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", Philips, NTSC, - 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, - { "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", Philips, NTSC, - 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, + { "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", Philips, NTSC, + 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, + { "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", Philips, NTSC, + 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, { "Microtune 4049 FM5", Microtune, PAL, 16*141.00,16*464.00,0xa0,0x90,0x30,0x8e,623}, { "Panasonic VP27s/ENGE4324D", Panasonic, NTSC, 16*160.00,16*454.00,0x01,0x02,0x08,0xce,940}, - { "LG NTSC (TAPE series)", LGINNOTEK, NTSC, - 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, - { "Tenna TNF 8831 BGFF)", Philips, PAL, - 16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, + { "LG NTSC (TAPE series)", LGINNOTEK, NTSC, + 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, + { "Tenna TNF 8831 BGFF)", Philips, PAL, + 16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, { "Microtune 4042 FI5 ATSC/NTSC dual in", Microtune, NTSC, 16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732}, /* 50-59 */ - { "TCL 2002N", TCL, NTSC, - 16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732}, + { "TCL 2002N", TCL, NTSC, + 16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732}, { "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL, 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 }, { "Thomson DDT 7610 (ATSC/NTSC)", THOMSON, ATSC, @@ -223,7 +223,7 @@ static struct tunertype tuners[] = { { "tda8290+75", Philips, PAL|NTSC, /* see tda8290.c for details */ }, { "TCL 2002MB", TCL, PAL, - 16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623}, + 16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623}, { "Philips PAL/SECAM multi (FQ1216AME MK4)", Philips, PAL, 16*160.00,16*442.00,0x01,0x02,0x04,0xce,623 }, { "Philips FQ1236A MK4", Philips, NTSC, @@ -237,16 +237,16 @@ static struct tunertype tuners[] = { { "Thomson DDT 7611 (ATSC/NTSC)", THOMSON, ATSC, 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732}, { "Tena TNF9533-D/IF/TNF9533-B/DF", Philips, PAL, - 16*160.25,16*464.25,0x01,0x02,0x04,0x8e,623}, + 16*160.25,16*464.25,0x01,0x02,0x04,0x8e,623}, { "Philips TEA5767HN FM Radio", Philips, RADIO, - /* see tea5767.c for details */}, + /* see tea5767.c for details */}, { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, { "LG TDVS-H062F/TUA6034", LGINNOTEK, ATSC, 16*160.00,16*455.00,0x01,0x02,0x04,0x8e,732}, { "Ymec TVF66T5-B/DFF", Philips, PAL, - 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623}, - { "LG NTSC (TALN mini series)", LGINNOTEK, NTSC, + 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623}, + { "LG NTSC (TALN mini series)", LGINNOTEK, NTSC, 16*137.25,16*373.25,0x01,0x02,0x08,0x8e,732 }, { "Philips TD1316 Hybrid Tuner", Philips, PAL, 16*160.00,16*442.00,0xa1,0xa2,0xa4,0xc8,623 }, @@ -281,7 +281,7 @@ static int tuner_stereo(struct i2c_client *c) status = tuner_getstatus (c); switch (t->type) { - case TUNER_PHILIPS_FM1216ME_MK3: + case TUNER_PHILIPS_FM1216ME_MK3: case TUNER_PHILIPS_FM1236_MK3: case TUNER_PHILIPS_FM1256_IH3: stereo = ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); @@ -302,7 +302,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) u8 config; u16 div; struct tunertype *tun; - unsigned char buffer[4]; + unsigned char buffer[4]; int rc; tun = &tuners[t->type]; @@ -419,7 +419,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", buffer[0],buffer[1],buffer[2],buffer[3]); - if (4 != (rc = i2c_master_send(c,buffer,4))) + if (4 != (rc = i2c_master_send(c,buffer,4))) tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); if (t->type == TUNER_MICROTUNE_4042FI5) { @@ -458,7 +458,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) { struct tunertype *tun; struct tuner *t = i2c_get_clientdata(c); - unsigned char buffer[4]; + unsigned char buffer[4]; unsigned div; int rc; @@ -491,13 +491,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) buffer[3] = 0xa4; break; } - buffer[0] = (div>>8) & 0x7f; - buffer[1] = div & 0xff; + buffer[0] = (div>>8) & 0x7f; + buffer[1] = div & 0xff; tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n", buffer[0],buffer[1],buffer[2],buffer[3]); - if (4 != (rc = i2c_master_send(c,buffer,4))) + if (4 != (rc = i2c_master_send(c,buffer,4))) tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); } diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 1c31ef52f863..e1639a24f77f 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -458,8 +458,8 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode) #define TDA9855_LOUD 1<<5 /* Loudness, 1==off */ #define TDA9855_SUR 1<<3 /* Surround / Subwoofer 1==.5(L-R) 0==.5(L+R) */ /* Bits 0 to 3 select various combinations - * of line in and line out, only the - * interesting ones are defined */ + * of line in and line out, only the + * interesting ones are defined */ #define TDA9855_EXT 1<<2 /* Selects inputs LIR and LIL. Pins 41 & 12 */ #define TDA9855_INT 0 /* Selects inputs LOR and LOL. (internal) */ @@ -1028,7 +1028,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip) #define TEA6300_TR 0x03 /* treble */ #define TEA6300_FA 0x04 /* fader control */ #define TEA6300_S 0x05 /* switch register */ - /* values for those registers: */ + /* values for those registers: */ #define TEA6300_S_SA 0x01 /* stereo A input */ #define TEA6300_S_SB 0x02 /* stereo B */ #define TEA6300_S_SC 0x04 /* stereo C */ @@ -1042,7 +1042,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip) #define TEA6320_BA 0x05 /* bass (0-4) */ #define TEA6320_TR 0x06 /* treble (0-4) */ #define TEA6320_S 0x07 /* switch register */ - /* values for those registers: */ + /* values for those registers: */ #define TEA6320_S_SA 0x07 /* stereo A input */ #define TEA6320_S_SB 0x06 /* stereo B */ #define TEA6320_S_SC 0x05 /* stereo C */ @@ -1082,7 +1082,7 @@ static int tea6320_initialize(struct CHIPSTATE * chip) #define TDA8425_BA 0x02 /* bass */ #define TDA8425_TR 0x03 /* treble */ #define TDA8425_S1 0x08 /* switch functions */ - /* values for those registers: */ + /* values for those registers: */ #define TDA8425_S1_OFF 0xEE /* audio off (mute on) */ #define TDA8425_S1_CH1 0xCE /* audio channel 1 (mute off) - "linear stereo" mode */ #define TDA8425_S1_CH2 0xCF /* audio channel 2 (mute off) - "linear stereo" mode */ @@ -1148,7 +1148,7 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode) /* bit definition of the RESET register, I2C data. */ #define PIC16C54_MISC_RESET_REMOTE_CTL 0x01 /* bit 0, Reset to receive the key */ - /* code of remote controller */ + /* code of remote controller */ #define PIC16C54_MISC_MTS_MAIN 0x02 /* bit 1 */ #define PIC16C54_MISC_MTS_SAP 0x04 /* bit 2 */ #define PIC16C54_MISC_MTS_BOTH 0x08 /* bit 3 */ @@ -1281,7 +1281,7 @@ static struct CHIPDESC chiplist[] = { .setmode = tda9840_setmode, .checkmode = generic_checkmode, - .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN + .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN /* ,TDA9840_SW, TDA9840_MONO */} } }, { @@ -1467,7 +1467,7 @@ static struct CHIPDESC chiplist[] = { .setmode = ta8874z_setmode, .checkmode = generic_checkmode, - .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}}, + .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}}, }, { .name = NULL } /* EOF */ }; @@ -1486,8 +1486,8 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) return -ENOMEM; memset(chip,0,sizeof(*chip)); memcpy(&chip->c,&client_template,sizeof(struct i2c_client)); - chip->c.adapter = adap; - chip->c.addr = addr; + chip->c.adapter = adap; + chip->c.addr = addr; i2c_set_clientdata(&chip->c, chip); /* find description for the chip */ diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index ee605712bf19..68128e04dacc 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c @@ -6,12 +6,12 @@ * which are: Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) - & Marcus Metzler (mocm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 1999-2001 Gerd Knorr * Adjustments to fit a more general model and all bugs: - Copyright (C) 2003 John Klar + Copyright (C) 2003 John Klar * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,14 +54,14 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)"); #define tveeprom_info(fmt, arg...) do {\ printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ - c->adapter->nr, c->addr , ##arg); } while (0) + c->adapter->nr, c->addr , ##arg); } while (0) #define tveeprom_warn(fmt, arg...) do {\ printk(KERN_WARNING "tveeprom %d-%04x: " fmt, \ - c->adapter->nr, c->addr , ##arg); } while (0) + c->adapter->nr, c->addr , ##arg); } while (0) #define tveeprom_dbg(fmt, arg...) do {\ if (debug) \ - printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ - c->adapter->nr, c->addr , ##arg); } while (0) + printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ + c->adapter->nr, c->addr , ##arg); } while (0) /* ----------------------------------------------------------------------- */ @@ -294,7 +294,7 @@ static const char *decoderIC[] = { static int hasRadioTuner(int tunerType) { - switch (tunerType) { + switch (tunerType) { case 18: //PNPEnv_TUNER_FR1236_MK2: case 23: //PNPEnv_TUNER_FM1236: case 38: //PNPEnv_TUNER_FMR1236: @@ -326,12 +326,12 @@ static int hasRadioTuner(int tunerType) case 89: //PNPEnv_TUNER_TCL_MFPE05_2: case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4: return 1; - } - return 0; + } + return 0; } void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, - unsigned char *eeprom_data) + unsigned char *eeprom_data) { /* ---------------------------------------------- ** The hauppauge eeprom format is tagged diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c index d86e08ebddfc..8318bd1aad00 100644 --- a/drivers/media/video/tvmixer.c +++ b/drivers/media/video/tvmixer.c @@ -79,7 +79,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm { struct video_audio va; int left,right,ret,val = 0; - struct TVMIXER *mix = file->private_data; + struct TVMIXER *mix = file->private_data; struct i2c_client *client = mix->dev; void __user *argp = (void __user *)arg; int __user *p = argp; @@ -87,25 +87,25 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm if (NULL == client) return -ENODEV; - if (cmd == SOUND_MIXER_INFO) { - mixer_info info; - strlcpy(info.id, "tv card", sizeof(info.id)); - strlcpy(info.name, client->name, sizeof(info.name)); - info.modify_counter = 42 /* FIXME */; - if (copy_to_user(argp, &info, sizeof(info))) - return -EFAULT; - return 0; - } - if (cmd == SOUND_OLD_MIXER_INFO) { - _old_mixer_info info; - strlcpy(info.id, "tv card", sizeof(info.id)); - strlcpy(info.name, client->name, sizeof(info.name)); - if (copy_to_user(argp, &info, sizeof(info))) - return -EFAULT; - return 0; - } - if (cmd == OSS_GETVERSION) - return put_user(SOUND_VERSION, p); + if (cmd == SOUND_MIXER_INFO) { + mixer_info info; + strlcpy(info.id, "tv card", sizeof(info.id)); + strlcpy(info.name, client->name, sizeof(info.name)); + info.modify_counter = 42 /* FIXME */; + if (copy_to_user(argp, &info, sizeof(info))) + return -EFAULT; + return 0; + } + if (cmd == SOUND_OLD_MIXER_INFO) { + _old_mixer_info info; + strlcpy(info.id, "tv card", sizeof(info.id)); + strlcpy(info.name, client->name, sizeof(info.name)); + if (copy_to_user(argp, &info, sizeof(info))) + return -EFAULT; + return 0; + } + if (cmd == OSS_GETVERSION) + return put_user(SOUND_VERSION, p); if (_SIOC_DIR(cmd) & _SIOC_WRITE) if (get_user(val, p)) @@ -181,8 +181,8 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm static int tvmixer_open(struct inode *inode, struct file *file) { - int i, minor = iminor(inode); - struct TVMIXER *mix = NULL; + int i, minor = iminor(inode); + struct TVMIXER *mix = NULL; struct i2c_client *client = NULL; for (i = 0; i < DEV_MAX; i++) { @@ -204,7 +204,7 @@ static int tvmixer_open(struct inode *inode, struct file *file) #endif if (client->adapter->owner) try_module_get(client->adapter->owner); - return 0; + return 0; } static int tvmixer_release(struct inode *inode, struct file *file) @@ -231,15 +231,15 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, #endif .name = "tv card mixer driver", - .id = I2C_DRIVERID_TVMIXER, + .id = I2C_DRIVERID_TVMIXER, #ifdef I2C_DF_DUMMY .flags = I2C_DF_DUMMY, #else .flags = I2C_DF_NOTIFY, - .detach_adapter = tvmixer_adapters, + .detach_adapter = tvmixer_adapters, #endif - .attach_adapter = tvmixer_adapters, - .detach_client = tvmixer_clients, + .attach_adapter = tvmixer_adapters, + .detach_client = tvmixer_clients, }; static struct file_operations tvmixer_fops = { diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 88beb5a3be15..4134549d11a8 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -960,7 +960,7 @@ v4l_compat_translate_ioctl(struct inode *inode, fmt->start[1] = fmt2->fmt.vbi.start[1]; fmt->count[1] = fmt2->fmt.vbi.count[1]; fmt->flags = fmt2->fmt.vbi.flags & 0x03; - break; + break; } case VIDIOCSVBIFMT: { diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c index 574b8e36f3c6..acfd3a103f35 100644 --- a/drivers/media/video/video-buf.c +++ b/drivers/media/video/video-buf.c @@ -147,7 +147,7 @@ int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, data,size,dma->nr_pages); down_read(¤t->mm->mmap_sem); - err = get_user_pages(current,current->mm, + err = get_user_pages(current,current->mm, data & PAGE_MASK, dma->nr_pages, rw == READ, 1, /* force */ dma->pages, NULL); @@ -750,9 +750,9 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data, { enum v4l2_field field; unsigned long flags; - int retval; + int retval; - /* setup stuff */ + /* setup stuff */ retval = -ENOMEM; q->read_buf = videobuf_alloc(q->msize); if (NULL == q->read_buf) @@ -760,18 +760,18 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data, q->read_buf->memory = V4L2_MEMORY_USERPTR; q->read_buf->baddr = (unsigned long)data; - q->read_buf->bsize = count; + q->read_buf->bsize = count; field = videobuf_next_field(q); retval = q->ops->buf_prepare(q,q->read_buf,field); if (0 != retval) goto done; - /* start capture & wait */ + /* start capture & wait */ spin_lock_irqsave(q->irqlock,flags); q->ops->buf_queue(q,q->read_buf); spin_unlock_irqrestore(q->irqlock,flags); - retval = videobuf_waiton(q->read_buf,0,0); - if (0 == retval) { + retval = videobuf_waiton(q->read_buf,0,0); + if (0 == retval) { videobuf_dma_pci_sync(q->pci,&q->read_buf->dma); if (STATE_ERROR == q->read_buf->state) retval = -EIO; @@ -828,7 +828,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, } /* wait until capture is done */ - retval = videobuf_waiton(q->read_buf, nonblocking, 1); + retval = videobuf_waiton(q->read_buf, nonblocking, 1); if (0 != retval) goto done; videobuf_dma_pci_sync(q->pci,&q->read_buf->dma); @@ -1096,7 +1096,7 @@ videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr, dprintk(3,"nopage: fault @ %08lx [vma %08lx-%08lx]\n", vaddr,vma->vm_start,vma->vm_end); - if (vaddr > vma->vm_end) + if (vaddr > vma->vm_end) return NOPAGE_SIGBUS; page = alloc_page(GFP_USER); if (!page) diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 8200f3dad0c6..5bd592673b94 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c @@ -36,10 +36,10 @@ MODULE_LICENSE("GPL"); #define wm8775_err(fmt, arg...) do { \ printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) + i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define wm8775_info(fmt, arg...) do { \ printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) + i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END }; diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 1cc8c31b7988..22e6e4bad7b8 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -202,9 +202,9 @@ struct video_audio #define VIDEO_SOUND_STEREO 2 #define VIDEO_SOUND_LANG1 4 #define VIDEO_SOUND_LANG2 8 - __u16 mode; - __u16 balance; /* Stereo balance */ - __u16 step; /* Step actual volume uses */ + __u16 mode; + __u16 balance; /* Stereo balance */ + __u16 step; /* Step actual volume uses */ }; struct video_clip diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 27979003db44..a9a0999be702 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -24,7 +24,7 @@ /* Four-character-code (FOURCC) */ #define v4l2_fourcc(a,b,c,d)\ - (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) + (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) /* * E N U M S @@ -154,20 +154,20 @@ struct v4l2_capability }; /* Values for 'capabilities' field */ -#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ -#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ -#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ -#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ -#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ +#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ +#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ +#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ +#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ +#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ #if 1 #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ #endif -#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ +#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ -#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ -#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ -#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ +#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ +#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ +#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ @@ -179,13 +179,13 @@ struct v4l2_capability struct v4l2_pix_format { - __u32 width; - __u32 height; - __u32 pixelformat; + __u32 width; + __u32 height; + __u32 pixelformat; enum v4l2_field field; __u32 bytesperline; /* for padding, zero if unused */ - __u32 sizeimage; - enum v4l2_colorspace colorspace; + __u32 sizeimage; + enum v4l2_colorspace colorspace; __u32 priv; /* private data, depends on pixelformat */ }; @@ -238,12 +238,12 @@ struct v4l2_pix_format */ struct v4l2_fmtdesc { - __u32 index; /* Format number */ + __u32 index; /* Format number */ enum v4l2_buf_type type; /* buffer type */ __u32 flags; - __u8 description[32]; /* Description string */ - __u32 pixelformat; /* Format fourcc */ - __u32 reserved[4]; + __u8 description[32]; /* Description string */ + __u32 pixelformat; /* Format fourcc */ + __u32 reserved[4]; }; #define V4L2_FMT_FLAG_COMPRESSED 0x0001 @@ -393,7 +393,7 @@ struct v4l2_jpegcompression #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will - * allways use APP0 */ + * allways use APP0 */ }; @@ -402,10 +402,10 @@ struct v4l2_jpegcompression */ struct v4l2_requestbuffers { - __u32 count; + __u32 count; enum v4l2_buf_type type; enum v4l2_memory memory; - __u32 reserved[2]; + __u32 reserved[2]; }; struct v4l2_buffer @@ -511,9 +511,9 @@ struct v4l2_outputparm struct v4l2_cropcap { enum v4l2_buf_type type; - struct v4l2_rect bounds; - struct v4l2_rect defrect; - struct v4l2_fract pixelaspect; + struct v4l2_rect bounds; + struct v4l2_rect defrect; + struct v4l2_fract pixelaspect; }; struct v4l2_crop { @@ -587,7 +587,7 @@ typedef __u64 v4l2_std_id; V4L2_STD_PAL_Nc |\ V4L2_STD_SECAM) #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ - V4L2_STD_ATSC_16_VSB) + V4L2_STD_ATSC_16_VSB) #define V4L2_STD_UNKNOWN 0 #define V4L2_STD_ALL (V4L2_STD_525_60 |\ @@ -595,7 +595,7 @@ typedef __u64 v4l2_std_id; struct v4l2_standard { - __u32 index; + __u32 index; v4l2_std_id id; __u8 name[24]; struct v4l2_fract frameperiod; /* Frames, not fields */ @@ -610,9 +610,9 @@ struct v4l2_standard struct v4l2_input { __u32 index; /* Which input */ - __u8 name[32]; /* Label */ + __u8 name[32]; /* Label */ __u32 type; /* Type of input */ - __u32 audioset; /* Associated audios (bitfield) */ + __u32 audioset; /* Associated audios (bitfield) */ __u32 tuner; /* Associated tuner */ v4l2_std_id std; __u32 status; @@ -647,9 +647,9 @@ struct v4l2_input struct v4l2_output { __u32 index; /* Which output */ - __u8 name[32]; /* Label */ + __u8 name[32]; /* Label */ __u32 type; /* Type of output */ - __u32 audioset; /* Associated audios (bitfield) */ + __u32 audioset; /* Associated audios (bitfield) */ __u32 modulator; /* Associated modulator */ v4l2_std_id std; __u32 reserved[4]; @@ -671,12 +671,12 @@ struct v4l2_control /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ struct v4l2_queryctrl { - __u32 id; + __u32 id; enum v4l2_ctrl_type type; __u8 name[32]; /* Whatever */ __s32 minimum; /* Note signedness */ __s32 maximum; - __s32 step; + __s32 step; __s32 default_value; __u32 flags; __u32 reserved[2]; @@ -779,10 +779,10 @@ struct v4l2_modulator struct v4l2_frequency { - __u32 tuner; + __u32 tuner; enum v4l2_tuner_type type; - __u32 frequency; - __u32 reserved[8]; + __u32 frequency; + __u32 reserved[8]; }; /* @@ -846,14 +846,14 @@ struct v4l2_vbi_format struct v4l2_sliced_vbi_format { - __u16 service_set; - /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field - service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field - (equals frame lines 313-336 for 625 line video - standards, 263-286 for 525 line standards) */ - __u16 service_lines[2][24]; - __u32 io_size; - __u32 reserved[2]; /* must be zero */ + __u16 service_set; + /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field + service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field + (equals frame lines 313-336 for 625 line video + standards, 263-286 for 525 line standards) */ + __u16 service_lines[2][24]; + __u32 io_size; + __u32 reserved[2]; /* must be zero */ }; #define V4L2_SLICED_TELETEXT_B (0x0001) @@ -866,22 +866,22 @@ struct v4l2_sliced_vbi_format struct v4l2_sliced_vbi_cap { - __u16 service_set; - /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field - service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field - (equals frame lines 313-336 for 625 line video - standards, 263-286 for 525 line standards) */ - __u16 service_lines[2][24]; - __u32 reserved[4]; /* must be 0 */ + __u16 service_set; + /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field + service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field + (equals frame lines 313-336 for 625 line video + standards, 263-286 for 525 line standards) */ + __u16 service_lines[2][24]; + __u32 reserved[4]; /* must be 0 */ }; struct v4l2_sliced_vbi_data { - __u32 id; - __u32 field; /* 0: first field, 1: second field */ - __u32 line; /* 1-23 */ - __u32 reserved; /* must be 0 */ - __u8 data[48]; + __u32 id; + __u32 field; /* 0: first field, 1: second field */ + __u32 line; /* 1-23 */ + __u32 reserved; /* must be 0 */ + __u8 data[48]; }; #endif @@ -896,9 +896,9 @@ struct v4l2_format enum v4l2_buf_type type; union { - struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE - struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY - struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE + struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE + struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY + struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE #if 1 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE #endif diff --git a/include/media/audiochip.h b/include/media/audiochip.h index dd1e484e86d3..b7d4b0930408 100644 --- a/include/media/audiochip.h +++ b/include/media/audiochip.h @@ -10,13 +10,13 @@ enum audiochip { /* Provided by video chip */ AUDIO_CHIP_INTERNAL, /* Provided by tvaudio.c */ - AUDIO_CHIP_TDA8425, - AUDIO_CHIP_TEA6300, - AUDIO_CHIP_TEA6420, - AUDIO_CHIP_TDA9840, - AUDIO_CHIP_TDA985X, - AUDIO_CHIP_TDA9874, - AUDIO_CHIP_PIC16C54, + AUDIO_CHIP_TDA8425, + AUDIO_CHIP_TEA6300, + AUDIO_CHIP_TEA6420, + AUDIO_CHIP_TDA9840, + AUDIO_CHIP_TDA985X, + AUDIO_CHIP_TDA9874, + AUDIO_CHIP_PIC16C54, /* Provided by msp3400.c */ AUDIO_CHIP_MSP34XX }; diff --git a/include/media/tuner.h b/include/media/tuner.h index 81025323267f..94a9511479a1 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -215,14 +215,14 @@ extern int tea5767_autodetection(struct i2c_client *c); #define tuner_warn(fmt, arg...) do {\ printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \ - t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_info(fmt, arg...) do {\ printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \ - t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_dbg(fmt, arg...) do {\ if (tuner_debug) \ - printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ - t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) + printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #endif /* __KERNEL__ */ diff --git a/include/media/video-buf.h b/include/media/video-buf.h index ae8d7a000440..ee8eb15c0ea6 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h @@ -177,7 +177,7 @@ struct videobuf_queue_ops { }; struct videobuf_queue { - struct semaphore lock; + struct semaphore lock; spinlock_t *irqlock; struct pci_dev *pci; -- cgit v1.2.2