Hi, The patch just removes all trailing whitespaces, there are no actual code changes. I've a script to remove them from my sources now, that should kill those no-op whitespace changes in my patches after merging this initial cleanup. Gerd Signed-off-by: Gerd Knorr --- drivers/media/video/btcx-risc.c | 6 drivers/media/video/bttv-gpio.c | 4 Signed-off-by: Andrew Morton --- 25-akpm/drivers/media/video/bt848.h | 10 - 25-akpm/drivers/media/video/btcx-risc.c | 6 25-akpm/drivers/media/video/bttv-cards.c | 182 +++++++++++++++--------------- 25-akpm/drivers/media/video/bttv-driver.c | 143 +++++++++++------------ 25-akpm/drivers/media/video/bttv-gpio.c | 4 25-akpm/drivers/media/video/bttv-i2c.c | 14 +- 25-akpm/drivers/media/video/bttv-if.c | 14 +- 25-akpm/drivers/media/video/bttv-risc.c | 14 +- 25-akpm/drivers/media/video/bttv-vbi.c | 16 +- 25-akpm/drivers/media/video/bttv.h | 18 +- 25-akpm/drivers/media/video/bttvp.h | 8 - 11 files changed, 214 insertions(+), 215 deletions(-) diff -puN drivers/media/video/bt848.h~v4l-bttv-whitespace-cleanup drivers/media/video/bt848.h --- 25/drivers/media/video/bt848.h~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.725145728 -0700 +++ 25-akpm/drivers/media/video/bt848.h 2004-10-24 02:51:20.745142688 -0700 @@ -1,4 +1,4 @@ -/* +/* bt848.h - Bt848 register offsets Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) @@ -22,10 +22,10 @@ #define _BT848_H_ #ifndef PCI_VENDOR_ID_BROOKTREE -#define PCI_VENDOR_ID_BROOKTREE 0x109e +#define PCI_VENDOR_ID_BROOKTREE 0x109e #endif #ifndef PCI_DEVICE_ID_BT848 -#define PCI_DEVICE_ID_BT848 0x350 +#define PCI_DEVICE_ID_BT848 0x350 #endif #ifndef PCI_DEVICE_ID_BT849 #define PCI_DEVICE_ID_BT849 0x351 @@ -50,7 +50,7 @@ #define BT848_DSTATUS_LOF (1<<1) #define BT848_DSTATUS_COF (1<<0) -#define BT848_IFORM 0x004 +#define BT848_IFORM 0x004 #define BT848_IFORM_HACTIVE (1<<7) #define BT848_IFORM_MUXSEL (3<<5) #define BT848_IFORM_MUX0 (2<<5) @@ -71,7 +71,7 @@ #define BT848_IFORM_AUTO 0 #define BT848_IFORM_NORM 7 -#define BT848_TDEC 0x008 +#define BT848_TDEC 0x008 #define BT848_TDEC_DEC_FIELD (1<<7) #define BT848_TDEC_FLDALIGN (1<<6) #define BT848_TDEC_DEC_RAT (0x1f) diff -puN drivers/media/video/btcx-risc.c~v4l-bttv-whitespace-cleanup drivers/media/video/btcx-risc.c --- 25/drivers/media/video/btcx-risc.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.727145424 -0700 +++ 25-akpm/drivers/media/video/btcx-risc.c 2004-10-24 02:51:20.762140104 -0700 @@ -1,5 +1,5 @@ /* - $Id: btcx-risc.c,v 1.2 2004/09/15 16:15:24 kraxel Exp $ + $Id: btcx-risc.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $ btcx-risc.c @@ -189,7 +189,7 @@ btcx_calc_skips(int line, int width, uns { unsigned int clip,skip; int end,maxline; - + skip=0; maxline = 9999; for (clip = 0; clip < nclips; clip++) { @@ -199,7 +199,7 @@ btcx_calc_skips(int line, int width, uns continue; if (clips[clip].c.left > (signed)width) break; - + /* vertical range */ if (line > clips[clip].c.top+clips[clip].c.height-1) continue; diff -puN drivers/media/video/bttv-cards.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-cards.c --- 25/drivers/media/video/bttv-cards.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.729145120 -0700 +++ 25-akpm/drivers/media/video/bttv-cards.c 2004-10-24 02:51:20.758140712 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.28 2004/10/06 13:45:14 kraxel Exp $ + $Id: bttv-cards.c,v 1.29 2004/10/13 10:39:00 kraxel Exp $ bttv-cards.c @@ -143,7 +143,7 @@ __setup("bttv.tuner=", p_tuner); int __init bttv_parse(char *str, int max, int *vals) { int i,number,res = 2; - + for (i = 0; res == 2 && i < max; i++) { res = get_option(&str,&number); if (res) @@ -192,7 +192,7 @@ static struct CARD { { 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" }, { 0x263710b4, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" }, { 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" }, - + { 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" }, { 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" }, { 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" }, @@ -210,7 +210,7 @@ static struct CARD { { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" }, { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" }, { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" }, - + { 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" }, { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" }, // clashes with FlyVideo @@ -246,7 +246,7 @@ static struct CARD { { 0xa1550000, BTTV_IVC200, "IVC-200" }, { 0xa1550001, BTTV_IVC200, "IVC-200" }, { 0xa1550002, BTTV_IVC200, "IVC-200" }, - { 0xa1550003, BTTV_IVC200, "IVC-200" }, + { 0xa1550003, BTTV_IVC200, "IVC-200" }, { 0xa1550100, BTTV_IVC200, "IVC-200G" }, { 0xa1550101, BTTV_IVC200, "IVC-200G" }, { 0xa1550102, BTTV_IVC200, "IVC-200G" }, @@ -267,10 +267,10 @@ static struct CARD { { 0xa182ff0d, BTTV_IVC120, "IVC-120G" }, { 0xa182ff0e, BTTV_IVC120, "IVC-120G" }, { 0xa182ff0f, BTTV_IVC120, "IVC-120G" }, - + { 0x41424344, BTTV_GRANDTEC, "GrandTec Multi Capture" }, { 0x01020304, BTTV_XGUARD, "Grandtec Grand X-Guard" }, - + { 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" }, { 0xa0501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" }, { 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" }, @@ -302,7 +302,7 @@ static struct CARD { // likely broken, vendor id doesn't match the other magic views ... //{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, - + // DVB cards (using pci function .1 for mpeg data xfer) { 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T" }, @@ -311,7 +311,7 @@ static struct CARD { { 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" }, { 0x07711461, BTTV_AVDVBT_771, "AVermedia DVB-T 771" }, { 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DVICO FusionHDTV DVB-T Lite" }, - + { 0, -1, NULL } }; @@ -702,7 +702,7 @@ struct tvcard bttv_tvcards[] = { 10000 : ext. Video audio input 20000 : TV Mono a0000 : TV Mono/2 - 1a0000 : TV Stereo + 1a0000 : TV Stereo 30000 : Radio 40000 : Mute */ @@ -1117,7 +1117,7 @@ struct tvcard bttv_tvcards[] = { .pll = PLL_28, .tuner_type = 5, },{ - /* This is the ultimate cheapo capture card + /* This is the ultimate cheapo capture card * just a BT848A on a small PCB! * Steve Hosgood */ .name = "GrandTec 'Grand Video Capture' (Bt848)", @@ -1188,7 +1188,7 @@ struct tvcard bttv_tvcards[] = { .tuner_type = -1, },{ /* Miguel Angel Alvarez - new Easy TV BT878 version (model CPH061) + new Easy TV BT878 version (model CPH061) special thanks to Informatica Mieres for providing the card */ .name = "Askey CPH061/ BESTBUY Easy TV (bt878)", .video_inputs = 3, @@ -1392,7 +1392,7 @@ struct tvcard bttv_tvcards[] = { },{ .name = "Powercolor MTV878/ MTV878R/ MTV878F", .video_inputs = 3, - .audio_inputs = 2, + .audio_inputs = 2, .tuner = 0, .svhs = 2, .gpiomask = 0x1C800F, // Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset @@ -1570,7 +1570,7 @@ struct tvcard bttv_tvcards[] = { .no_tda9875 = 1, .no_tda7432 = 1, },{ - + /* ---- card 0x58 ---------------------------------- */ .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */ .video_inputs = 2, @@ -1663,11 +1663,11 @@ struct tvcard bttv_tvcards[] = { .tuner_type = -1, .no_msp34xx = 1, .no_tda9875 = 1, - .no_tda7432 = 1, + .no_tda7432 = 1, .gpiomask = 0x01, .audiomux = { 0, 0, 0, 0, 1 }, .muxsel = { 3, 0, 1, 2}, - .needs_tvaudio = 0, + .needs_tvaudio = 0, .pll = PLL_28, .no_gpioirq = 1, },{ @@ -1679,7 +1679,7 @@ struct tvcard bttv_tvcards[] = { .gpiomask = 2, // TV, Comp1, Composite over SVID con, SVID .muxsel = { 2, 3, 1, 1}, - .audiomux = { 2, 2, 0, 0, 0 }, + .audiomux = { 2, 2, 0, 0, 0 }, .pll = PLL_28, .has_radio = 1, .tuner_type = TUNER_PHILIPS_PAL, @@ -1764,7 +1764,7 @@ struct tvcard bttv_tvcards[] = { /* Notes: - card lacks subsystem ID - stereo variant w/ daughter board with tda9874a @0xb0 - - Audio Routing: + - Audio Routing: always from tda9874 independent of GPIO (?) external line in: unknown - Other chips: em78p156elp @ 0x96 (probably IR remote control) @@ -1848,7 +1848,7 @@ struct tvcard bttv_tvcards[] = { .audio_inputs = 0, .tuner = -1, /* card has no tuner */ .svhs = 3, - .gpiomask = 0x00, + .gpiomask = 0x00, .muxsel = { 2, 3, 1, 0}, .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ .needs_tvaudio = 1, @@ -1921,7 +1921,7 @@ struct tvcard bttv_tvcards[] = { .no_tda9875 = 1, .no_tda7432 = 1, .gpiomask = 0x00, - .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 }, .muxsel_hook = ivc120_muxsel, .pll = PLL_28, @@ -2206,7 +2206,7 @@ void __devinit bttv_idcard(struct bttv * for (type = -1, i = 0; cards[i].id != 0; i++) if (cards[i].id == btv->cardid) type = i; - + if (type != -1) { /* found it */ printk(KERN_INFO "bttv%d: detected: %s [card=%d], " @@ -2223,12 +2223,12 @@ void __devinit bttv_idcard(struct bttv * printk(KERN_DEBUG "please mail id, board name and " "the correct card= insmod option to kraxel@bytesex.org\n"); } - } + } /* let the user override the autodetected type */ if (card[btv->c.nr] < bttv_num_tvcards) btv->c.type=card[btv->c.nr]; - + /* print which card config we are using */ printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type, @@ -2268,7 +2268,7 @@ void __devinit bttv_idcard(struct bttv * void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) { int type = -1; - + if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13)) type = BTTV_MODTEC_205; else if (0 == strncmp(eeprom_data+20,"Picolo",7)) @@ -2284,7 +2284,7 @@ void identify_by_eeprom(struct bttv *btv } static void flyvideo_gpio(struct bttv *btv) -{ +{ int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821; int tuner=-1,ttype; @@ -2298,10 +2298,10 @@ static void flyvideo_gpio(struct bttv *b // CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1. // GPIO14-12: n.c. // LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878) - + // lowest 3 bytes are remote control codes (no handshake needed) // xxxFFF: No remote control chip soldered - // xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered + // xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered // Note: Some bits are Audio_Mask ! ttype=(gpio&0x0f0000)>>16; @@ -2329,18 +2329,18 @@ static void flyvideo_gpio(struct bttv *b is_lr90 = !(gpio & 0x002000); // else LR26/LR50 (LR38/LR51 f. capture only) // gpio & 0x001000 // output bit for audio routing - if(is_capture_only) - tuner=4; // No tuner present + if(is_capture_only) + tuner=4; // No tuner present - printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", - btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); + printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", + btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", - btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", + btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", is_capture_only?"yes":"no "); if(tuner!= -1) // only set if known tuner autodetected, else let insmod option through btv->tuner_type = tuner; - btv->has_radio = has_radio; + btv->has_radio = has_radio; // LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 // LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 @@ -2439,13 +2439,13 @@ static void init_ids_eagle(struct bttv * { gpio_inout(0xffffff,0xFFFF37); gpio_write(0x200020); - + /* flash strobe inverter ?! */ gpio_write(0x200024); - + /* switch sync drive off */ gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE); - + /* set BT848 muxel to 2 */ btaor((2)<<5, ~(2<<5), BT848_IFORM); } @@ -2534,7 +2534,7 @@ void bttv_reset_audio(struct bttv *btv) */ if (btv->id != 878) return; - + if (bttv_debug) printk("bttv%d: BT878A ARESET\n",btv->c.nr); btwrite((1<<7), 0x058); @@ -2581,7 +2581,7 @@ void __devinit bttv_init_card2(struct bt case BTTV_MIRO: case BTTV_MIROPRO: case BTTV_PINNACLE: - case BTTV_PINNACLEPRO: + case BTTV_PINNACLEPRO: /* miro/pinnacle */ miro_pinnacle_gpio(btv); break; @@ -2705,7 +2705,7 @@ void __devinit bttv_init_card2(struct bt /* tuner configuration (from card list / autodetect / insmod option) */ if (UNSET != bttv_tvcards[btv->c.type].tuner_type) - if(UNSET == btv->tuner_type) + if(UNSET == btv->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]; @@ -2753,7 +2753,7 @@ void __devinit bttv_init_card2(struct bt bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0) request_module("tda9875"); - if (!bttv_tvcards[btv->c.type].no_tda7432 && + if (!bttv_tvcards[btv->c.type].no_tda7432 && bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0) request_module("tda7432"); @@ -2777,12 +2777,12 @@ void __devinit bttv_init_card2(struct bt /* ----------------------------------------------------------------------- */ /* some hauppauge specific stuff */ -static struct HAUPPAUGE_TUNER +static struct HAUPPAUGE_TUNER { int id; char *name; -} -hauppauge_tuner[] __devinitdata = +} +hauppauge_tuner[] __devinitdata = { { TUNER_ABSENT, "" }, { TUNER_ABSENT, "External" }, @@ -2832,7 +2832,7 @@ hauppauge_tuner[] __devinitdata = { TUNER_ABSENT, "Philips TD1536D_FH_44"}, { TUNER_LG_NTSC_FM, "LG TPI8NSR01F"}, { TUNER_LG_PAL_FM, "LG TPI8PSB01D"}, - { TUNER_LG_PAL, "LG TPI8PSB11D"}, + { TUNER_LG_PAL, "LG TPI8PSB11D"}, { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"}, { TUNER_LG_PAL_I, "LG TAPC-I701D"} }; @@ -2872,12 +2872,12 @@ static void __devinit hauppauge_eeprom(s model = eeprom_data[12] << 8 | eeprom_data[11]; tuner = eeprom_data[9]; radio = eeprom_data[blk2-1] & 0x01; - + if (tuner < ARRAY_SIZE(hauppauge_tuner)) btv->tuner_type = hauppauge_tuner[tuner].id; if (radio) btv->has_radio = 1; - + if (bttv_verbose) printk(KERN_INFO "bttv%d: Hauppauge eeprom: model=%d, " "tuner=%s (%d), radio=%s\n", @@ -2914,7 +2914,7 @@ static int terratec_active_radio_upgrade btv->has_matchbox = 0; } return 0; -} +} /* ----------------------------------------------------------------------- */ @@ -2941,7 +2941,7 @@ static int __devinit pvr_altera_load(str gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG); gpio_write(0); udelay(PVR_GPIO_DELAY); - + gpio_write(BTTV_ALT_NCONFIG); udelay(PVR_GPIO_DELAY); @@ -2951,7 +2951,7 @@ static int __devinit pvr_altera_load(str gpio_bits(BTTV_ALT_DCLK,0); if (bits & 0x01) gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA); - else + else gpio_bits(BTTV_ALT_DATA,0); gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK); bits >>= 1; @@ -2959,7 +2959,7 @@ static int __devinit pvr_altera_load(str } gpio_bits(BTTV_ALT_DCLK,0); udelay(PVR_GPIO_DELAY); - + /* begin Altera init loop (Not necessary,but doesn't hurt) */ for (i = 0 ; i < 30 ; i++) { gpio_bits(BTTV_ALT_DCLK,0); @@ -2971,7 +2971,7 @@ static int __devinit pvr_altera_load(str #if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE) /* old 2.4.x way -- via soundcore's mod_firmware_load */ - + static char *firm_altera = "/usr/lib/video4linux/hcwamc.rbf"; MODULE_PARM(firm_altera,"s"); MODULE_PARM_DESC(firm_altera,"WinTV/PVR firmware " @@ -2991,7 +2991,7 @@ int __devinit pvr_boot(struct bttv *btv) btv->c.nr, firm_altera); return -1; } - + printk(KERN_INFO "bttv%d: uploading altera firmware [%s] ...\n", btv->c.nr, firm_altera); result = pvr_altera_load(btv, micro, microlen); @@ -3019,7 +3019,7 @@ int __devinit pvr_boot(struct bttv *btv) btv->c.nr, (rc < 0) ? "failed" : "ok"); release_firmware(fw_entry); return rc; -} +} #endif /* ----------------------------------------------------------------------- */ @@ -3030,7 +3030,7 @@ static void __devinit osprey_eeprom(stru int i = 0; unsigned char *ee = eeprom_data; 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')) { @@ -3046,7 +3046,7 @@ static void __devinit osprey_eeprom(stru } else { unsigned short type; int offset = 4*16; - + for(; offset < 8*16; offset += 16) { unsigned short checksum = 0; /* verify the checksum */ @@ -3057,13 +3057,13 @@ static void __devinit osprey_eeprom(stru break; } } - + if (offset >= 8*16) return; /* found a valid descriptor */ type = (ee[offset+4]<<8) | (ee[offset+5]); - + switch(type) { /* 848 based */ @@ -3073,7 +3073,7 @@ static void __devinit osprey_eeprom(stru case 0x0005: btv->c.type = BTTV_OSPREY101_848; break; - + /* 878 based */ case 0x0012: case 0x0013: @@ -3121,10 +3121,10 @@ static void __devinit osprey_eeprom(stru | (ee[offset+8] << 8) | (ee[offset+9]); } - + printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n", btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial); -} +} /* ----------------------------------------------------------------------- */ /* AVermedia specific stuff, from bktr_card.c */ @@ -3166,7 +3166,7 @@ static void __devinit avermedia_eeprom(s if (tuner_make == 1) if(tuner_format <=9) tuner = tuner_1_table[tuner_format]; - + printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); if(tuner) { @@ -3256,8 +3256,8 @@ static void __devinit boot_bt832(struct /* ----------------------------------------------------------------------- */ /* Imagenation L-Model PXC200 Framegrabber */ -/* This is basically the same procedure as - * used by Alessandro Rubini in his pxc200 +/* This is basically the same procedure as + * used by Alessandro Rubini in his pxc200 * driver, but using BTTV functions */ static void __devinit init_PXC200(struct bttv *btv) @@ -3268,13 +3268,13 @@ static void __devinit init_PXC200(struct unsigned int i; int tmp; u32 val; - + /* Initialise GPIO-connevted stuff */ gpio_inout(0xffffff, (1<<13)); gpio_write(0); udelay(3); gpio_write(1<<13); - /* GPIO inputs are pulled up, so no need to drive + /* GPIO inputs are pulled up, so no need to drive * reset pin any longer */ gpio_bits(0xffffff, 0); if (bttv_gpio) @@ -3289,16 +3289,16 @@ static void __devinit init_PXC200(struct */ btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC); - + /* Initialise MAX517 DAC */ printk(KERN_INFO "Setting DAC reference voltage level ...\n"); bttv_I2CWrite(btv,0x5E,0,0x80,1); - + /* Initialise 12C508 PIC */ - /* The I2CWrite and I2CRead commmands are actually to the + /* The I2CWrite and I2CRead commmands are actually to the * same chips - but the R/W bit is included in the address * argument so the numbers are different */ - + printk(KERN_INFO "Initialising 12C508 PIC chip ...\n"); @@ -3306,7 +3306,7 @@ static void __devinit init_PXC200(struct val = btread(BT848_GPIO_DMA_CTL); val |= BT848_GPIO_DMA_CTL_GPCLKMODE; btwrite(val, BT848_GPIO_DMA_CTL); - + /* Then, push to 0 the reset pin long enough to reset the * * device same as above for the reset line, but not the same * value sent to the GPIO-connected stuff @@ -3418,7 +3418,7 @@ static int tea5757_read(struct bttv *btv unsigned long timeout; int value = 0; int i; - + /* better safe than sorry */ gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we); @@ -3430,10 +3430,10 @@ static int tea5757_read(struct bttv *btv if (bttv_gpio) bttv_gpio_tracking(btv,"tea5757 read"); - + bus_low(btv,btv->mbox_we); bus_low(btv,btv->mbox_clk); - + udelay(10); timeout= jiffies + HZ; @@ -3465,7 +3465,7 @@ static int tea5757_write(struct bttv *bt { int i; int reg = value; - + gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data); if (btv->mbox_ior) { @@ -3520,7 +3520,7 @@ void winview_audio(struct bttv *btv, str v->flags |= VIDEO_AUDIO_VOLUME; return; } - + /* 32 levels logarithmic */ vol = 32 - ((v->volume>>11)); /* units */ @@ -3547,7 +3547,7 @@ void winview_audio(struct bttv *btv, str data |= WINVIEW_PT2254_STROBE; data &= ~WINVIEW_PT2254_DATA; gpio_write(data); - udelay(10); + udelay(10); data &= ~WINVIEW_PT2254_STROBE; gpio_write(data); } @@ -3672,7 +3672,7 @@ static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set) { int val = 0; - + if (set) { if (v->mode & VIDEO_SOUND_LANG2) /* SAP */ val = 0x01; @@ -3807,7 +3807,7 @@ pvbt878p9b_audio(struct bttv *btv, struc /* * Dariusz Kowalewski - * sound control for FlyVideo 2000S (with tda9874 decoder) + * sound control for FlyVideo 2000S (with tda9874 decoder) * based on pvbt878p9b_audio() - this is not tested, please fix!!! */ static void @@ -3990,13 +3990,13 @@ static void picolo_tetra_muxsel (struct * ivc120_muxsel [Added by Alan Garfield ] * * The IVC120G security card has 4 i2c controlled TDA8540 matrix - * swichers to provide 16 channels to MUX0. The TDA8540's have - * 4 indepedant outputs and as such the IVC120G also has the - * optional "Monitor Out" bus. This allows the card to be looking + * swichers to provide 16 channels to MUX0. The TDA8540's have + * 4 indepedant outputs and as such the IVC120G also has the + * optional "Monitor Out" bus. This allows the card to be looking * at one input while the monitor is looking at another. * * Since I've couldn't be bothered figuring out how to add an - * independant muxsel for the monitor bus, I've just set it to + * independant muxsel for the monitor bus, I've just set it to * whatever the card is looking at. * * OUT0 of the TDA8540's is connected to MUX0 (0x03) @@ -4021,12 +4021,12 @@ static void picolo_tetra_muxsel (struct static void ivc120_muxsel(struct bttv *btv, unsigned int input) { // Simple maths - int key = input % 4; + int key = input % 4; int matrix = input / 4; - + dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n", btv->c.nr, input, matrix, key); - + // Handles the input selection on the TDA8540's bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00, ((matrix == 3) ? (key | key << 2) : 0x00), 1); @@ -4036,17 +4036,17 @@ static void ivc120_muxsel(struct bttv *b ((matrix == 1) ? (key | key << 2) : 0x00), 1); bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00, ((matrix == 2) ? (key | key << 2) : 0x00), 1); - + // Handles the output enables on the TDA8540's bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02, ((matrix == 3) ? 0x03 : 0x00), 1); // 13 - 16 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02, ((matrix == 0) ? 0x03 : 0x00), 1); // 1-4 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02, - ((matrix == 1) ? 0x03 : 0x00), 1); // 5-8 + ((matrix == 1) ? 0x03 : 0x00), 1); // 5-8 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02, ((matrix == 2) ? 0x03 : 0x00), 1); // 9-12 - + // Selects MUX0 for input on the 878 btaor((0)<<5, ~(3<<5), BT848_IFORM); } @@ -4153,7 +4153,7 @@ void __devinit bttv_check_chipset(void) #if 0 /* print which chipset we have */ - while ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8,dev))) + while ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8,dev))) printk(KERN_INFO "bttv: Host bridge is %s\n",pci_name(dev)); #endif @@ -4172,8 +4172,8 @@ void __devinit bttv_check_chipset(void) if (UNSET != latency) 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))) { + while ((dev = pci_find_device(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82441, dev))) { unsigned char b; pci_read_config_byte(dev, 0x53, &b); if (bttv_debug) diff -puN drivers/media/video/bttv-driver.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-driver.c --- 25/drivers/media/video/bttv-driver.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.731144816 -0700 +++ 25-akpm/drivers/media/video/bttv-driver.c 2004-10-24 02:51:20.751141776 -0700 @@ -1,26 +1,26 @@ /* - $Id: bttv-driver.c,v 1.22 2004/10/12 07:33:22 kraxel Exp $ + $Id: bttv-driver.c,v 1.23 2004/10/13 10:39:00 kraxel Exp $ bttv - Bt848 frame grabber driver - + Copyright (C) 1996,97,98 Ralph Metzler & Marcus Metzler (c) 1999-2002 Gerd Knorr - + some v4l2 code lines are taken from Justin's bttv2 driver which is (c) 2000 Justin Schoeman - + 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -195,7 +195,7 @@ const struct bttv_tvnorm bttv_tvnorms[] .sheight = 576, .totalwidth = 1135, .adelay = 0x7f, - .bdelay = 0x72, + .bdelay = 0x72, .iform = (BT848_IFORM_PAL_BDGHI|BT848_IFORM_XT1), .scaledtwidth = 1135, .hdelayx1 = 186, @@ -683,20 +683,20 @@ void free_btres(struct bttv *btv, struct /* ----------------------------------------------------------------------- */ /* If Bt848a or Bt849, use PLL for PAL/SECAM and crystal for NTSC */ -/* Frequency = (F_input / PLL_X) * PLL_I.PLL_F/PLL_C - PLL_X = Reference pre-divider (0=1, 1=2) +/* Frequency = (F_input / PLL_X) * PLL_I.PLL_F/PLL_C + PLL_X = Reference pre-divider (0=1, 1=2) PLL_C = Post divider (0=6, 1=4) - PLL_I = Integer input - PLL_F = Fractional input - - F_input = 28.636363 MHz: + PLL_I = Integer input + PLL_F = Fractional input + + F_input = 28.636363 MHz: PAL (CLKx2 = 35.46895 MHz): PLL_X = 1, PLL_I = 0x0E, PLL_F = 0xDCF9, PLL_C = 0 */ static void set_pll_freq(struct bttv *btv, unsigned int fin, unsigned int fout) { unsigned char fl, fh, fi; - + /* prevent overflows */ fin/=4; fout/=4; @@ -747,7 +747,7 @@ static void set_pll(struct bttv *btv) /* Let other people run while the PLL stabilizes */ vprintk("."); msleep(10); - + if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) { btwrite(0,BT848_DSTATUS); } else { @@ -810,7 +810,7 @@ static void bt848_bright(struct bttv *bt static void bt848_hue(struct bttv *btv, int hue) { int value; - + btv->hue = hue; /* -128 to 127 */ @@ -821,9 +821,9 @@ static void bt848_hue(struct bttv *btv, static void bt848_contrast(struct bttv *btv, int cont) { int value,hibit; - + btv->contrast = cont; - + /* 0-511 */ value = (cont >> 7); hibit = (value >> 6) & 4; @@ -835,7 +835,7 @@ static void bt848_contrast(struct bttv * static void bt848_sat(struct bttv *btv, int color) { int val_u,val_v,hibits; - + btv->saturation = color; /* 0-511 for the color */ @@ -977,7 +977,7 @@ static void set_input(struct bttv *btv, unsigned int input) { unsigned long flags; - + btv->input = input; if (irq_iswitch) { spin_lock_irqsave(&btv->s_lock,flags); @@ -1022,7 +1022,7 @@ static void init_irqreg(struct bttv *btv static void init_bt848(struct bttv *btv) { int val; - + if (bttv_tvcards[btv->c.type].no_video) { /* very basic init only */ init_irqreg(btv); @@ -1039,7 +1039,7 @@ static void init_bt848(struct bttv *btv) 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_GPINTI, BT848_GPIO_DMA_CTL); val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0; @@ -1091,7 +1091,7 @@ static int get_control(struct bttv *btv, { struct video_audio va; int i; - + for (i = 0; i < BTTV_CTLS; i++) if (bttv_ctls[i].id == c->id) break; @@ -1361,7 +1361,7 @@ static int bttv_prepare_buffer(struct bt { int redo_dma_risc = 0; int rc; - + /* check settings */ if (NULL == fmt) return -EINVAL; @@ -1381,7 +1381,7 @@ static int bttv_prepare_buffer(struct bt if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) return -EINVAL; } - + /* alloc + fill struct bttv_buffer (if changed) */ if (buf->vb.width != width || buf->vb.height != height || buf->vb.field != field || @@ -1417,7 +1417,7 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) { struct bttv_fh *fh = priv; - + *size = fh->fmt->depth*fh->width*fh->height >> 3; if (0 == *count) *count = gbuffers; @@ -1503,7 +1503,7 @@ int bttv_common_ioctls(struct bttv *btv, case VIDIOCGTUNER: { struct video_tuner *v = arg; - + if (UNSET == bttv_tvcards[btv->c.type].tuner) return -EINVAL; if (v->tuner) /* Only tuner 0 */ @@ -1532,7 +1532,7 @@ int bttv_common_ioctls(struct bttv *btv, up(&btv->lock); return 0; } - + case VIDIOCGCHAN: { struct video_channel *v = arg; @@ -1574,7 +1574,6 @@ int bttv_common_ioctls(struct bttv *btv, return 0; } - bttv_call_i2c_clients(btv,cmd,v); btv->tvnorm = v->norm; set_input(btv,v->channel); up(&btv->lock); @@ -1615,7 +1614,7 @@ int bttv_common_ioctls(struct bttv *btv, /* card specific hooks */ if (btv->audio_hook) btv->audio_hook(btv,v,1); - + up(&btv->lock); return 0; } @@ -1625,7 +1624,7 @@ int bttv_common_ioctls(struct bttv *btv, { struct v4l2_standard *e = arg; unsigned int index = e->index; - + if (index >= BTTV_TVNORMS) return -EINVAL; v4l2_video_std_construct(e, bttv_tvnorms[e->index].v4l2_id, @@ -1659,7 +1658,7 @@ int bttv_common_ioctls(struct bttv *btv, case VIDIOC_QUERYSTD: { v4l2_std_id *id = arg; - + if (btread(BT848_DSTATUS) & BT848_DSTATUS_NUML) *id = V4L2_STD_625_50; else @@ -1671,7 +1670,7 @@ int bttv_common_ioctls(struct bttv *btv, { struct v4l2_input *i = arg; unsigned int n; - + n = i->index; if (n >= bttv_tvcards[btv->c.type].video_inputs) return -EINVAL; @@ -1708,7 +1707,7 @@ int bttv_common_ioctls(struct bttv *btv, case VIDIOC_S_INPUT: { unsigned int *i = arg; - + if (*i > bttv_tvcards[btv->c.type].video_inputs) return -EINVAL; down(&btv->lock); @@ -1716,7 +1715,7 @@ int bttv_common_ioctls(struct bttv *btv, up(&btv->lock); return 0; } - + case VIDIOC_G_TUNER: { struct v4l2_tuner *t = arg; @@ -1812,7 +1811,7 @@ int bttv_common_ioctls(struct bttv *btv, default: return -ENOIOCTLCMD; - + } return 0; } @@ -1907,25 +1906,25 @@ static int setup_window(struct bttv_fh * default: BUG(); } - + down(&fh->cap.lock); if (fh->ov.clips) kfree(fh->ov.clips); fh->ov.clips = clips; fh->ov.nclips = n; - + fh->ov.w = win->w; fh->ov.field = win->field; fh->ov.setup_ok = 1; btv->init.ov.w.width = win->w.width; btv->init.ov.w.height = win->w.height; btv->init.ov.field = win->field; - + /* update overlay if needed */ retval = 0; if (check_btres(fh, RESOURCE_OVERLAY)) { struct bttv_buffer *new; - + new = videobuf_alloc(sizeof(*new)); bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new); retval = bttv_switch_overlay(btv,fh,new); @@ -1939,7 +1938,7 @@ static int setup_window(struct bttv_fh * static struct videobuf_queue* bttv_queue(struct bttv_fh *fh) { struct videobuf_queue* q = NULL; - + switch (fh->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: q = &fh->cap; @@ -1956,7 +1955,7 @@ static struct videobuf_queue* bttv_queue static int bttv_resource(struct bttv_fh *fh) { int res = 0; - + switch (fh->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: res = RESOURCE_VIDEO; @@ -2065,7 +2064,7 @@ static int bttv_try_fmt(struct bttv_fh * (f->fmt.pix.width * fmt->depth) >> 3; f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline; - + return 0; } case V4L2_BUF_TYPE_VIDEO_OVERLAY: @@ -2083,7 +2082,7 @@ static int bttv_s_fmt(struct bttv_fh *fh struct v4l2_format *f) { int retval; - + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: { @@ -2096,7 +2095,7 @@ static int bttv_s_fmt(struct bttv_fh *fh if (0 != retval) return retval; fmt = format_by_fourcc(f->fmt.pix.pixelformat); - + /* update our state informations */ down(&fh->cap.lock); fh->fmt = fmt; @@ -2108,7 +2107,7 @@ static int bttv_s_fmt(struct bttv_fh *fh btv->init.width = f->fmt.pix.width; btv->init.height = f->fmt.pix.height; up(&fh->cap.lock); - + return 0; } case V4L2_BUF_TYPE_VIDEO_OVERLAY: @@ -2218,7 +2217,7 @@ static int bttv_do_ioctl(struct inode *i { struct video_picture *pic = arg; const struct bttv_format *fmt; - + fmt = format_by_palette(pic->palette); if (NULL == fmt) return -EINVAL; @@ -2365,7 +2364,7 @@ static int bttv_do_ioctl(struct inode *i if (!check_alloc_btres(btv,fh,RESOURCE_OVERLAY)) return -EBUSY; - + down(&fh->cap.lock); if (*on) { fh->ov.tvnorm = btv->tvnorm; @@ -2419,7 +2418,7 @@ static int bttv_do_ioctl(struct inode *i if (buf->vb.state == STATE_QUEUED || buf->vb.state == STATE_ACTIVE) goto fh_unlock_and_return; - + field = (vm->height > bttv_tvnorms[btv->tvnorm].sheight/2) ? V4L2_FIELD_INTERLACED : V4L2_FIELD_BOTTOM; @@ -2543,7 +2542,7 @@ static int bttv_do_ioctl(struct inode *i V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_TUNER | - V4L2_CAP_READWRITE | + V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; return 0; } @@ -2628,7 +2627,7 @@ static int bttv_do_ioctl(struct inode *i { struct v4l2_framebuffer *fb = arg; const struct bttv_format *fmt; - + if(!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO)) return -EPERM; @@ -2657,7 +2656,7 @@ static int bttv_do_ioctl(struct inode *i btv->fbuf.fmt.bytesperline = fb->fmt.bytesperline; else btv->fbuf.fmt.bytesperline = btv->fbuf.fmt.width*fmt->depth/8; - + retval = 0; fh->ovfmt = fmt; btv->init.ovfmt = fmt; @@ -2675,7 +2674,7 @@ static int bttv_do_ioctl(struct inode *i if (check_btres(fh, RESOURCE_OVERLAY)) { struct bttv_buffer *new; - + new = videobuf_alloc(sizeof(*new)); bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new); retval = bttv_switch_overlay(btv,fh,new); @@ -2795,7 +2794,7 @@ static int bttv_do_ioctl(struct inode *i } #endif - + case VIDIOC_ENUMSTD: case VIDIOC_G_STD: case VIDIOC_S_STD: @@ -2908,7 +2907,7 @@ static unsigned int bttv_poll(struct fil up(&fh->cap.lock); buf = (struct bttv_buffer*)fh->cap.read_buf; } - + poll_wait(file, &buf->vb.done, wait); if (buf->vb.state == STATE_DONE || buf->vb.state == STATE_ERROR) @@ -2985,7 +2984,7 @@ static int bttv_release(struct inode *in /* turn off overlay */ if (check_btres(fh, RESOURCE_OVERLAY)) bttv_switch_overlay(btv,fh,NULL); - + /* stop video capture */ if (check_btres(fh, RESOURCE_VIDEO)) { videobuf_streamoff(file->private_data,&fh->cap); @@ -3140,7 +3139,7 @@ static int radio_do_ioctl(struct inode * case VIDIOCSTUNER: /* nothing to do */ return 0; - + case BTTV_VERSION: case VIDIOCGFREQ: case VIDIOCSFREQ: @@ -3206,7 +3205,7 @@ static char *irq_name[] = { static void bttv_print_irqbits(u32 print, u32 mark) { unsigned int i; - + printk("bits:"); for (i = 0; i < ARRAY_SIZE(irq_name); i++) { if (print & (1 << i)) @@ -3373,7 +3372,7 @@ static void bttv_irq_timeout(unsigned lo struct bttv_buffer *ovbi; struct bttv_buffer *item; unsigned long flags; - + if (bttv_verbose) { printk(KERN_INFO "bttv%d: timeout: drop=%d irq=%d/%d, risc=%08x, ", btv->c.nr, btv->framedrop, btv->irq_me, btv->irq_total, @@ -3383,7 +3382,7 @@ static void bttv_irq_timeout(unsigned lo } spin_lock_irqsave(&btv->s_lock,flags); - + /* deactivate stuff */ memset(&new,0,sizeof(new)); old = btv->curr; @@ -3412,7 +3411,7 @@ static void bttv_irq_timeout(unsigned lo item->vb.state = STATE_ERROR; wake_up(&item->vb.done); } - + btv->errors++; spin_unlock_irqrestore(&btv->s_lock,flags); } @@ -3466,7 +3465,7 @@ bttv_irq_switch_video(struct bttv *btv) spin_unlock(&btv->s_lock); return; } - + /* switch over */ old = btv->curr; btv->curr = new; @@ -3558,7 +3557,7 @@ static irqreturn_t bttv_irq(int irq, voi printk("\n"); } - if (astat&BT848_INT_VSYNC) + if (astat&BT848_INT_VSYNC) btv->field_count++; if (astat & BT848_INT_GPINT) { @@ -3603,7 +3602,7 @@ static irqreturn_t bttv_irq(int irq, voi count++; if (count > 4) { btwrite(0, BT848_INT_MASK); - printk(KERN_ERR + printk(KERN_ERR "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr); bttv_print_irqbits(stat,astat); printk("]\n"); @@ -3711,9 +3710,9 @@ static void pci_set_command(struct pci_d { #if defined(__powerpc__) unsigned int cmd; - + pci_read_config_dword(dev, PCI_COMMAND, &cmd); - cmd = (cmd | PCI_COMMAND_MEMORY ); + cmd = (cmd | PCI_COMMAND_MEMORY ); pci_write_config_dword(dev, PCI_COMMAND, cmd); #endif } @@ -3750,14 +3749,14 @@ static int __devinit bttv_probe(struct p init_timer(&btv->timeout); btv->timeout.function = bttv_irq_timeout; btv->timeout.data = (unsigned long)btv; - + btv->i2c_rc = -1; btv->tuner_type = UNSET; btv->pinnacle_id = UNSET; btv->new_input = UNSET; btv->gpioirq = 1; btv->has_radio=radio[btv->c.nr]; - + /* pci stuff (init, get irq/mmio, ... */ btv->c.pci = dev; btv->id = dev->device; @@ -3794,7 +3793,7 @@ static int __devinit bttv_probe(struct p printk("irq: %d, latency: %d, mmio: 0x%lx\n", btv->c.pci->irq, lat, pci_resource_start(dev,0)); schedule(); - + btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000); if (NULL == ioremap(pci_resource_start(dev,0), 0x1000)) { printk("bttv%d: ioremap() failed\n", btv->c.nr); @@ -3829,7 +3828,7 @@ static int __devinit bttv_probe(struct p btv->opt_vcr_hack = vcr_hack; btv->opt_whitecrush_upper = whitecrush_upper; btv->opt_whitecrush_lower = whitecrush_lower; - + /* fill struct bttv with some useful defaults */ btv->init.btv = btv; btv->init.ov.w.width = 320; @@ -3886,7 +3885,7 @@ static int __devinit bttv_probe(struct p fail2: free_irq(btv->c.pci->irq,btv); - + fail1: if (btv->bt848_mmio) iounmap(btv->bt848_mmio); @@ -3915,7 +3914,7 @@ static void __devexit bttv_remove(struct btv->shutdown=1; wake_up(&btv->gpioq); bttv_sub_del_devices(&btv->c); - + /* unregister i2c_bus + input */ fini_bttv_i2c(btv); diff -puN drivers/media/video/bttv-gpio.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-gpio.c --- 25/drivers/media/video/bttv-gpio.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.733144512 -0700 +++ 25-akpm/drivers/media/video/bttv-gpio.c 2004-10-24 02:51:20.761140256 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttv-gpio.c,v 1.3 2004/09/15 16:15:24 kraxel Exp $ + $Id: bttv-gpio.c,v 1.4 2004/10/13 10:39:00 kraxel Exp $ bttv-gpio.c -- gpio sub drivers @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + */ #include diff -puN drivers/media/video/bttv.h~v4l-bttv-whitespace-cleanup drivers/media/video/bttv.h --- 25/drivers/media/video/bttv.h~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.734144360 -0700 +++ 25-akpm/drivers/media/video/bttv.h 2004-10-24 02:51:20.746142536 -0700 @@ -1,5 +1,5 @@ /* - * $Id: bttv.h,v 1.9 2004/09/15 16:15:24 kraxel Exp $ + * $Id: bttv.h,v 1.10 2004/10/13 10:39:00 kraxel Exp $ * * bttv - Bt848 frame grabber driver * @@ -26,9 +26,9 @@ #define BTTV_HAUPPAUGE 0x02 #define BTTV_STB 0x03 #define BTTV_INTEL 0x04 -#define BTTV_DIAMOND 0x05 -#define BTTV_AVERMEDIA 0x06 -#define BTTV_MATRIX_VISION 0x07 +#define BTTV_DIAMOND 0x05 +#define BTTV_AVERMEDIA 0x06 +#define BTTV_MATRIX_VISION 0x07 #define BTTV_FLYVIDEO 0x08 #define BTTV_TURBOTV 0x09 #define BTTV_HAUPPAUGE878 0x0a @@ -245,7 +245,7 @@ extern int bttv_handle_chipset(struct bt /* returns card type + card ID (for bt878-based ones) for possible values see lines below beginning with #define BTTV_UNKNOWN - returns negative value if error occurred + returns negative value if error occurred */ extern int bttv_get_cardinfo(unsigned int card, int *type, unsigned int *cardid); @@ -268,18 +268,18 @@ extern int bttv_read_gpio(unsigned int c /* sets GPDATA register to new value: (data & mask) | (current_GPDATA_value & ~mask) - returns negative value if error occurred + returns negative value if error occurred */ extern int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data); -/* returns pointer to task queue which can be used as parameter to +/* returns pointer to task queue which can be used as parameter to interruptible_sleep_on in interrupt handler if BT848_INT_GPINT bit is set - this queue is activated - (wake_up_interruptible) and following call to the function bttv_read_gpio + (wake_up_interruptible) and following call to the function bttv_read_gpio should return new value of GPDATA, returns NULL value if error occurred or queue is not available - WARNING: because there is no buffer for GPIO data, one MUST + WARNING: because there is no buffer for GPIO data, one MUST process data ASAP */ extern wait_queue_head_t* bttv_get_gpio_queue(unsigned int card); diff -puN drivers/media/video/bttv-i2c.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-i2c.c --- 25/drivers/media/video/bttv-i2c.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.736144056 -0700 +++ 25-akpm/drivers/media/video/bttv-i2c.c 2004-10-24 02:51:20.762140104 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.10 2004/10/06 17:30:51 kraxel Exp $ + $Id: bttv-i2c.c,v 1.11 2004/10/13 10:39:00 kraxel Exp $ bttv-i2c.c -- all the i2c code is here @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + */ #include @@ -83,7 +83,7 @@ static int bttv_bit_getscl(void *data) { struct bttv *btv = (struct bttv*)data; int state; - + state = btread(BT848_I2C) & 0x02 ? 1 : 0; return state; } @@ -126,7 +126,7 @@ static struct i2c_adapter bttv_i2c_adap_ /* ----------------------------------------------------------------------- */ /* I2C functions - hardware i2c */ -static int algo_control(struct i2c_adapter *adapter, +static int algo_control(struct i2c_adapter *adapter, unsigned int cmd, unsigned long arg) { return 0; @@ -142,7 +142,7 @@ bttv_i2c_wait_done(struct bttv *btv) { DECLARE_WAITQUEUE(wait, current); int rc = 0; - + add_wait_queue(&btv->i2c_queue, &wait); if (0 == btv->i2c_done) msleep_interruptible(20); @@ -352,7 +352,7 @@ static struct i2c_client bttv_i2c_client /* read I2C */ -int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) +int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) { unsigned char buffer = 0; @@ -397,7 +397,7 @@ int bttv_I2CWrite(struct bttv *btv, unsi void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) { int i; - + if (bttv_I2CWrite(btv, addr, 0, -1, 0)<0) { printk(KERN_WARNING "bttv: readee error\n"); return; diff -puN drivers/media/video/bttv-if.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-if.c --- 25/drivers/media/video/bttv-if.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.737143904 -0700 +++ 25-akpm/drivers/media/video/bttv-if.c 2004-10-24 02:51:20.759140560 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttv-if.c,v 1.2 2004/09/15 16:15:24 kraxel Exp $ + $Id: bttv-if.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $ bttv-if.c -- old gpio interface to other kernel modules don't use in new code, will go away in 2.7 @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + */ #include @@ -82,7 +82,7 @@ int bttv_gpio_enable(unsigned int card, if (card >= bttv_num) { return -EINVAL; } - + btv = &bttvs[card]; gpio_inout(mask,data); if (bttv_gpio) @@ -93,7 +93,7 @@ int bttv_gpio_enable(unsigned int card, int bttv_read_gpio(unsigned int card, unsigned long *data) { struct bttv *btv; - + if (card >= bttv_num) { return -EINVAL; } @@ -104,7 +104,7 @@ int bttv_read_gpio(unsigned int card, un return -ENODEV; } -/* prior setting BT848_GPIO_REG_INP is (probably) not needed +/* prior setting BT848_GPIO_REG_INP is (probably) not needed because we set direct input on init */ *data = gpio_read(); return 0; @@ -113,14 +113,14 @@ int bttv_read_gpio(unsigned int card, un int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data) { struct bttv *btv; - + if (card >= bttv_num) { return -EINVAL; } btv = &bttvs[card]; -/* prior setting BT848_GPIO_REG_INP is (probably) not needed +/* prior setting BT848_GPIO_REG_INP is (probably) not needed because direct input is set on init */ gpio_bits(mask,data); if (bttv_gpio) diff -puN drivers/media/video/bttvp.h~v4l-bttv-whitespace-cleanup drivers/media/video/bttvp.h --- 25/drivers/media/video/bttvp.h~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.738143752 -0700 +++ 25-akpm/drivers/media/video/bttvp.h 2004-10-24 02:51:20.746142536 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttvp.h,v 1.10 2004/10/06 17:30:51 kraxel Exp $ + $Id: bttvp.h,v 1.11 2004/10/13 10:39:00 kraxel Exp $ bttv - Bt848 frame grabber driver @@ -145,7 +145,7 @@ struct bttv_overlay { struct bttv_fh { struct bttv *btv; int resources; -#ifdef VIDIOC_G_PRIORITY +#ifdef VIDIOC_G_PRIORITY enum v4l2_priority prio; #endif enum v4l2_buf_type type; @@ -334,10 +334,10 @@ struct bttv { struct semaphore lock; int resources; struct semaphore reslock; -#ifdef VIDIOC_G_PRIORITY +#ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio; #endif - + /* video state */ unsigned int input; unsigned int audio; diff -puN drivers/media/video/bttv-risc.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-risc.c --- 25/drivers/media/video/bttv-risc.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.740143448 -0700 +++ 25-akpm/drivers/media/video/bttv-risc.c 2004-10-24 02:51:20.760140408 -0700 @@ -1,5 +1,5 @@ /* - $Id: bttv-risc.c,v 1.8 2004/10/06 17:30:51 kraxel Exp $ + $Id: bttv-risc.c,v 1.9 2004/10/13 10:39:00 kraxel Exp $ bttv-risc.c -- interfaces to other kernel modules @@ -240,7 +240,7 @@ bttv_risc_overlay(struct bttv *btv, stru /* skip list for window clipping */ if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) return -ENOMEM; - + /* estimate risc mem: worst case is (clip+1) * lines instructions + sync + jump (all 2 dwords) */ instructions = (ov->nclips + 1) * @@ -293,7 +293,7 @@ bttv_risc_overlay(struct bttv *btv, stru ra = addr + (fmt->depth>>3)*start; else ra = 0; - + if (0 == start) ri |= BT848_RISC_SOL; if (ov->w.width == end) @@ -413,7 +413,7 @@ bttv_set_dma(struct bttv *btv, int overr btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0, btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0, btv->curr.bottom ? (unsigned long long)btv->curr.bottom->bottom.dma : 0); - + cmd = BT848_RISC_JUMP; if (btv->loop_irq) { cmd |= BT848_RISC_IRQ; @@ -426,7 +426,7 @@ bttv_set_dma(struct bttv *btv, int overr del_timer(&btv->timeout); } btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); - + btaor(capctl, ~0x0f, BT848_CAP_CTL); if (capctl) { if (btv->dma_on) @@ -447,7 +447,7 @@ int bttv_risc_init_main(struct bttv *btv) { int rc; - + if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0) return rc; dprintk(KERN_DEBUG "bttv%d: risc main @ %08Lx\n", @@ -616,7 +616,7 @@ bttv_buffer_risc(struct bttv *btv, struc bttv_calc_geo(btv,&buf->geo,buf->vb.width,buf->vb.height, V4L2_FIELD_HAS_BOTH(buf->vb.field),buf->tvnorm); - + switch (buf->vb.field) { case V4L2_FIELD_TOP: bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, diff -puN drivers/media/video/bttv-vbi.c~v4l-bttv-whitespace-cleanup drivers/media/video/bttv-vbi.c --- 25/drivers/media/video/bttv-vbi.c~v4l-bttv-whitespace-cleanup 2004-10-24 02:51:20.741143296 -0700 +++ 25-akpm/drivers/media/video/bttv-vbi.c 2004-10-24 02:51:20.760140408 -0700 @@ -1,21 +1,21 @@ /* - $Id: bttv-vbi.c,v 1.5 2004/10/06 17:30:51 kraxel Exp $ + $Id: bttv-vbi.c,v 1.6 2004/10/13 10:39:00 kraxel Exp $ bttv - Bt848 frame grabber driver vbi interface - + (c) 2002 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -83,7 +83,7 @@ static int vbi_buffer_prepare(void *priv struct bttv *btv = fh->btv; struct bttv_buffer *buf = (struct bttv_buffer*)vb; int rc; - + buf->vb.size = fh->lines * 2 * 2048; if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) return -EINVAL; @@ -112,7 +112,7 @@ vbi_buffer_queue(void *priv, struct vide struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; struct bttv_buffer *buf = (struct bttv_buffer*)vb; - + dprintk("queue %p\n",vb); buf->vb.state = STATE_QUEUED; list_add_tail(&buf->vb.queue,&btv->vcapture); @@ -127,7 +127,7 @@ static void vbi_buffer_release(void *pri struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; struct bttv_buffer *buf = (struct bttv_buffer*)vb; - + dprintk("free %p\n",vb); bttv_dma_free(fh->btv,buf); } _