aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/common/ir-common.c4
-rw-r--r--drivers/media/video/bt832.c88
-rw-r--r--drivers/media/video/bt832.h4
-rw-r--r--drivers/media/video/bttv-cards.c260
-rw-r--r--drivers/media/video/bttv-driver.c342
-rw-r--r--drivers/media/video/bttv-gpio.c2
-rw-r--r--drivers/media/video/bttv-i2c.c42
-rw-r--r--drivers/media/video/bttv-if.c4
-rw-r--r--drivers/media/video/bttv-risc.c110
-rw-r--r--drivers/media/video/bttv.h20
-rw-r--r--drivers/media/video/bttvp.h14
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c40
-rw-r--r--drivers/media/video/cx88/cx88-cards.c340
-rw-r--r--drivers/media/video/cx88/cx88-core.c40
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c16
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c22
-rw-r--r--drivers/media/video/cx88/cx88-input.c2
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c18
-rw-r--r--drivers/media/video/cx88/cx88-reg.h12
-rw-r--r--drivers/media/video/cx88/cx88-video.c22
-rw-r--r--drivers/media/video/cx88/cx88.h4
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c4
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c28
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c4
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c52
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c10
-rw-r--r--drivers/media/video/em28xx/em28xx.h12
-rw-r--r--drivers/media/video/ir-kbd-gpio.c4
-rw-r--r--drivers/media/video/ir-kbd-i2c.c22
-rw-r--r--drivers/media/video/msp3400.c62
-rw-r--r--drivers/media/video/mt20xx.c204
-rw-r--r--drivers/media/video/saa711x.c4
-rw-r--r--drivers/media/video/saa7134/saa6752hs.c62
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c504
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c314
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c38
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c14
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c100
-rw-r--r--drivers/media/video/saa7134/saa7134-oss.c68
-rw-r--r--drivers/media/video/saa7134/saa7134-reg.h18
-rw-r--r--drivers/media/video/saa7134/saa7134-ts.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c12
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c106
-rw-r--r--drivers/media/video/saa7134/saa7134.h12
-rw-r--r--drivers/media/video/tda7432.c16
-rw-r--r--drivers/media/video/tda8290.c2
-rw-r--r--drivers/media/video/tda9875.c56
-rw-r--r--drivers/media/video/tda9887.c36
-rw-r--r--drivers/media/video/tea5767.c8
-rw-r--r--drivers/media/video/tuner-core.c30
-rw-r--r--drivers/media/video/tuner-simple.c106
-rw-r--r--drivers/media/video/tvaudio.c20
-rw-r--r--drivers/media/video/tveeprom.c20
-rw-r--r--drivers/media/video/tvmixer.c54
-rw-r--r--drivers/media/video/v4l1-compat.c2
-rw-r--r--drivers/media/video/video-buf.c18
-rw-r--r--drivers/media/video/wm8775.c4
59 files changed, 1723 insertions, 1723 deletions
diff --git a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c
index 31fccb4f05d..4b71fd6f7ae 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] = {
116 [ 46 ] = KEY_BLUE, 116 [ 46 ] = KEY_BLUE,
117 [ 24 ] = KEY_KPPLUS, /* fine tune + */ 117 [ 24 ] = KEY_KPPLUS, /* fine tune + */
118 [ 25 ] = KEY_KPMINUS, /* fine tune - */ 118 [ 25 ] = KEY_KPMINUS, /* fine tune - */
119 [ 33 ] = KEY_KPDOT, 119 [ 33 ] = KEY_KPDOT,
120 [ 19 ] = KEY_KPENTER, 120 [ 19 ] = KEY_KPENTER,
121 [ 34 ] = KEY_BACK, 121 [ 34 ] = KEY_BACK,
122 [ 35 ] = KEY_PLAYPAUSE, 122 [ 35 ] = KEY_PLAYPAUSE,
@@ -239,7 +239,7 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
239 dprintk(1,"%s: key event code=%d down=%d\n", 239 dprintk(1,"%s: key event code=%d down=%d\n",
240 dev->name,ir->keycode,ir->keypressed); 240 dev->name,ir->keycode,ir->keypressed);
241 input_report_key(dev,ir->keycode,ir->keypressed); 241 input_report_key(dev,ir->keycode,ir->keypressed);
242 input_sync(dev); 242 input_sync(dev);
243} 243}
244 244
245/* -------------------------------------------------------------------------- */ 245/* -------------------------------------------------------------------------- */
diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c
index 76c1b63ebdf..3e42493a4e0 100644
--- a/drivers/media/video/bt832.c
+++ b/drivers/media/video/bt832.c
@@ -54,36 +54,36 @@ static struct i2c_driver driver;
54static struct i2c_client client_template; 54static struct i2c_client client_template;
55 55
56struct bt832 { 56struct bt832 {
57 struct i2c_client client; 57 struct i2c_client client;
58}; 58};
59 59
60int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf) 60int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf)
61{ 61{
62 int i,rc; 62 int i,rc;
63 buf[0]=0x80; // start at register 0 with auto-increment 63 buf[0]=0x80; // start at register 0 with auto-increment
64 if (1 != (rc = i2c_master_send(i2c_client_s,buf,1))) 64 if (1 != (rc = i2c_master_send(i2c_client_s,buf,1)))
65 printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc); 65 printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc);
66 66
67 for(i=0;i<65;i++) 67 for(i=0;i<65;i++)
68 buf[i]=0; 68 buf[i]=0;
69 if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65))) 69 if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65)))
70 printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc); 70 printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc);
71 71
72 // Note: On READ the first byte is the current index 72 // Note: On READ the first byte is the current index
73 // (e.g. 0x80, what we just wrote) 73 // (e.g. 0x80, what we just wrote)
74 74
75 if(1) { 75 if(1) {
76 int i; 76 int i;
77 printk("BT832 hexdump:\n"); 77 printk("BT832 hexdump:\n");
78 for(i=1;i<65;i++) { 78 for(i=1;i<65;i++) {
79 if(i!=1) { 79 if(i!=1) {
80 if(((i-1)%8)==0) printk(" "); 80 if(((i-1)%8)==0) printk(" ");
81 if(((i-1)%16)==0) printk("\n"); 81 if(((i-1)%16)==0) printk("\n");
82 } 82 }
83 printk(" %02x",buf[i]); 83 printk(" %02x",buf[i]);
84 } 84 }
85 printk("\n"); 85 printk("\n");
86 } 86 }
87 return 0; 87 return 0;
88} 88}
89 89
@@ -102,13 +102,13 @@ int bt832_init(struct i2c_client *i2c_client_s)
102 return 0; 102 return 0;
103 } 103 }
104 104
105 printk("Write 0 tp VPSTATUS\n"); 105 printk("Write 0 tp VPSTATUS\n");
106 buf[0]=BT832_VP_STATUS; // Reg.52 106 buf[0]=BT832_VP_STATUS; // Reg.52
107 buf[1]= 0x00; 107 buf[1]= 0x00;
108 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) 108 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
109 printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); 109 printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
110 110
111 bt832_hexdump(i2c_client_s,buf); 111 bt832_hexdump(i2c_client_s,buf);
112 112
113 113
114 // Leave low power mode: 114 // Leave low power mode:
@@ -116,17 +116,17 @@ int bt832_init(struct i2c_client *i2c_client_s)
116 buf[0]=BT832_CAM_SETUP0; //0x39 57 116 buf[0]=BT832_CAM_SETUP0; //0x39 57
117 buf[1]=0x08; 117 buf[1]=0x08;
118 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) 118 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
119 printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc); 119 printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc);
120 120
121 bt832_hexdump(i2c_client_s,buf); 121 bt832_hexdump(i2c_client_s,buf);
122 122
123 printk("Write 0 tp VPSTATUS\n"); 123 printk("Write 0 tp VPSTATUS\n");
124 buf[0]=BT832_VP_STATUS; // Reg.52 124 buf[0]=BT832_VP_STATUS; // Reg.52
125 buf[1]= 0x00; 125 buf[1]= 0x00;
126 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) 126 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
127 printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc); 127 printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
128 128
129 bt832_hexdump(i2c_client_s,buf); 129 bt832_hexdump(i2c_client_s,buf);
130 130
131 131
132 // Enable Output 132 // Enable Output
@@ -134,22 +134,22 @@ int bt832_init(struct i2c_client *i2c_client_s)
134 buf[0]=BT832_VP_CONTROL1; // Reg.40 134 buf[0]=BT832_VP_CONTROL1; // Reg.40
135 buf[1]= 0x27 & (~0x01); // Default | !skip 135 buf[1]= 0x27 & (~0x01); // Default | !skip
136 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) 136 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
137 printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc); 137 printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc);
138 138
139 bt832_hexdump(i2c_client_s,buf); 139 bt832_hexdump(i2c_client_s,buf);
140 140
141 141
142 // for testing (even works when no camera attached) 142 // for testing (even works when no camera attached)
143 printk("bt832: *** Generate NTSC M Bars *****\n"); 143 printk("bt832: *** Generate NTSC M Bars *****\n");
144 buf[0]=BT832_VP_TESTCONTROL0; // Reg. 42 144 buf[0]=BT832_VP_TESTCONTROL0; // Reg. 42
145 buf[1]=3; // Generate NTSC System M bars, Generate Frame timing internally 145 buf[1]=3; // Generate NTSC System M bars, Generate Frame timing internally
146 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2))) 146 if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
147 printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc); 147 printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc);
148 148
149 printk("Bt832: Camera Present: %s\n", 149 printk("Bt832: Camera Present: %s\n",
150 (buf[1+BT832_CAM_STATUS] & BT832_56_CAMERA_PRESENT) ? "yes":"no"); 150 (buf[1+BT832_CAM_STATUS] & BT832_56_CAMERA_PRESENT) ? "yes":"no");
151 151
152 bt832_hexdump(i2c_client_s,buf); 152 bt832_hexdump(i2c_client_s,buf);
153 kfree(buf); 153 kfree(buf);
154 return 1; 154 return 1;
155} 155}
@@ -162,17 +162,17 @@ static int bt832_attach(struct i2c_adapter *adap, int addr, int kind)
162 162
163 printk("bt832_attach\n"); 163 printk("bt832_attach\n");
164 164
165 client_template.adapter = adap; 165 client_template.adapter = adap;
166 client_template.addr = addr; 166 client_template.addr = addr;
167 167
168 printk("bt832: chip found @ 0x%x\n", addr<<1); 168 printk("bt832: chip found @ 0x%x\n", addr<<1);
169 169
170 if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) 170 if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
171 return -ENOMEM; 171 return -ENOMEM;
172 memset(t,0,sizeof(*t)); 172 memset(t,0,sizeof(*t));
173 t->client = client_template; 173 t->client = client_template;
174 i2c_set_clientdata(&t->client, t); 174 i2c_set_clientdata(&t->client, t);
175 i2c_attach_client(&t->client); 175 i2c_attach_client(&t->client);
176 176
177 if(! bt832_init(&t->client)) { 177 if(! bt832_init(&t->client)) {
178 bt832_detach(&t->client); 178 bt832_detach(&t->client);
@@ -211,7 +211,7 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
211 211
212 printk("bt832: command %x\n",cmd); 212 printk("bt832: command %x\n",cmd);
213 213
214 switch (cmd) { 214 switch (cmd) {
215 case BT832_HEXDUMP: { 215 case BT832_HEXDUMP: {
216 unsigned char *buf; 216 unsigned char *buf;
217 buf=kmalloc(65,GFP_KERNEL); 217 buf=kmalloc(65,GFP_KERNEL);
diff --git a/drivers/media/video/bt832.h b/drivers/media/video/bt832.h
index 9b6a8d2c96b..1ce8fa71f7d 100644
--- a/drivers/media/video/bt832.h
+++ b/drivers/media/video/bt832.h
@@ -233,8 +233,8 @@ SetInterlaceMode( spec.interlace );
233/* from web: 233/* from web:
234 Video Sampling 234 Video Sampling
235Digital video is a sampled form of analog video. The most common sampling schemes in use today are: 235Digital video is a sampled form of analog video. The most common sampling schemes in use today are:
236 Pixel Clock Horiz Horiz Vert 236 Pixel Clock Horiz Horiz Vert
237 Rate Total Active 237 Rate Total Active
238NTSC square pixel 12.27 MHz 780 640 525 238NTSC square pixel 12.27 MHz 780 640 525
239NTSC CCIR-601 13.5 MHz 858 720 525 239NTSC CCIR-601 13.5 MHz 858 720 525
240NTSC 4FSc 14.32 MHz 910 768 525 240NTSC 4FSc 14.32 MHz 910 768 525
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 3937da065e4..92bb515fbe4 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -6,7 +6,7 @@
6 like the big tvcards array for the most part 6 like the big tvcards array for the most part
7 7
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de) 9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de> 10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
11 11
12 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
@@ -163,10 +163,10 @@ static struct CARD {
163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" }, 163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" }, 164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" }, 165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" }, 166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" }, 167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, 168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" }, 169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
170 170
171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" }, 171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
172 /* some cards ship with byteswapped IDs ... */ 172 /* some cards ship with byteswapped IDs ... */
@@ -277,7 +277,7 @@ static struct CARD {
277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"}, 277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" }, 278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" }, 279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" }, 280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
281 281
282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" }, 282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" }, 283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
@@ -1346,17 +1346,17 @@ struct tvcard bttv_tvcards[] = {
1346 }, 1346 },
1347 [BTTV_BOARD_GMV1] = { 1347 [BTTV_BOARD_GMV1] = {
1348 /* Adrian Cox <adrian@humboldt.co.uk */ 1348 /* Adrian Cox <adrian@humboldt.co.uk */
1349 .name = "AG Electronics GMV1", 1349 .name = "AG Electronics GMV1",
1350 .video_inputs = 2, 1350 .video_inputs = 2,
1351 .audio_inputs = 0, 1351 .audio_inputs = 0,
1352 .tuner = -1, 1352 .tuner = -1,
1353 .svhs = 1, 1353 .svhs = 1,
1354 .gpiomask = 0xF, 1354 .gpiomask = 0xF,
1355 .muxsel = { 2, 2}, 1355 .muxsel = { 2, 2},
1356 .audiomux = { }, 1356 .audiomux = { },
1357 .no_msp34xx = 1, 1357 .no_msp34xx = 1,
1358 .needs_tvaudio = 0, 1358 .needs_tvaudio = 0,
1359 .pll = PLL_28, 1359 .pll = PLL_28,
1360 .tuner_type = -1, 1360 .tuner_type = -1,
1361 .tuner_addr = ADDR_UNSET, 1361 .tuner_addr = ADDR_UNSET,
1362 .radio_addr = ADDR_UNSET, 1362 .radio_addr = ADDR_UNSET,
@@ -2895,7 +2895,7 @@ void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2895 else if (0 == strncmp(eeprom_data+20,"Picolo",7)) 2895 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2896 type = BTTV_BOARD_EURESYS_PICOLO; 2896 type = BTTV_BOARD_EURESYS_PICOLO;
2897 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0) 2897 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2898 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */ 2898 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2899 2899
2900 if (-1 != type) { 2900 if (-1 != type) {
2901 btv->c.type = type; 2901 btv->c.type = type;
@@ -2929,7 +2929,7 @@ static void flyvideo_gpio(struct bttv *btv)
2929 switch(ttype) { 2929 switch(ttype) {
2930 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ 2930 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
2931 break; 2931 break;
2932 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ 2932 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
2933 break; 2933 break;
2934 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ 2934 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
2935 break; 2935 break;
@@ -2945,7 +2945,7 @@ static void flyvideo_gpio(struct bttv *btv)
2945 has_radio = gpio & 0x400000; 2945 has_radio = gpio & 0x400000;
2946 /* unknown 0x200000; 2946 /* unknown 0x200000;
2947 * unknown2 0x100000; */ 2947 * unknown2 0x100000; */
2948 is_capture_only = !(gpio & 0x008000); /* GPIO15 */ 2948 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
2949 has_tda9820_tda9821 = !(gpio & 0x004000); 2949 has_tda9820_tda9821 = !(gpio & 0x004000);
2950 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */ 2950 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2951 /* 2951 /*
@@ -2982,7 +2982,7 @@ static void miro_pinnacle_gpio(struct bttv *btv)
2982 char *info; 2982 char *info;
2983 2983
2984 gpio_inout(0xffffff, 0); 2984 gpio_inout(0xffffff, 0);
2985 gpio = gpio_read(); 2985 gpio = gpio_read();
2986 id = ((gpio>>10) & 63) -1; 2986 id = ((gpio>>10) & 63) -1;
2987 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx"); 2987 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2988 if (id < 32) { 2988 if (id < 32) {
@@ -3093,7 +3093,7 @@ static void eagle_muxsel(struct bttv *btv, unsigned int input)
3093 3093
3094static void gvc1100_muxsel(struct bttv *btv, unsigned int input) 3094static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3095{ 3095{
3096 static const int masks[] = {0x30, 0x01, 0x12, 0x23}; 3096 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3097 gpio_write(masks[input%4]); 3097 gpio_write(masks[input%4]);
3098} 3098}
3099 3099
@@ -3161,10 +3161,10 @@ void __devinit bttv_init_card1(struct bttv *btv)
3161 switch (btv->c.type) { 3161 switch (btv->c.type) {
3162 case BTTV_BOARD_HAUPPAUGE: 3162 case BTTV_BOARD_HAUPPAUGE:
3163 case BTTV_BOARD_HAUPPAUGE878: 3163 case BTTV_BOARD_HAUPPAUGE878:
3164 boot_msp34xx(btv,5); 3164 boot_msp34xx(btv,5);
3165 break; 3165 break;
3166 case BTTV_BOARD_VOODOOTV_FM: 3166 case BTTV_BOARD_VOODOOTV_FM:
3167 boot_msp34xx(btv,20); 3167 boot_msp34xx(btv,20);
3168 break; 3168 break;
3169 case BTTV_BOARD_AVERMEDIA98: 3169 case BTTV_BOARD_AVERMEDIA98:
3170 boot_msp34xx(btv,11); 3170 boot_msp34xx(btv,11);
@@ -3192,7 +3192,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3192 int tda9887; 3192 int tda9887;
3193 int addr=ADDR_UNSET, radio_addr=ADDR_UNSET; 3193 int addr=ADDR_UNSET, radio_addr=ADDR_UNSET;
3194 3194
3195 btv->tuner_type = -1; 3195 btv->tuner_type = -1;
3196 3196
3197 if (BTTV_BOARD_UNKNOWN == btv->c.type) { 3197 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3198 bttv_readee(btv,eeprom_data,0xa0); 3198 bttv_readee(btv,eeprom_data,0xa0);
@@ -3225,7 +3225,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3225 case BTTV_BOARD_HAUPPAUGEPVR: 3225 case BTTV_BOARD_HAUPPAUGEPVR:
3226 /* pick up some config infos from the eeprom */ 3226 /* pick up some config infos from the eeprom */
3227 bttv_readee(btv,eeprom_data,0xa0); 3227 bttv_readee(btv,eeprom_data,0xa0);
3228 hauppauge_eeprom(btv); 3228 hauppauge_eeprom(btv);
3229 break; 3229 break;
3230 case BTTV_BOARD_AVERMEDIA98: 3230 case BTTV_BOARD_AVERMEDIA98:
3231 case BTTV_BOARD_AVPHONE98: 3231 case BTTV_BOARD_AVPHONE98:
@@ -3258,7 +3258,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3258 } 3258 }
3259 break; 3259 break;
3260 case BTTV_BOARD_STB2: 3260 case BTTV_BOARD_STB2:
3261 if (btv->cardid == 0x3060121a) { 3261 if (btv->cardid == 0x3060121a) {
3262 /* Fix up entry for 3DFX VoodooTV 100, 3262 /* Fix up entry for 3DFX VoodooTV 100,
3263 which is an OEM STB card variant. */ 3263 which is an OEM STB card variant. */
3264 btv->has_radio=0; 3264 btv->has_radio=0;
@@ -3277,7 +3277,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3277 case BTTV_BOARD_OSPREY540: 3277 case BTTV_BOARD_OSPREY540:
3278 case BTTV_BOARD_OSPREY2000: 3278 case BTTV_BOARD_OSPREY2000:
3279 bttv_readee(btv,eeprom_data,0xa0); 3279 bttv_readee(btv,eeprom_data,0xa0);
3280 osprey_eeprom(btv); 3280 osprey_eeprom(btv);
3281 break; 3281 break;
3282 case BTTV_BOARD_IDS_EAGLE: 3282 case BTTV_BOARD_IDS_EAGLE:
3283 init_ids_eagle(btv); 3283 init_ids_eagle(btv);
@@ -3298,7 +3298,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3298 } 3298 }
3299 3299
3300 /* pll configuration */ 3300 /* pll configuration */
3301 if (!(btv->id==848 && btv->revision==0x11)) { 3301 if (!(btv->id==848 && btv->revision==0x11)) {
3302 /* defaults from card list */ 3302 /* defaults from card list */
3303 if (PLL_28 == bttv_tvcards[btv->c.type].pll) { 3303 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3304 btv->pll.pll_ifreq=28636363; 3304 btv->pll.pll_ifreq=28636363;
@@ -3309,26 +3309,26 @@ void __devinit bttv_init_card2(struct bttv *btv)
3309 btv->pll.pll_crystal=BT848_IFORM_XT1; 3309 btv->pll.pll_crystal=BT848_IFORM_XT1;
3310 } 3310 }
3311 /* insmod options can override */ 3311 /* insmod options can override */
3312 switch (pll[btv->c.nr]) { 3312 switch (pll[btv->c.nr]) {
3313 case 0: /* none */ 3313 case 0: /* none */
3314 btv->pll.pll_crystal = 0; 3314 btv->pll.pll_crystal = 0;
3315 btv->pll.pll_ifreq = 0; 3315 btv->pll.pll_ifreq = 0;
3316 btv->pll.pll_ofreq = 0; 3316 btv->pll.pll_ofreq = 0;
3317 break; 3317 break;
3318 case 1: /* 28 MHz */ 3318 case 1: /* 28 MHz */
3319 case 28: 3319 case 28:
3320 btv->pll.pll_ifreq = 28636363; 3320 btv->pll.pll_ifreq = 28636363;
3321 btv->pll.pll_ofreq = 0; 3321 btv->pll.pll_ofreq = 0;
3322 btv->pll.pll_crystal = BT848_IFORM_XT0; 3322 btv->pll.pll_crystal = BT848_IFORM_XT0;
3323 break; 3323 break;
3324 case 2: /* 35 MHz */ 3324 case 2: /* 35 MHz */
3325 case 35: 3325 case 35:
3326 btv->pll.pll_ifreq = 35468950; 3326 btv->pll.pll_ifreq = 35468950;
3327 btv->pll.pll_ofreq = 0; 3327 btv->pll.pll_ofreq = 0;
3328 btv->pll.pll_crystal = BT848_IFORM_XT1; 3328 btv->pll.pll_crystal = BT848_IFORM_XT1;
3329 break; 3329 break;
3330 } 3330 }
3331 } 3331 }
3332 btv->pll.pll_current = -1; 3332 btv->pll.pll_current = -1;
3333 3333
3334 /* tuner configuration (from card list / autodetect / insmod option) */ 3334 /* tuner configuration (from card list / autodetect / insmod option) */
@@ -3340,7 +3340,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3340 3340
3341 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) 3341 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3342 if(UNSET == btv->tuner_type) 3342 if(UNSET == btv->tuner_type)
3343 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; 3343 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3344 if (UNSET != tuner[btv->c.nr]) 3344 if (UNSET != tuner[btv->c.nr])
3345 btv->tuner_type = tuner[btv->c.nr]; 3345 btv->tuner_type = tuner[btv->c.nr];
3346 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type); 3346 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)
3348 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE, 3348 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
3349 &btv->pinnacle_id); 3349 &btv->pinnacle_id);
3350 if (btv->tuner_type != UNSET) { 3350 if (btv->tuner_type != UNSET) {
3351 struct tuner_setup tun_setup; 3351 struct tuner_setup tun_setup;
3352 3352
3353 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; 3353 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3354 tun_setup.type = btv->tuner_type; 3354 tun_setup.type = btv->tuner_type;
3355 tun_setup.addr = addr; 3355 tun_setup.addr = addr;
3356 3356
3357 if (addr == radio_addr) 3357 if (addr == radio_addr)
3358 tun_setup.mode_mask = T_RADIO; 3358 tun_setup.mode_mask = T_RADIO;
3359 3359
3360 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup); 3360 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3361 } 3361 }
@@ -3433,11 +3433,11 @@ static void modtec_eeprom(struct bttv *btv)
3433 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) { 3433 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3434 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I; 3434 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3435 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", 3435 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3436 btv->c.nr,&eeprom_data[0x1e]); 3436 btv->c.nr,&eeprom_data[0x1e]);
3437 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) { 3437 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3438 btv->tuner_type=TUNER_PHILIPS_NTSC; 3438 btv->tuner_type=TUNER_PHILIPS_NTSC;
3439 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", 3439 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3440 btv->c.nr,&eeprom_data[0x1e]); 3440 btv->c.nr,&eeprom_data[0x1e]);
3441 } else { 3441 } else {
3442 printk("bttv%d: Modtec: Unknown TunerString: %s\n", 3442 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3443 btv->c.nr,&eeprom_data[0x1e]); 3443 btv->c.nr,&eeprom_data[0x1e]);
@@ -3502,7 +3502,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv)
3502static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen) 3502static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3503{ 3503{
3504 u32 n; 3504 u32 n;
3505 u8 bits; 3505 u8 bits;
3506 int i; 3506 int i;
3507 3507
3508 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG); 3508 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)
3538 3538
3539static int __devinit pvr_boot(struct bttv *btv) 3539static int __devinit pvr_boot(struct bttv *btv)
3540{ 3540{
3541 const struct firmware *fw_entry; 3541 const struct firmware *fw_entry;
3542 int rc; 3542 int rc;
3543 3543
3544 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev); 3544 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3545 if (rc != 0) { 3545 if (rc != 0) {
3546 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n", 3546 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3547 btv->c.nr); 3547 btv->c.nr);
3548 return rc; 3548 return rc;
3549 } 3549 }
3550 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size); 3550 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3551 printk(KERN_INFO "bttv%d: altera firmware upload %s\n", 3551 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3552 btv->c.nr, (rc < 0) ? "failed" : "ok"); 3552 btv->c.nr, (rc < 0) ? "failed" : "ok");
3553 release_firmware(fw_entry); 3553 release_firmware(fw_entry);
3554 return rc; 3554 return rc;
3555} 3555}
3556 3556
@@ -3564,33 +3564,33 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3564 unsigned long serial = 0; 3564 unsigned long serial = 0;
3565 3565
3566 if (btv->c.type == 0) { 3566 if (btv->c.type == 0) {
3567 /* this might be an antique... check for MMAC label in eeprom */ 3567 /* this might be an antique... check for MMAC label in eeprom */
3568 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { 3568 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3569 unsigned char checksum = 0; 3569 unsigned char checksum = 0;
3570 for (i =0; i<21; i++) 3570 for (i =0; i<21; i++)
3571 checksum += ee[i]; 3571 checksum += ee[i];
3572 if (checksum != ee[21]) 3572 if (checksum != ee[21])
3573 return; 3573 return;
3574 btv->c.type = BTTV_BOARD_OSPREY1x0_848; 3574 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3575 for (i = 12; i < 21; i++) 3575 for (i = 12; i < 21; i++)
3576 serial *= 10, serial += ee[i] - '0'; 3576 serial *= 10, serial += ee[i] - '0';
3577 } 3577 }
3578 } else { 3578 } else {
3579 unsigned short type; 3579 unsigned short type;
3580 int offset = 4*16; 3580 int offset = 4*16;
3581 3581
3582 for(; offset < 8*16; offset += 16) { 3582 for(; offset < 8*16; offset += 16) {
3583 unsigned short checksum = 0; 3583 unsigned short checksum = 0;
3584 /* verify the checksum */ 3584 /* verify the checksum */
3585 for(i = 0; i<14; i++) checksum += ee[i+offset]; 3585 for(i = 0; i<14; i++) checksum += ee[i+offset];
3586 checksum = ~checksum; /* no idea why */ 3586 checksum = ~checksum; /* no idea why */
3587 if ((((checksum>>8)&0x0FF) == ee[offset+14]) && 3587 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3588 ((checksum & 0x0FF) == ee[offset+15])) { 3588 ((checksum & 0x0FF) == ee[offset+15])) {
3589 break; 3589 break;
3590 } 3590 }
3591 } 3591 }
3592 3592
3593 if (offset >= 8*16) 3593 if (offset >= 8*16)
3594 return; 3594 return;
3595 3595
3596 /* found a valid descriptor */ 3596 /* found a valid descriptor */
@@ -3606,7 +3606,7 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3606 btv->c.type = BTTV_BOARD_OSPREY101_848; 3606 btv->c.type = BTTV_BOARD_OSPREY101_848;
3607 break; 3607 break;
3608 3608
3609 /* 878 based */ 3609 /* 878 based */
3610 case 0x0012: 3610 case 0x0012:
3611 case 0x0013: 3611 case 0x0013:
3612 btv->c.type = BTTV_BOARD_OSPREY1x0; 3612 btv->c.type = BTTV_BOARD_OSPREY1x0;
@@ -3662,27 +3662,27 @@ static void __devinit osprey_eeprom(struct bttv *btv)
3662/* AVermedia specific stuff, from bktr_card.c */ 3662/* AVermedia specific stuff, from bktr_card.c */
3663 3663
3664static int tuner_0_table[] = { 3664static int tuner_0_table[] = {
3665 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/, 3665 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3666 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/, 3666 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3667 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL, 3667 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3668 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM, 3668 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3669 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL, 3669 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3670 TUNER_PHILIPS_FM1216ME_MK3 }; 3670 TUNER_PHILIPS_FM1216ME_MK3 };
3671 3671
3672static int tuner_1_table[] = { 3672static int tuner_1_table[] = {
3673 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL, 3673 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3674 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, 3674 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3675 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL, 3675 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3676 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */ 3676 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3677 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL}; 3677 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3678 3678
3679static void __devinit avermedia_eeprom(struct bttv *btv) 3679static void __devinit avermedia_eeprom(struct bttv *btv)
3680{ 3680{
3681 int tuner_make,tuner_tv_fm,tuner_format,tuner=0; 3681 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3682 3682
3683 tuner_make = (eeprom_data[0x41] & 0x7); 3683 tuner_make = (eeprom_data[0x41] & 0x7);
3684 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; 3684 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3685 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4; 3685 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3686 btv->has_remote = (eeprom_data[0x42] & 0x01); 3686 btv->has_remote = (eeprom_data[0x42] & 0x01);
3687 3687
3688 if (tuner_make == 0 || tuner_make == 2) 3688 if (tuner_make == 0 || tuner_make == 2)
@@ -3718,8 +3718,8 @@ void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3718 dprintk("bttv_tda9880_setnorm to NTSC\n"); 3718 dprintk("bttv_tda9880_setnorm to NTSC\n");
3719 } 3719 }
3720 else { 3720 else {
3721 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff; 3721 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3722 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff; 3722 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
3723 dprintk("bttv_tda9880_setnorm to PAL\n"); 3723 dprintk("bttv_tda9880_setnorm to PAL\n");
3724 } 3724 }
3725 /* set GPIO according */ 3725 /* set GPIO according */
@@ -3741,7 +3741,7 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3741 3741
3742 gpio_inout(mask,mask); 3742 gpio_inout(mask,mask);
3743 gpio_bits(mask,0); 3743 gpio_bits(mask,0);
3744 udelay(2500); 3744 udelay(2500);
3745 gpio_bits(mask,mask); 3745 gpio_bits(mask,mask);
3746 3746
3747 if (bttv_gpio) 3747 if (bttv_gpio)
@@ -3817,7 +3817,7 @@ static void __devinit init_PXC200(struct bttv *btv)
3817 udelay(10); 3817 udelay(10);
3818 gpio_write(1<<2); 3818 gpio_write(1<<2);
3819 3819
3820 for (i = 0; i < ARRAY_SIZE(vals); i++) { 3820 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3821 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1); 3821 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3822 if (tmp != -1) { 3822 if (tmp != -1) {
3823 printk(KERN_INFO 3823 printk(KERN_INFO
@@ -4260,30 +4260,30 @@ avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4260static void 4260static void
4261lt9415_audio(struct bttv *btv, struct video_audio *v, int set) 4261lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4262{ 4262{
4263 int val = 0; 4263 int val = 0;
4264 4264
4265 if (gpio_read() & 0x4000) { 4265 if (gpio_read() & 0x4000) {
4266 v->mode = VIDEO_SOUND_MONO; 4266 v->mode = VIDEO_SOUND_MONO;
4267 return; 4267 return;
4268 } 4268 }
4269 4269
4270 if (set) { 4270 if (set) {
4271 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */ 4271 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4272 val = 0x0080; 4272 val = 0x0080;
4273 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */ 4273 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4274 val = 0x0880; 4274 val = 0x0880;
4275 if ((v->mode & VIDEO_SOUND_LANG1) || 4275 if ((v->mode & VIDEO_SOUND_LANG1) ||
4276 (v->mode & VIDEO_SOUND_MONO)) 4276 (v->mode & VIDEO_SOUND_MONO))
4277 val = 0; 4277 val = 0;
4278 gpio_bits(0x0880, val); 4278 gpio_bits(0x0880, val);
4279 if (bttv_gpio) 4279 if (bttv_gpio)
4280 bttv_gpio_tracking(btv,"lt9415"); 4280 bttv_gpio_tracking(btv,"lt9415");
4281 } else { 4281 } else {
4282 /* autodetect doesn't work with this card :-( */ 4282 /* autodetect doesn't work with this card :-( */
4283 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | 4283 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4284 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; 4284 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4285 return; 4285 return;
4286 } 4286 }
4287} 4287}
4288 4288
4289/* TDA9821 on TerraTV+ Bt848, Bt878 */ 4289/* TDA9821 on TerraTV+ Bt848, Bt878 */
@@ -4406,26 +4406,26 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4406static void 4406static void
4407windvr_audio(struct bttv *btv, struct video_audio *v, int set) 4407windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4408{ 4408{
4409 unsigned long val = 0; 4409 unsigned long val = 0;
4410 4410
4411 if (set) { 4411 if (set) {
4412 if (v->mode & VIDEO_SOUND_MONO) 4412 if (v->mode & VIDEO_SOUND_MONO)
4413 val = 0x040000; 4413 val = 0x040000;
4414 if (v->mode & VIDEO_SOUND_LANG1) 4414 if (v->mode & VIDEO_SOUND_LANG1)
4415 val = 0; 4415 val = 0;
4416 if (v->mode & VIDEO_SOUND_LANG2) 4416 if (v->mode & VIDEO_SOUND_LANG2)
4417 val = 0x100000; 4417 val = 0x100000;
4418 if (v->mode & VIDEO_SOUND_STEREO) 4418 if (v->mode & VIDEO_SOUND_STEREO)
4419 val = 0; 4419 val = 0;
4420 if (val) { 4420 if (val) {
4421 gpio_bits(0x140000, val); 4421 gpio_bits(0x140000, val);
4422 if (bttv_gpio) 4422 if (bttv_gpio)
4423 bttv_gpio_tracking(btv,"windvr"); 4423 bttv_gpio_tracking(btv,"windvr");
4424 } 4424 }
4425 } else { 4425 } else {
4426 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | 4426 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4427 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; 4427 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4428 } 4428 }
4429} 4429}
4430 4430
4431/* 4431/*
@@ -4668,10 +4668,10 @@ static void kodicom4400r_init(struct bttv *btv)
4668static void xguard_muxsel(struct bttv *btv, unsigned int input) 4668static void xguard_muxsel(struct bttv *btv, unsigned int input)
4669{ 4669{
4670 static const int masks[] = { 4670 static const int masks[] = {
4671 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10, 4671 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4672 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10, 4672 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4673 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11, 4673 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4674 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11, 4674 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4675 }; 4675 };
4676 gpio_write(masks[input%16]); 4676 gpio_write(masks[input%16]);
4677} 4677}
@@ -4776,10 +4776,10 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4776 4776
4777static void PXC200_muxsel(struct bttv *btv, unsigned int input) 4777static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4778{ 4778{
4779 int rc; 4779 int rc;
4780 long mux; 4780 long mux;
4781 int bitmask; 4781 int bitmask;
4782 unsigned char buf[2]; 4782 unsigned char buf[2];
4783 4783
4784 /* Read PIC config to determine if this is a PXC200F */ 4784 /* Read PIC config to determine if this is a PXC200F */
4785 /* PX_I2C_CMD_CFG*/ 4785 /* PX_I2C_CMD_CFG*/
@@ -4809,14 +4809,14 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4809 /* bitmask=0x30f; */ 4809 /* bitmask=0x30f; */
4810 bitmask=0x302; 4810 bitmask=0x302;
4811 /* check whether we have a PXC200A */ 4811 /* check whether we have a PXC200A */
4812 if (btv->cardid == PX_PXC200A_CARDID) { 4812 if (btv->cardid == PX_PXC200A_CARDID) {
4813 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */ 4813 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4814 bitmask |= 7<<4; /* the DAC */ 4814 bitmask |= 7<<4; /* the DAC */
4815 } 4815 }
4816 btwrite(bitmask, BT848_GPIO_OUT_EN); 4816 btwrite(bitmask, BT848_GPIO_OUT_EN);
4817 4817
4818 bitmask = btread(BT848_GPIO_DATA); 4818 bitmask = btread(BT848_GPIO_DATA);
4819 if (btv->cardid == PX_PXC200A_CARDID) 4819 if (btv->cardid == PX_PXC200A_CARDID)
4820 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7); 4820 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4821 else /* older device */ 4821 else /* older device */
4822 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8); 4822 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
@@ -4829,7 +4829,7 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4829 * 4829 *
4830 * needed because bttv-driver sets mux before calling this function 4830 * needed because bttv-driver sets mux before calling this function
4831 */ 4831 */
4832 if (btv->cardid == PX_PXC200A_CARDID) 4832 if (btv->cardid == PX_PXC200A_CARDID)
4833 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM); 4833 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4834 else /* older device */ 4834 else /* older device */
4835 btand(~BT848_IFORM_MUXSEL,BT848_IFORM); 4835 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
@@ -4875,7 +4875,7 @@ void __devinit bttv_check_chipset(void)
4875 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency); 4875 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4876 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL, 4876 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4877 PCI_DEVICE_ID_INTEL_82441, dev))) { 4877 PCI_DEVICE_ID_INTEL_82441, dev))) {
4878 unsigned char b; 4878 unsigned char b;
4879 pci_read_config_byte(dev, 0x53, &b); 4879 pci_read_config_byte(dev, 0x53, &b);
4880 if (bttv_debug) 4880 if (bttv_debug)
4881 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, " 4881 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
@@ -4885,7 +4885,7 @@ void __devinit bttv_check_chipset(void)
4885 4885
4886int __devinit bttv_handle_chipset(struct bttv *btv) 4886int __devinit bttv_handle_chipset(struct bttv *btv)
4887{ 4887{
4888 unsigned char command; 4888 unsigned char command;
4889 4889
4890 if (!triton1 && !vsfx && UNSET == latency) 4890 if (!triton1 && !vsfx && UNSET == latency)
4891 return 0; 4891 return 0;
@@ -4906,13 +4906,13 @@ int __devinit bttv_handle_chipset(struct bttv *btv)
4906 btv->triton1 = BT848_INT_ETBF; 4906 btv->triton1 = BT848_INT_ETBF;
4907 } else { 4907 } else {
4908 /* bt878 has a bit in the pci config space for it */ 4908 /* bt878 has a bit in the pci config space for it */
4909 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command); 4909 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4910 if (triton1) 4910 if (triton1)
4911 command |= BT878_EN_TBFX; 4911 command |= BT878_EN_TBFX;
4912 if (vsfx) 4912 if (vsfx)
4913 command |= BT878_EN_VSFX; 4913 command |= BT878_EN_VSFX;
4914 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command); 4914 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4915 } 4915 }
4916 if (UNSET != latency) 4916 if (UNSET != latency)
4917 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency); 4917 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4918 return 0; 4918 return 0;
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index f8307407e32..0005741d551 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -3,7 +3,7 @@
3 bttv - Bt848 frame grabber driver 3 bttv - Bt848 frame grabber driver
4 4
5 Copyright (C) 1996,97,98 Ralph Metzler <rjkm@thp.uni-koeln.de> 5 Copyright (C) 1996,97,98 Ralph Metzler <rjkm@thp.uni-koeln.de>
6 & Marcus Metzler <mocm@thp.uni-koeln.de> 6 & Marcus Metzler <mocm@thp.uni-koeln.de>
7 (c) 1999-2002 Gerd Knorr <kraxel@bytesex.org> 7 (c) 1999-2002 Gerd Knorr <kraxel@bytesex.org>
8 8
9 some v4l2 code lines are taken from Justin's bttv2 driver which is 9 some v4l2 code lines are taken from Justin's bttv2 driver which is
@@ -192,8 +192,8 @@ static u8 SRAM_Table[][60] =
192 192
193const struct bttv_tvnorm bttv_tvnorms[] = { 193const struct bttv_tvnorm bttv_tvnorms[] = {
194 /* PAL-BDGHI */ 194 /* PAL-BDGHI */
195 /* max. active video is actually 922, but 924 is divisible by 4 and 3! */ 195 /* max. active video is actually 922, but 924 is divisible by 4 and 3! */
196 /* actually, max active PAL with HSCALE=0 is 948, NTSC is 768 - nil */ 196 /* actually, max active PAL with HSCALE=0 is 948, NTSC is 768 - nil */
197 { 197 {
198 .v4l2_id = V4L2_STD_PAL, 198 .v4l2_id = V4L2_STD_PAL,
199 .name = "PAL", 199 .name = "PAL",
@@ -806,9 +806,9 @@ static void bt848A_set_timing(struct bttv *btv)
806 btv->c.nr,table_idx); 806 btv->c.nr,table_idx);
807 807
808 /* timing change...reset timing generator address */ 808 /* timing change...reset timing generator address */
809 btwrite(0x00, BT848_TGCTRL); 809 btwrite(0x00, BT848_TGCTRL);
810 btwrite(0x02, BT848_TGCTRL); 810 btwrite(0x02, BT848_TGCTRL);
811 btwrite(0x00, BT848_TGCTRL); 811 btwrite(0x00, BT848_TGCTRL);
812 812
813 len=SRAM_Table[table_idx][0]; 813 len=SRAM_Table[table_idx][0];
814 for(i = 1; i <= len; i++) 814 for(i = 1; i <= len; i++)
@@ -847,7 +847,7 @@ static void bt848_hue(struct bttv *btv, int hue)
847 847
848 /* -128 to 127 */ 848 /* -128 to 127 */
849 value = (hue >> 8) - 128; 849 value = (hue >> 8) - 128;
850 btwrite(value & 0xff, BT848_HUE); 850 btwrite(value & 0xff, BT848_HUE);
851} 851}
852 852
853static void bt848_contrast(struct bttv *btv, int cont) 853static void bt848_contrast(struct bttv *btv, int cont)
@@ -859,9 +859,9 @@ static void bt848_contrast(struct bttv *btv, int cont)
859 /* 0-511 */ 859 /* 0-511 */
860 value = (cont >> 7); 860 value = (cont >> 7);
861 hibit = (value >> 6) & 4; 861 hibit = (value >> 6) & 4;
862 btwrite(value & 0xff, BT848_CONTRAST_LO); 862 btwrite(value & 0xff, BT848_CONTRAST_LO);
863 btaor(hibit, ~4, BT848_E_CONTROL); 863 btaor(hibit, ~4, BT848_E_CONTROL);
864 btaor(hibit, ~4, BT848_O_CONTROL); 864 btaor(hibit, ~4, BT848_O_CONTROL);
865} 865}
866 866
867static void bt848_sat(struct bttv *btv, int color) 867static void bt848_sat(struct bttv *btv, int color)
@@ -873,12 +873,12 @@ static void bt848_sat(struct bttv *btv, int color)
873 /* 0-511 for the color */ 873 /* 0-511 for the color */
874 val_u = ((color * btv->opt_uv_ratio) / 50) >> 7; 874 val_u = ((color * btv->opt_uv_ratio) / 50) >> 7;
875 val_v = (((color * (100 - btv->opt_uv_ratio) / 50) >>7)*180L)/254; 875 val_v = (((color * (100 - btv->opt_uv_ratio) / 50) >>7)*180L)/254;
876 hibits = (val_u >> 7) & 2; 876 hibits = (val_u >> 7) & 2;
877 hibits |= (val_v >> 8) & 1; 877 hibits |= (val_v >> 8) & 1;
878 btwrite(val_u & 0xff, BT848_SAT_U_LO); 878 btwrite(val_u & 0xff, BT848_SAT_U_LO);
879 btwrite(val_v & 0xff, BT848_SAT_V_LO); 879 btwrite(val_v & 0xff, BT848_SAT_V_LO);
880 btaor(hibits, ~3, BT848_E_CONTROL); 880 btaor(hibits, ~3, BT848_E_CONTROL);
881 btaor(hibits, ~3, BT848_O_CONTROL); 881 btaor(hibits, ~3, BT848_O_CONTROL);
882} 882}
883 883
884/* ----------------------------------------------------------------------- */ 884/* ----------------------------------------------------------------------- */
@@ -891,7 +891,7 @@ video_mux(struct bttv *btv, unsigned int input)
891 if (input >= bttv_tvcards[btv->c.type].video_inputs) 891 if (input >= bttv_tvcards[btv->c.type].video_inputs)
892 return -EINVAL; 892 return -EINVAL;
893 893
894 /* needed by RemoteVideo MX */ 894 /* needed by RemoteVideo MX */
895 mask2 = bttv_tvcards[btv->c.type].gpiomask2; 895 mask2 = bttv_tvcards[btv->c.type].gpiomask2;
896 if (mask2) 896 if (mask2)
897 gpio_inout(mask2,mask2); 897 gpio_inout(mask2,mask2);
@@ -1055,22 +1055,22 @@ static void init_bt848(struct bttv *btv)
1055 btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL); 1055 btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL);
1056 btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM); 1056 btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM);
1057 1057
1058 /* set planar and packed mode trigger points and */ 1058 /* set planar and packed mode trigger points and */
1059 /* set rising edge of inverted GPINTR pin as irq trigger */ 1059 /* set rising edge of inverted GPINTR pin as irq trigger */
1060 btwrite(BT848_GPIO_DMA_CTL_PKTP_32| 1060 btwrite(BT848_GPIO_DMA_CTL_PKTP_32|
1061 BT848_GPIO_DMA_CTL_PLTP1_16| 1061 BT848_GPIO_DMA_CTL_PLTP1_16|
1062 BT848_GPIO_DMA_CTL_PLTP23_16| 1062 BT848_GPIO_DMA_CTL_PLTP23_16|
1063 BT848_GPIO_DMA_CTL_GPINTC| 1063 BT848_GPIO_DMA_CTL_GPINTC|
1064 BT848_GPIO_DMA_CTL_GPINTI, 1064 BT848_GPIO_DMA_CTL_GPINTI,
1065 BT848_GPIO_DMA_CTL); 1065 BT848_GPIO_DMA_CTL);
1066 1066
1067 val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0; 1067 val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0;
1068 btwrite(val, BT848_E_SCLOOP); 1068 btwrite(val, BT848_E_SCLOOP);
1069 btwrite(val, BT848_O_SCLOOP); 1069 btwrite(val, BT848_O_SCLOOP);
1070 1070
1071 btwrite(0x20, BT848_E_VSCALE_HI); 1071 btwrite(0x20, BT848_E_VSCALE_HI);
1072 btwrite(0x20, BT848_O_VSCALE_HI); 1072 btwrite(0x20, BT848_O_VSCALE_HI);
1073 btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0), 1073 btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0),
1074 BT848_ADC); 1074 BT848_ADC);
1075 1075
1076 btwrite(whitecrush_upper, BT848_WC_UP); 1076 btwrite(whitecrush_upper, BT848_WC_UP);
@@ -1089,7 +1089,7 @@ static void init_bt848(struct bttv *btv)
1089 bt848_contrast(btv, btv->contrast); 1089 bt848_contrast(btv, btv->contrast);
1090 bt848_sat(btv, btv->saturation); 1090 bt848_sat(btv, btv->saturation);
1091 1091
1092 /* interrupt */ 1092 /* interrupt */
1093 init_irqreg(btv); 1093 init_irqreg(btv);
1094} 1094}
1095 1095
@@ -1105,7 +1105,7 @@ static void bttv_reinit_bt848(struct bttv *btv)
1105 spin_unlock_irqrestore(&btv->s_lock,flags); 1105 spin_unlock_irqrestore(&btv->s_lock,flags);
1106 1106
1107 init_bt848(btv); 1107 init_bt848(btv);
1108 btv->pll.pll_current = -1; 1108 btv->pll.pll_current = -1;
1109 set_input(btv,btv->input); 1109 set_input(btv,btv->input);
1110} 1110}
1111 1111
@@ -1398,7 +1398,7 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1398/* video4linux (1) interface */ 1398/* video4linux (1) interface */
1399 1399
1400static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf, 1400static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf,
1401 const struct bttv_format *fmt, 1401 const struct bttv_format *fmt,
1402 unsigned int width, unsigned int height, 1402 unsigned int width, unsigned int height,
1403 enum v4l2_field field) 1403 enum v4l2_field field)
1404{ 1404{
@@ -1521,8 +1521,8 @@ static const char *v4l1_ioctls[] = {
1521static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) 1521static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1522{ 1522{
1523 switch (cmd) { 1523 switch (cmd) {
1524 case BTTV_VERSION: 1524 case BTTV_VERSION:
1525 return BTTV_VERSION_CODE; 1525 return BTTV_VERSION_CODE;
1526 1526
1527 /* *** v4l1 *** ************************************************ */ 1527 /* *** v4l1 *** ************************************************ */
1528 case VIDIOCGFREQ: 1528 case VIDIOCGFREQ:
@@ -1576,32 +1576,32 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1576 return 0; 1576 return 0;
1577 } 1577 }
1578 1578
1579 case VIDIOCGCHAN: 1579 case VIDIOCGCHAN:
1580 { 1580 {
1581 struct video_channel *v = arg; 1581 struct video_channel *v = arg;
1582 unsigned int channel = v->channel; 1582 unsigned int channel = v->channel;
1583 1583
1584 if (channel >= bttv_tvcards[btv->c.type].video_inputs) 1584 if (channel >= bttv_tvcards[btv->c.type].video_inputs)
1585 return -EINVAL; 1585 return -EINVAL;
1586 v->tuners=0; 1586 v->tuners=0;
1587 v->flags = VIDEO_VC_AUDIO; 1587 v->flags = VIDEO_VC_AUDIO;
1588 v->type = VIDEO_TYPE_CAMERA; 1588 v->type = VIDEO_TYPE_CAMERA;
1589 v->norm = btv->tvnorm; 1589 v->norm = btv->tvnorm;
1590 if (channel == bttv_tvcards[btv->c.type].tuner) { 1590 if (channel == bttv_tvcards[btv->c.type].tuner) {
1591 strcpy(v->name,"Television"); 1591 strcpy(v->name,"Television");
1592 v->flags|=VIDEO_VC_TUNER; 1592 v->flags|=VIDEO_VC_TUNER;
1593 v->type=VIDEO_TYPE_TV; 1593 v->type=VIDEO_TYPE_TV;
1594 v->tuners=1; 1594 v->tuners=1;
1595 } else if (channel == btv->svhs) { 1595 } else if (channel == btv->svhs) {
1596 strcpy(v->name,"S-Video"); 1596 strcpy(v->name,"S-Video");
1597 } else { 1597 } else {
1598 sprintf(v->name,"Composite%d",channel); 1598 sprintf(v->name,"Composite%d",channel);
1599 } 1599 }
1600 return 0; 1600 return 0;
1601 } 1601 }
1602 case VIDIOCSCHAN: 1602 case VIDIOCSCHAN:
1603 { 1603 {
1604 struct video_channel *v = arg; 1604 struct video_channel *v = arg;
1605 unsigned int channel = v->channel; 1605 unsigned int channel = v->channel;
1606 1606
1607 if (channel >= bttv_tvcards[btv->c.type].video_inputs) 1607 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)
1623 return 0; 1623 return 0;
1624 } 1624 }
1625 1625
1626 case VIDIOCGAUDIO: 1626 case VIDIOCGAUDIO:
1627 { 1627 {
1628 struct video_audio *v = arg; 1628 struct video_audio *v = arg;
1629 1629
@@ -1728,7 +1728,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1728 } else if (i->index == btv->svhs) { 1728 } else if (i->index == btv->svhs) {
1729 sprintf(i->name, "S-Video"); 1729 sprintf(i->name, "S-Video");
1730 } else { 1730 } else {
1731 sprintf(i->name,"Composite%d",i->index); 1731 sprintf(i->name,"Composite%d",i->index);
1732 } 1732 }
1733 if (i->index == btv->input) { 1733 if (i->index == btv->input) {
1734 __u32 dstatus = btread(BT848_DSTATUS); 1734 __u32 dstatus = btread(BT848_DSTATUS);
@@ -2168,7 +2168,7 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv,
2168 if (0 != retval) 2168 if (0 != retval)
2169 return retval; 2169 return retval;
2170 if (locked_btres(fh->btv, RESOURCE_VBI)) 2170 if (locked_btres(fh->btv, RESOURCE_VBI))
2171 return -EBUSY; 2171 return -EBUSY;
2172 bttv_vbi_try_fmt(fh,f); 2172 bttv_vbi_try_fmt(fh,f);
2173 bttv_vbi_setlines(fh,btv,f->fmt.vbi.count[0]); 2173 bttv_vbi_setlines(fh,btv,f->fmt.vbi.count[0]);
2174 bttv_vbi_get_fmt(fh,f); 2174 bttv_vbi_get_fmt(fh,f);
@@ -2206,9 +2206,9 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2206 bttv_reinit_bt848(btv); 2206 bttv_reinit_bt848(btv);
2207 2207
2208 switch (cmd) { 2208 switch (cmd) {
2209 case VIDIOCSFREQ: 2209 case VIDIOCSFREQ:
2210 case VIDIOCSTUNER: 2210 case VIDIOCSTUNER:
2211 case VIDIOCSCHAN: 2211 case VIDIOCSCHAN:
2212 case VIDIOC_S_CTRL: 2212 case VIDIOC_S_CTRL:
2213 case VIDIOC_S_STD: 2213 case VIDIOC_S_STD:
2214 case VIDIOC_S_INPUT: 2214 case VIDIOC_S_INPUT:
@@ -2224,10 +2224,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2224 /* *** v4l1 *** ************************************************ */ 2224 /* *** v4l1 *** ************************************************ */
2225 case VIDIOCGCAP: 2225 case VIDIOCGCAP:
2226 { 2226 {
2227 struct video_capability *cap = arg; 2227 struct video_capability *cap = arg;
2228 2228
2229 memset(cap,0,sizeof(*cap)); 2229 memset(cap,0,sizeof(*cap));
2230 strcpy(cap->name,btv->video_dev->name); 2230 strcpy(cap->name,btv->video_dev->name);
2231 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { 2231 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
2232 /* vbi */ 2232 /* vbi */
2233 cap->type = VID_TYPE_TUNER|VID_TYPE_TELETEXT; 2233 cap->type = VID_TYPE_TUNER|VID_TYPE_TELETEXT;
@@ -2247,7 +2247,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2247 } 2247 }
2248 cap->channels = bttv_tvcards[btv->c.type].video_inputs; 2248 cap->channels = bttv_tvcards[btv->c.type].video_inputs;
2249 cap->audios = bttv_tvcards[btv->c.type].audio_inputs; 2249 cap->audios = bttv_tvcards[btv->c.type].audio_inputs;
2250 return 0; 2250 return 0;
2251 } 2251 }
2252 2252
2253 case VIDIOCGPICT: 2253 case VIDIOCGPICT:
@@ -2296,7 +2296,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2296 bt848_hue(btv,pic->hue); 2296 bt848_hue(btv,pic->hue);
2297 bt848_sat(btv,pic->colour); 2297 bt848_sat(btv,pic->colour);
2298 up(&fh->cap.lock); 2298 up(&fh->cap.lock);
2299 return 0; 2299 return 0;
2300 } 2300 }
2301 2301
2302 case VIDIOCGWIN: 2302 case VIDIOCGWIN:
@@ -2357,8 +2357,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2357 unsigned long end; 2357 unsigned long end;
2358 2358
2359 if(!capable(CAP_SYS_ADMIN) && 2359 if(!capable(CAP_SYS_ADMIN) &&
2360 !capable(CAP_SYS_RAWIO)) 2360 !capable(CAP_SYS_RAWIO))
2361 return -EPERM; 2361 return -EPERM;
2362 end = (unsigned long)fbuf->base + 2362 end = (unsigned long)fbuf->base +
2363 fbuf->height * fbuf->bytesperline; 2363 fbuf->height * fbuf->bytesperline;
2364 down(&fh->cap.lock); 2364 down(&fh->cap.lock);
@@ -2432,7 +2432,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2432 } 2432 }
2433 2433
2434 /* switch over */ 2434 /* switch over */
2435 retval = bttv_switch_overlay(btv,fh,new); 2435 retval = bttv_switch_overlay(btv,fh,new);
2436 up(&fh->cap.lock); 2436 up(&fh->cap.lock);
2437 return retval; 2437 return retval;
2438 } 2438 }
@@ -2571,13 +2571,13 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2571 return 0; 2571 return 0;
2572 } 2572 }
2573 2573
2574 case BTTV_VERSION: 2574 case BTTV_VERSION:
2575 case VIDIOCGFREQ: 2575 case VIDIOCGFREQ:
2576 case VIDIOCSFREQ: 2576 case VIDIOCSFREQ:
2577 case VIDIOCGTUNER: 2577 case VIDIOCGTUNER:
2578 case VIDIOCSTUNER: 2578 case VIDIOCSTUNER:
2579 case VIDIOCGCHAN: 2579 case VIDIOCGCHAN:
2580 case VIDIOCSCHAN: 2580 case VIDIOCSCHAN:
2581 case VIDIOCGAUDIO: 2581 case VIDIOCGAUDIO:
2582 case VIDIOCSAUDIO: 2582 case VIDIOCSAUDIO:
2583 return bttv_common_ioctls(btv,cmd,arg); 2583 return bttv_common_ioctls(btv,cmd,arg);
@@ -2589,8 +2589,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2589 2589
2590 if (0 == v4l2) 2590 if (0 == v4l2)
2591 return -EINVAL; 2591 return -EINVAL;
2592 strcpy(cap->driver,"bttv"); 2592 strcpy(cap->driver,"bttv");
2593 strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); 2593 strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card));
2594 sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); 2594 sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci));
2595 cap->version = BTTV_VERSION_CODE; 2595 cap->version = BTTV_VERSION_CODE;
2596 cap->capabilities = 2596 cap->capabilities =
@@ -3097,7 +3097,7 @@ static struct video_device bttv_video_template =
3097{ 3097{
3098 .name = "UNSET", 3098 .name = "UNSET",
3099 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| 3099 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|
3100 VID_TYPE_CLIPPING|VID_TYPE_SCALES, 3100 VID_TYPE_CLIPPING|VID_TYPE_SCALES,
3101 .hardware = VID_HARDWARE_BT848, 3101 .hardware = VID_HARDWARE_BT848,
3102 .fops = &bttv_fops, 3102 .fops = &bttv_fops,
3103 .minor = -1, 3103 .minor = -1,
@@ -3143,7 +3143,7 @@ static int radio_open(struct inode *inode, struct file *file)
3143 audio_mux(btv,AUDIO_RADIO); 3143 audio_mux(btv,AUDIO_RADIO);
3144 3144
3145 up(&btv->lock); 3145 up(&btv->lock);
3146 return 0; 3146 return 0;
3147} 3147}
3148 3148
3149static int radio_release(struct inode *inode, struct file *file) 3149static int radio_release(struct inode *inode, struct file *file)
@@ -3166,34 +3166,34 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
3166 switch (cmd) { 3166 switch (cmd) {
3167 case VIDIOCGCAP: 3167 case VIDIOCGCAP:
3168 { 3168 {
3169 struct video_capability *cap = arg; 3169 struct video_capability *cap = arg;
3170 3170
3171 memset(cap,0,sizeof(*cap)); 3171 memset(cap,0,sizeof(*cap));
3172 strcpy(cap->name,btv->radio_dev->name); 3172 strcpy(cap->name,btv->radio_dev->name);
3173 cap->type = VID_TYPE_TUNER; 3173 cap->type = VID_TYPE_TUNER;
3174 cap->channels = 1; 3174 cap->channels = 1;
3175 cap->audios = 1; 3175 cap->audios = 1;
3176 return 0; 3176 return 0;
3177 } 3177 }
3178 3178
3179 case VIDIOCGTUNER: 3179 case VIDIOCGTUNER:
3180 { 3180 {
3181 struct video_tuner *v = arg; 3181 struct video_tuner *v = arg;
3182 3182
3183 if(v->tuner) 3183 if(v->tuner)
3184 return -EINVAL; 3184 return -EINVAL;
3185 memset(v,0,sizeof(*v)); 3185 memset(v,0,sizeof(*v));
3186 strcpy(v->name, "Radio"); 3186 strcpy(v->name, "Radio");
3187 bttv_call_i2c_clients(btv,cmd,v); 3187 bttv_call_i2c_clients(btv,cmd,v);
3188 return 0; 3188 return 0;
3189 } 3189 }
3190 case VIDIOCSTUNER: 3190 case VIDIOCSTUNER:
3191 /* nothing to do */ 3191 /* nothing to do */
3192 return 0; 3192 return 0;
3193 3193
3194 case BTTV_VERSION: 3194 case BTTV_VERSION:
3195 case VIDIOCGFREQ: 3195 case VIDIOCGFREQ:
3196 case VIDIOCSFREQ: 3196 case VIDIOCSFREQ:
3197 case VIDIOCGAUDIO: 3197 case VIDIOCGAUDIO:
3198 case VIDIOCSAUDIO: 3198 case VIDIOCSAUDIO:
3199 return bttv_common_ioctls(btv,cmd,arg); 3199 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)
3699 } 3699 }
3700 3700
3701 if (astat&BT848_INT_VSYNC) 3701 if (astat&BT848_INT_VSYNC)
3702 btv->field_count++; 3702 btv->field_count++;
3703 3703
3704 if (astat & BT848_INT_GPINT) { 3704 if (astat & BT848_INT_GPINT) {
3705 wake_up(&btv->gpioq); 3705 wake_up(&btv->gpioq);
@@ -3711,13 +3711,13 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
3711 wake_up(&btv->i2c_queue); 3711 wake_up(&btv->i2c_queue);
3712 } 3712 }
3713 3713
3714 if ((astat & BT848_INT_RISCI) && (stat & (4<<28))) 3714 if ((astat & BT848_INT_RISCI) && (stat & (4<<28)))
3715 bttv_irq_switch_vbi(btv); 3715 bttv_irq_switch_vbi(btv);
3716 3716
3717 if ((astat & BT848_INT_RISCI) && (stat & (2<<28))) 3717 if ((astat & BT848_INT_RISCI) && (stat & (2<<28)))
3718 bttv_irq_wakeup_top(btv); 3718 bttv_irq_wakeup_top(btv);
3719 3719
3720 if ((astat & BT848_INT_RISCI) && (stat & (1<<28))) 3720 if ((astat & BT848_INT_RISCI) && (stat & (1<<28)))
3721 bttv_irq_switch_video(btv); 3721 bttv_irq_switch_video(btv);
3722 3722
3723 if ((astat & BT848_INT_HLOCK) && btv->opt_automute) 3723 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)
3744 if (count > 4) { 3744 if (count > 4) {
3745 3745
3746 if (count > 8 || !(astat & BT848_INT_GPINT)) { 3746 if (count > 8 || !(astat & BT848_INT_GPINT)) {
3747 btwrite(0, BT848_INT_MASK); 3747 btwrite(0, BT848_INT_MASK);
3748 3748
3749 printk(KERN_ERR 3749 printk(KERN_ERR
3750 "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr); 3750 "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr);
@@ -3826,7 +3826,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
3826 3826
3827 /* video */ 3827 /* video */
3828 btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); 3828 btv->video_dev = vdev_init(btv, &bttv_video_template, "video");
3829 if (NULL == btv->video_dev) 3829 if (NULL == btv->video_dev)
3830 goto err; 3830 goto err;
3831 if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0) 3831 if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0)
3832 goto err; 3832 goto err;
@@ -3836,18 +3836,18 @@ static int __devinit bttv_register_video(struct bttv *btv)
3836 3836
3837 /* vbi */ 3837 /* vbi */
3838 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); 3838 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
3839 if (NULL == btv->vbi_dev) 3839 if (NULL == btv->vbi_dev)
3840 goto err; 3840 goto err;
3841 if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) 3841 if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0)
3842 goto err; 3842 goto err;
3843 printk(KERN_INFO "bttv%d: registered device vbi%d\n", 3843 printk(KERN_INFO "bttv%d: registered device vbi%d\n",
3844 btv->c.nr,btv->vbi_dev->minor & 0x1f); 3844 btv->c.nr,btv->vbi_dev->minor & 0x1f);
3845 3845
3846 if (!btv->has_radio) 3846 if (!btv->has_radio)
3847 return 0; 3847 return 0;
3848 /* radio */ 3848 /* radio */
3849 btv->radio_dev = vdev_init(btv, &radio_template, "radio"); 3849 btv->radio_dev = vdev_init(btv, &radio_template, "radio");
3850 if (NULL == btv->radio_dev) 3850 if (NULL == btv->radio_dev)
3851 goto err; 3851 goto err;
3852 if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0) 3852 if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0)
3853 goto err; 3853 goto err;
@@ -3868,11 +3868,11 @@ static int __devinit bttv_register_video(struct bttv *btv)
3868static void pci_set_command(struct pci_dev *dev) 3868static void pci_set_command(struct pci_dev *dev)
3869{ 3869{
3870#if defined(__powerpc__) 3870#if defined(__powerpc__)
3871 unsigned int cmd; 3871 unsigned int cmd;
3872 3872
3873 pci_read_config_dword(dev, PCI_COMMAND, &cmd); 3873 pci_read_config_dword(dev, PCI_COMMAND, &cmd);
3874 cmd = (cmd | PCI_COMMAND_MEMORY ); 3874 cmd = (cmd | PCI_COMMAND_MEMORY );
3875 pci_write_config_dword(dev, PCI_COMMAND, cmd); 3875 pci_write_config_dword(dev, PCI_COMMAND, cmd);
3876#endif 3876#endif
3877} 3877}
3878 3878
@@ -3886,21 +3886,21 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3886 if (bttv_num == BTTV_MAX) 3886 if (bttv_num == BTTV_MAX)
3887 return -ENOMEM; 3887 return -ENOMEM;
3888 printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num); 3888 printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num);
3889 btv=&bttvs[bttv_num]; 3889 btv=&bttvs[bttv_num];
3890 memset(btv,0,sizeof(*btv)); 3890 memset(btv,0,sizeof(*btv));
3891 btv->c.nr = bttv_num; 3891 btv->c.nr = bttv_num;
3892 sprintf(btv->c.name,"bttv%d",btv->c.nr); 3892 sprintf(btv->c.name,"bttv%d",btv->c.nr);
3893 3893
3894 /* initialize structs / fill in defaults */ 3894 /* initialize structs / fill in defaults */
3895 init_MUTEX(&btv->lock); 3895 init_MUTEX(&btv->lock);
3896 init_MUTEX(&btv->reslock); 3896 init_MUTEX(&btv->reslock);
3897 spin_lock_init(&btv->s_lock); 3897 spin_lock_init(&btv->s_lock);
3898 spin_lock_init(&btv->gpio_lock); 3898 spin_lock_init(&btv->gpio_lock);
3899 init_waitqueue_head(&btv->gpioq); 3899 init_waitqueue_head(&btv->gpioq);
3900 init_waitqueue_head(&btv->i2c_queue); 3900 init_waitqueue_head(&btv->i2c_queue);
3901 INIT_LIST_HEAD(&btv->c.subs); 3901 INIT_LIST_HEAD(&btv->c.subs);
3902 INIT_LIST_HEAD(&btv->capture); 3902 INIT_LIST_HEAD(&btv->capture);
3903 INIT_LIST_HEAD(&btv->vcapture); 3903 INIT_LIST_HEAD(&btv->vcapture);
3904 v4l2_prio_init(&btv->prio); 3904 v4l2_prio_init(&btv->prio);
3905 3905
3906 init_timer(&btv->timeout); 3906 init_timer(&btv->timeout);
@@ -3921,27 +3921,27 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3921 btv->c.nr); 3921 btv->c.nr);
3922 return -EIO; 3922 return -EIO;
3923 } 3923 }
3924 if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) { 3924 if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
3925 printk(KERN_WARNING "bttv%d: No suitable DMA available.\n", 3925 printk(KERN_WARNING "bttv%d: No suitable DMA available.\n",
3926 btv->c.nr); 3926 btv->c.nr);
3927 return -EIO; 3927 return -EIO;
3928 } 3928 }
3929 if (!request_mem_region(pci_resource_start(dev,0), 3929 if (!request_mem_region(pci_resource_start(dev,0),
3930 pci_resource_len(dev,0), 3930 pci_resource_len(dev,0),
3931 btv->c.name)) { 3931 btv->c.name)) {
3932 printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n", 3932 printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n",
3933 btv->c.nr, pci_resource_start(dev,0)); 3933 btv->c.nr, pci_resource_start(dev,0));
3934 return -EBUSY; 3934 return -EBUSY;
3935 } 3935 }
3936 pci_set_master(dev); 3936 pci_set_master(dev);
3937 pci_set_command(dev); 3937 pci_set_command(dev);
3938 pci_set_drvdata(dev,btv); 3938 pci_set_drvdata(dev,btv);
3939 3939
3940 pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); 3940 pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);
3941 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); 3941 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
3942 printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", 3942 printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ",
3943 bttv_num,btv->id, btv->revision, pci_name(dev)); 3943 bttv_num,btv->id, btv->revision, pci_name(dev));
3944 printk("irq: %d, latency: %d, mmio: 0x%lx\n", 3944 printk("irq: %d, latency: %d, mmio: 0x%lx\n",
3945 btv->c.pci->irq, lat, pci_resource_start(dev,0)); 3945 btv->c.pci->irq, lat, pci_resource_start(dev,0));
3946 schedule(); 3946 schedule();
3947 3947
@@ -3952,23 +3952,23 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3952 goto fail1; 3952 goto fail1;
3953 } 3953 }
3954 3954
3955 /* identify card */ 3955 /* identify card */
3956 bttv_idcard(btv); 3956 bttv_idcard(btv);
3957 3957
3958 /* disable irqs, register irq handler */ 3958 /* disable irqs, register irq handler */
3959 btwrite(0, BT848_INT_MASK); 3959 btwrite(0, BT848_INT_MASK);
3960 result = request_irq(btv->c.pci->irq, bttv_irq, 3960 result = request_irq(btv->c.pci->irq, bttv_irq,
3961 SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv); 3961 SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv);
3962 if (result < 0) { 3962 if (result < 0) {
3963 printk(KERN_ERR "bttv%d: can't get IRQ %d\n", 3963 printk(KERN_ERR "bttv%d: can't get IRQ %d\n",
3964 bttv_num,btv->c.pci->irq); 3964 bttv_num,btv->c.pci->irq);
3965 goto fail1; 3965 goto fail1;
3966 } 3966 }
3967 3967
3968 if (0 != bttv_handle_chipset(btv)) { 3968 if (0 != bttv_handle_chipset(btv)) {
3969 result = -EIO; 3969 result = -EIO;
3970 goto fail2; 3970 goto fail2;
3971 } 3971 }
3972 3972
3973 /* init options from insmod args */ 3973 /* init options from insmod args */
3974 btv->opt_combfilter = combfilter; 3974 btv->opt_combfilter = combfilter;
@@ -3994,29 +3994,29 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3994 btv->input = 0; 3994 btv->input = 0;
3995 3995
3996 /* initialize hardware */ 3996 /* initialize hardware */
3997 if (bttv_gpio) 3997 if (bttv_gpio)
3998 bttv_gpio_tracking(btv,"pre-init"); 3998 bttv_gpio_tracking(btv,"pre-init");
3999 3999
4000 bttv_risc_init_main(btv); 4000 bttv_risc_init_main(btv);
4001 init_bt848(btv); 4001 init_bt848(btv);
4002 4002
4003 /* gpio */ 4003 /* gpio */
4004 btwrite(0x00, BT848_GPIO_REG_INP); 4004 btwrite(0x00, BT848_GPIO_REG_INP);
4005 btwrite(0x00, BT848_GPIO_OUT_EN); 4005 btwrite(0x00, BT848_GPIO_OUT_EN);
4006 if (bttv_verbose) 4006 if (bttv_verbose)
4007 bttv_gpio_tracking(btv,"init"); 4007 bttv_gpio_tracking(btv,"init");
4008 4008
4009 /* needs to be done before i2c is registered */ 4009 /* needs to be done before i2c is registered */
4010 bttv_init_card1(btv); 4010 bttv_init_card1(btv);
4011 4011
4012 /* register i2c + gpio */ 4012 /* register i2c + gpio */
4013 init_bttv_i2c(btv); 4013 init_bttv_i2c(btv);
4014 4014
4015 /* some card-specific stuff (needs working i2c) */ 4015 /* some card-specific stuff (needs working i2c) */
4016 bttv_init_card2(btv); 4016 bttv_init_card2(btv);
4017 init_irqreg(btv); 4017 init_irqreg(btv);
4018 4018
4019 /* register video4linux + input */ 4019 /* register video4linux + input */
4020 if (!bttv_tvcards[btv->c.type].no_video) { 4020 if (!bttv_tvcards[btv->c.type].no_video) {
4021 bttv_register_video(btv); 4021 bttv_register_video(btv);
4022 bt848_bright(btv,32768); 4022 bt848_bright(btv,32768);
@@ -4035,10 +4035,10 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4035 4035
4036 /* everything is fine */ 4036 /* everything is fine */
4037 bttv_num++; 4037 bttv_num++;
4038 return 0; 4038 return 0;
4039 4039
4040 fail2: 4040 fail2:
4041 free_irq(btv->c.pci->irq,btv); 4041 free_irq(btv->c.pci->irq,btv);
4042 4042
4043 fail1: 4043 fail1:
4044 if (btv->bt848_mmio) 4044 if (btv->bt848_mmio)
@@ -4051,12 +4051,12 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4051 4051
4052static void __devexit bttv_remove(struct pci_dev *pci_dev) 4052static void __devexit bttv_remove(struct pci_dev *pci_dev)
4053{ 4053{
4054 struct bttv *btv = pci_get_drvdata(pci_dev); 4054 struct bttv *btv = pci_get_drvdata(pci_dev);
4055 4055
4056 if (bttv_verbose) 4056 if (bttv_verbose)
4057 printk("bttv%d: unloading\n",btv->c.nr); 4057 printk("bttv%d: unloading\n",btv->c.nr);
4058 4058
4059 /* shutdown everything (DMA+IRQs) */ 4059 /* shutdown everything (DMA+IRQs) */
4060 btand(~15, BT848_GPIO_DMA_CTL); 4060 btand(~15, BT848_GPIO_DMA_CTL);
4061 btwrite(0, BT848_INT_MASK); 4061 btwrite(0, BT848_INT_MASK);
4062 btwrite(~0x0, BT848_INT_STAT); 4062 btwrite(~0x0, BT848_INT_STAT);
@@ -4069,7 +4069,7 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
4069 wake_up(&btv->gpioq); 4069 wake_up(&btv->gpioq);
4070 bttv_sub_del_devices(&btv->c); 4070 bttv_sub_del_devices(&btv->c);
4071 4071
4072 /* unregister i2c_bus + input */ 4072 /* unregister i2c_bus + input */
4073 fini_bttv_i2c(btv); 4073 fini_bttv_i2c(btv);
4074 4074
4075 /* unregister video4linux */ 4075 /* unregister video4linux */
@@ -4079,18 +4079,18 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
4079 btcx_riscmem_free(btv->c.pci,&btv->main); 4079 btcx_riscmem_free(btv->c.pci,&btv->main);
4080 4080
4081 /* free ressources */ 4081 /* free ressources */
4082 free_irq(btv->c.pci->irq,btv); 4082 free_irq(btv->c.pci->irq,btv);
4083 iounmap(btv->bt848_mmio); 4083 iounmap(btv->bt848_mmio);
4084 release_mem_region(pci_resource_start(btv->c.pci,0), 4084 release_mem_region(pci_resource_start(btv->c.pci,0),
4085 pci_resource_len(btv->c.pci,0)); 4085 pci_resource_len(btv->c.pci,0));
4086 4086
4087 pci_set_drvdata(pci_dev, NULL); 4087 pci_set_drvdata(pci_dev, NULL);
4088 return; 4088 return;
4089} 4089}
4090 4090
4091static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state) 4091static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
4092{ 4092{
4093 struct bttv *btv = pci_get_drvdata(pci_dev); 4093 struct bttv *btv = pci_get_drvdata(pci_dev);
4094 struct bttv_buffer_set idle; 4094 struct bttv_buffer_set idle;
4095 unsigned long flags; 4095 unsigned long flags;
4096 4096
@@ -4125,7 +4125,7 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
4125 4125
4126static int bttv_resume(struct pci_dev *pci_dev) 4126static int bttv_resume(struct pci_dev *pci_dev)
4127{ 4127{
4128 struct bttv *btv = pci_get_drvdata(pci_dev); 4128 struct bttv *btv = pci_get_drvdata(pci_dev);
4129 unsigned long flags; 4129 unsigned long flags;
4130 int err; 4130 int err;
4131 4131
@@ -4170,24 +4170,24 @@ static int bttv_resume(struct pci_dev *pci_dev)
4170} 4170}
4171 4171
4172static struct pci_device_id bttv_pci_tbl[] = { 4172static struct pci_device_id bttv_pci_tbl[] = {
4173 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848, 4173 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848,
4174 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 4174 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
4175 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849, 4175 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849,
4176 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 4176 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
4177 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878, 4177 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878,
4178 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 4178 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
4179 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT879, 4179 {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT879,
4180 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 4180 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
4181 {0,} 4181 {0,}
4182}; 4182};
4183 4183
4184MODULE_DEVICE_TABLE(pci, bttv_pci_tbl); 4184MODULE_DEVICE_TABLE(pci, bttv_pci_tbl);
4185 4185
4186static struct pci_driver bttv_pci_driver = { 4186static struct pci_driver bttv_pci_driver = {
4187 .name = "bttv", 4187 .name = "bttv",
4188 .id_table = bttv_pci_tbl, 4188 .id_table = bttv_pci_tbl,
4189 .probe = bttv_probe, 4189 .probe = bttv_probe,
4190 .remove = __devexit_p(bttv_remove), 4190 .remove = __devexit_p(bttv_remove),
4191 .suspend = bttv_suspend, 4191 .suspend = bttv_suspend,
4192 .resume = bttv_resume, 4192 .resume = bttv_resume,
4193}; 4193};
diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c
index 6b280c03e39..575ce8b8e71 100644
--- a/drivers/media/video/bttv-gpio.c
+++ b/drivers/media/video/bttv-gpio.c
@@ -7,7 +7,7 @@
7 7
8 8
9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
10 & Marcus Metzler (mocm@thp.uni-koeln.de) 10 & Marcus Metzler (mocm@thp.uni-koeln.de)
11 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> 11 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
12 12
13 This program is free software; you can redistribute it and/or modify 13 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 e684df37eb0..06c5965b561 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -5,7 +5,7 @@
5 bttv - Bt848 frame grabber driver 5 bttv - Bt848 frame grabber driver
6 6
7 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 7 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
8 & Marcus Metzler (mocm@thp.uni-koeln.de) 8 & Marcus Metzler (mocm@thp.uni-koeln.de)
9 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> 9 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
10 10
11 This program is free software; you can redistribute it and/or modify 11 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)
237 err: 237 err:
238 if (i2c_debug) 238 if (i2c_debug)
239 printk(" ERR: %d\n",retval); 239 printk(" ERR: %d\n",retval);
240 return retval; 240 return retval;
241} 241}
242 242
243static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) 243static 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 = {
290 290
291static int attach_inform(struct i2c_client *client) 291static int attach_inform(struct i2c_client *client)
292{ 292{
293 struct bttv *btv = i2c_get_adapdata(client->adapter); 293 struct bttv *btv = i2c_get_adapdata(client->adapter);
294 294
295 if (bttv_debug) 295 if (bttv_debug)
296 printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n", 296 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)
300 return 0; 300 return 0;
301 301
302 if (btv->tuner_type != UNSET) { 302 if (btv->tuner_type != UNSET) {
303 struct tuner_setup tun_setup; 303 struct tuner_setup tun_setup;
304 304
305 tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV; 305 tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
306 tun_setup.type = btv->tuner_type; 306 tun_setup.type = btv->tuner_type;
307 tun_setup.addr = ADDR_UNSET; 307 tun_setup.addr = ADDR_UNSET;
308 308
@@ -312,7 +312,7 @@ static int attach_inform(struct i2c_client *client)
312 if (btv->pinnacle_id != UNSET) 312 if (btv->pinnacle_id != UNSET)
313 client->driver->command(client,AUDC_CONFIG_PINNACLE, 313 client->driver->command(client,AUDC_CONFIG_PINNACLE,
314 &btv->pinnacle_id); 314 &btv->pinnacle_id);
315 return 0; 315 return 0;
316} 316}
317 317
318void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) 318void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg)
@@ -330,43 +330,43 @@ static struct i2c_client bttv_i2c_client_template = {
330/* read I2C */ 330/* read I2C */
331int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for) 331int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for)
332{ 332{
333 unsigned char buffer = 0; 333 unsigned char buffer = 0;
334 334
335 if (0 != btv->i2c_rc) 335 if (0 != btv->i2c_rc)
336 return -1; 336 return -1;
337 if (bttv_verbose && NULL != probe_for) 337 if (bttv_verbose && NULL != probe_for)
338 printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ", 338 printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ",
339 btv->c.nr,probe_for,addr); 339 btv->c.nr,probe_for,addr);
340 btv->i2c_client.addr = addr >> 1; 340 btv->i2c_client.addr = addr >> 1;
341 if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) { 341 if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
342 if (NULL != probe_for) { 342 if (NULL != probe_for) {
343 if (bttv_verbose) 343 if (bttv_verbose)
344 printk("not found\n"); 344 printk("not found\n");
345 } else 345 } else
346 printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n", 346 printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n",
347 btv->c.nr,addr); 347 btv->c.nr,addr);
348 return -1; 348 return -1;
349 } 349 }
350 if (bttv_verbose && NULL != probe_for) 350 if (bttv_verbose && NULL != probe_for)
351 printk("found\n"); 351 printk("found\n");
352 return buffer; 352 return buffer;
353} 353}
354 354
355/* write I2C */ 355/* write I2C */
356int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1, 356int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
357 unsigned char b2, int both) 357 unsigned char b2, int both)
358{ 358{
359 unsigned char buffer[2]; 359 unsigned char buffer[2];
360 int bytes = both ? 2 : 1; 360 int bytes = both ? 2 : 1;
361 361
362 if (0 != btv->i2c_rc) 362 if (0 != btv->i2c_rc)
363 return -1; 363 return -1;
364 btv->i2c_client.addr = addr >> 1; 364 btv->i2c_client.addr = addr >> 1;
365 buffer[0] = b1; 365 buffer[0] = b1;
366 buffer[1] = b2; 366 buffer[1] = b2;
367 if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes)) 367 if (bytes != i2c_master_send(&btv->i2c_client, buffer, bytes))
368 return -1; 368 return -1;
369 return 0; 369 return 0;
370} 370}
371 371
372/* read EEPROM content */ 372/* read EEPROM content */
@@ -431,8 +431,8 @@ int __devinit init_bttv_i2c(struct bttv *btv)
431 "bt%d #%d [%s]", btv->id, btv->c.nr, 431 "bt%d #%d [%s]", btv->id, btv->c.nr,
432 btv->use_i2c_hw ? "hw" : "sw"); 432 btv->use_i2c_hw ? "hw" : "sw");
433 433
434 i2c_set_adapdata(&btv->c.i2c_adap, btv); 434 i2c_set_adapdata(&btv->c.i2c_adap, btv);
435 btv->i2c_client.adapter = &btv->c.i2c_adap; 435 btv->i2c_client.adapter = &btv->c.i2c_adap;
436 436
437#ifdef I2C_CLASS_TV_ANALOG 437#ifdef I2C_CLASS_TV_ANALOG
438 if (bttv_tvcards[btv->c.type].no_video) 438 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 e8aada772b8..19b564ab0e9 100644
--- a/drivers/media/video/bttv-if.c
+++ b/drivers/media/video/bttv-if.c
@@ -1,13 +1,13 @@
1/* 1/*
2 2
3 bttv-if.c -- old gpio interface to other kernel modules 3 bttv-if.c -- old gpio interface to other kernel modules
4 don't use in new code, will go away in 2.7 4 don't use in new code, will go away in 2.7
5 have a look at bttv-gpio.c instead. 5 have a look at bttv-gpio.c instead.
6 6
7 bttv - Bt848 frame grabber driver 7 bttv - Bt848 frame grabber driver
8 8
9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
10 & Marcus Metzler (mocm@thp.uni-koeln.de) 10 & Marcus Metzler (mocm@thp.uni-koeln.de)
11 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> 11 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
12 12
13 This program is free software; you can redistribute it and/or modify 13 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 a5ed99b8944..3028862934d 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,
74 } 74 }
75 if (bpl <= sg_dma_len(sg)-offset) { 75 if (bpl <= sg_dma_len(sg)-offset) {
76 /* fits into current chunk */ 76 /* fits into current chunk */
77 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| 77 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|
78 BT848_RISC_EOL|bpl); 78 BT848_RISC_EOL|bpl);
79 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); 79 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
80 offset+=bpl; 80 offset+=bpl;
81 } else { 81 } else {
82 /* scanline needs to be splitted */ 82 /* scanline needs to be splitted */
83 todo = bpl; 83 todo = bpl;
84 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL| 84 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|
85 (sg_dma_len(sg)-offset)); 85 (sg_dma_len(sg)-offset));
86 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); 86 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
87 todo -= (sg_dma_len(sg)-offset); 87 todo -= (sg_dma_len(sg)-offset);
88 offset = 0; 88 offset = 0;
89 sg++; 89 sg++;
90 while (todo > sg_dma_len(sg)) { 90 while (todo > sg_dma_len(sg)) {
91 *(rp++)=cpu_to_le32(BT848_RISC_WRITE| 91 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|
92 sg_dma_len(sg)); 92 sg_dma_len(sg));
93 *(rp++)=cpu_to_le32(sg_dma_address(sg)); 93 *(rp++)=cpu_to_le32(sg_dma_address(sg));
94 todo -= sg_dma_len(sg); 94 todo -= sg_dma_len(sg);
95 sg++; 95 sg++;
96 } 96 }
97 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL| 97 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|
98 todo); 98 todo);
99 *(rp++)=cpu_to_le32(sg_dma_address(sg)); 99 *(rp++)=cpu_to_le32(sg_dma_address(sg));
100 offset += todo; 100 offset += todo;
@@ -201,8 +201,8 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
201 ri |= BT848_RISC_EOL; 201 ri |= BT848_RISC_EOL;
202 202
203 /* write risc instruction */ 203 /* write risc instruction */
204 *(rp++)=cpu_to_le32(ri | ylen); 204 *(rp++)=cpu_to_le32(ri | ylen);
205 *(rp++)=cpu_to_le32(((ylen >> hshift) << 16) | 205 *(rp++)=cpu_to_le32(((ylen >> hshift) << 16) |
206 (ylen >> hshift)); 206 (ylen >> hshift));
207 *(rp++)=cpu_to_le32(sg_dma_address(ysg)+yoffset); 207 *(rp++)=cpu_to_le32(sg_dma_address(ysg)+yoffset);
208 yoffset += ylen; 208 yoffset += ylen;
@@ -319,7 +319,7 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
319 int width, int height, int interleaved, int norm) 319 int width, int height, int interleaved, int norm)
320{ 320{
321 const struct bttv_tvnorm *tvnorm = &bttv_tvnorms[norm]; 321 const struct bttv_tvnorm *tvnorm = &bttv_tvnorms[norm];
322 u32 xsf, sr; 322 u32 xsf, sr;
323 int vdelay; 323 int vdelay;
324 324
325 int swidth = tvnorm->swidth; 325 int swidth = tvnorm->swidth;
@@ -334,52 +334,52 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
334 334
335 vdelay = tvnorm->vdelay; 335 vdelay = tvnorm->vdelay;
336 336
337 xsf = (width*scaledtwidth)/swidth; 337 xsf = (width*scaledtwidth)/swidth;
338 geo->hscale = ((totalwidth*4096UL)/xsf-4096); 338 geo->hscale = ((totalwidth*4096UL)/xsf-4096);
339 geo->hdelay = tvnorm->hdelayx1; 339 geo->hdelay = tvnorm->hdelayx1;
340 geo->hdelay = (geo->hdelay*width)/swidth; 340 geo->hdelay = (geo->hdelay*width)/swidth;
341 geo->hdelay &= 0x3fe; 341 geo->hdelay &= 0x3fe;
342 sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512; 342 sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512;
343 geo->vscale = (0x10000UL-sr) & 0x1fff; 343 geo->vscale = (0x10000UL-sr) & 0x1fff;
344 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | 344 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) |
345 ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0); 345 ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0);
346 geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0; 346 geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0;
347 geo->vdelay = vdelay; 347 geo->vdelay = vdelay;
348 geo->width = width; 348 geo->width = width;
349 geo->sheight = tvnorm->sheight; 349 geo->sheight = tvnorm->sheight;
350 geo->vtotal = tvnorm->vtotal; 350 geo->vtotal = tvnorm->vtotal;
351 351
352 if (btv->opt_combfilter) { 352 if (btv->opt_combfilter) {
353 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); 353 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0);
354 geo->comb = (width < 769) ? 1 : 0; 354 geo->comb = (width < 769) ? 1 : 0;
355 } else { 355 } else {
356 geo->vtc = 0; 356 geo->vtc = 0;
357 geo->comb = 0; 357 geo->comb = 0;
358 } 358 }
359} 359}
360 360
361static void 361static void
362bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd) 362bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd)
363{ 363{
364 int off = odd ? 0x80 : 0x00; 364 int off = odd ? 0x80 : 0x00;
365 365
366 if (geo->comb) 366 if (geo->comb)
367 btor(BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off); 367 btor(BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off);
368 else 368 else
369 btand(~BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off); 369 btand(~BT848_VSCALE_COMB, BT848_E_VSCALE_HI+off);
370 370
371 btwrite(geo->vtc, BT848_E_VTC+off); 371 btwrite(geo->vtc, BT848_E_VTC+off);
372 btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off); 372 btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off);
373 btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off); 373 btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off);
374 btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off); 374 btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off);
375 btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off); 375 btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off);
376 btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off); 376 btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off);
377 btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off); 377 btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off);
378 btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off); 378 btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off);
379 btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off); 379 btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off);
380 btwrite(geo->crop, BT848_E_CROP+off); 380 btwrite(geo->crop, BT848_E_CROP+off);
381 btwrite(geo->vtotal>>8, BT848_VTOTAL_HI); 381 btwrite(geo->vtotal>>8, BT848_VTOTAL_HI);
382 btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO); 382 btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO);
383} 383}
384 384
385/* ---------------------------------------------------------- */ 385/* ---------------------------------------------------------- */
@@ -420,7 +420,7 @@ bttv_set_dma(struct bttv *btv, int override)
420 } else { 420 } else {
421 del_timer(&btv->timeout); 421 del_timer(&btv->timeout);
422 } 422 }
423 btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); 423 btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd);
424 424
425 btaor(capctl, ~0x0f, BT848_CAP_CTL); 425 btaor(capctl, ~0x0f, BT848_CAP_CTL);
426 if (capctl) { 426 if (capctl) {
@@ -432,7 +432,7 @@ bttv_set_dma(struct bttv *btv, int override)
432 } else { 432 } else {
433 if (!btv->dma_on) 433 if (!btv->dma_on)
434 return; 434 return;
435 btand(~3, BT848_GPIO_DMA_CTL); 435 btand(~3, BT848_GPIO_DMA_CTL);
436 btv->dma_on = 0; 436 btv->dma_on = 0;
437 } 437 }
438 return; 438 return;
@@ -460,19 +460,19 @@ bttv_risc_init_main(struct bttv *btv)
460 btv->main.cpu[6] = cpu_to_le32(BT848_RISC_JUMP); 460 btv->main.cpu[6] = cpu_to_le32(BT848_RISC_JUMP);
461 btv->main.cpu[7] = cpu_to_le32(btv->main.dma + (8<<2)); 461 btv->main.cpu[7] = cpu_to_le32(btv->main.dma + (8<<2));
462 462
463 btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | 463 btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC |
464 BT848_FIFO_STATUS_VRO); 464 BT848_FIFO_STATUS_VRO);
465 btv->main.cpu[9] = cpu_to_le32(0); 465 btv->main.cpu[9] = cpu_to_le32(0);
466 466
467 /* bottom field */ 467 /* bottom field */
468 btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP); 468 btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP);
469 btv->main.cpu[11] = cpu_to_le32(btv->main.dma + (12<<2)); 469 btv->main.cpu[11] = cpu_to_le32(btv->main.dma + (12<<2));
470 btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP); 470 btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP);
471 btv->main.cpu[13] = cpu_to_le32(btv->main.dma + (14<<2)); 471 btv->main.cpu[13] = cpu_to_le32(btv->main.dma + (14<<2));
472 472
473 /* jump back to top field */ 473 /* jump back to top field */
474 btv->main.cpu[14] = cpu_to_le32(BT848_RISC_JUMP); 474 btv->main.cpu[14] = cpu_to_le32(BT848_RISC_JUMP);
475 btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2)); 475 btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2));
476 476
477 return 0; 477 return 0;
478} 478}
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index 26cd117a6df..124ea41dada 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -202,7 +202,7 @@ struct bttv_core {
202 struct list_head subs; /* struct bttv_sub_device */ 202 struct list_head subs; /* struct bttv_sub_device */
203 203
204 /* device config */ 204 /* device config */
205 unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */ 205 unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */
206 unsigned int type; /* card type (pointer into tvcards[]) */ 206 unsigned int type; /* card type (pointer into tvcards[]) */
207 char name[8]; /* dev name */ 207 char name[8]; /* dev name */
208}; 208};
@@ -211,16 +211,16 @@ struct bttv;
211 211
212struct tvcard 212struct tvcard
213{ 213{
214 char *name; 214 char *name;
215 unsigned int video_inputs; 215 unsigned int video_inputs;
216 unsigned int audio_inputs; 216 unsigned int audio_inputs;
217 unsigned int tuner; 217 unsigned int tuner;
218 unsigned int svhs; 218 unsigned int svhs;
219 unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO 219 unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
220 u32 gpiomask; 220 u32 gpiomask;
221 u32 muxsel[16]; 221 u32 muxsel[16];
222 u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ 222 u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
223 u32 gpiomask2; /* GPIO MUX mask */ 223 u32 gpiomask2; /* GPIO MUX mask */
224 224
225 /* i2c audio flags */ 225 /* i2c audio flags */
226 unsigned int no_msp34xx:1; 226 unsigned int no_msp34xx:1;
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
index e0e7c7a84bc..386f546f7d1 100644
--- a/drivers/media/video/bttvp.h
+++ b/drivers/media/video/bttvp.h
@@ -77,14 +77,14 @@
77struct bttv_tvnorm { 77struct bttv_tvnorm {
78 int v4l2_id; 78 int v4l2_id;
79 char *name; 79 char *name;
80 u32 Fsc; 80 u32 Fsc;
81 u16 swidth, sheight; /* scaled standard width, height */ 81 u16 swidth, sheight; /* scaled standard width, height */
82 u16 totalwidth; 82 u16 totalwidth;
83 u8 adelay, bdelay, iform; 83 u8 adelay, bdelay, iform;
84 u32 scaledtwidth; 84 u32 scaledtwidth;
85 u16 hdelayx1, hactivex1; 85 u16 hdelayx1, hactivex1;
86 u16 vdelay; 86 u16 vdelay;
87 u8 vbipack; 87 u8 vbipack;
88 u16 vtotal; 88 u16 vtotal;
89 int sram; 89 int sram;
90}; 90};
@@ -267,8 +267,8 @@ struct bttv {
267 267
268 /* card configuration info */ 268 /* card configuration info */
269 unsigned int cardid; /* pci subsystem id (bt878 based ones) */ 269 unsigned int cardid; /* pci subsystem id (bt878 based ones) */
270 unsigned int tuner_type; /* tuner chip type */ 270 unsigned int tuner_type; /* tuner chip type */
271 unsigned int pinnacle_id; 271 unsigned int pinnacle_id;
272 unsigned int svhs; 272 unsigned int svhs;
273 struct bttv_pll_info pll; 273 struct bttv_pll_info pll;
274 int triton1; 274 int triton1;
@@ -301,9 +301,9 @@ struct bttv {
301 301
302 /* locking */ 302 /* locking */
303 spinlock_t s_lock; 303 spinlock_t s_lock;
304 struct semaphore lock; 304 struct semaphore lock;
305 int resources; 305 int resources;
306 struct semaphore reslock; 306 struct semaphore reslock;
307#ifdef VIDIOC_G_PRIORITY 307#ifdef VIDIOC_G_PRIORITY
308 struct v4l2_prio_state prio; 308 struct v4l2_prio_state prio;
309#endif 309#endif
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index fac67d98a74..4ae3f78cccf 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)
436 436
437static int memory_read(struct cx88_core *core, u32 address, u32 *value) 437static int memory_read(struct cx88_core *core, u32 address, u32 *value)
438{ 438{
439 int retval; 439 int retval;
440 u32 val; 440 u32 val;
441 441
442 /* Warning: address is dword address (4 bytes) */ 442 /* Warning: address is dword address (4 bytes) */
@@ -605,11 +605,11 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
605 u32 *dataptr; 605 u32 *dataptr;
606 606
607 retval = register_write(dev->core, IVTV_REG_VPU, 0xFFFFFFED); 607 retval = register_write(dev->core, IVTV_REG_VPU, 0xFFFFFFED);
608 retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); 608 retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST);
609 retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_REFRESH, 0x80000640); 609 retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_REFRESH, 0x80000640);
610 retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_PRECHARGE, 0x1A); 610 retval |= register_write(dev->core, IVTV_REG_ENC_SDRAM_PRECHARGE, 0x1A);
611 msleep(1); 611 msleep(1);
612 retval |= register_write(dev->core, IVTV_REG_APU, 0); 612 retval |= register_write(dev->core, IVTV_REG_APU, 0);
613 613
614 if (retval < 0) 614 if (retval < 0)
615 dprintk(0, "Error with register_write\n"); 615 dprintk(0, "Error with register_write\n");
@@ -657,13 +657,13 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
657 release_firmware(firmware); 657 release_firmware(firmware);
658 dprintk(0, "Firmware upload successful.\n"); 658 dprintk(0, "Firmware upload successful.\n");
659 659
660 retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST); 660 retval |= register_write(dev->core, IVTV_REG_HW_BLOCKS, IVTV_CMD_HW_BLOCKS_RST);
661 retval |= register_read(dev->core, IVTV_REG_SPU, &value); 661 retval |= register_read(dev->core, IVTV_REG_SPU, &value);
662 retval |= register_write(dev->core, IVTV_REG_SPU, value & 0xFFFFFFFE); 662 retval |= register_write(dev->core, IVTV_REG_SPU, value & 0xFFFFFFFE);
663 msleep(1); 663 msleep(1);
664 664
665 retval |= register_read(dev->core, IVTV_REG_VPU, &value); 665 retval |= register_read(dev->core, IVTV_REG_VPU, &value);
666 retval |= register_write(dev->core, IVTV_REG_VPU, value & 0xFFFFFFE8); 666 retval |= register_write(dev->core, IVTV_REG_VPU, value & 0xFFFFFFE8);
667 667
668 if (retval < 0) 668 if (retval < 0)
669 dprintk(0, "Error with register_write\n"); 669 dprintk(0, "Error with register_write\n");
@@ -876,7 +876,7 @@ static void blackbird_set_default_params(struct cx8802_dev *dev)
876 au_params |= 0; 876 au_params |= 0;
877 } 877 }
878 else if( params->au_bitrate.target >= 878 else if( params->au_bitrate.target >=
879 mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) 879 mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate )
880 { 880 {
881 /* clamp the bitrate to the max supported by the standard */ 881 /* clamp the bitrate to the max supported by the standard */
882 params->au_bitrate.target = mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate; 882 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)
942 /* TODO: implement the stream ID stuff: 942 /* TODO: implement the stream ID stuff:
943 ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr, 943 ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr,
944 ps_size, au_pesid, vi_pesid 944 ps_size, au_pesid, vi_pesid
945 */ 945 */
946} 946}
947#define CHECK_PARAM( name ) ( dev->params.name != params->name ) 947#define CHECK_PARAM( name ) ( dev->params.name != params->name )
948#define IF_PARAM( name ) if( CHECK_PARAM( name ) ) 948#define IF_PARAM( name ) if( CHECK_PARAM( name ) )
@@ -1068,7 +1068,7 @@ void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression *
1068 au_params |= 0; 1068 au_params |= 0;
1069 } 1069 }
1070 else if( params->au_bitrate.target >= 1070 else if( params->au_bitrate.target >=
1071 mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate ) 1071 mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate )
1072 { 1072 {
1073 /* clamp the bitrate to the max supported by the standard */ 1073 /* clamp the bitrate to the max supported by the standard */
1074 params->au_bitrate.target = mpeg_audio_bitrates[BITRATES_SIZE-1].layer[layer].rate; 1074 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 *
1150 /* TODO: implement the stream ID stuff: 1150 /* TODO: implement the stream ID stuff:
1151 ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr, 1151 ts_pid_pmt, ts_pid_audio, ts_pid_video, ts_pid_pcr,
1152 ps_size, au_pesid, vi_pesid 1152 ps_size, au_pesid, vi_pesid
1153 */ 1153 */
1154 UPDATE_PARAM( ts_pid_pmt ); 1154 UPDATE_PARAM( ts_pid_pmt );
1155 UPDATE_PARAM( ts_pid_audio ); 1155 UPDATE_PARAM( ts_pid_audio );
1156 UPDATE_PARAM( ts_pid_video ); 1156 UPDATE_PARAM( ts_pid_video );
@@ -1712,7 +1712,7 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev,
1712 1712
1713static void __devexit blackbird_remove(struct pci_dev *pci_dev) 1713static void __devexit blackbird_remove(struct pci_dev *pci_dev)
1714{ 1714{
1715 struct cx8802_dev *dev = pci_get_drvdata(pci_dev); 1715 struct cx8802_dev *dev = pci_get_drvdata(pci_dev);
1716 1716
1717 /* blackbird */ 1717 /* blackbird */
1718 blackbird_unregister_video(dev); 1718 blackbird_unregister_video(dev);
@@ -1728,8 +1728,8 @@ static struct pci_device_id cx8802_pci_tbl[] = {
1728 { 1728 {
1729 .vendor = 0x14f1, 1729 .vendor = 0x14f1,
1730 .device = 0x8802, 1730 .device = 0x8802,
1731 .subvendor = PCI_ANY_ID, 1731 .subvendor = PCI_ANY_ID,
1732 .subdevice = PCI_ANY_ID, 1732 .subdevice = PCI_ANY_ID,
1733 },{ 1733 },{
1734 /* --- end of list --- */ 1734 /* --- end of list --- */
1735 } 1735 }
@@ -1737,10 +1737,10 @@ static struct pci_device_id cx8802_pci_tbl[] = {
1737MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl); 1737MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl);
1738 1738
1739static struct pci_driver blackbird_pci_driver = { 1739static struct pci_driver blackbird_pci_driver = {
1740 .name = "cx88-blackbird", 1740 .name = "cx88-blackbird",
1741 .id_table = cx8802_pci_tbl, 1741 .id_table = cx8802_pci_tbl,
1742 .probe = blackbird_probe, 1742 .probe = blackbird_probe,
1743 .remove = __devexit_p(blackbird_remove), 1743 .remove = __devexit_p(blackbird_remove),
1744 .suspend = cx8802_suspend_common, 1744 .suspend = cx8802_suspend_common,
1745 .resume = cx8802_resume_common, 1745 .resume = cx8802_resume_common,
1746}; 1746};
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index cf17da83691..50491776879 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[] = {
126 .input = {{ 126 .input = {{
127 .type = CX88_VMUX_TELEVISION, 127 .type = CX88_VMUX_TELEVISION,
128 .vmux = 0, 128 .vmux = 0,
129 .gpio0 = 0x03ff, 129 .gpio0 = 0x03ff,
130 },{ 130 },{
131 .type = CX88_VMUX_COMPOSITE1, 131 .type = CX88_VMUX_COMPOSITE1,
132 .vmux = 1, 132 .vmux = 1,
133 .gpio0 = 0x03fe, 133 .gpio0 = 0x03fe,
134 },{ 134 },{
135 .type = CX88_VMUX_SVIDEO, 135 .type = CX88_VMUX_SVIDEO,
136 .vmux = 2, 136 .vmux = 2,
137 .gpio0 = 0x03fe, 137 .gpio0 = 0x03fe,
138 }}, 138 }},
139 }, 139 },
140 [CX88_BOARD_WINFAST2000XP_EXPERT] = { 140 [CX88_BOARD_WINFAST2000XP_EXPERT] = {
141 .name = "Leadtek Winfast 2000XP Expert", 141 .name = "Leadtek Winfast 2000XP Expert",
142 .tuner_type = TUNER_PHILIPS_4IN1, 142 .tuner_type = TUNER_PHILIPS_4IN1,
143 .radio_type = UNSET, 143 .radio_type = UNSET,
144 .tuner_addr = ADDR_UNSET, 144 .tuner_addr = ADDR_UNSET,
145 .radio_addr = ADDR_UNSET, 145 .radio_addr = ADDR_UNSET,
146 .tda9887_conf = TDA9887_PRESENT, 146 .tda9887_conf = TDA9887_PRESENT,
147 .input = {{ 147 .input = {{
148 .type = CX88_VMUX_TELEVISION, 148 .type = CX88_VMUX_TELEVISION,
149 .vmux = 0, 149 .vmux = 0,
150 .gpio0 = 0x00F5e700, 150 .gpio0 = 0x00F5e700,
151 .gpio1 = 0x00003004, 151 .gpio1 = 0x00003004,
152 .gpio2 = 0x00F5e700, 152 .gpio2 = 0x00F5e700,
@@ -165,15 +165,15 @@ struct cx88_board cx88_boards[] = {
165 .gpio1 = 0x00003004, 165 .gpio1 = 0x00003004,
166 .gpio2 = 0x00F5c700, 166 .gpio2 = 0x00F5c700,
167 .gpio3 = 0x02000000, 167 .gpio3 = 0x02000000,
168 }}, 168 }},
169 .radio = { 169 .radio = {
170 .type = CX88_RADIO, 170 .type = CX88_RADIO,
171 .gpio0 = 0x00F5d700, 171 .gpio0 = 0x00F5d700,
172 .gpio1 = 0x00003004, 172 .gpio1 = 0x00003004,
173 .gpio2 = 0x00F5d700, 173 .gpio2 = 0x00F5d700,
174 .gpio3 = 0x02000000, 174 .gpio3 = 0x02000000,
175 }, 175 },
176 }, 176 },
177 [CX88_BOARD_AVERTV_303] = { 177 [CX88_BOARD_AVERTV_303] = {
178 .name = "AverTV Studio 303 (M126)", 178 .name = "AverTV Studio 303 (M126)",
179 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 179 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
@@ -214,32 +214,32 @@ struct cx88_board cx88_boards[] = {
214 .gpio1 = 0x000080c0, 214 .gpio1 = 0x000080c0,
215 .gpio2 = 0x0000ff40, 215 .gpio2 = 0x0000ff40,
216 },{ 216 },{
217 .type = CX88_VMUX_COMPOSITE1, 217 .type = CX88_VMUX_COMPOSITE1,
218 .vmux = 1, 218 .vmux = 1,
219 .gpio0 = 0x000040bf, 219 .gpio0 = 0x000040bf,
220 .gpio1 = 0x000080c0, 220 .gpio1 = 0x000080c0,
221 .gpio2 = 0x0000ff40, 221 .gpio2 = 0x0000ff40,
222 },{ 222 },{
223 .type = CX88_VMUX_SVIDEO, 223 .type = CX88_VMUX_SVIDEO,
224 .vmux = 2, 224 .vmux = 2,
225 .gpio0 = 0x000040bf, 225 .gpio0 = 0x000040bf,
226 .gpio1 = 0x000080c0, 226 .gpio1 = 0x000080c0,
227 .gpio2 = 0x0000ff40, 227 .gpio2 = 0x0000ff40,
228 }}, 228 }},
229 .radio = { 229 .radio = {
230 .type = CX88_RADIO, 230 .type = CX88_RADIO,
231 }, 231 },
232 }, 232 },
233 [CX88_BOARD_WINFAST_DV2000] = { 233 [CX88_BOARD_WINFAST_DV2000] = {
234 .name = "Leadtek Winfast DV2000", 234 .name = "Leadtek Winfast DV2000",
235 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 235 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
236 .radio_type = UNSET, 236 .radio_type = UNSET,
237 .tuner_addr = ADDR_UNSET, 237 .tuner_addr = ADDR_UNSET,
238 .radio_addr = ADDR_UNSET, 238 .radio_addr = ADDR_UNSET,
239 .tda9887_conf = TDA9887_PRESENT, 239 .tda9887_conf = TDA9887_PRESENT,
240 .input = {{ 240 .input = {{
241 .type = CX88_VMUX_TELEVISION, 241 .type = CX88_VMUX_TELEVISION,
242 .vmux = 0, 242 .vmux = 0,
243 .gpio0 = 0x0035e700, 243 .gpio0 = 0x0035e700,
244 .gpio1 = 0x00003004, 244 .gpio1 = 0x00003004,
245 .gpio2 = 0x0035e700, 245 .gpio2 = 0x0035e700,
@@ -260,14 +260,14 @@ struct cx88_board cx88_boards[] = {
260 .gpio2 = 0x02000000, 260 .gpio2 = 0x02000000,
261 .gpio3 = 0x02000000, 261 .gpio3 = 0x02000000,
262 }}, 262 }},
263 .radio = { 263 .radio = {
264 .type = CX88_RADIO, 264 .type = CX88_RADIO,
265 .gpio0 = 0x0035d700, 265 .gpio0 = 0x0035d700,
266 .gpio1 = 0x00007004, 266 .gpio1 = 0x00007004,
267 .gpio2 = 0x0035d700, 267 .gpio2 = 0x0035d700,
268 .gpio3 = 0x02000000, 268 .gpio3 = 0x02000000,
269 }, 269 },
270 }, 270 },
271 [CX88_BOARD_LEADTEK_PVR2000] = { 271 [CX88_BOARD_LEADTEK_PVR2000] = {
272 // gpio values for PAL version from regspy by DScaler 272 // gpio values for PAL version from regspy by DScaler
273 .name = "Leadtek PVR 2000", 273 .name = "Leadtek PVR 2000",
@@ -296,25 +296,25 @@ struct cx88_board cx88_boards[] = {
296 .blackbird = 1, 296 .blackbird = 1,
297 }, 297 },
298 [CX88_BOARD_IODATA_GVVCP3PCI] = { 298 [CX88_BOARD_IODATA_GVVCP3PCI] = {
299 .name = "IODATA GV-VCP3/PCI", 299 .name = "IODATA GV-VCP3/PCI",
300 .tuner_type = TUNER_ABSENT, 300 .tuner_type = TUNER_ABSENT,
301 .radio_type = UNSET, 301 .radio_type = UNSET,
302 .tuner_addr = ADDR_UNSET, 302 .tuner_addr = ADDR_UNSET,
303 .radio_addr = ADDR_UNSET, 303 .radio_addr = ADDR_UNSET,
304 .input = {{ 304 .input = {{
305 .type = CX88_VMUX_COMPOSITE1, 305 .type = CX88_VMUX_COMPOSITE1,
306 .vmux = 0, 306 .vmux = 0,
307 },{ 307 },{
308 .type = CX88_VMUX_COMPOSITE2, 308 .type = CX88_VMUX_COMPOSITE2,
309 .vmux = 1, 309 .vmux = 1,
310 },{ 310 },{
311 .type = CX88_VMUX_SVIDEO, 311 .type = CX88_VMUX_SVIDEO,
312 .vmux = 2, 312 .vmux = 2,
313 }}, 313 }},
314 }, 314 },
315 [CX88_BOARD_PROLINK_PLAYTVPVR] = { 315 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
316 .name = "Prolink PlayTV PVR", 316 .name = "Prolink PlayTV PVR",
317 .tuner_type = TUNER_PHILIPS_FM1236_MK3, 317 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
318 .radio_type = UNSET, 318 .radio_type = UNSET,
319 .tuner_addr = ADDR_UNSET, 319 .tuner_addr = ADDR_UNSET,
320 .radio_addr = ADDR_UNSET, 320 .radio_addr = ADDR_UNSET,
@@ -348,15 +348,15 @@ struct cx88_board cx88_boards[] = {
348 .type = CX88_VMUX_TELEVISION, 348 .type = CX88_VMUX_TELEVISION,
349 .vmux = 0, 349 .vmux = 0,
350 .gpio0 = 0x0000fde6, 350 .gpio0 = 0x0000fde6,
351 },{ 351 },{
352 .type = CX88_VMUX_SVIDEO, 352 .type = CX88_VMUX_SVIDEO,
353 .vmux = 2, 353 .vmux = 2,
354 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? 354 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
355 }}, 355 }},
356 .radio = { 356 .radio = {
357 .type = CX88_RADIO, 357 .type = CX88_RADIO,
358 .gpio0 = 0x0000fde2, 358 .gpio0 = 0x0000fde2,
359 }, 359 },
360 .blackbird = 1, 360 .blackbird = 1,
361 }, 361 },
362 [CX88_BOARD_MSI_TVANYWHERE] = { 362 [CX88_BOARD_MSI_TVANYWHERE] = {
@@ -372,34 +372,34 @@ struct cx88_board cx88_boards[] = {
372 .gpio0 = 0x00000fbf, 372 .gpio0 = 0x00000fbf,
373 .gpio2 = 0x0000fc08, 373 .gpio2 = 0x0000fc08,
374 },{ 374 },{
375 .type = CX88_VMUX_COMPOSITE1, 375 .type = CX88_VMUX_COMPOSITE1,
376 .vmux = 1, 376 .vmux = 1,
377 .gpio0 = 0x00000fbf, 377 .gpio0 = 0x00000fbf,
378 .gpio2 = 0x0000fc68, 378 .gpio2 = 0x0000fc68,
379 },{ 379 },{
380 .type = CX88_VMUX_SVIDEO, 380 .type = CX88_VMUX_SVIDEO,
381 .vmux = 2, 381 .vmux = 2,
382 .gpio0 = 0x00000fbf, 382 .gpio0 = 0x00000fbf,
383 .gpio2 = 0x0000fc68, 383 .gpio2 = 0x0000fc68,
384 }}, 384 }},
385 }, 385 },
386 [CX88_BOARD_KWORLD_DVB_T] = { 386 [CX88_BOARD_KWORLD_DVB_T] = {
387 .name = "KWorld/VStream XPert DVB-T", 387 .name = "KWorld/VStream XPert DVB-T",
388 .tuner_type = TUNER_ABSENT, 388 .tuner_type = TUNER_ABSENT,
389 .radio_type = UNSET, 389 .radio_type = UNSET,
390 .tuner_addr = ADDR_UNSET, 390 .tuner_addr = ADDR_UNSET,
391 .radio_addr = ADDR_UNSET, 391 .radio_addr = ADDR_UNSET,
392 .input = {{ 392 .input = {{
393 .type = CX88_VMUX_COMPOSITE1, 393 .type = CX88_VMUX_COMPOSITE1,
394 .vmux = 1, 394 .vmux = 1,
395 .gpio0 = 0x0700, 395 .gpio0 = 0x0700,
396 .gpio2 = 0x0101, 396 .gpio2 = 0x0101,
397 },{ 397 },{
398 .type = CX88_VMUX_SVIDEO, 398 .type = CX88_VMUX_SVIDEO,
399 .vmux = 2, 399 .vmux = 2,
400 .gpio0 = 0x0700, 400 .gpio0 = 0x0700,
401 .gpio2 = 0x0101, 401 .gpio2 = 0x0101,
402 }}, 402 }},
403 .dvb = 1, 403 .dvb = 1,
404 }, 404 },
405 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 405 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
@@ -425,27 +425,27 @@ struct cx88_board cx88_boards[] = {
425 .radio_type = UNSET, 425 .radio_type = UNSET,
426 .tuner_addr = ADDR_UNSET, 426 .tuner_addr = ADDR_UNSET,
427 .radio_addr = ADDR_UNSET, 427 .radio_addr = ADDR_UNSET,
428 .input = {{ 428 .input = {{
429 .type = CX88_VMUX_TELEVISION, 429 .type = CX88_VMUX_TELEVISION,
430 .vmux = 0, 430 .vmux = 0,
431 .gpio0 = 0x07f8, 431 .gpio0 = 0x07f8,
432 },{ 432 },{
433 .type = CX88_VMUX_DEBUG, 433 .type = CX88_VMUX_DEBUG,
434 .vmux = 0, 434 .vmux = 0,
435 .gpio0 = 0x07f9, // mono from tuner chip 435 .gpio0 = 0x07f9, // mono from tuner chip
436 },{ 436 },{
437 .type = CX88_VMUX_COMPOSITE1, 437 .type = CX88_VMUX_COMPOSITE1,
438 .vmux = 1, 438 .vmux = 1,
439 .gpio0 = 0x000007fa, 439 .gpio0 = 0x000007fa,
440 },{ 440 },{
441 .type = CX88_VMUX_SVIDEO, 441 .type = CX88_VMUX_SVIDEO,
442 .vmux = 2, 442 .vmux = 2,
443 .gpio0 = 0x000007fa, 443 .gpio0 = 0x000007fa,
444 }}, 444 }},
445 .radio = { 445 .radio = {
446 .type = CX88_RADIO, 446 .type = CX88_RADIO,
447 .gpio0 = 0x000007f8, 447 .gpio0 = 0x000007f8,
448 }, 448 },
449 }, 449 },
450 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = { 450 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
451 .name = "DViCO FusionHDTV 3 Gold-Q", 451 .name = "DViCO FusionHDTV 3 Gold-Q",
@@ -489,28 +489,28 @@ struct cx88_board cx88_boards[] = {
489 }}, 489 }},
490 .dvb = 1, 490 .dvb = 1,
491 }, 491 },
492 [CX88_BOARD_HAUPPAUGE_DVB_T1] = { 492 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
493 .name = "Hauppauge Nova-T DVB-T", 493 .name = "Hauppauge Nova-T DVB-T",
494 .tuner_type = TUNER_ABSENT, 494 .tuner_type = TUNER_ABSENT,
495 .radio_type = UNSET, 495 .radio_type = UNSET,
496 .tuner_addr = ADDR_UNSET, 496 .tuner_addr = ADDR_UNSET,
497 .radio_addr = ADDR_UNSET, 497 .radio_addr = ADDR_UNSET,
498 .input = {{ 498 .input = {{
499 .type = CX88_VMUX_DVB, 499 .type = CX88_VMUX_DVB,
500 .vmux = 0, 500 .vmux = 0,
501 }}, 501 }},
502 .dvb = 1, 502 .dvb = 1,
503 }, 503 },
504 [CX88_BOARD_CONEXANT_DVB_T1] = { 504 [CX88_BOARD_CONEXANT_DVB_T1] = {
505 .name = "Conexant DVB-T reference design", 505 .name = "Conexant DVB-T reference design",
506 .tuner_type = TUNER_ABSENT, 506 .tuner_type = TUNER_ABSENT,
507 .radio_type = UNSET, 507 .radio_type = UNSET,
508 .tuner_addr = ADDR_UNSET, 508 .tuner_addr = ADDR_UNSET,
509 .radio_addr = ADDR_UNSET, 509 .radio_addr = ADDR_UNSET,
510 .input = {{ 510 .input = {{
511 .type = CX88_VMUX_DVB, 511 .type = CX88_VMUX_DVB,
512 .vmux = 0, 512 .vmux = 0,
513 }}, 513 }},
514 .dvb = 1, 514 .dvb = 1,
515 }, 515 },
516 [CX88_BOARD_PROVIDEO_PV259] = { 516 [CX88_BOARD_PROVIDEO_PV259] = {
@@ -543,12 +543,12 @@ struct cx88_board cx88_boards[] = {
543 .dvb = 1, 543 .dvb = 1,
544 }, 544 },
545 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 545 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
546 .name = "digitalnow DNTV Live! DVB-T", 546 .name = "digitalnow DNTV Live! DVB-T",
547 .tuner_type = TUNER_ABSENT, 547 .tuner_type = TUNER_ABSENT,
548 .radio_type = UNSET, 548 .radio_type = UNSET,
549 .tuner_addr = ADDR_UNSET, 549 .tuner_addr = ADDR_UNSET,
550 .radio_addr = ADDR_UNSET, 550 .radio_addr = ADDR_UNSET,
551 .input = {{ 551 .input = {{
552 .type = CX88_VMUX_COMPOSITE1, 552 .type = CX88_VMUX_COMPOSITE1,
553 .vmux = 1, 553 .vmux = 1,
554 .gpio0 = 0x00000700, 554 .gpio0 = 0x00000700,
@@ -705,44 +705,44 @@ struct cx88_board cx88_boards[] = {
705 .gpio0 = 0xbf60, 705 .gpio0 = 0xbf60,
706 }, 706 },
707 }, 707 },
708 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { 708 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
709 .name = "DViCO FusionHDTV 3 Gold-T", 709 .name = "DViCO FusionHDTV 3 Gold-T",
710 .tuner_type = TUNER_THOMSON_DTT7611, 710 .tuner_type = TUNER_THOMSON_DTT7611,
711 .radio_type = UNSET, 711 .radio_type = UNSET,
712 .tuner_addr = ADDR_UNSET, 712 .tuner_addr = ADDR_UNSET,
713 .radio_addr = ADDR_UNSET, 713 .radio_addr = ADDR_UNSET,
714 .input = {{ 714 .input = {{
715 .type = CX88_VMUX_TELEVISION, 715 .type = CX88_VMUX_TELEVISION,
716 .vmux = 0, 716 .vmux = 0,
717 .gpio0 = 0x97ed, 717 .gpio0 = 0x97ed,
718 },{ 718 },{
719 .type = CX88_VMUX_COMPOSITE1, 719 .type = CX88_VMUX_COMPOSITE1,
720 .vmux = 1, 720 .vmux = 1,
721 .gpio0 = 0x97e9, 721 .gpio0 = 0x97e9,
722 },{ 722 },{
723 .type = CX88_VMUX_SVIDEO, 723 .type = CX88_VMUX_SVIDEO,
724 .vmux = 2, 724 .vmux = 2,
725 .gpio0 = 0x97e9, 725 .gpio0 = 0x97e9,
726 }}, 726 }},
727 .dvb = 1, 727 .dvb = 1,
728 }, 728 },
729 [CX88_BOARD_ADSTECH_DVB_T_PCI] = { 729 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
730 .name = "ADS Tech Instant TV DVB-T PCI", 730 .name = "ADS Tech Instant TV DVB-T PCI",
731 .tuner_type = TUNER_ABSENT, 731 .tuner_type = TUNER_ABSENT,
732 .radio_type = UNSET, 732 .radio_type = UNSET,
733 .tuner_addr = ADDR_UNSET, 733 .tuner_addr = ADDR_UNSET,
734 .radio_addr = ADDR_UNSET, 734 .radio_addr = ADDR_UNSET,
735 .input = {{ 735 .input = {{
736 .type = CX88_VMUX_COMPOSITE1, 736 .type = CX88_VMUX_COMPOSITE1,
737 .vmux = 1, 737 .vmux = 1,
738 .gpio0 = 0x0700, 738 .gpio0 = 0x0700,
739 .gpio2 = 0x0101, 739 .gpio2 = 0x0101,
740 },{ 740 },{
741 .type = CX88_VMUX_SVIDEO, 741 .type = CX88_VMUX_SVIDEO,
742 .vmux = 2, 742 .vmux = 2,
743 .gpio0 = 0x0700, 743 .gpio0 = 0x0700,
744 .gpio2 = 0x0101, 744 .gpio2 = 0x0101,
745 }}, 745 }},
746 .dvb = 1, 746 .dvb = 1,
747 }, 747 },
748 [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = { 748 [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
@@ -762,18 +762,18 @@ struct cx88_board cx88_boards[] = {
762 .radio_addr = ADDR_UNSET, 762 .radio_addr = ADDR_UNSET,
763 .tda9887_conf = TDA9887_PRESENT, 763 .tda9887_conf = TDA9887_PRESENT,
764 .input = {{ 764 .input = {{
765 .type = CX88_VMUX_TELEVISION, 765 .type = CX88_VMUX_TELEVISION,
766 .vmux = 0, 766 .vmux = 0,
767 .gpio0 = 0x87fd, 767 .gpio0 = 0x87fd,
768 },{ 768 },{
769 .type = CX88_VMUX_COMPOSITE1, 769 .type = CX88_VMUX_COMPOSITE1,
770 .vmux = 1, 770 .vmux = 1,
771 .gpio0 = 0x87f9, 771 .gpio0 = 0x87f9,
772 },{ 772 },{
773 .type = CX88_VMUX_SVIDEO, 773 .type = CX88_VMUX_SVIDEO,
774 .vmux = 2, 774 .vmux = 2,
775 .gpio0 = 0x87f9, 775 .gpio0 = 0x87f9,
776 }}, 776 }},
777 .dvb = 1, 777 .dvb = 1,
778 }, 778 },
779 [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = { 779 [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
@@ -805,23 +805,23 @@ struct cx88_board cx88_boards[] = {
805 }, 805 },
806 [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = { 806 [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = {
807 /* Alexander Wold <awold@bigfoot.com> */ 807 /* Alexander Wold <awold@bigfoot.com> */
808 .name = "Kworld V-Stream Xpert DVD", 808 .name = "Kworld V-Stream Xpert DVD",
809 .tuner_type = UNSET, 809 .tuner_type = UNSET,
810 .input = {{ 810 .input = {{
811 .type = CX88_VMUX_COMPOSITE1, 811 .type = CX88_VMUX_COMPOSITE1,
812 .vmux = 1, 812 .vmux = 1,
813 .gpio0 = 0x03000000, 813 .gpio0 = 0x03000000,
814 .gpio1 = 0x01000000,
815 .gpio2 = 0x02000000,
816 .gpio3 = 0x00100000,
817 },{
818 .type = CX88_VMUX_SVIDEO,
819 .vmux = 2,
820 .gpio0 = 0x03000000,
821 .gpio1 = 0x01000000, 814 .gpio1 = 0x01000000,
822 .gpio2 = 0x02000000, 815 .gpio2 = 0x02000000,
823 .gpio3 = 0x00100000, 816 .gpio3 = 0x00100000,
824 }}, 817 },{
818 .type = CX88_VMUX_SVIDEO,
819 .vmux = 2,
820 .gpio0 = 0x03000000,
821 .gpio1 = 0x01000000,
822 .gpio2 = 0x02000000,
823 .gpio3 = 0x00100000,
824 }},
825 }, 825 },
826 [CX88_BOARD_ATI_HDTVWONDER] = { 826 [CX88_BOARD_ATI_HDTVWONDER] = {
827 .name = "ATI HDTV Wonder", 827 .name = "ATI HDTV Wonder",
@@ -892,26 +892,26 @@ struct cx88_subid cx88_subids[] = {
892 .subdevice = 0x00f8, 892 .subdevice = 0x00f8,
893 .card = CX88_BOARD_ATI_WONDER_PRO, 893 .card = CX88_BOARD_ATI_WONDER_PRO,
894 },{ 894 },{
895 .subvendor = 0x107d, 895 .subvendor = 0x107d,
896 .subdevice = 0x6611, 896 .subdevice = 0x6611,
897 .card = CX88_BOARD_WINFAST2000XP_EXPERT, 897 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
898 },{
899 .subvendor = 0x107d,
900 .subdevice = 0x6613, /* NTSC */
901 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
902 },{
903 .subvendor = 0x107d,
904 .subdevice = 0x6620,
905 .card = CX88_BOARD_WINFAST_DV2000,
898 },{ 906 },{
899 .subvendor = 0x107d, 907 .subvendor = 0x107d,
900 .subdevice = 0x6613, /* NTSC */ 908 .subdevice = 0x663b,
901 .card = CX88_BOARD_WINFAST2000XP_EXPERT, 909 .card = CX88_BOARD_LEADTEK_PVR2000,
902 },{ 910 },{
903 .subvendor = 0x107d, 911 .subvendor = 0x107d,
904 .subdevice = 0x6620, 912 .subdevice = 0x663C,
905 .card = CX88_BOARD_WINFAST_DV2000, 913 .card = CX88_BOARD_LEADTEK_PVR2000,
906 },{ 914 },{
907 .subvendor = 0x107d,
908 .subdevice = 0x663b,
909 .card = CX88_BOARD_LEADTEK_PVR2000,
910 },{
911 .subvendor = 0x107d,
912 .subdevice = 0x663C,
913 .card = CX88_BOARD_LEADTEK_PVR2000,
914 },{
915 .subvendor = 0x1461, 915 .subvendor = 0x1461,
916 .subdevice = 0x000b, 916 .subdevice = 0x000b,
917 .card = CX88_BOARD_AVERTV_303, 917 .card = CX88_BOARD_AVERTV_303,
@@ -920,13 +920,13 @@ struct cx88_subid cx88_subids[] = {
920 .subdevice = 0x8606, 920 .subdevice = 0x8606,
921 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER, 921 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
922 },{ 922 },{
923 .subvendor = 0x10fc, 923 .subvendor = 0x10fc,
924 .subdevice = 0xd003, 924 .subdevice = 0xd003,
925 .card = CX88_BOARD_IODATA_GVVCP3PCI, 925 .card = CX88_BOARD_IODATA_GVVCP3PCI,
926 },{ 926 },{
927 .subvendor = 0x1043, 927 .subvendor = 0x1043,
928 .subdevice = 0x4823, /* with mpeg encoder */ 928 .subdevice = 0x4823, /* with mpeg encoder */
929 .card = CX88_BOARD_ASUS_PVR_416, 929 .card = CX88_BOARD_ASUS_PVR_416,
930 },{ 930 },{
931 .subvendor = 0x17de, 931 .subvendor = 0x17de,
932 .subdevice = 0x08a6, 932 .subdevice = 0x08a6,
@@ -943,15 +943,15 @@ struct cx88_subid cx88_subids[] = {
943 .subvendor = 0x18ac, 943 .subvendor = 0x18ac,
944 .subdevice = 0xdb00, 944 .subdevice = 0xdb00,
945 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1, 945 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
946 },{ 946 },{
947 .subvendor = 0x0070, 947 .subvendor = 0x0070,
948 .subdevice = 0x9002, 948 .subdevice = 0x9002,
949 .card = CX88_BOARD_HAUPPAUGE_DVB_T1, 949 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
950 },{ 950 },{
951 .subvendor = 0x14f1, 951 .subvendor = 0x14f1,
952 .subdevice = 0x0187, 952 .subdevice = 0x0187,
953 .card = CX88_BOARD_CONEXANT_DVB_T1, 953 .card = CX88_BOARD_CONEXANT_DVB_T1,
954 },{ 954 },{
955 .subvendor = 0x1540, 955 .subvendor = 0x1540,
956 .subdevice = 0x2580, 956 .subdevice = 0x2580,
957 .card = CX88_BOARD_PROVIDEO_PV259, 957 .card = CX88_BOARD_PROVIDEO_PV259,
@@ -960,9 +960,9 @@ struct cx88_subid cx88_subids[] = {
960 .subdevice = 0xdb10, 960 .subdevice = 0xdb10,
961 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS, 961 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
962 },{ 962 },{
963 .subvendor = 0x1554, 963 .subvendor = 0x1554,
964 .subdevice = 0x4811, 964 .subdevice = 0x4811,
965 .card = CX88_BOARD_PIXELVIEW, 965 .card = CX88_BOARD_PIXELVIEW,
966 },{ 966 },{
967 .subvendor = 0x7063, 967 .subvendor = 0x7063,
968 .subdevice = 0x3000, /* HD-3000 card */ 968 .subdevice = 0x3000, /* HD-3000 card */
@@ -987,23 +987,23 @@ struct cx88_subid cx88_subids[] = {
987 .subvendor = 0x1421, 987 .subvendor = 0x1421,
988 .subdevice = 0x0334, 988 .subdevice = 0x0334,
989 .card = CX88_BOARD_ADSTECH_DVB_T_PCI, 989 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
990 },{ 990 },{
991 .subvendor = 0x153b, 991 .subvendor = 0x153b,
992 .subdevice = 0x1166, 992 .subdevice = 0x1166,
993 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, 993 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
994 },{ 994 },{
995 .subvendor = 0x18ac, 995 .subvendor = 0x18ac,
996 .subdevice = 0xd500, 996 .subdevice = 0xd500,
997 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD, 997 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
998 },{ 998 },{
999 .subvendor = 0x1461, 999 .subvendor = 0x1461,
1000 .subdevice = 0x8011, 1000 .subdevice = 0x8011,
1001 .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550, 1001 .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550,
1002 },{ 1002 },{
1003 .subvendor = PCI_VENDOR_ID_ATI, 1003 .subvendor = PCI_VENDOR_ID_ATI,
1004 .subdevice = 0xa101, 1004 .subdevice = 0xa101,
1005 .card = CX88_BOARD_ATI_HDTVWONDER, 1005 .card = CX88_BOARD_ATI_HDTVWONDER,
1006 },{ 1006 },{
1007 .subvendor = 0x107d, 1007 .subvendor = 0x107d,
1008 .subdevice = 0x665f, 1008 .subdevice = 0x665f,
1009 .card = CX88_BOARD_WINFAST_DTV1000, 1009 .card = CX88_BOARD_WINFAST_DTV1000,
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index d4d39c1751a..f01a631d0c0 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,
153 } 153 }
154 if (bpl <= sg_dma_len(sg)-offset) { 154 if (bpl <= sg_dma_len(sg)-offset) {
155 /* fits into current chunk */ 155 /* fits into current chunk */
156 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|RISC_EOL|bpl); 156 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|RISC_EOL|bpl);
157 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); 157 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
158 offset+=bpl; 158 offset+=bpl;
159 } else { 159 } else {
160 /* scanline needs to be splitted */ 160 /* scanline needs to be splitted */
161 todo = bpl; 161 todo = bpl;
162 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL| 162 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|
163 (sg_dma_len(sg)-offset)); 163 (sg_dma_len(sg)-offset));
164 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); 164 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
165 todo -= (sg_dma_len(sg)-offset); 165 todo -= (sg_dma_len(sg)-offset);
166 offset = 0; 166 offset = 0;
167 sg++; 167 sg++;
168 while (todo > sg_dma_len(sg)) { 168 while (todo > sg_dma_len(sg)) {
169 *(rp++)=cpu_to_le32(RISC_WRITE| 169 *(rp++)=cpu_to_le32(RISC_WRITE|
170 sg_dma_len(sg)); 170 sg_dma_len(sg));
171 *(rp++)=cpu_to_le32(sg_dma_address(sg)); 171 *(rp++)=cpu_to_le32(sg_dma_address(sg));
172 todo -= sg_dma_len(sg); 172 todo -= sg_dma_len(sg);
173 sg++; 173 sg++;
174 } 174 }
175 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo); 175 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
176 *(rp++)=cpu_to_le32(sg_dma_address(sg)); 176 *(rp++)=cpu_to_le32(sg_dma_address(sg));
177 offset += todo; 177 offset += todo;
178 } 178 }
@@ -309,7 +309,7 @@ struct sram_channel cx88_sram_channels[] = {
309 .name = "video y / packed", 309 .name = "video y / packed",
310 .cmds_start = 0x180040, 310 .cmds_start = 0x180040,
311 .ctrl_start = 0x180400, 311 .ctrl_start = 0x180400,
312 .cdt = 0x180400 + 64, 312 .cdt = 0x180400 + 64,
313 .fifo_start = 0x180c00, 313 .fifo_start = 0x180c00,
314 .fifo_size = 0x002800, 314 .fifo_size = 0x002800,
315 .ptr1_reg = MO_DMA21_PTR1, 315 .ptr1_reg = MO_DMA21_PTR1,
@@ -321,7 +321,7 @@ struct sram_channel cx88_sram_channels[] = {
321 .name = "video u", 321 .name = "video u",
322 .cmds_start = 0x180080, 322 .cmds_start = 0x180080,
323 .ctrl_start = 0x1804a0, 323 .ctrl_start = 0x1804a0,
324 .cdt = 0x1804a0 + 64, 324 .cdt = 0x1804a0 + 64,
325 .fifo_start = 0x183400, 325 .fifo_start = 0x183400,
326 .fifo_size = 0x000800, 326 .fifo_size = 0x000800,
327 .ptr1_reg = MO_DMA22_PTR1, 327 .ptr1_reg = MO_DMA22_PTR1,
@@ -333,7 +333,7 @@ struct sram_channel cx88_sram_channels[] = {
333 .name = "video v", 333 .name = "video v",
334 .cmds_start = 0x1800c0, 334 .cmds_start = 0x1800c0,
335 .ctrl_start = 0x180540, 335 .ctrl_start = 0x180540,
336 .cdt = 0x180540 + 64, 336 .cdt = 0x180540 + 64,
337 .fifo_start = 0x183c00, 337 .fifo_start = 0x183c00,
338 .fifo_size = 0x000800, 338 .fifo_size = 0x000800,
339 .ptr1_reg = MO_DMA23_PTR1, 339 .ptr1_reg = MO_DMA23_PTR1,
@@ -345,7 +345,7 @@ struct sram_channel cx88_sram_channels[] = {
345 .name = "vbi", 345 .name = "vbi",
346 .cmds_start = 0x180100, 346 .cmds_start = 0x180100,
347 .ctrl_start = 0x1805e0, 347 .ctrl_start = 0x1805e0,
348 .cdt = 0x1805e0 + 64, 348 .cdt = 0x1805e0 + 64,
349 .fifo_start = 0x184400, 349 .fifo_start = 0x184400,
350 .fifo_size = 0x001000, 350 .fifo_size = 0x001000,
351 .ptr1_reg = MO_DMA24_PTR1, 351 .ptr1_reg = MO_DMA24_PTR1,
@@ -357,7 +357,7 @@ struct sram_channel cx88_sram_channels[] = {
357 .name = "audio from", 357 .name = "audio from",
358 .cmds_start = 0x180140, 358 .cmds_start = 0x180140,
359 .ctrl_start = 0x180680, 359 .ctrl_start = 0x180680,
360 .cdt = 0x180680 + 64, 360 .cdt = 0x180680 + 64,
361 .fifo_start = 0x185400, 361 .fifo_start = 0x185400,
362 .fifo_size = 0x000200, 362 .fifo_size = 0x000200,
363 .ptr1_reg = MO_DMA25_PTR1, 363 .ptr1_reg = MO_DMA25_PTR1,
@@ -369,7 +369,7 @@ struct sram_channel cx88_sram_channels[] = {
369 .name = "audio to", 369 .name = "audio to",
370 .cmds_start = 0x180180, 370 .cmds_start = 0x180180,
371 .ctrl_start = 0x180720, 371 .ctrl_start = 0x180720,
372 .cdt = 0x180680 + 64, /* same as audio IN */ 372 .cdt = 0x180680 + 64, /* same as audio IN */
373 .fifo_start = 0x185400, /* same as audio IN */ 373 .fifo_start = 0x185400, /* same as audio IN */
374 .fifo_size = 0x000200, /* same as audio IN */ 374 .fifo_size = 0x000200, /* same as audio IN */
375 .ptr1_reg = MO_DMA26_PTR1, 375 .ptr1_reg = MO_DMA26_PTR1,
@@ -1137,7 +1137,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1137 if (!core->radio_addr) 1137 if (!core->radio_addr)
1138 core->radio_addr = cx88_boards[core->board].radio_addr; 1138 core->radio_addr = cx88_boards[core->board].radio_addr;
1139 1139
1140 printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n", 1140 printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n",
1141 core->tuner_type, core->tuner_addr<<1, 1141 core->tuner_type, core->tuner_addr<<1,
1142 core->radio_type, core->radio_addr<<1); 1142 core->radio_type, core->radio_addr<<1);
1143 1143
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 579de88e308..3be601cfc99 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)
128 static u8 reset [] = { 0x50, 0x80 }; 128 static u8 reset [] = { 0x50, 0x80 };
129 static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 }; 129 static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 };
130 static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF, 130 static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF,
131 0x00, 0xFF, 0x00, 0x40, 0x40 }; 131 0x00, 0xFF, 0x00, 0x40, 0x40 };
132 static u8 dntv_extra[] = { 0xB5, 0x7A }; 132 static u8 dntv_extra[] = { 0xB5, 0x7A };
133 static u8 capt_range_cfg[] = { 0x75, 0x32 }; 133 static u8 capt_range_cfg[] = { 0x75, 0x32 };
134 134
@@ -464,7 +464,7 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
464 464
465static void __devexit dvb_remove(struct pci_dev *pci_dev) 465static void __devexit dvb_remove(struct pci_dev *pci_dev)
466{ 466{
467 struct cx8802_dev *dev = pci_get_drvdata(pci_dev); 467 struct cx8802_dev *dev = pci_get_drvdata(pci_dev);
468 468
469 /* dvb */ 469 /* dvb */
470 videobuf_dvb_unregister(&dev->dvb); 470 videobuf_dvb_unregister(&dev->dvb);
@@ -479,8 +479,8 @@ static struct pci_device_id cx8802_pci_tbl[] = {
479 { 479 {
480 .vendor = 0x14f1, 480 .vendor = 0x14f1,
481 .device = 0x8802, 481 .device = 0x8802,
482 .subvendor = PCI_ANY_ID, 482 .subvendor = PCI_ANY_ID,
483 .subdevice = PCI_ANY_ID, 483 .subdevice = PCI_ANY_ID,
484 },{ 484 },{
485 /* --- end of list --- */ 485 /* --- end of list --- */
486 } 486 }
@@ -488,10 +488,10 @@ static struct pci_device_id cx8802_pci_tbl[] = {
488MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl); 488MODULE_DEVICE_TABLE(pci, cx8802_pci_tbl);
489 489
490static struct pci_driver dvb_pci_driver = { 490static struct pci_driver dvb_pci_driver = {
491 .name = "cx88-dvb", 491 .name = "cx88-dvb",
492 .id_table = cx8802_pci_tbl, 492 .id_table = cx8802_pci_tbl,
493 .probe = dvb_probe, 493 .probe = dvb_probe,
494 .remove = __devexit_p(dvb_remove), 494 .remove = __devexit_p(dvb_remove),
495 .suspend = cx8802_suspend_common, 495 .suspend = cx8802_suspend_common,
496 .resume = cx8802_resume_common, 496 .resume = cx8802_resume_common,
497}; 497};
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 761cebd40db..9790d412f19 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -3,7 +3,7 @@
3 cx88-i2c.c -- all the i2c code is here 3 cx88-i2c.c -- all the i2c code is here
4 4
5 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 5 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
6 & Marcus Metzler (mocm@thp.uni-koeln.de) 6 & Marcus Metzler (mocm@thp.uni-koeln.de)
7 (c) 2002 Yurij Sysoev <yurij@naturesoft.net> 7 (c) 2002 Yurij Sysoev <yurij@naturesoft.net>
8 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> 8 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
9 9
@@ -90,7 +90,7 @@ static int cx8800_bit_getsda(void *data)
90 90
91static int attach_inform(struct i2c_client *client) 91static int attach_inform(struct i2c_client *client)
92{ 92{
93 struct tuner_setup tun_setup; 93 struct tuner_setup tun_setup;
94 struct cx88_core *core = i2c_get_adapdata(client->adapter); 94 struct cx88_core *core = i2c_get_adapdata(client->adapter);
95 95
96 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", 96 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
@@ -98,7 +98,7 @@ static int attach_inform(struct i2c_client *client)
98 if (!client->driver->command) 98 if (!client->driver->command)
99 return 0; 99 return 0;
100 100
101 if (core->radio_type != UNSET) { 101 if (core->radio_type != UNSET) {
102 if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) { 102 if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
103 tun_setup.mode_mask = T_RADIO; 103 tun_setup.mode_mask = T_RADIO;
104 tun_setup.type = core->radio_type; 104 tun_setup.type = core->radio_type;
@@ -106,8 +106,8 @@ static int attach_inform(struct i2c_client *client)
106 106
107 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup); 107 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
108 } 108 }
109 } 109 }
110 if (core->tuner_type != UNSET) { 110 if (core->tuner_type != UNSET) {
111 if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) { 111 if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
112 112
113 tun_setup.mode_mask = T_ANALOG_TV; 113 tun_setup.mode_mask = T_ANALOG_TV;
@@ -116,7 +116,7 @@ static int attach_inform(struct i2c_client *client)
116 116
117 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup); 117 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
118 } 118 }
119 } 119 }
120 120
121 if (core->tda9887_conf) 121 if (core->tda9887_conf)
122 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); 122 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf);
@@ -159,7 +159,7 @@ static struct i2c_adapter cx8800_i2c_adap_template = {
159}; 159};
160 160
161static struct i2c_client cx8800_i2c_client_template = { 161static struct i2c_client cx8800_i2c_client_template = {
162 .name = "cx88xx internal", 162 .name = "cx88xx internal",
163}; 163};
164 164
165static char *i2c_devs[128] = { 165static char *i2c_devs[128] = {
@@ -202,10 +202,10 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
202 202
203 core->i2c_adap.dev.parent = &pci->dev; 203 core->i2c_adap.dev.parent = &pci->dev;
204 strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); 204 strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name));
205 core->i2c_algo.data = core; 205 core->i2c_algo.data = core;
206 i2c_set_adapdata(&core->i2c_adap,core); 206 i2c_set_adapdata(&core->i2c_adap,core);
207 core->i2c_adap.algo_data = &core->i2c_algo; 207 core->i2c_adap.algo_data = &core->i2c_algo;
208 core->i2c_client.adapter = &core->i2c_adap; 208 core->i2c_client.adapter = &core->i2c_adap;
209 209
210 cx8800_bit_setscl(core,1); 210 cx8800_bit_setscl(core,1);
211 cx8800_bit_setsda(core,1); 211 cx8800_bit_setsda(core,1);
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index c27fe4c36f6..38b12ebaa49 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)
553 553
554 if ((ircode & 0xffff) != 0xeb04) { /* wrong address */ 554 if ((ircode & 0xffff) != 0xeb04) { /* wrong address */
555 ir_dprintk("pulse distance decoded wrong address\n"); 555 ir_dprintk("pulse distance decoded wrong address\n");
556 break; 556 break;
557 } 557 }
558 558
559 if (((~ircode >> 24) & 0xff) != ((ircode >> 16) & 0xff)) { /* wrong checksum */ 559 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 2c4fbe9258d..35e6d0c2b87 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)
316 spin_unlock(&dev->slock); 316 spin_unlock(&dev->slock);
317 } 317 }
318 318
319 /* other general errors */ 319 /* other general errors */
320 if (status & 0x1f0100) { 320 if (status & 0x1f0100) {
321 dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 ); 321 dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 );
322 spin_lock(&dev->slock); 322 spin_lock(&dev->slock);
323 cx8802_stop_dma(dev); 323 cx8802_stop_dma(dev);
324 cx8802_restart_queue(dev,&dev->mpegq); 324 cx8802_restart_queue(dev,&dev->mpegq);
325 spin_unlock(&dev->slock); 325 spin_unlock(&dev->slock);
326 } 326 }
327} 327}
328 328
329#define MAX_IRQ_LOOP 10 329#define MAX_IRQ_LOOP 10
@@ -379,8 +379,8 @@ int cx8802_init_common(struct cx8802_dev *dev)
379 } 379 }
380 380
381 pci_read_config_byte(dev->pci, PCI_CLASS_REVISION, &dev->pci_rev); 381 pci_read_config_byte(dev->pci, PCI_CLASS_REVISION, &dev->pci_rev);
382 pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); 382 pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat);
383 printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, " 383 printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, "
384 "latency: %d, mmio: 0x%lx\n", dev->core->name, 384 "latency: %d, mmio: 0x%lx\n", dev->core->name,
385 pci_name(dev->pci), dev->pci_rev, dev->pci->irq, 385 pci_name(dev->pci), dev->pci_rev, dev->pci->irq,
386 dev->pci_lat,pci_resource_start(dev->pci,0)); 386 dev->pci_lat,pci_resource_start(dev->pci,0));
@@ -430,7 +430,7 @@ void cx8802_fini_common(struct cx8802_dev *dev)
430 430
431int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state) 431int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state)
432{ 432{
433 struct cx8802_dev *dev = pci_get_drvdata(pci_dev); 433 struct cx8802_dev *dev = pci_get_drvdata(pci_dev);
434 struct cx88_core *core = dev->core; 434 struct cx88_core *core = dev->core;
435 435
436 /* stop mpeg dma */ 436 /* stop mpeg dma */
diff --git a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h
index 0a3a62fc9bb..d3bf5b17b1d 100644
--- a/drivers/media/video/cx88/cx88-reg.h
+++ b/drivers/media/video/cx88/cx88-reg.h
@@ -3,9 +3,9 @@
3 cx88x-hw.h - CX2388x register offsets 3 cx88x-hw.h - CX2388x register offsets
4 4
5 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 5 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
6 2001 Michael Eskin 6 2001 Michael Eskin
7 2002 Yurij Sysoev <yurij@naturesoft.net> 7 2002 Yurij Sysoev <yurij@naturesoft.net>
8 2003 Gerd Knorr <kraxel@bytesex.org> 8 2003 Gerd Knorr <kraxel@bytesex.org>
9 9
10 This program is free software; you can redistribute it and/or modify 10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by 11 it under the terms of the GNU General Public License as published by
@@ -728,13 +728,13 @@
728#define ColorFormatGamma 0x1000 728#define ColorFormatGamma 0x1000
729 729
730#define Interlaced 0x1 730#define Interlaced 0x1
731#define NonInterlaced 0x0 731#define NonInterlaced 0x0
732 732
733#define FieldEven 0x1 733#define FieldEven 0x1
734#define FieldOdd 0x0 734#define FieldOdd 0x0
735 735
736#define TGReadWriteMode 0x0 736#define TGReadWriteMode 0x0
737#define TGEnableMode 0x1 737#define TGEnableMode 0x1
738 738
739#define DV_CbAlign 0x0 739#define DV_CbAlign 0x0
740#define DV_Y0Align 0x1 740#define DV_Y0Align 0x1
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 4c99fc39bb2..f22ccb65de1 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[] = {
100 .id = V4L2_STD_PAL_I, 100 .id = V4L2_STD_PAL_I,
101 .cxiformat = VideoFormatPAL, 101 .cxiformat = VideoFormatPAL,
102 .cxoformat = 0x181f0008, 102 .cxoformat = 0x181f0008,
103 },{ 103 },{
104 .name = "PAL-M", 104 .name = "PAL-M",
105 .id = V4L2_STD_PAL_M, 105 .id = V4L2_STD_PAL_M,
106 .cxiformat = VideoFormatPALM, 106 .cxiformat = VideoFormatPALM,
@@ -470,7 +470,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
470 struct list_head *item; 470 struct list_head *item;
471 471
472 if (!list_empty(&q->active)) { 472 if (!list_empty(&q->active)) {
473 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 473 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
474 dprintk(2,"restart_queue [%p/%d]: restart dma\n", 474 dprintk(2,"restart_queue [%p/%d]: restart dma\n",
475 buf, buf->vb.i); 475 buf, buf->vb.i);
476 start_video_dma(dev, q, buf); 476 start_video_dma(dev, q, buf);
@@ -486,7 +486,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
486 for (;;) { 486 for (;;) {
487 if (list_empty(&q->queued)) 487 if (list_empty(&q->queued))
488 return 0; 488 return 0;
489 buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); 489 buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
490 if (NULL == prev) { 490 if (NULL == prev) {
491 list_del(&buf->vb.queue); 491 list_del(&buf->vb.queue);
492 list_add_tail(&buf->vb.queue,&q->active); 492 list_add_tail(&buf->vb.queue,&q->active);
@@ -783,7 +783,7 @@ static int video_open(struct inode *inode, struct file *file)
783 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); 783 cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL);
784 } 784 }
785 785
786 return 0; 786 return 0;
787} 787}
788 788
789static ssize_t 789static ssize_t
@@ -922,7 +922,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl)
922{ 922{
923 /* struct cx88_core *core = dev->core; */ 923 /* struct cx88_core *core = dev->core; */
924 struct cx88_ctrl *c = NULL; 924 struct cx88_ctrl *c = NULL;
925 u32 v_sat_value; 925 u32 v_sat_value;
926 u32 value; 926 u32 value;
927 int i; 927 int i;
928 928
@@ -1252,7 +1252,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1252} 1252}
1253 1253
1254int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, 1254int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1255 struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl) 1255 struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl)
1256{ 1256{
1257 int err; 1257 int err;
1258 1258
@@ -1399,7 +1399,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1399 1399
1400 cx88_get_stereo(core ,t); 1400 cx88_get_stereo(core ,t);
1401 reg = cx_read(MO_DEVICE_STATUS); 1401 reg = cx_read(MO_DEVICE_STATUS);
1402 t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; 1402 t->signal = (reg & (1<<5)) ? 0xffff : 0x0000;
1403 return 0; 1403 return 0;
1404 } 1404 }
1405 case VIDIOC_S_TUNER: 1405 case VIDIOC_S_TUNER:
@@ -1486,7 +1486,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1486 struct v4l2_capability *cap = arg; 1486 struct v4l2_capability *cap = arg;
1487 1487
1488 memset(cap,0,sizeof(*cap)); 1488 memset(cap,0,sizeof(*cap));
1489 strcpy(cap->driver, "cx8800"); 1489 strcpy(cap->driver, "cx8800");
1490 strlcpy(cap->card, cx88_boards[core->board].name, 1490 strlcpy(cap->card, cx88_boards[core->board].name,
1491 sizeof(cap->card)); 1491 sizeof(cap->card));
1492 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1492 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
@@ -1827,8 +1827,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1827 1827
1828 /* print pci info */ 1828 /* print pci info */
1829 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); 1829 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
1830 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); 1830 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat);
1831 printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " 1831 printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, "
1832 "latency: %d, mmio: 0x%lx\n", core->name, 1832 "latency: %d, mmio: 0x%lx\n", core->name,
1833 pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 1833 pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
1834 dev->pci_lat,pci_resource_start(pci_dev,0)); 1834 dev->pci_lat,pci_resource_start(pci_dev,0));
@@ -1944,7 +1944,7 @@ fail_free:
1944 1944
1945static void __devexit cx8800_finidev(struct pci_dev *pci_dev) 1945static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
1946{ 1946{
1947 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 1947 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
1948 struct cx88_core *core = dev->core; 1948 struct cx88_core *core = dev->core;
1949 1949
1950 /* stop thread */ 1950 /* stop thread */
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index ea5c092a779..baeae1ac992 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -259,8 +259,8 @@ struct cx88_core {
259 /* pci stuff */ 259 /* pci stuff */
260 int pci_bus; 260 int pci_bus;
261 int pci_slot; 261 int pci_slot;
262 u32 __iomem *lmmio; 262 u32 __iomem *lmmio;
263 u8 __iomem *bmmio; 263 u8 __iomem *bmmio;
264 u32 shadow[SHADOW_MAX]; 264 u32 shadow[SHADOW_MAX];
265 int pci_irqmask; 265 int pci_irqmask;
266 266
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 59f8fa0bea6..f0860532575 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2,8 +2,8 @@
2 em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 2 em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
3 3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> 4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it> 5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 7
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> 8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
9 9
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index f7b8fb035c9..227a47d6e4b 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -2,8 +2,8 @@
2 em2820-core.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 2 em2820-core.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
3 3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> 4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it> 5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 7
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> 8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
9 9
@@ -33,32 +33,32 @@
33 33
34/* #define ENABLE_DEBUG_ISOC_FRAMES */ 34/* #define ENABLE_DEBUG_ISOC_FRAMES */
35 35
36unsigned int core_debug = 0; 36unsigned int core_debug;
37module_param(core_debug,int,0644); 37module_param(core_debug,int,0644);
38MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); 38MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
39 39
40#define em2820_coredbg(fmt, arg...) do {\ 40#define em2820_coredbg(fmt, arg...) do {\
41 if (core_debug) \ 41 if (core_debug) \
42 printk(KERN_INFO "%s %s :"fmt, \ 42 printk(KERN_INFO "%s %s :"fmt, \
43 dev->name, __FUNCTION__ , ##arg); } while (0) 43 dev->name, __FUNCTION__ , ##arg); } while (0)
44 44
45unsigned int reg_debug = 0; 45unsigned int reg_debug;
46module_param(reg_debug,int,0644); 46module_param(reg_debug,int,0644);
47MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); 47MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
48 48
49#define em2820_regdbg(fmt, arg...) do {\ 49#define em2820_regdbg(fmt, arg...) do {\
50 if (reg_debug) \ 50 if (reg_debug) \
51 printk(KERN_INFO "%s %s :"fmt, \ 51 printk(KERN_INFO "%s %s :"fmt, \
52 dev->name, __FUNCTION__ , ##arg); } while (0) 52 dev->name, __FUNCTION__ , ##arg); } while (0)
53 53
54unsigned int isoc_debug = 0; 54unsigned int isoc_debug;
55module_param(isoc_debug,int,0644); 55module_param(isoc_debug,int,0644);
56MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); 56MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
57 57
58#define em2820_isocdbg(fmt, arg...) do {\ 58#define em2820_isocdbg(fmt, arg...) do {\
59 if (isoc_debug) \ 59 if (isoc_debug) \
60 printk(KERN_INFO "%s %s :"fmt, \ 60 printk(KERN_INFO "%s %s :"fmt, \
61 dev->name, __FUNCTION__ , ##arg); } while (0) 61 dev->name, __FUNCTION__ , ##arg); } while (0)
62 62
63static int alt = EM2820_PINOUT; 63static int alt = EM2820_PINOUT;
64module_param(alt, int, 0644); 64module_param(alt, int, 0644);
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index f6bfc038777..bfe0d8795b6 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -2,8 +2,8 @@
2 em2820-i2c.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 2 em2820-i2c.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
3 3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> 4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it> 5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 7
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> 8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
9 9
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index ba367a9796e..8681a793a0b 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]");
43/* ---------------------------------------------------------------------- */ 43/* ---------------------------------------------------------------------- */
44 44
45static IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE] = { 45static IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE] = {
46 [ 0x01 ] = KEY_CHANNEL, 46 [ 0x01 ] = KEY_CHANNEL,
47 [ 0x02 ] = KEY_SELECT, 47 [ 0x02 ] = KEY_SELECT,
48 [ 0x03 ] = KEY_MUTE, 48 [ 0x03 ] = KEY_MUTE,
49 [ 0x04 ] = KEY_POWER, 49 [ 0x04 ] = KEY_POWER,
50 [ 0x05 ] = KEY_KP1, 50 [ 0x05 ] = KEY_KP1,
51 [ 0x06 ] = KEY_KP2, 51 [ 0x06 ] = KEY_KP2,
52 [ 0x07 ] = KEY_KP3, 52 [ 0x07 ] = KEY_KP3,
53 [ 0x08 ] = KEY_CHANNELUP, 53 [ 0x08 ] = KEY_CHANNELUP,
54 [ 0x09 ] = KEY_KP4, 54 [ 0x09 ] = KEY_KP4,
55 [ 0x0a ] = KEY_KP5, 55 [ 0x0a ] = KEY_KP5,
56 [ 0x0b ] = KEY_KP6, 56 [ 0x0b ] = KEY_KP6,
57 [ 0x0c ] = KEY_CHANNELDOWN, 57 [ 0x0c ] = KEY_CHANNELDOWN,
58 [ 0x0d ] = KEY_KP7, 58 [ 0x0d ] = KEY_KP7,
59 [ 0x0e ] = KEY_KP8, 59 [ 0x0e ] = KEY_KP8,
60 [ 0x0f ] = KEY_KP9, 60 [ 0x0f ] = KEY_KP9,
61 [ 0x10 ] = KEY_VOLUMEUP, 61 [ 0x10 ] = KEY_VOLUMEUP,
62 [ 0x11 ] = KEY_KP0, 62 [ 0x11 ] = KEY_KP0,
63 [ 0x12 ] = KEY_MENU, 63 [ 0x12 ] = KEY_MENU,
64 [ 0x13 ] = KEY_PRINT, 64 [ 0x13 ] = KEY_PRINT,
65 [ 0x14 ] = KEY_VOLUMEDOWN, 65 [ 0x14 ] = KEY_VOLUMEDOWN,
66 [ 0x16 ] = KEY_PAUSE, 66 [ 0x16 ] = KEY_PAUSE,
67 [ 0x18 ] = KEY_RECORD, 67 [ 0x18 ] = KEY_RECORD,
68 [ 0x19 ] = KEY_REWIND, 68 [ 0x19 ] = KEY_REWIND,
69 [ 0x1a ] = KEY_PLAY, 69 [ 0x1a ] = KEY_PLAY,
70 [ 0x1b ] = KEY_FORWARD, 70 [ 0x1b ] = KEY_FORWARD,
71 [ 0x1c ] = KEY_BACKSPACE, 71 [ 0x1c ] = KEY_BACKSPACE,
72 [ 0x1e ] = KEY_STOP, 72 [ 0x1e ] = KEY_STOP,
73 [ 0x40 ] = KEY_ZOOM, 73 [ 0x40 ] = KEY_ZOOM,
74}; 74};
75 75
76/* ----------------------------------------------------------------------- */ 76/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 048ad1d77ba..e5066d05697 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -2,8 +2,8 @@
2 em2820-video.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 2 em2820-video.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
3 3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> 4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it> 5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 7
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> 8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
9 9
@@ -42,9 +42,9 @@
42#define EM2820_VERSION_CODE KERNEL_VERSION(0, 0, 1) 42#define EM2820_VERSION_CODE KERNEL_VERSION(0, 0, 1)
43 43
44#define em2820_videodbg(fmt, arg...) do {\ 44#define em2820_videodbg(fmt, arg...) do {\
45 if (video_debug) \ 45 if (video_debug) \
46 printk(KERN_INFO "%s %s :"fmt, \ 46 printk(KERN_INFO "%s %s :"fmt, \
47 dev->name, __FUNCTION__ , ##arg); } while (0) 47 dev->name, __FUNCTION__ , ##arg); } while (0)
48 48
49MODULE_AUTHOR(DRIVER_AUTHOR); 49MODULE_AUTHOR(DRIVER_AUTHOR);
50MODULE_DESCRIPTION(DRIVER_DESC); 50MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index a11df04a8c3..c48354062eb 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -2,8 +2,8 @@
2 em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 2 em2820-cards.c - driver for Empia EM2800/EM2820/2840 USB video capture devices
3 3
4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> 4 Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
5 Ludovico Cavedon <cavedon@sssup.it> 5 Ludovico Cavedon <cavedon@sssup.it>
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 7
8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> 8 Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
9 9
@@ -390,17 +390,17 @@ extern const unsigned int em2820_bcount;
390/* printk macros */ 390/* printk macros */
391 391
392#define em2820_err(fmt, arg...) do {\ 392#define em2820_err(fmt, arg...) do {\
393 printk(KERN_ERR fmt , ##arg); } while (0) 393 printk(KERN_ERR fmt , ##arg); } while (0)
394 394
395#define em2820_errdev(fmt, arg...) do {\ 395#define em2820_errdev(fmt, arg...) do {\
396 printk(KERN_ERR "%s: "fmt,\ 396 printk(KERN_ERR "%s: "fmt,\
397 dev->name , ##arg); } while (0) 397 dev->name , ##arg); } while (0)
398 398
399#define em2820_info(fmt, arg...) do {\ 399#define em2820_info(fmt, arg...) do {\
400 printk(KERN_INFO "%s: "fmt,\ 400 printk(KERN_INFO "%s: "fmt,\
401 dev->name , ##arg); } while (0) 401 dev->name , ##arg); } while (0)
402#define em2820_warn(fmt, arg...) do {\ 402#define em2820_warn(fmt, arg...) do {\
403 printk(KERN_WARNING "%s: "fmt,\ 403 printk(KERN_WARNING "%s: "fmt,\
404 dev->name , ##arg); } while (0) 404 dev->name , ##arg); } while (0)
405 405
406inline static int em2820_audio_source(struct em2820 *dev, int input) 406inline 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 cc5973950c0..ed81934ef3c 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)
369 ir->mask_keycode = 0x003e00; 369 ir->mask_keycode = 0x003e00;
370 ir->mask_keyup = 0x010000; 370 ir->mask_keyup = 0x010000;
371 ir->polling = 50; // ms 371 ir->polling = 50; // ms
372 break; 372 break;
373 case BTTV_BOARD_PV_BT878P_9B: 373 case BTTV_BOARD_PV_BT878P_9B:
374 case BTTV_BOARD_PV_BT878P_PLUS: 374 case BTTV_BOARD_PV_BT878P_PLUS:
375 ir_codes = ir_codes_pixelview; 375 ir_codes = ir_codes_pixelview;
376 ir->mask_keycode = 0x001f00; 376 ir->mask_keycode = 0x001f00;
377 ir->mask_keyup = 0x008000; 377 ir->mask_keyup = 0x008000;
378 ir->polling = 50; // ms 378 ir->polling = 50; // ms
379 break; 379 break;
380 380
381 case BTTV_BOARD_WINFAST2000: 381 case BTTV_BOARD_WINFAST2000:
382 ir_codes = ir_codes_winfast; 382 ir_codes = ir_codes_winfast;
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index b0facaa40b2..12f1053137d 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)
163 163
164static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 164static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
165{ 165{
166 unsigned char b; 166 unsigned char b;
167 167
168 /* poll IR chip */ 168 /* poll IR chip */
169 if (1 != i2c_master_recv(&ir->c,&b,1)) { 169 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)
177 177
178static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 178static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
179{ 179{
180 unsigned char b; 180 unsigned char b;
181 181
182 /* poll IR chip */ 182 /* poll IR chip */
183 if (1 != i2c_master_recv(&ir->c,&b,1)) { 183 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)
225 225
226static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 226static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
227{ 227{
228 unsigned char b; 228 unsigned char b;
229 229
230 /* poll IR chip */ 230 /* poll IR chip */
231 if (1 != i2c_master_recv(&ir->c,&b,1)) { 231 if (1 != i2c_master_recv(&ir->c,&b,1)) {
@@ -287,17 +287,17 @@ static int ir_detach(struct i2c_client *client);
287static int ir_probe(struct i2c_adapter *adap); 287static int ir_probe(struct i2c_adapter *adap);
288 288
289static struct i2c_driver driver = { 289static struct i2c_driver driver = {
290 .name = "ir remote kbd driver", 290 .name = "ir remote kbd driver",
291 .id = I2C_DRIVERID_EXP3, /* FIXME */ 291 .id = I2C_DRIVERID_EXP3, /* FIXME */
292 .flags = I2C_DF_NOTIFY, 292 .flags = I2C_DF_NOTIFY,
293 .attach_adapter = ir_probe, 293 .attach_adapter = ir_probe,
294 .detach_client = ir_detach, 294 .detach_client = ir_detach,
295}; 295};
296 296
297static struct i2c_client client_template = 297static struct i2c_client client_template =
298{ 298{
299 .name = "unset", 299 .name = "unset",
300 .driver = &driver 300 .driver = &driver
301}; 301};
302 302
303static int ir_attach(struct i2c_adapter *adap, int addr, 303static int ir_attach(struct i2c_adapter *adap, int addr,
@@ -398,7 +398,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
398 398
399static int ir_detach(struct i2c_client *client) 399static int ir_detach(struct i2c_client *client)
400{ 400{
401 struct IR_i2c *ir = i2c_get_clientdata(client); 401 struct IR_i2c *ir = i2c_get_clientdata(client);
402 402
403 /* kill outstanding polls */ 403 /* kill outstanding polls */
404 del_timer(&ir->timer); 404 del_timer(&ir->timer);
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index 5573f68ce45..699cea2cc64 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)
192 (2 != i2c_transfer(client->adapter,test,2)) ) { 192 (2 != i2c_transfer(client->adapter,test,2)) ) {
193 printk(KERN_ERR "msp3400: chip reset failed\n"); 193 printk(KERN_ERR "msp3400: chip reset failed\n");
194 return -1; 194 return -1;
195 } 195 }
196 return 0; 196 return 0;
197} 197}
198 198
@@ -200,16 +200,16 @@ static int msp3400c_read(struct i2c_client *client, int dev, int addr)
200{ 200{
201 int err,retval; 201 int err,retval;
202 202
203 unsigned char write[3]; 203 unsigned char write[3];
204 unsigned char read[2]; 204 unsigned char read[2];
205 struct i2c_msg msgs[2] = { 205 struct i2c_msg msgs[2] = {
206 { client->addr, 0, 3, write }, 206 { client->addr, 0, 3, write },
207 { client->addr, I2C_M_RD, 2, read } 207 { client->addr, I2C_M_RD, 2, read }
208 }; 208 };
209 209
210 write[0] = dev+1; 210 write[0] = dev+1;
211 write[1] = addr >> 8; 211 write[1] = addr >> 8;
212 write[2] = addr & 0xff; 212 write[2] = addr & 0xff;
213 213
214 for (err = 0; err < 3;) { 214 for (err = 0; err < 3;) {
215 if (2 == i2c_transfer(client->adapter,msgs,2)) 215 if (2 == i2c_transfer(client->adapter,msgs,2))
@@ -236,13 +236,13 @@ static int msp3400c_read(struct i2c_client *client, int dev, int addr)
236static int msp3400c_write(struct i2c_client *client, int dev, int addr, int val) 236static int msp3400c_write(struct i2c_client *client, int dev, int addr, int val)
237{ 237{
238 int err; 238 int err;
239 unsigned char buffer[5]; 239 unsigned char buffer[5];
240 240
241 buffer[0] = dev; 241 buffer[0] = dev;
242 buffer[1] = addr >> 8; 242 buffer[1] = addr >> 8;
243 buffer[2] = addr & 0xff; 243 buffer[2] = addr & 0xff;
244 buffer[3] = val >> 8; 244 buffer[3] = val >> 8;
245 buffer[4] = val & 0xff; 245 buffer[4] = val & 0xff;
246 246
247 dprintk_trace("trace: msp3400c_write(0x%x, 0x%x, 0x%x)\n", dev, addr, 247 dprintk_trace("trace: msp3400c_write(0x%x, 0x%x, 0x%x)\n", dev, addr,
248 val); 248 val);
@@ -812,7 +812,7 @@ static void watch_stereo(struct i2c_client *client)
812 else if (msp->stereo & VIDEO_SOUND_LANG1) 812 else if (msp->stereo & VIDEO_SOUND_LANG1)
813 msp3400c_setstereo(client, V4L2_TUNER_MODE_LANG1); 813 msp3400c_setstereo(client, V4L2_TUNER_MODE_LANG1);
814 else 814 else
815 msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); 815 msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
816 } 816 }
817 817
818 if (once) 818 if (once)
@@ -1512,21 +1512,21 @@ static struct i2c_client client_template =
1512static int msp_attach(struct i2c_adapter *adap, int addr, int kind) 1512static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
1513{ 1513{
1514 struct msp3400c *msp; 1514 struct msp3400c *msp;
1515 struct i2c_client *c; 1515 struct i2c_client *c;
1516 int (*thread_func)(void *data) = NULL; 1516 int (*thread_func)(void *data) = NULL;
1517 int i; 1517 int i;
1518 1518
1519 client_template.adapter = adap; 1519 client_template.adapter = adap;
1520 client_template.addr = addr; 1520 client_template.addr = addr;
1521 1521
1522 if (-1 == msp3400c_reset(&client_template)) { 1522 if (-1 == msp3400c_reset(&client_template)) {
1523 dprintk("msp34xx: no chip found\n"); 1523 dprintk("msp34xx: no chip found\n");
1524 return -1; 1524 return -1;
1525 } 1525 }
1526 1526
1527 if (NULL == (c = kmalloc(sizeof(struct i2c_client),GFP_KERNEL))) 1527 if (NULL == (c = kmalloc(sizeof(struct i2c_client),GFP_KERNEL)))
1528 return -ENOMEM; 1528 return -ENOMEM;
1529 memcpy(c,&client_template,sizeof(struct i2c_client)); 1529 memcpy(c,&client_template,sizeof(struct i2c_client));
1530 if (NULL == (msp = kmalloc(sizeof(struct msp3400c),GFP_KERNEL))) { 1530 if (NULL == (msp = kmalloc(sizeof(struct msp3400c),GFP_KERNEL))) {
1531 kfree(c); 1531 kfree(c);
1532 return -ENOMEM; 1532 return -ENOMEM;
@@ -1618,7 +1618,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
1618 } 1618 }
1619 1619
1620 /* done */ 1620 /* done */
1621 i2c_attach_client(c); 1621 i2c_attach_client(c);
1622 1622
1623 /* update our own array */ 1623 /* update our own array */
1624 for (i = 0; i < MSP3400_MAX; i++) { 1624 for (i = 0; i < MSP3400_MAX; i++) {
@@ -1739,7 +1739,7 @@ static void msp_any_set_audmode(struct i2c_client *client, int audmode)
1739static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) 1739static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
1740{ 1740{
1741 struct msp3400c *msp = i2c_get_clientdata(client); 1741 struct msp3400c *msp = i2c_get_clientdata(client);
1742 __u16 *sarg = arg; 1742 __u16 *sarg = arg;
1743 int scart = 0; 1743 int scart = 0;
1744 1744
1745 switch (cmd) { 1745 switch (cmd) {
@@ -1969,7 +1969,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
1969 } 1969 }
1970 1970
1971 msp_any_detect_stereo(client); 1971 msp_any_detect_stereo(client);
1972 if (msp->audmode == V4L2_TUNER_MODE_STEREO) { 1972 if (msp->audmode == V4L2_TUNER_MODE_STEREO) {
1973 a->capability=V4L2_AUDCAP_STEREO; 1973 a->capability=V4L2_AUDCAP_STEREO;
1974 } 1974 }
1975 1975
@@ -2005,7 +2005,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
2005 msp3400c_set_scart(client,scart,0); 2005 msp3400c_set_scart(client,scart,0);
2006 msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900); 2006 msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900);
2007 } 2007 }
2008 if (sarg->capability==V4L2_AUDCAP_STEREO) { 2008 if (sarg->capability==V4L2_AUDCAP_STEREO) {
2009 msp->audmode = V4L2_TUNER_MODE_STEREO; 2009 msp->audmode = V4L2_TUNER_MODE_STEREO;
2010 } else { 2010 } else {
2011 msp->audmode &= ~V4L2_TUNER_MODE_STEREO; 2011 msp->audmode &= ~V4L2_TUNER_MODE_STEREO;
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 972aa5e0aee..13b61c4dcbf 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,
76 unsigned int xogc) //all in Hz 76 unsigned int xogc) //all in Hz
77{ 77{
78 struct tuner *t = i2c_get_clientdata(c); 78 struct tuner *t = i2c_get_clientdata(c);
79 unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1, 79 unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1,
80 desired_lo2,lo2,lo2n,lo2a,lo2num,lo2freq; 80 desired_lo2,lo2,lo2n,lo2a,lo2num,lo2freq;
81 81
82 fref= 5250 *1000; //5.25MHz 82 fref= 5250 *1000; //5.25MHz
83 desired_lo1=rfin+if1; 83 desired_lo1=rfin+if1;
84 84
85 lo1=(2*(desired_lo1/1000)+(fref/1000)) / (2*fref/1000); 85 lo1=(2*(desired_lo1/1000)+(fref/1000)) / (2*fref/1000);
86 lo1n=lo1/8; 86 lo1n=lo1/8;
87 lo1a=lo1-(lo1n*8); 87 lo1a=lo1-(lo1n*8);
88 88
89 s=rfin/1000/1000+1090; 89 s=rfin/1000/1000+1090;
90 90
91 if(optimize_vco) { 91 if(optimize_vco) {
92 if(s>1890) sel=0; 92 if(s>1890) sel=0;
@@ -96,34 +96,34 @@ static int mt2032_compute_freq(struct i2c_client *c,
96 else sel=4; // >1090 96 else sel=4; // >1090
97 } 97 }
98 else { 98 else {
99 if(s>1790) sel=0; // <1958 99 if(s>1790) sel=0; // <1958
100 else if(s>1617) sel=1; 100 else if(s>1617) sel=1;
101 else if(s>1449) sel=2; 101 else if(s>1449) sel=2;
102 else if(s>1291) sel=3; 102 else if(s>1291) sel=3;
103 else sel=4; // >1090 103 else sel=4; // >1090
104 } 104 }
105 *ret_sel=sel; 105 *ret_sel=sel;
106 106
107 lo1freq=(lo1a+8*lo1n)*fref; 107 lo1freq=(lo1a+8*lo1n)*fref;
108 108
109 tuner_dbg("mt2032: rfin=%d lo1=%d lo1n=%d lo1a=%d sel=%d, lo1freq=%d\n", 109 tuner_dbg("mt2032: rfin=%d lo1=%d lo1n=%d lo1a=%d sel=%d, lo1freq=%d\n",
110 rfin,lo1,lo1n,lo1a,sel,lo1freq); 110 rfin,lo1,lo1n,lo1a,sel,lo1freq);
111 111
112 desired_lo2=lo1freq-rfin-if2; 112 desired_lo2=lo1freq-rfin-if2;
113 lo2=(desired_lo2)/fref; 113 lo2=(desired_lo2)/fref;
114 lo2n=lo2/8; 114 lo2n=lo2/8;
115 lo2a=lo2-(lo2n*8); 115 lo2a=lo2-(lo2n*8);
116 lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith 116 lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith
117 lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000; 117 lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000;
118 118
119 tuner_dbg("mt2032: rfin=%d lo2=%d lo2n=%d lo2a=%d num=%d lo2freq=%d\n", 119 tuner_dbg("mt2032: rfin=%d lo2=%d lo2n=%d lo2a=%d num=%d lo2freq=%d\n",
120 rfin,lo2,lo2n,lo2a,lo2num,lo2freq); 120 rfin,lo2,lo2n,lo2a,lo2num,lo2freq);
121 121
122 if(lo1a<0 || lo1a>7 || lo1n<17 ||lo1n>48 || lo2a<0 ||lo2a >7 ||lo2n<17 || lo2n>30) { 122 if(lo1a<0 || lo1a>7 || lo1n<17 ||lo1n>48 || lo2a<0 ||lo2a >7 ||lo2n<17 || lo2n>30) {
123 tuner_info("mt2032: frequency parameters out of range: %d %d %d %d\n", 123 tuner_info("mt2032: frequency parameters out of range: %d %d %d %d\n",
124 lo1a, lo1n, lo2a,lo2n); 124 lo1a, lo1n, lo2a,lo2n);
125 return(-1); 125 return(-1);
126 } 126 }
127 127
128 mt2032_spurcheck(c, lo1freq, desired_lo2, spectrum_from, spectrum_to); 128 mt2032_spurcheck(c, lo1freq, desired_lo2, spectrum_from, spectrum_to);
129 // should recalculate lo1 (one step up/down) 129 // should recalculate lo1 (one step up/down)
@@ -135,10 +135,10 @@ static int mt2032_compute_freq(struct i2c_client *c,
135 buf[3]=0x0f; //reserved 135 buf[3]=0x0f; //reserved
136 buf[4]=0x1f; 136 buf[4]=0x1f;
137 buf[5]=(lo2n-1) | (lo2a<<5); 137 buf[5]=(lo2n-1) | (lo2a<<5);
138 if(rfin >400*1000*1000) 138 if(rfin >400*1000*1000)
139 buf[6]=0xe4; 139 buf[6]=0xe4;
140 else 140 else
141 buf[6]=0xf4; // set PKEN per rev 1.2 141 buf[6]=0xf4; // set PKEN per rev 1.2
142 buf[7]=8+xogc; 142 buf[7]=8+xogc;
143 buf[8]=0xc3; //reserved 143 buf[8]=0xc3; //reserved
144 buf[9]=0x4e; //reserved 144 buf[9]=0x4e; //reserved
@@ -168,7 +168,7 @@ static int mt2032_check_lo_lock(struct i2c_client *c)
168 tuner_dbg("mt2032: pll wait 1ms for lock (0x%2x)\n",buf[0]); 168 tuner_dbg("mt2032: pll wait 1ms for lock (0x%2x)\n",buf[0]);
169 udelay(1000); 169 udelay(1000);
170 } 170 }
171 return lock; 171 return lock;
172} 172}
173 173
174static int mt2032_optimize_vco(struct i2c_client *c,int sel,int lock) 174static 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)
202 202
203 buf[0]=0x0f; 203 buf[0]=0x0f;
204 buf[1]=sel; 204 buf[1]=sel;
205 i2c_master_send(c,buf,2); 205 i2c_master_send(c,buf,2);
206 lock=mt2032_check_lo_lock(c); 206 lock=mt2032_check_lo_lock(c);
207 return lock; 207 return lock;
208} 208}
@@ -219,23 +219,23 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin,
219 tuner_dbg("mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n", 219 tuner_dbg("mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n",
220 rfin,if1,if2,from,to); 220 rfin,if1,if2,from,to);
221 221
222 buf[0]=0; 222 buf[0]=0;
223 ret=i2c_master_send(c,buf,1); 223 ret=i2c_master_send(c,buf,1);
224 i2c_master_recv(c,buf,21); 224 i2c_master_recv(c,buf,21);
225 225
226 buf[0]=0; 226 buf[0]=0;
227 ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,&buf[1],&sel,t->xogc); 227 ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,&buf[1],&sel,t->xogc);
228 if (ret<0) 228 if (ret<0)
229 return; 229 return;
230 230
231 // send only the relevant registers per Rev. 1.2 231 // send only the relevant registers per Rev. 1.2
232 buf[0]=0; 232 buf[0]=0;
233 ret=i2c_master_send(c,buf,4); 233 ret=i2c_master_send(c,buf,4);
234 buf[5]=5; 234 buf[5]=5;
235 ret=i2c_master_send(c,buf+5,4); 235 ret=i2c_master_send(c,buf+5,4);
236 buf[11]=11; 236 buf[11]=11;
237 ret=i2c_master_send(c,buf+11,3); 237 ret=i2c_master_send(c,buf+11,3);
238 if(ret!=3) 238 if(ret!=3)
239 tuner_warn("i2c i/o error: rc == %d (should be 3)\n",ret); 239 tuner_warn("i2c i/o error: rc == %d (should be 3)\n",ret);
240 240
241 // wait for PLLs to lock (per manual), retry LINT if not. 241 // 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,
253 mdelay(10); 253 mdelay(10);
254 buf[1]=8+t->xogc; 254 buf[1]=8+t->xogc;
255 i2c_master_send(c,buf,2); 255 i2c_master_send(c,buf,2);
256 } 256 }
257 257
258 if (lock!=6) 258 if (lock!=6)
259 tuner_warn("MT2032 Fatal Error: PLLs didn't lock.\n"); 259 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)
284 if2 = 38900*1000; 284 if2 = 38900*1000;
285 } 285 }
286 286
287 mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */, 287 mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */,
288 1090*1000*1000, if2, from, to); 288 1090*1000*1000, if2, from, to);
289} 289}
290 290
@@ -294,7 +294,7 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
294 int if2 = t->radio_if2; 294 int if2 = t->radio_if2;
295 295
296 // per Manual for FM tuning: first if center freq. 1085 MHz 296 // per Manual for FM tuning: first if center freq. 1085 MHz
297 mt2032_set_if_freq(c, freq * 1000 / 16, 297 mt2032_set_if_freq(c, freq * 1000 / 16,
298 1085*1000*1000,if2,if2,if2); 298 1085*1000*1000,if2,if2,if2);
299} 299}
300 300
@@ -302,57 +302,57 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
302static int mt2032_init(struct i2c_client *c) 302static int mt2032_init(struct i2c_client *c)
303{ 303{
304 struct tuner *t = i2c_get_clientdata(c); 304 struct tuner *t = i2c_get_clientdata(c);
305 unsigned char buf[21]; 305 unsigned char buf[21];
306 int ret,xogc,xok=0; 306 int ret,xogc,xok=0;
307 307
308 // Initialize Registers per spec. 308 // Initialize Registers per spec.
309 buf[1]=2; // Index to register 2 309 buf[1]=2; // Index to register 2
310 buf[2]=0xff; 310 buf[2]=0xff;
311 buf[3]=0x0f; 311 buf[3]=0x0f;
312 buf[4]=0x1f; 312 buf[4]=0x1f;
313 ret=i2c_master_send(c,buf+1,4); 313 ret=i2c_master_send(c,buf+1,4);
314 314
315 buf[5]=6; // Index register 6 315 buf[5]=6; // Index register 6
316 buf[6]=0xe4; 316 buf[6]=0xe4;
317 buf[7]=0x8f; 317 buf[7]=0x8f;
318 buf[8]=0xc3; 318 buf[8]=0xc3;
319 buf[9]=0x4e; 319 buf[9]=0x4e;
320 buf[10]=0xec; 320 buf[10]=0xec;
321 ret=i2c_master_send(c,buf+5,6); 321 ret=i2c_master_send(c,buf+5,6);
322 322
323 buf[12]=13; // Index register 13 323 buf[12]=13; // Index register 13
324 buf[13]=0x32; 324 buf[13]=0x32;
325 ret=i2c_master_send(c,buf+12,2); 325 ret=i2c_master_send(c,buf+12,2);
326 326
327 // Adjust XOGC (register 7), wait for XOK 327 // Adjust XOGC (register 7), wait for XOK
328 xogc=7; 328 xogc=7;
329 do { 329 do {
330 tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07);
331 mdelay(10);
332 buf[0]=0x0e;
333 i2c_master_send(c,buf,1);
334 i2c_master_recv(c,buf,1);
335 xok=buf[0]&0x01;
336 tuner_dbg("mt2032: xok = 0x%02x\n",xok);
337 if (xok == 1) break;
338
339 xogc--;
330 tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); 340 tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07);
331 mdelay(10); 341 if (xogc == 3) {
332 buf[0]=0x0e; 342 xogc=4; // min. 4 per spec
333 i2c_master_send(c,buf,1); 343 break;
334 i2c_master_recv(c,buf,1); 344 }
335 xok=buf[0]&0x01; 345 buf[0]=0x07;
336 tuner_dbg("mt2032: xok = 0x%02x\n",xok); 346 buf[1]=0x88 + xogc;
337 if (xok == 1) break; 347 ret=i2c_master_send(c,buf,2);
338 348 if (ret!=2)
339 xogc--;
340 tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07);
341 if (xogc == 3) {
342 xogc=4; // min. 4 per spec
343 break;
344 }
345 buf[0]=0x07;
346 buf[1]=0x88 + xogc;
347 ret=i2c_master_send(c,buf,2);
348 if (ret!=2)
349 tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret); 349 tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret);
350 } while (xok != 1 ); 350 } while (xok != 1 );
351 t->xogc=xogc; 351 t->xogc=xogc;
352 352
353 t->tv_freq = mt2032_set_tv_freq; 353 t->tv_freq = mt2032_set_tv_freq;
354 t->radio_freq = mt2032_set_radio_freq; 354 t->radio_freq = mt2032_set_radio_freq;
355 return(1); 355 return(1);
356} 356}
357 357
358static void mt2050_set_antenna(struct i2c_client *c, unsigned char antenna) 358static 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
426 } 426 }
427 427
428 ret=i2c_master_send(c,buf,6); 428 ret=i2c_master_send(c,buf,6);
429 if (ret!=6) 429 if (ret!=6)
430 tuner_warn("i2c i/o error: rc == %d (should be 6)\n",ret); 430 tuner_warn("i2c i/o error: rc == %d (should be 6)\n",ret);
431} 431}
432 432
@@ -437,11 +437,11 @@ static void mt2050_set_tv_freq(struct i2c_client *c, unsigned int freq)
437 437
438 if (t->std & V4L2_STD_525_60) { 438 if (t->std & V4L2_STD_525_60) {
439 // NTSC 439 // NTSC
440 if2 = 45750*1000; 440 if2 = 45750*1000;
441 } else { 441 } else {
442 // PAL 442 // PAL
443 if2 = 38900*1000; 443 if2 = 38900*1000;
444 } 444 }
445 if (V4L2_TUNER_DIGITAL_TV == t->mode) { 445 if (V4L2_TUNER_DIGITAL_TV == t->mode) {
446 // DVB (pinnacle 300i) 446 // DVB (pinnacle 300i)
447 if2 = 36150*1000; 447 if2 = 36150*1000;
@@ -487,7 +487,7 @@ int microtune_init(struct i2c_client *c)
487{ 487{
488 struct tuner *t = i2c_get_clientdata(c); 488 struct tuner *t = i2c_get_clientdata(c);
489 char *name; 489 char *name;
490 unsigned char buf[21]; 490 unsigned char buf[21];
491 int company_code; 491 int company_code;
492 492
493 memset(buf,0,sizeof(buf)); 493 memset(buf,0,sizeof(buf));
@@ -496,17 +496,17 @@ int microtune_init(struct i2c_client *c)
496 t->standby = NULL; 496 t->standby = NULL;
497 name = "unknown"; 497 name = "unknown";
498 498
499 i2c_master_send(c,buf,1); 499 i2c_master_send(c,buf,1);
500 i2c_master_recv(c,buf,21); 500 i2c_master_recv(c,buf,21);
501 if (tuner_debug) { 501 if (tuner_debug) {
502 int i; 502 int i;
503 tuner_dbg("MT20xx hexdump:"); 503 tuner_dbg("MT20xx hexdump:");
504 for(i=0;i<21;i++) { 504 for(i=0;i<21;i++) {
505 printk(" %02x",buf[i]); 505 printk(" %02x",buf[i]);
506 if(((i+1)%8)==0) printk(" "); 506 if(((i+1)%8)==0) printk(" ");
507 } 507 }
508 printk("\n"); 508 printk("\n");
509 } 509 }
510 company_code = buf[0x11] << 8 | buf[0x12]; 510 company_code = buf[0x11] << 8 | buf[0x12];
511 tuner_info("microtune: companycode=%04x part=%02x rev=%02x\n", 511 tuner_info("microtune: companycode=%04x part=%02x rev=%02x\n",
512 company_code,buf[0x13],buf[0x14]); 512 company_code,buf[0x13],buf[0x14]);
@@ -525,8 +525,8 @@ int microtune_init(struct i2c_client *c)
525 default: 525 default:
526 tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", 526 tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n",
527 name); 527 name);
528 return 0; 528 return 0;
529 } 529 }
530 530
531 strlcpy(c->name, name, sizeof(c->name)); 531 strlcpy(c->name, name, sizeof(c->name));
532 tuner_info("microtune %s found, OK\n",name); 532 tuner_info("microtune %s found, OK\n",name);
diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c
index 37653ee8723..ed16282fca5 100644
--- a/drivers/media/video/saa711x.c
+++ b/drivers/media/video/saa711x.c
@@ -464,8 +464,8 @@ saa7113_command (struct i2c_client *client,
464 464
465/* standard i2c insmod options */ 465/* standard i2c insmod options */
466static unsigned short normal_i2c[] = { 466static unsigned short normal_i2c[] = {
467 I2C_SAA7113>>1, /* saa7113 */ 467 I2C_SAA7113>>1, /* saa7113 */
468 I2C_CLIENT_END 468 I2C_CLIENT_END
469}; 469};
470 470
471I2C_CLIENT_INSMOD; 471I2C_CLIENT_INSMOD;
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
index dac720ea3b0..2bf5cf79eec 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,
169 169
170 /* execute the command */ 170 /* execute the command */
171 switch(command) { 171 switch(command) {
172 case SAA6752HS_COMMAND_RESET: 172 case SAA6752HS_COMMAND_RESET:
173 buf[0] = 0x00; 173 buf[0] = 0x00;
174 break; 174 break;
175 175
176 case SAA6752HS_COMMAND_STOP: 176 case SAA6752HS_COMMAND_STOP:
177 buf[0] = 0x03; 177 buf[0] = 0x03;
178 break; 178 break;
179 179
180 case SAA6752HS_COMMAND_START: 180 case SAA6752HS_COMMAND_START:
181 buf[0] = 0x02; 181 buf[0] = 0x02;
182 break; 182 break;
183 183
184 case SAA6752HS_COMMAND_PAUSE: 184 case SAA6752HS_COMMAND_PAUSE:
185 buf[0] = 0x04; 185 buf[0] = 0x04;
186 break; 186 break;
187 187
188 case SAA6752HS_COMMAND_RECONFIGURE: 188 case SAA6752HS_COMMAND_RECONFIGURE:
189 buf[0] = 0x05; 189 buf[0] = 0x05;
190 break; 190 break;
191 191
192 case SAA6752HS_COMMAND_SLEEP: 192 case SAA6752HS_COMMAND_SLEEP:
193 buf[0] = 0x06; 193 buf[0] = 0x06;
194 break; 194 break;
195 195
196 case SAA6752HS_COMMAND_RECONFIGURE_FORCE: 196 case SAA6752HS_COMMAND_RECONFIGURE_FORCE:
197 buf[0] = 0x07; 197 buf[0] = 0x07;
198 break; 198 break;
199 199
@@ -201,13 +201,13 @@ static int saa6752hs_chip_command(struct i2c_client* client,
201 return -EINVAL; 201 return -EINVAL;
202 } 202 }
203 203
204 /* set it and wait for it to be so */ 204 /* set it and wait for it to be so */
205 i2c_master_send(client, buf, 1); 205 i2c_master_send(client, buf, 1);
206 timeout = jiffies + HZ * 3; 206 timeout = jiffies + HZ * 3;
207 for (;;) { 207 for (;;) {
208 /* get the current status */ 208 /* get the current status */
209 buf[0] = 0x10; 209 buf[0] = 0x10;
210 i2c_master_send(client, buf, 1); 210 i2c_master_send(client, buf, 1);
211 i2c_master_recv(client, buf, 1); 211 i2c_master_recv(client, buf, 1);
212 212
213 if (!(buf[0] & 0x20)) 213 if (!(buf[0] & 0x20))
@@ -223,14 +223,14 @@ static int saa6752hs_chip_command(struct i2c_client* client,
223 /* delay a bit to let encoder settle */ 223 /* delay a bit to let encoder settle */
224 msleep(50); 224 msleep(50);
225 225
226 return status; 226 return status;
227} 227}
228 228
229 229
230static int saa6752hs_set_bitrate(struct i2c_client* client, 230static int saa6752hs_set_bitrate(struct i2c_client* client,
231 struct v4l2_mpeg_compression* params) 231 struct v4l2_mpeg_compression* params)
232{ 232{
233 u8 buf[3]; 233 u8 buf[3];
234 234
235 /* set the bitrate mode */ 235 /* set the bitrate mode */
236 buf[0] = 0x71; 236 buf[0] = 0x71;
@@ -242,31 +242,31 @@ static int saa6752hs_set_bitrate(struct i2c_client* client,
242 /* set the target bitrate */ 242 /* set the target bitrate */
243 buf[0] = 0x80; 243 buf[0] = 0x80;
244 buf[1] = params->vi_bitrate.target >> 8; 244 buf[1] = params->vi_bitrate.target >> 8;
245 buf[2] = params->vi_bitrate.target & 0xff; 245 buf[2] = params->vi_bitrate.target & 0xff;
246 i2c_master_send(client, buf, 3); 246 i2c_master_send(client, buf, 3);
247 247
248 /* set the max bitrate */ 248 /* set the max bitrate */
249 buf[0] = 0x81; 249 buf[0] = 0x81;
250 buf[1] = params->vi_bitrate.max >> 8; 250 buf[1] = params->vi_bitrate.max >> 8;
251 buf[2] = params->vi_bitrate.max & 0xff; 251 buf[2] = params->vi_bitrate.max & 0xff;
252 i2c_master_send(client, buf, 3); 252 i2c_master_send(client, buf, 3);
253 } else { 253 } else {
254 /* set the target bitrate (no max bitrate for CBR) */ 254 /* set the target bitrate (no max bitrate for CBR) */
255 buf[0] = 0x81; 255 buf[0] = 0x81;
256 buf[1] = params->vi_bitrate.target >> 8; 256 buf[1] = params->vi_bitrate.target >> 8;
257 buf[2] = params->vi_bitrate.target & 0xff; 257 buf[2] = params->vi_bitrate.target & 0xff;
258 i2c_master_send(client, buf, 3); 258 i2c_master_send(client, buf, 3);
259 } 259 }
260 260
261 /* set the audio bitrate */ 261 /* set the audio bitrate */
262 buf[0] = 0x94; 262 buf[0] = 0x94;
263 buf[1] = (256 == params->au_bitrate.target) ? 0 : 1; 263 buf[1] = (256 == params->au_bitrate.target) ? 0 : 1;
264 i2c_master_send(client, buf, 2); 264 i2c_master_send(client, buf, 2);
265 265
266 /* set the total bitrate */ 266 /* set the total bitrate */
267 buf[0] = 0xb1; 267 buf[0] = 0xb1;
268 buf[1] = params->st_bitrate.target >> 8; 268 buf[1] = params->st_bitrate.target >> 8;
269 buf[2] = params->st_bitrate.target & 0xff; 269 buf[2] = params->st_bitrate.target & 0xff;
270 i2c_master_send(client, buf, 3); 270 i2c_master_send(client, buf, 3);
271 271
272 return 0; 272 return 0;
@@ -386,8 +386,8 @@ static int saa6752hs_init(struct i2c_client* client)
386 buf[1] = 0x01; 386 buf[1] = 0x01;
387 i2c_master_send(client, buf, 2); 387 i2c_master_send(client, buf, 2);
388 388
389 /* set bitrate */ 389 /* set bitrate */
390 saa6752hs_set_bitrate(client, &h->params); 390 saa6752hs_set_bitrate(client, &h->params);
391 391
392 /* Set GOP structure {3, 13} */ 392 /* Set GOP structure {3, 13} */
393 buf[0] = 0x72; 393 buf[0] = 0x72;
@@ -426,9 +426,9 @@ static int saa6752hs_init(struct i2c_client* client)
426 localPAT[sizeof(PAT) - 1] = crc & 0xFF; 426 localPAT[sizeof(PAT) - 1] = crc & 0xFF;
427 427
428 /* compute PMT */ 428 /* compute PMT */
429 memcpy(localPMT, PMT, sizeof(PMT)); 429 memcpy(localPMT, PMT, sizeof(PMT));
430 localPMT[3] = 0x40 | ((h->params.ts_pid_pmt >> 8) & 0x0f); 430 localPMT[3] = 0x40 | ((h->params.ts_pid_pmt >> 8) & 0x0f);
431 localPMT[4] = h->params.ts_pid_pmt & 0xff; 431 localPMT[4] = h->params.ts_pid_pmt & 0xff;
432 localPMT[15] = 0xE0 | ((h->params.ts_pid_pcr >> 8) & 0x0F); 432 localPMT[15] = 0xE0 | ((h->params.ts_pid_pcr >> 8) & 0x0F);
433 localPMT[16] = h->params.ts_pid_pcr & 0xFF; 433 localPMT[16] = h->params.ts_pid_pcr & 0xFF;
434 localPMT[20] = 0xE0 | ((h->params.ts_pid_video >> 8) & 0x0F); 434 localPMT[20] = 0xE0 | ((h->params.ts_pid_video >> 8) & 0x0F);
@@ -453,7 +453,7 @@ static int saa6752hs_init(struct i2c_client* client)
453 buf[2] = h->params.ts_pid_video & 0xFF; 453 buf[2] = h->params.ts_pid_video & 0xFF;
454 i2c_master_send(client,buf,3); 454 i2c_master_send(client,buf,3);
455 455
456 /* Set PCR PID */ 456 /* Set PCR PID */
457 buf[0] = 0xC4; 457 buf[0] = 0xC4;
458 buf[1] = (h->params.ts_pid_pcr >> 8) & 0xFF; 458 buf[1] = (h->params.ts_pid_pcr >> 8) & 0xFF;
459 buf[2] = h->params.ts_pid_pcr & 0xFF; 459 buf[2] = h->params.ts_pid_pcr & 0xFF;
@@ -467,7 +467,7 @@ static int saa6752hs_init(struct i2c_client* client)
467 buf[0] = 0xa4; 467 buf[0] = 0xa4;
468 buf[1] = 1; 468 buf[1] = 1;
469 i2c_master_send(client, buf, 2); 469 i2c_master_send(client, buf, 2);
470 buf[1] = 0; 470 buf[1] = 0;
471 i2c_master_send(client, buf, 2); 471 i2c_master_send(client, buf, 2);
472 472
473 /* start it going */ 473 /* start it going */
@@ -510,10 +510,10 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
510{ 510{
511 struct saa6752hs_state *h; 511 struct saa6752hs_state *h;
512 512
513 printk("saa6752hs: chip found @ 0x%x\n", addr<<1); 513 printk("saa6752hs: chip found @ 0x%x\n", addr<<1);
514 514
515 if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) 515 if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL)))
516 return -ENOMEM; 516 return -ENOMEM;
517 memset(h,0,sizeof(*h)); 517 memset(h,0,sizeof(*h));
518 h->client = client_template; 518 h->client = client_template;
519 h->params = param_defaults; 519 h->params = param_defaults;
@@ -552,7 +552,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
552 struct v4l2_mpeg_compression *params = arg; 552 struct v4l2_mpeg_compression *params = arg;
553 int err = 0; 553 int err = 0;
554 554
555 switch (cmd) { 555 switch (cmd) {
556 case VIDIOC_S_MPEGCOMP: 556 case VIDIOC_S_MPEGCOMP:
557 if (NULL == params) { 557 if (NULL == params) {
558 /* apply settings and start encoder */ 558 /* apply settings and start encoder */
@@ -566,7 +566,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
566 break; 566 break;
567 case VIDIOC_G_FMT: 567 case VIDIOC_G_FMT:
568 { 568 {
569 struct v4l2_format *f = arg; 569 struct v4l2_format *f = arg;
570 570
571 if (h->video_format == SAA6752HS_VF_UNKNOWN) 571 if (h->video_format == SAA6752HS_VF_UNKNOWN)
572 h->video_format = SAA6752HS_VF_D1; 572 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 465beac941d..e9ffe8f144a 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 {
80 spinlock_t mixer_lock; 80 spinlock_t mixer_lock;
81 int mixer_volume[MIXER_ADDR_LAST+1][2]; 81 int mixer_volume[MIXER_ADDR_LAST+1][2];
82 int capture_source[MIXER_ADDR_LAST+1][2]; 82 int capture_source[MIXER_ADDR_LAST+1][2];
83 struct pci_dev *pci; 83 struct pci_dev *pci;
84 struct saa7134_dev *saadev; 84 struct saa7134_dev *saadev;
85 85
86 unsigned long iobase; 86 unsigned long iobase;
87 int irq; 87 int irq;
88 88
89 spinlock_t lock; 89 spinlock_t lock;
90} snd_card_saa7134_t; 90} snd_card_saa7134_t;
@@ -94,7 +94,7 @@ typedef struct snd_card_saa7134 {
94 */ 94 */
95 95
96typedef struct snd_card_saa7134_pcm { 96typedef struct snd_card_saa7134_pcm {
97 struct saa7134_dev *saadev; 97 struct saa7134_dev *saadev;
98 98
99 spinlock_t lock; 99 spinlock_t lock;
100 unsigned int pcm_size; /* buffer size */ 100 unsigned int pcm_size; /* buffer size */
@@ -118,9 +118,9 @@ static snd_card_t *snd_saa7134_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
118static void saa7134_dma_stop(struct saa7134_dev *dev) 118static void saa7134_dma_stop(struct saa7134_dev *dev)
119 119
120{ 120{
121 dev->oss.dma_blk = -1; 121 dev->oss.dma_blk = -1;
122 dev->oss.dma_running = 0; 122 dev->oss.dma_running = 0;
123 saa7134_set_dmabits(dev); 123 saa7134_set_dmabits(dev);
124} 124}
125 125
126/* 126/*
@@ -135,9 +135,9 @@ static void saa7134_dma_stop(struct saa7134_dev *dev)
135 135
136static void saa7134_dma_start(struct saa7134_dev *dev) 136static void saa7134_dma_start(struct saa7134_dev *dev)
137{ 137{
138 dev->oss.dma_blk = 0; 138 dev->oss.dma_blk = 0;
139 dev->oss.dma_running = 1; 139 dev->oss.dma_running = 1;
140 saa7134_set_dmabits(dev); 140 saa7134_set_dmabits(dev);
141} 141}
142 142
143/* 143/*
@@ -184,28 +184,28 @@ void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status)
184 goto done; 184 goto done;
185 } 185 }
186 186
187 /* next block addr */ 187 /* next block addr */
188 next_blk = (dev->oss.dma_blk + 2) % dev->oss.blocks; 188 next_blk = (dev->oss.dma_blk + 2) % dev->oss.blocks;
189 saa_writel(reg,next_blk * dev->oss.blksize); 189 saa_writel(reg,next_blk * dev->oss.blksize);
190 if (alsa_debug > 2) 190 if (alsa_debug > 2)
191 dprintk("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n", 191 dprintk("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n",
192 (status & 0x10000000) ? "even" : "odd ", next_blk, 192 (status & 0x10000000) ? "even" : "odd ", next_blk,
193 next_blk * dev->oss.blksize, dev->oss.blocks, dev->oss.blksize, dev->oss.read_count); 193 next_blk * dev->oss.blksize, dev->oss.blocks, dev->oss.blksize, dev->oss.read_count);
194 194
195 195
196 /* update status & wake waiting readers */ 196 /* update status & wake waiting readers */
197 dev->oss.dma_blk = (dev->oss.dma_blk + 1) % dev->oss.blocks; 197 dev->oss.dma_blk = (dev->oss.dma_blk + 1) % dev->oss.blocks;
198 dev->oss.read_count += dev->oss.blksize; 198 dev->oss.read_count += dev->oss.blksize;
199 199
200 dev->oss.recording_on = reg; 200 dev->oss.recording_on = reg;
201 201
202 if (dev->oss.read_count >= snd_pcm_lib_period_bytes(dev->oss.substream)) { 202 if (dev->oss.read_count >= snd_pcm_lib_period_bytes(dev->oss.substream)) {
203 spin_unlock(&dev->slock); 203 spin_unlock(&dev->slock);
204 snd_pcm_period_elapsed(dev->oss.substream); 204 snd_pcm_period_elapsed(dev->oss.substream);
205 spin_lock(&dev->slock); 205 spin_lock(&dev->slock);
206 } 206 }
207 done: 207 done:
208 spin_unlock(&dev->slock); 208 spin_unlock(&dev->slock);
209 209
210} 210}
211 211
@@ -239,23 +239,23 @@ static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream,
239 239
240static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) 240static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks)
241{ 241{
242 if (blksize < 0x100) 242 if (blksize < 0x100)
243 blksize = 0x100; 243 blksize = 0x100;
244 if (blksize > 0x10000) 244 if (blksize > 0x10000)
245 blksize = 0x10000; 245 blksize = 0x10000;
246 246
247 if (blocks < 2) 247 if (blocks < 2)
248 blocks = 2; 248 blocks = 2;
249 if ((blksize * blocks) > 1024*1024) 249 if ((blksize * blocks) > 1024*1024)
250 blocks = 1024*1024 / blksize; 250 blocks = 1024*1024 / blksize;
251 251
252 dev->oss.blocks = blocks; 252 dev->oss.blocks = blocks;
253 dev->oss.blksize = blksize; 253 dev->oss.blksize = blksize;
254 dev->oss.bufsize = blksize * blocks; 254 dev->oss.bufsize = blksize * blocks;
255 255
256 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", 256 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n",
257 blocks,blksize,blksize * blocks / 1024); 257 blocks,blksize,blksize * blocks / 1024);
258 return 0; 258 return 0;
259} 259}
260 260
261/* 261/*
@@ -271,16 +271,16 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks)
271 271
272static int dsp_buffer_init(struct saa7134_dev *dev) 272static int dsp_buffer_init(struct saa7134_dev *dev)
273{ 273{
274 int err; 274 int err;
275 275
276 if (!dev->oss.bufsize) 276 if (!dev->oss.bufsize)
277 BUG(); 277 BUG();
278 videobuf_dma_init(&dev->oss.dma); 278 videobuf_dma_init(&dev->oss.dma);
279 err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE, 279 err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE,
280 (dev->oss.bufsize + PAGE_SIZE) >> PAGE_SHIFT); 280 (dev->oss.bufsize + PAGE_SIZE) >> PAGE_SHIFT);
281 if (0 != err) 281 if (0 != err)
282 return err; 282 return err;
283 return 0; 283 return 0;
284} 284}
285 285
286/* 286/*
@@ -298,18 +298,18 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
298static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) 298static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream)
299{ 299{
300 snd_pcm_runtime_t *runtime = substream->runtime; 300 snd_pcm_runtime_t *runtime = substream->runtime;
301 int err, bswap, sign; 301 int err, bswap, sign;
302 u32 fmt, control; 302 u32 fmt, control;
303 unsigned long flags; 303 unsigned long flags;
304 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 304 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
305 struct saa7134_dev *dev; 305 struct saa7134_dev *dev;
306 snd_card_saa7134_pcm_t *saapcm = runtime->private_data; 306 snd_card_saa7134_pcm_t *saapcm = runtime->private_data;
307 unsigned int bps; 307 unsigned int bps;
308 unsigned long size; 308 unsigned long size;
309 unsigned count; 309 unsigned count;
310 310
311 size = snd_pcm_lib_buffer_bytes(substream); 311 size = snd_pcm_lib_buffer_bytes(substream);
312 count = snd_pcm_lib_period_bytes(substream); 312 count = snd_pcm_lib_period_bytes(substream);
313 313
314 saapcm->saadev->oss.substream = substream; 314 saapcm->saadev->oss.substream = substream;
315 bps = runtime->rate * runtime->channels; 315 bps = runtime->rate * runtime->channels;
@@ -324,123 +324,123 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream)
324 324
325 dev=saa7134->saadev; 325 dev=saa7134->saadev;
326 326
327 dsp_buffer_conf(dev,saapcm->pcm_count,(saapcm->pcm_size/saapcm->pcm_count)); 327 dsp_buffer_conf(dev,saapcm->pcm_count,(saapcm->pcm_size/saapcm->pcm_count));
328 328
329 err = dsp_buffer_init(dev); 329 err = dsp_buffer_init(dev);
330 if (0 != err) 330 if (0 != err)
331 goto fail2; 331 goto fail2;
332 332
333 /* prepare buffer */ 333 /* prepare buffer */
334 if (0 != (err = videobuf_dma_pci_map(dev->pci,&dev->oss.dma))) 334 if (0 != (err = videobuf_dma_pci_map(dev->pci,&dev->oss.dma)))
335 return err; 335 return err;
336 if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->oss.pt))) 336 if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->oss.pt)))
337 goto fail1; 337 goto fail1;
338 if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->oss.pt, 338 if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->oss.pt,
339 dev->oss.dma.sglist, 339 dev->oss.dma.sglist,
340 dev->oss.dma.sglen, 340 dev->oss.dma.sglen,
341 0))) 341 0)))
342 goto fail2; 342 goto fail2;
343 343
344 344
345 345
346 switch (runtime->format) { 346 switch (runtime->format) {
347 case SNDRV_PCM_FORMAT_U8: 347 case SNDRV_PCM_FORMAT_U8:
348 case SNDRV_PCM_FORMAT_S8: 348 case SNDRV_PCM_FORMAT_S8:
349 fmt = 0x00; 349 fmt = 0x00;
350 break; 350 break;
351 case SNDRV_PCM_FORMAT_U16_LE: 351 case SNDRV_PCM_FORMAT_U16_LE:
352 case SNDRV_PCM_FORMAT_U16_BE: 352 case SNDRV_PCM_FORMAT_U16_BE:
353 case SNDRV_PCM_FORMAT_S16_LE: 353 case SNDRV_PCM_FORMAT_S16_LE:
354 case SNDRV_PCM_FORMAT_S16_BE: 354 case SNDRV_PCM_FORMAT_S16_BE:
355 fmt = 0x01; 355 fmt = 0x01;
356 break; 356 break;
357 default: 357 default:
358 err = -EINVAL; 358 err = -EINVAL;
359 return 1; 359 return 1;
360 } 360 }
361 361
362 switch (runtime->format) { 362 switch (runtime->format) {
363 case SNDRV_PCM_FORMAT_S8: 363 case SNDRV_PCM_FORMAT_S8:
364 case SNDRV_PCM_FORMAT_S16_LE: 364 case SNDRV_PCM_FORMAT_S16_LE:
365 case SNDRV_PCM_FORMAT_S16_BE: 365 case SNDRV_PCM_FORMAT_S16_BE:
366 sign = 1; 366 sign = 1;
367 break; 367 break;
368 default: 368 default:
369 sign = 0; 369 sign = 0;
370 break; 370 break;
371 } 371 }
372 372
373 switch (runtime->format) { 373 switch (runtime->format) {
374 case SNDRV_PCM_FORMAT_U16_BE: 374 case SNDRV_PCM_FORMAT_U16_BE:
375 case SNDRV_PCM_FORMAT_S16_BE: 375 case SNDRV_PCM_FORMAT_S16_BE:
376 bswap = 1; break; 376 bswap = 1; break;
377 default: 377 default:
378 bswap = 0; break; 378 bswap = 0; break;
379 } 379 }
380 380
381 switch (dev->pci->device) { 381 switch (dev->pci->device) {
382 case PCI_DEVICE_ID_PHILIPS_SAA7134: 382 case PCI_DEVICE_ID_PHILIPS_SAA7134:
383 if (1 == runtime->channels) 383 if (1 == runtime->channels)
384 fmt |= (1 << 3); 384 fmt |= (1 << 3);
385 if (2 == runtime->channels) 385 if (2 == runtime->channels)
386 fmt |= (3 << 3); 386 fmt |= (3 << 3);
387 if (sign) 387 if (sign)
388 fmt |= 0x04; 388 fmt |= 0x04;
389 389
390 fmt |= (MIXER_ADDR_TVTUNER == dev->oss.input) ? 0xc0 : 0x80; 390 fmt |= (MIXER_ADDR_TVTUNER == dev->oss.input) ? 0xc0 : 0x80;
391 saa_writeb(SAA7134_NUM_SAMPLES0, ((dev->oss.blksize - 1) & 0x0000ff)); 391 saa_writeb(SAA7134_NUM_SAMPLES0, ((dev->oss.blksize - 1) & 0x0000ff));
392 saa_writeb(SAA7134_NUM_SAMPLES1, ((dev->oss.blksize - 1) & 0x00ff00) >> 8); 392 saa_writeb(SAA7134_NUM_SAMPLES1, ((dev->oss.blksize - 1) & 0x00ff00) >> 8);
393 saa_writeb(SAA7134_NUM_SAMPLES2, ((dev->oss.blksize - 1) & 0xff0000) >> 16); 393 saa_writeb(SAA7134_NUM_SAMPLES2, ((dev->oss.blksize - 1) & 0xff0000) >> 16);
394 saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt); 394 saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt);
395 395
396 break; 396 break;
397 case PCI_DEVICE_ID_PHILIPS_SAA7133: 397 case PCI_DEVICE_ID_PHILIPS_SAA7133:
398 case PCI_DEVICE_ID_PHILIPS_SAA7135: 398 case PCI_DEVICE_ID_PHILIPS_SAA7135:
399 if (1 == runtime->channels) 399 if (1 == runtime->channels)
400 fmt |= (1 << 4); 400 fmt |= (1 << 4);
401 if (2 == runtime->channels) 401 if (2 == runtime->channels)
402 fmt |= (2 << 4); 402 fmt |= (2 << 4);
403 if (!sign) 403 if (!sign)
404 fmt |= 0x04; 404 fmt |= 0x04;
405 saa_writel(SAA7133_NUM_SAMPLES, dev->oss.blksize -1); 405 saa_writel(SAA7133_NUM_SAMPLES, dev->oss.blksize -1);
406 saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210 | (fmt << 24)); 406 saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210 | (fmt << 24));
407 //saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210); 407 //saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210);
408 break; 408 break;
409 } 409 }
410 410
411 dprintk("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n", 411 dprintk("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n",
412 runtime->format, runtime->channels, fmt, 412 runtime->format, runtime->channels, fmt,
413 bswap ? 'b' : '-'); 413 bswap ? 'b' : '-');
414 /* dma: setup channel 6 (= AUDIO) */ 414 /* dma: setup channel 6 (= AUDIO) */
415 control = SAA7134_RS_CONTROL_BURST_16 | 415 control = SAA7134_RS_CONTROL_BURST_16 |
416 SAA7134_RS_CONTROL_ME | 416 SAA7134_RS_CONTROL_ME |
417 (dev->oss.pt.dma >> 12); 417 (dev->oss.pt.dma >> 12);
418 if (bswap) 418 if (bswap)
419 control |= SAA7134_RS_CONTROL_BSWAP; 419 control |= SAA7134_RS_CONTROL_BSWAP;
420 420
421 /* I should be able to use runtime->dma_addr in the control 421 /* I should be able to use runtime->dma_addr in the control
422 byte, but it doesn't work. So I allocate the DMA using the 422 byte, but it doesn't work. So I allocate the DMA using the
423 V4L functions, and force ALSA to use that as the DMA area */ 423 V4L functions, and force ALSA to use that as the DMA area */
424 424
425 runtime->dma_area = dev->oss.dma.vmalloc; 425 runtime->dma_area = dev->oss.dma.vmalloc;
426 426
427 saa_writel(SAA7134_RS_BA1(6),0); 427 saa_writel(SAA7134_RS_BA1(6),0);
428 saa_writel(SAA7134_RS_BA2(6),dev->oss.blksize); 428 saa_writel(SAA7134_RS_BA2(6),dev->oss.blksize);
429 saa_writel(SAA7134_RS_PITCH(6),0); 429 saa_writel(SAA7134_RS_PITCH(6),0);
430 saa_writel(SAA7134_RS_CONTROL(6),control); 430 saa_writel(SAA7134_RS_CONTROL(6),control);
431 431
432 dev->oss.rate = runtime->rate; 432 dev->oss.rate = runtime->rate;
433 /* start dma */ 433 /* start dma */
434 spin_lock_irqsave(&dev->slock,flags); 434 spin_lock_irqsave(&dev->slock,flags);
435 saa7134_dma_start(dev); 435 saa7134_dma_start(dev);
436 spin_unlock_irqrestore(&dev->slock,flags); 436 spin_unlock_irqrestore(&dev->slock,flags);
437 437
438 return 0; 438 return 0;
439 fail2: 439 fail2:
440 saa7134_pgtable_free(dev->pci,&dev->oss.pt); 440 saa7134_pgtable_free(dev->pci,&dev->oss.pt);
441 fail1: 441 fail1:
442 videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); 442 videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma);
443 return err; 443 return err;
444 444
445 445
446} 446}
@@ -465,10 +465,10 @@ static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t *
465 465
466 466
467 if (dev->oss.read_count) { 467 if (dev->oss.read_count) {
468 dev->oss.read_count -= snd_pcm_lib_period_bytes(substream); 468 dev->oss.read_count -= snd_pcm_lib_period_bytes(substream);
469 dev->oss.read_offset += snd_pcm_lib_period_bytes(substream); 469 dev->oss.read_offset += snd_pcm_lib_period_bytes(substream);
470 if (dev->oss.read_offset == dev->oss.bufsize) 470 if (dev->oss.read_offset == dev->oss.bufsize)
471 dev->oss.read_offset = 0; 471 dev->oss.read_offset = 0;
472 } 472 }
473 473
474 return bytes_to_frames(runtime, dev->oss.read_offset); 474 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 *
480 480
481static snd_pcm_hardware_t snd_card_saa7134_capture = 481static snd_pcm_hardware_t snd_card_saa7134_capture =
482{ 482{
483 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 483 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
484 SNDRV_PCM_INFO_BLOCK_TRANSFER | 484 SNDRV_PCM_INFO_BLOCK_TRANSFER |
485 SNDRV_PCM_INFO_MMAP_VALID), 485 SNDRV_PCM_INFO_MMAP_VALID),
486 .formats = USE_FORMATS, 486 .formats = USE_FORMATS,
487 .rates = USE_RATE, 487 .rates = USE_RATE,
488 .rate_min = USE_RATE_MIN, 488 .rate_min = USE_RATE_MIN,
@@ -550,16 +550,16 @@ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream)
550 550
551static int dsp_buffer_free(struct saa7134_dev *dev) 551static int dsp_buffer_free(struct saa7134_dev *dev)
552{ 552{
553 if (!dev->oss.blksize) 553 if (!dev->oss.blksize)
554 BUG(); 554 BUG();
555 555
556 videobuf_dma_free(&dev->oss.dma); 556 videobuf_dma_free(&dev->oss.dma);
557 557
558 dev->oss.blocks = 0; 558 dev->oss.blocks = 0;
559 dev->oss.blksize = 0; 559 dev->oss.blksize = 0;
560 dev->oss.bufsize = 0; 560 dev->oss.bufsize = 0;
561 561
562 return 0; 562 return 0;
563} 563}
564 564
565/* 565/*
@@ -574,21 +574,21 @@ static int dsp_buffer_free(struct saa7134_dev *dev)
574 574
575static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) 575static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream)
576{ 576{
577 snd_card_saa7134_t *chip = snd_pcm_substream_chip(substream); 577 snd_card_saa7134_t *chip = snd_pcm_substream_chip(substream);
578 struct saa7134_dev *dev = chip->saadev; 578 struct saa7134_dev *dev = chip->saadev;
579 unsigned long flags; 579 unsigned long flags;
580 580
581 /* stop dma */ 581 /* stop dma */
582 spin_lock_irqsave(&dev->slock,flags); 582 spin_lock_irqsave(&dev->slock,flags);
583 saa7134_dma_stop(dev); 583 saa7134_dma_stop(dev);
584 spin_unlock_irqrestore(&dev->slock,flags); 584 spin_unlock_irqrestore(&dev->slock,flags);
585 585
586 /* unlock buffer */ 586 /* unlock buffer */
587 saa7134_pgtable_free(dev->pci,&dev->oss.pt); 587 saa7134_pgtable_free(dev->pci,&dev->oss.pt);
588 videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma); 588 videobuf_dma_pci_unmap(dev->pci,&dev->oss.dma);
589 589
590 dsp_buffer_free(dev); 590 dsp_buffer_free(dev);
591 return 0; 591 return 0;
592} 592}
593 593
594/* 594/*
@@ -605,18 +605,18 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
605{ 605{
606 snd_pcm_runtime_t *runtime = substream->runtime; 606 snd_pcm_runtime_t *runtime = substream->runtime;
607 snd_card_saa7134_pcm_t *saapcm; 607 snd_card_saa7134_pcm_t *saapcm;
608 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 608 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
609 struct saa7134_dev *dev = saa7134->saadev; 609 struct saa7134_dev *dev = saa7134->saadev;
610 int err; 610 int err;
611 611
612 down(&dev->oss.lock); 612 down(&dev->oss.lock);
613 613
614 dev->oss.afmt = SNDRV_PCM_FORMAT_U8; 614 dev->oss.afmt = SNDRV_PCM_FORMAT_U8;
615 dev->oss.channels = 2; 615 dev->oss.channels = 2;
616 dev->oss.read_count = 0; 616 dev->oss.read_count = 0;
617 dev->oss.read_offset = 0; 617 dev->oss.read_offset = 0;
618 618
619 up(&dev->oss.lock); 619 up(&dev->oss.lock);
620 620
621 saapcm = kcalloc(1, sizeof(*saapcm), GFP_KERNEL); 621 saapcm = kcalloc(1, sizeof(*saapcm), GFP_KERNEL);
622 if (saapcm == NULL) 622 if (saapcm == NULL)
@@ -630,8 +630,8 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
630 runtime->private_free = snd_card_saa7134_runtime_free; 630 runtime->private_free = snd_card_saa7134_runtime_free;
631 runtime->hw = snd_card_saa7134_capture; 631 runtime->hw = snd_card_saa7134_capture;
632 632
633 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 633 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
634 return err; 634 return err;
635 635
636 return 0; 636 return 0;
637} 637}
@@ -723,7 +723,7 @@ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
723 right = 20; 723 right = 20;
724 spin_lock_irqsave(&chip->mixer_lock, flags); 724 spin_lock_irqsave(&chip->mixer_lock, flags);
725 change = chip->mixer_volume[addr][0] != left || 725 change = chip->mixer_volume[addr][0] != left ||
726 chip->mixer_volume[addr][1] != right; 726 chip->mixer_volume[addr][1] != right;
727 chip->mixer_volume[addr][0] = left; 727 chip->mixer_volume[addr][0] = left;
728 chip->mixer_volume[addr][1] = right; 728 chip->mixer_volume[addr][1] = right;
729 spin_unlock_irqrestore(&chip->mixer_lock, flags); 729 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_
764 unsigned long flags; 764 unsigned long flags;
765 int change, addr = kcontrol->private_value; 765 int change, addr = kcontrol->private_value;
766 int left, right; 766 int left, right;
767 u32 anabar, xbarin; 767 u32 anabar, xbarin;
768 int analog_io, rate; 768 int analog_io, rate;
769 struct saa7134_dev *dev; 769 struct saa7134_dev *dev;
770 770
@@ -775,7 +775,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
775 spin_lock_irqsave(&chip->mixer_lock, flags); 775 spin_lock_irqsave(&chip->mixer_lock, flags);
776 776
777 change = chip->capture_source[addr][0] != left || 777 change = chip->capture_source[addr][0] != left ||
778 chip->capture_source[addr][1] != right; 778 chip->capture_source[addr][1] != right;
779 chip->capture_source[addr][0] = left; 779 chip->capture_source[addr][0] = left;
780 chip->capture_source[addr][1] = right; 780 chip->capture_source[addr][1] = right;
781 dev->oss.input=addr; 781 dev->oss.input=addr;
@@ -783,57 +783,57 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
783 783
784 784
785 if (change) { 785 if (change) {
786 switch (dev->pci->device) { 786 switch (dev->pci->device) {
787 787
788 case PCI_DEVICE_ID_PHILIPS_SAA7134: 788 case PCI_DEVICE_ID_PHILIPS_SAA7134:
789 switch (addr) { 789 switch (addr) {
790 case MIXER_ADDR_TVTUNER: 790 case MIXER_ADDR_TVTUNER:
791 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0); 791 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0);
792 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00); 792 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00);
793 break; 793 break;
794 case MIXER_ADDR_LINE1: 794 case MIXER_ADDR_LINE1:
795 case MIXER_ADDR_LINE2: 795 case MIXER_ADDR_LINE2:
796 analog_io = (MIXER_ADDR_LINE1 == addr) ? 0x00 : 0x08; 796 analog_io = (MIXER_ADDR_LINE1 == addr) ? 0x00 : 0x08;
797 rate = (32000 == dev->oss.rate) ? 0x01 : 0x03; 797 rate = (32000 == dev->oss.rate) ? 0x01 : 0x03;
798 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, analog_io); 798 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, analog_io);
799 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0x80); 799 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0x80);
800 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, rate); 800 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, rate);
801 break; 801 break;
802 } 802 }
803 803
804 break; 804 break;
805 case PCI_DEVICE_ID_PHILIPS_SAA7133: 805 case PCI_DEVICE_ID_PHILIPS_SAA7133:
806 case PCI_DEVICE_ID_PHILIPS_SAA7135: 806 case PCI_DEVICE_ID_PHILIPS_SAA7135:
807 xbarin = 0x03; // adc 807 xbarin = 0x03; // adc
808 anabar = 0; 808 anabar = 0;
809 switch (addr) { 809 switch (addr) {
810 case MIXER_ADDR_TVTUNER: 810 case MIXER_ADDR_TVTUNER:
811 xbarin = 0; // Demodulator 811 xbarin = 0; // Demodulator
812 anabar = 2; // DACs 812 anabar = 2; // DACs
813 break; 813 break;
814 case MIXER_ADDR_LINE1: 814 case MIXER_ADDR_LINE1:
815 anabar = 0; // aux1, aux1 815 anabar = 0; // aux1, aux1
816 break; 816 break;
817 case MIXER_ADDR_LINE2: 817 case MIXER_ADDR_LINE2:
818 anabar = 9; // aux2, aux2 818 anabar = 9; // aux2, aux2
819 break; 819 break;
820 } 820 }
821 821
822 /* output xbar always main channel */ 822 /* output xbar always main channel */
823 saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL1, 0xbbbb10); 823 saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL1, 0xbbbb10);
824 824
825 if (left || right) { // We've got data, turn the input on 825 if (left || right) { // We've got data, turn the input on
826 //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); 826 //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010);
827 saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, xbarin); 827 saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, xbarin);
828 saa_writel(SAA7133_ANALOG_IO_SELECT, anabar); 828 saa_writel(SAA7133_ANALOG_IO_SELECT, anabar);
829 } else { 829 } else {
830 //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010); 830 //saa_dsp_writel(dev, SAA7133_DIGITAL_OUTPUT_SEL2, 0x101010);
831 saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0); 831 saa_dsp_writel(dev, SAA7133_DIGITAL_INPUT_XBAR1, 0);
832 saa_writel(SAA7133_ANALOG_IO_SELECT, 0); 832 saa_writel(SAA7133_ANALOG_IO_SELECT, 0);
833 } 833 }
834 break; 834 break;
835 } 835 }
836 } 836 }
837 837
838 return change; 838 return change;
839} 839}
@@ -878,8 +878,8 @@ static int snd_saa7134_free(snd_card_saa7134_t *chip)
878 878
879static int snd_saa7134_dev_free(snd_device_t *device) 879static int snd_saa7134_dev_free(snd_device_t *device)
880{ 880{
881 snd_card_saa7134_t *chip = device->device_data; 881 snd_card_saa7134_t *chip = device->device_data;
882 return snd_saa7134_free(chip); 882 return snd_saa7134_free(chip);
883} 883}
884 884
885/* 885/*
@@ -896,12 +896,12 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum)
896 snd_card_t *card; 896 snd_card_t *card;
897 snd_card_saa7134_t *chip; 897 snd_card_saa7134_t *chip;
898 int err; 898 int err;
899 static snd_device_ops_t ops = { 899 static snd_device_ops_t ops = {
900 .dev_free = snd_saa7134_dev_free, 900 .dev_free = snd_saa7134_dev_free,
901 }; 901 };
902 902
903 if (dev >= SNDRV_CARDS) 903 if (dev >= SNDRV_CARDS)
904 return -ENODEV; 904 return -ENODEV;
905 if (!enable[dev]) 905 if (!enable[dev])
906 return -ENODEV; 906 return -ENODEV;
907 907
@@ -918,24 +918,24 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum)
918 /* Card "creation" */ 918 /* Card "creation" */
919 919
920 chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); 920 chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
921 if (chip == NULL) { 921 if (chip == NULL) {
922 return -ENOMEM; 922 return -ENOMEM;
923 } 923 }
924 924
925 spin_lock_init(&chip->lock); 925 spin_lock_init(&chip->lock);
926 926
927 chip->saadev = saadev; 927 chip->saadev = saadev;
928 928
929 chip->card = card; 929 chip->card = card;
930 930
931 chip->pci = saadev->pci; 931 chip->pci = saadev->pci;
932 chip->irq = saadev->pci->irq; 932 chip->irq = saadev->pci->irq;
933 chip->iobase = pci_resource_start(saadev->pci, 0); 933 chip->iobase = pci_resource_start(saadev->pci, 0);
934 934
935 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { 935 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
936 snd_saa7134_free(chip); 936 snd_saa7134_free(chip);
937 return err; 937 return err;
938 } 938 }
939 939
940 if ((err = snd_card_saa7134_new_mixer(chip)) < 0) 940 if ((err = snd_card_saa7134_new_mixer(chip)) < 0)
941 goto __nodev; 941 goto __nodev;
@@ -943,15 +943,15 @@ int alsa_card_saa7134_create(struct saa7134_dev *saadev, unsigned int devicenum)
943 if ((err = snd_card_saa7134_pcm(chip, 0)) < 0) 943 if ((err = snd_card_saa7134_pcm(chip, 0)) < 0)
944 goto __nodev; 944 goto __nodev;
945 945
946 spin_lock_init(&chip->mixer_lock); 946 spin_lock_init(&chip->mixer_lock);
947 947
948 snd_card_set_dev(card, &chip->pci->dev); 948 snd_card_set_dev(card, &chip->pci->dev);
949 949
950 /* End of "creation" */ 950 /* End of "creation" */
951 951
952 strcpy(card->shortname, "SAA7134"); 952 strcpy(card->shortname, "SAA7134");
953 sprintf(card->longname, "%s at 0x%lx irq %d", 953 sprintf(card->longname, "%s at 0x%lx irq %d",
954 chip->saadev->name, chip->iobase, chip->irq); 954 chip->saadev->name, chip->iobase, chip->irq);
955 955
956 if ((err = snd_card_register(card)) == 0) { 956 if ((err = snd_card_register(card)) == 0) {
957 snd_saa7134_cards[dev] = card; 957 snd_saa7134_cards[dev] = card;
@@ -966,8 +966,8 @@ __nodev:
966 966
967void alsa_card_saa7134_exit(void) 967void alsa_card_saa7134_exit(void)
968{ 968{
969 int idx; 969 int idx;
970 for (idx = 0; idx < SNDRV_CARDS; idx++) { 970 for (idx = 0; idx < SNDRV_CARDS; idx++) {
971 snd_card_free(snd_saa7134_cards[idx]); 971 snd_card_free(snd_saa7134_cards[idx]);
972 } 972 }
973} 973}
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 17b0549f2e1..a60d49af341 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[] = {
2114 }, 2114 },
2115 }, 2115 },
2116 [SAA7134_BOARD_BEHOLD_409FM] = { 2116 [SAA7134_BOARD_BEHOLD_409FM] = {
2117 /* <http://tuner.beholder.ru>, Sergey <skiv@orel.ru> */ 2117 /* <http://tuner.beholder.ru>, Sergey <skiv@orel.ru> */
2118 .name = "Beholder BeholdTV 409 FM", 2118 .name = "Beholder BeholdTV 409 FM",
2119 .audio_clock = 0x00187de7, 2119 .audio_clock = 0x00187de7,
2120 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 2120 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2121 .radio_type = UNSET, 2121 .radio_type = UNSET,
2122 .tuner_addr = ADDR_UNSET, 2122 .tuner_addr = ADDR_UNSET,
2123 .radio_addr = ADDR_UNSET, 2123 .radio_addr = ADDR_UNSET,
2124 .tda9887_conf = TDA9887_PRESENT, 2124 .tda9887_conf = TDA9887_PRESENT,
2125 .inputs = {{ 2125 .inputs = {{
2126 .name = name_tv, 2126 .name = name_tv,
2127 .vmux = 3, 2127 .vmux = 3,
2128 .amux = TV, 2128 .amux = TV,
2129 .tv = 1, 2129 .tv = 1,
@@ -2131,60 +2131,60 @@ struct saa7134_board saa7134_boards[] = {
2131 .name = name_comp1, 2131 .name = name_comp1,
2132 .vmux = 1, 2132 .vmux = 1,
2133 .amux = LINE1, 2133 .amux = LINE1,
2134 },{ 2134 },{
2135 .name = name_svideo, 2135 .name = name_svideo,
2136 .vmux = 8, 2136 .vmux = 8,
2137 .amux = LINE1, 2137 .amux = LINE1,
2138 }}, 2138 }},
2139 .radio = { 2139 .radio = {
2140 .name = name_radio, 2140 .name = name_radio,
2141 .amux = LINE2, 2141 .amux = LINE2,
2142 }, 2142 },
2143 }, 2143 },
2144 [SAA7134_BOARD_GOTVIEW_7135] = { 2144 [SAA7134_BOARD_GOTVIEW_7135] = {
2145 /* Mike Baikov <mike@baikov.com> */ 2145 /* Mike Baikov <mike@baikov.com> */
2146 /* Andrey Cvetcov <ays14@yandex.ru> */ 2146 /* Andrey Cvetcov <ays14@yandex.ru> */
2147 .name = "GoTView 7135 PCI", 2147 .name = "GoTView 7135 PCI",
2148 .audio_clock = 0x00187de7, 2148 .audio_clock = 0x00187de7,
2149 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 2149 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2150 .radio_type = UNSET, 2150 .radio_type = UNSET,
2151 .tuner_addr = ADDR_UNSET, 2151 .tuner_addr = ADDR_UNSET,
2152 .radio_addr = ADDR_UNSET, 2152 .radio_addr = ADDR_UNSET,
2153 .tda9887_conf = TDA9887_PRESENT, 2153 .tda9887_conf = TDA9887_PRESENT,
2154 .gpiomask = 0x00200003, 2154 .gpiomask = 0x00200003,
2155 .inputs = {{ 2155 .inputs = {{
2156 .name = name_tv, 2156 .name = name_tv,
2157 .vmux = 1, 2157 .vmux = 1,
2158 .amux = TV, 2158 .amux = TV,
2159 .tv = 1, 2159 .tv = 1,
2160 .gpio = 0x00200003, 2160 .gpio = 0x00200003,
2161 },{ 2161 },{
2162 .name = name_tv_mono, 2162 .name = name_tv_mono,
2163 .vmux = 1, 2163 .vmux = 1,
2164 .amux = LINE2, 2164 .amux = LINE2,
2165 .gpio = 0x00200003, 2165 .gpio = 0x00200003,
2166 },{ 2166 },{
2167 .name = name_comp1, 2167 .name = name_comp1,
2168 .vmux = 3, 2168 .vmux = 3,
2169 .amux = LINE1, 2169 .amux = LINE1,
2170 .gpio = 0x00200003, 2170 .gpio = 0x00200003,
2171 },{ 2171 },{
2172 .name = name_svideo, 2172 .name = name_svideo,
2173 .vmux = 8, 2173 .vmux = 8,
2174 .amux = LINE1, 2174 .amux = LINE1,
2175 .gpio = 0x00200003, 2175 .gpio = 0x00200003,
2176 }}, 2176 }},
2177 .radio = { 2177 .radio = {
2178 .name = name_radio, 2178 .name = name_radio,
2179 .amux = LINE2, 2179 .amux = LINE2,
2180 .gpio = 0x00200003, 2180 .gpio = 0x00200003,
2181 }, 2181 },
2182 .mute = { 2182 .mute = {
2183 .name = name_mute, 2183 .name = name_mute,
2184 .amux = TV, 2184 .amux = TV,
2185 .gpio = 0x00200003, 2185 .gpio = 0x00200003,
2186 }, 2186 },
2187 }, 2187 },
2188 [SAA7134_BOARD_PHILIPS_EUROPA] = { 2188 [SAA7134_BOARD_PHILIPS_EUROPA] = {
2189 .name = "Philips EUROPA V3 reference design", 2189 .name = "Philips EUROPA V3 reference design",
2190 .audio_clock = 0x00187de7, 2190 .audio_clock = 0x00187de7,
@@ -2251,78 +2251,78 @@ struct saa7134_board saa7134_boards[] = {
2251 .amux = LINE1, 2251 .amux = LINE1,
2252 }}, 2252 }},
2253 }, 2253 },
2254 [SAA7134_BOARD_RTD_VFG7350] = { 2254 [SAA7134_BOARD_RTD_VFG7350] = {
2255 .name = "RTD Embedded Technologies VFG7350", 2255 .name = "RTD Embedded Technologies VFG7350",
2256 .audio_clock = 0x00200000, 2256 .audio_clock = 0x00200000,
2257 .tuner_type = TUNER_ABSENT, 2257 .tuner_type = TUNER_ABSENT,
2258 .radio_type = UNSET, 2258 .radio_type = UNSET,
2259 .tuner_addr = ADDR_UNSET, 2259 .tuner_addr = ADDR_UNSET,
2260 .radio_addr = ADDR_UNSET, 2260 .radio_addr = ADDR_UNSET,
2261 .inputs = {{ 2261 .inputs = {{
2262 .name = "Composite 0", 2262 .name = "Composite 0",
2263 .vmux = 0, 2263 .vmux = 0,
2264 .amux = LINE1, 2264 .amux = LINE1,
2265 },{ 2265 },{
2266 .name = "Composite 1", 2266 .name = "Composite 1",
2267 .vmux = 1, 2267 .vmux = 1,
2268 .amux = LINE2, 2268 .amux = LINE2,
2269 },{ 2269 },{
2270 .name = "Composite 2", 2270 .name = "Composite 2",
2271 .vmux = 2, 2271 .vmux = 2,
2272 .amux = LINE1, 2272 .amux = LINE1,
2273 },{ 2273 },{
2274 .name = "Composite 3", 2274 .name = "Composite 3",
2275 .vmux = 3, 2275 .vmux = 3,
2276 .amux = LINE2, 2276 .amux = LINE2,
2277 },{ 2277 },{
2278 .name = "S-Video 0", 2278 .name = "S-Video 0",
2279 .vmux = 8, 2279 .vmux = 8,
2280 .amux = LINE1, 2280 .amux = LINE1,
2281 },{ 2281 },{
2282 .name = "S-Video 1", 2282 .name = "S-Video 1",
2283 .vmux = 9, 2283 .vmux = 9,
2284 .amux = LINE2, 2284 .amux = LINE2,
2285 }}, 2285 }},
2286 .mpeg = SAA7134_MPEG_EMPRESS, 2286 .mpeg = SAA7134_MPEG_EMPRESS,
2287 .video_out = CCIR656, 2287 .video_out = CCIR656,
2288 .vid_port_opts = ( SET_T_CODE_POLARITY_NON_INVERTED | 2288 .vid_port_opts = ( SET_T_CODE_POLARITY_NON_INVERTED |
2289 SET_CLOCK_NOT_DELAYED | 2289 SET_CLOCK_NOT_DELAYED |
2290 SET_CLOCK_INVERTED | 2290 SET_CLOCK_INVERTED |
2291 SET_VSYNC_OFF ), 2291 SET_VSYNC_OFF ),
2292 }, 2292 },
2293 [SAA7134_BOARD_RTD_VFG7330] = { 2293 [SAA7134_BOARD_RTD_VFG7330] = {
2294 .name = "RTD Embedded Technologies VFG7330", 2294 .name = "RTD Embedded Technologies VFG7330",
2295 .audio_clock = 0x00200000, 2295 .audio_clock = 0x00200000,
2296 .tuner_type = TUNER_ABSENT, 2296 .tuner_type = TUNER_ABSENT,
2297 .radio_type = UNSET, 2297 .radio_type = UNSET,
2298 .tuner_addr = ADDR_UNSET, 2298 .tuner_addr = ADDR_UNSET,
2299 .radio_addr = ADDR_UNSET, 2299 .radio_addr = ADDR_UNSET,
2300 .inputs = {{ 2300 .inputs = {{
2301 .name = "Composite 0", 2301 .name = "Composite 0",
2302 .vmux = 0, 2302 .vmux = 0,
2303 .amux = LINE1, 2303 .amux = LINE1,
2304 },{ 2304 },{
2305 .name = "Composite 1", 2305 .name = "Composite 1",
2306 .vmux = 1, 2306 .vmux = 1,
2307 .amux = LINE2, 2307 .amux = LINE2,
2308 },{ 2308 },{
2309 .name = "Composite 2", 2309 .name = "Composite 2",
2310 .vmux = 2, 2310 .vmux = 2,
2311 .amux = LINE1, 2311 .amux = LINE1,
2312 },{ 2312 },{
2313 .name = "Composite 3", 2313 .name = "Composite 3",
2314 .vmux = 3, 2314 .vmux = 3,
2315 .amux = LINE2, 2315 .amux = LINE2,
2316 },{ 2316 },{
2317 .name = "S-Video 0", 2317 .name = "S-Video 0",
2318 .vmux = 8, 2318 .vmux = 8,
2319 .amux = LINE1, 2319 .amux = LINE1,
2320 },{ 2320 },{
2321 .name = "S-Video 1", 2321 .name = "S-Video 1",
2322 .vmux = 9, 2322 .vmux = 9,
2323 .amux = LINE2, 2323 .amux = LINE2,
2324 }}, 2324 }},
2325 }, 2325 },
2326 [SAA7134_BOARD_FLYTVPLATINUM_MINI2] = { 2326 [SAA7134_BOARD_FLYTVPLATINUM_MINI2] = {
2327 .name = "LifeView FlyTV Platinum Mini2", 2327 .name = "LifeView FlyTV Platinum Mini2",
2328 .audio_clock = 0x00200000, 2328 .audio_clock = 0x00200000,
@@ -2760,55 +2760,55 @@ struct pci_device_id saa7134_pci_tbl[] = {
2760 .subvendor = 0x0000, /* It shouldn't break anything, since subdevice id seems unique */ 2760 .subvendor = 0x0000, /* It shouldn't break anything, since subdevice id seems unique */
2761 .subdevice = 0x4091, 2761 .subdevice = 0x4091,
2762 .driver_data = SAA7134_BOARD_BEHOLD_409FM, 2762 .driver_data = SAA7134_BOARD_BEHOLD_409FM,
2763 },{ 2763 },{
2764 .vendor = PCI_VENDOR_ID_PHILIPS, 2764 .vendor = PCI_VENDOR_ID_PHILIPS,
2765 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2765 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2766 .subvendor = 0x5456, /* GoTView */ 2766 .subvendor = 0x5456, /* GoTView */
2767 .subdevice = 0x7135, 2767 .subdevice = 0x7135,
2768 .driver_data = SAA7134_BOARD_GOTVIEW_7135, 2768 .driver_data = SAA7134_BOARD_GOTVIEW_7135,
2769 },{ 2769 },{
2770 .vendor = PCI_VENDOR_ID_PHILIPS, 2770 .vendor = PCI_VENDOR_ID_PHILIPS,
2771 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 2771 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
2772 .subvendor = PCI_VENDOR_ID_PHILIPS, 2772 .subvendor = PCI_VENDOR_ID_PHILIPS,
2773 .subdevice = 0x2004, 2773 .subdevice = 0x2004,
2774 .driver_data = SAA7134_BOARD_PHILIPS_EUROPA, 2774 .driver_data = SAA7134_BOARD_PHILIPS_EUROPA,
2775 },{ 2775 },{
2776 .vendor = PCI_VENDOR_ID_PHILIPS, 2776 .vendor = PCI_VENDOR_ID_PHILIPS,
2777 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 2777 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
2778 .subvendor = 0x185b, 2778 .subvendor = 0x185b,
2779 .subdevice = 0xc900, 2779 .subdevice = 0xc900,
2780 .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_300, 2780 .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_300,
2781 },{ 2781 },{
2782 .vendor = PCI_VENDOR_ID_PHILIPS, 2782 .vendor = PCI_VENDOR_ID_PHILIPS,
2783 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 2783 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
2784 .subvendor = 0x185b, 2784 .subvendor = 0x185b,
2785 .subdevice = 0xc901, 2785 .subdevice = 0xc901,
2786 .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_200, 2786 .driver_data = SAA7134_BOARD_VIDEOMATE_DVBT_200,
2787 },{ 2787 },{
2788 .vendor = PCI_VENDOR_ID_PHILIPS, 2788 .vendor = PCI_VENDOR_ID_PHILIPS,
2789 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2789 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2790 .subvendor = 0x1435, 2790 .subvendor = 0x1435,
2791 .subdevice = 0x7350, 2791 .subdevice = 0x7350,
2792 .driver_data = SAA7134_BOARD_RTD_VFG7350, 2792 .driver_data = SAA7134_BOARD_RTD_VFG7350,
2793 },{ 2793 },{
2794 .vendor = PCI_VENDOR_ID_PHILIPS, 2794 .vendor = PCI_VENDOR_ID_PHILIPS,
2795 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2795 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2796 .subvendor = 0x1435, 2796 .subvendor = 0x1435,
2797 .subdevice = 0x7330, 2797 .subdevice = 0x7330,
2798 .driver_data = SAA7134_BOARD_RTD_VFG7330, 2798 .driver_data = SAA7134_BOARD_RTD_VFG7330,
2799 },{ 2799 },{
2800 .vendor = PCI_VENDOR_ID_PHILIPS, 2800 .vendor = PCI_VENDOR_ID_PHILIPS,
2801 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2801 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2802 .subvendor = 0x1461, 2802 .subvendor = 0x1461,
2803 .subdevice = 0x1044, 2803 .subdevice = 0x1044,
2804 .driver_data = SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180, 2804 .driver_data = SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180,
2805 },{ 2805 },{
2806 .vendor = PCI_VENDOR_ID_PHILIPS, 2806 .vendor = PCI_VENDOR_ID_PHILIPS,
2807 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2807 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2808 .subvendor = 0x1131, 2808 .subvendor = 0x1131,
2809 .subdevice = 0x4ee9, 2809 .subdevice = 0x4ee9,
2810 .driver_data = SAA7134_BOARD_MONSTERTV_MOBILE, 2810 .driver_data = SAA7134_BOARD_MONSTERTV_MOBILE,
2811 },{ 2811 },{
2812 /* --- boards without eeprom + subsystem ID --- */ 2812 /* --- boards without eeprom + subsystem ID --- */
2813 .vendor = PCI_VENDOR_ID_PHILIPS, 2813 .vendor = PCI_VENDOR_ID_PHILIPS,
2814 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 2814 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -3051,7 +3051,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
3051 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 3051 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
3052 /* The Philips EUROPA based hybrid boards have the tuner connected through 3052 /* The Philips EUROPA based hybrid boards have the tuner connected through
3053 * the channel decoder. We have to make it transparent to find it 3053 * the channel decoder. We have to make it transparent to find it
3054 */ 3054 */
3055 { 3055 {
3056 struct tuner_setup tun_setup; 3056 struct tuner_setup tun_setup;
3057 u8 data[] = { 0x07, 0x02}; 3057 u8 data[] = { 0x07, 0x02};
@@ -3063,7 +3063,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
3063 tun_setup.addr = dev->tuner_addr; 3063 tun_setup.addr = dev->tuner_addr;
3064 3064
3065 saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); 3065 saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup);
3066 } 3066 }
3067 break; 3067 break;
3068 } 3068 }
3069 return 0; 3069 return 0;
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 907dbd4de7c..afa0cfce657 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,
201 if (module != THIS_MODULE || state != MODULE_STATE_LIVE) 201 if (module != THIS_MODULE || state != MODULE_STATE_LIVE)
202 return NOTIFY_DONE; 202 return NOTIFY_DONE;
203 203
204 if (need_empress) 204 if (need_empress)
205 request_module("saa7134-empress"); 205 request_module("saa7134-empress");
206 if (need_dvb) 206 if (need_dvb)
207 request_module("saa7134-dvb"); 207 request_module("saa7134-dvb");
208 return NOTIFY_DONE; 208 return NOTIFY_DONE;
209} 209}
210 210
@@ -279,8 +279,8 @@ unsigned long saa7134_buffer_base(struct saa7134_buf *buf)
279 279
280int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt) 280int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt)
281{ 281{
282 __le32 *cpu; 282 __le32 *cpu;
283 dma_addr_t dma_addr; 283 dma_addr_t dma_addr;
284 284
285 cpu = pci_alloc_consistent(pci, SAA7134_PGTABLE_SIZE, &dma_addr); 285 cpu = pci_alloc_consistent(pci, SAA7134_PGTABLE_SIZE, &dma_addr);
286 if (NULL == cpu) 286 if (NULL == cpu)
@@ -440,7 +440,7 @@ int saa7134_set_dmabits(struct saa7134_dev *dev)
440 ctrl |= SAA7134_MAIN_CTRL_TE0; 440 ctrl |= SAA7134_MAIN_CTRL_TE0;
441 irq |= SAA7134_IRQ1_INTE_RA0_1 | 441 irq |= SAA7134_IRQ1_INTE_RA0_1 |
442 SAA7134_IRQ1_INTE_RA0_0; 442 SAA7134_IRQ1_INTE_RA0_0;
443 cap = dev->video_q.curr->vb.field; 443 cap = dev->video_q.curr->vb.field;
444 } 444 }
445 445
446 /* video capture -- dma 1+2 (planar modes) */ 446 /* video capture -- dma 1+2 (planar modes) */
@@ -646,7 +646,7 @@ static int saa7134_hwinit1(struct saa7134_dev *dev)
646 646
647 saa_writel(SAA7134_IRQ1, 0); 647 saa_writel(SAA7134_IRQ1, 0);
648 saa_writel(SAA7134_IRQ2, 0); 648 saa_writel(SAA7134_IRQ2, 0);
649 init_MUTEX(&dev->lock); 649 init_MUTEX(&dev->lock);
650 spin_lock_init(&dev->slock); 650 spin_lock_init(&dev->slock);
651 651
652 saa7134_track_gpio(dev,"pre-init"); 652 saa7134_track_gpio(dev,"pre-init");
@@ -704,7 +704,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev)
704 saa7134_tvaudio_init2(dev); 704 saa7134_tvaudio_init2(dev);
705 705
706 /* enable IRQ's */ 706 /* enable IRQ's */
707 irq2_mask = 707 irq2_mask =
708 SAA7134_IRQ2_INTE_DEC3 | 708 SAA7134_IRQ2_INTE_DEC3 |
709 SAA7134_IRQ2_INTE_DEC2 | 709 SAA7134_IRQ2_INTE_DEC2 |
710 SAA7134_IRQ2_INTE_DEC1 | 710 SAA7134_IRQ2_INTE_DEC1 |
@@ -889,8 +889,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
889 889
890 /* print pci info */ 890 /* print pci info */
891 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); 891 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
892 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); 892 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat);
893 printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, " 893 printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, "
894 "latency: %d, mmio: 0x%lx\n", dev->name, 894 "latency: %d, mmio: 0x%lx\n", dev->name,
895 pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 895 pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
896 dev->pci_lat,pci_resource_start(pci_dev,0)); 896 dev->pci_lat,pci_resource_start(pci_dev,0));
@@ -914,7 +914,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
914 dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf; 914 dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
915 if (UNSET != tuner[dev->nr]) 915 if (UNSET != tuner[dev->nr])
916 dev->tuner_type = tuner[dev->nr]; 916 dev->tuner_type = tuner[dev->nr];
917 printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", 917 printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
918 dev->name,pci_dev->subsystem_vendor, 918 dev->name,pci_dev->subsystem_vendor,
919 pci_dev->subsystem_device,saa7134_boards[dev->board].name, 919 pci_dev->subsystem_device,saa7134_boards[dev->board].name,
920 dev->board, card[dev->nr] == dev->board ? 920 dev->board, card[dev->nr] == dev->board ?
@@ -964,12 +964,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
964 request_module("tuner"); 964 request_module("tuner");
965 if (dev->tda9887_conf) 965 if (dev->tda9887_conf)
966 request_module("tda9887"); 966 request_module("tda9887");
967 if (card_is_empress(dev)) { 967 if (card_is_empress(dev)) {
968 request_module("saa6752hs"); 968 request_module("saa6752hs");
969 request_module_depend("saa7134-empress",&need_empress); 969 request_module_depend("saa7134-empress",&need_empress);
970 } 970 }
971 971
972 if (card_is_dvb(dev)) 972 if (card_is_dvb(dev))
973 request_module_depend("saa7134-dvb",&need_dvb); 973 request_module_depend("saa7134-dvb",&need_dvb);
974 974
975 v4l2_prio_init(&dev->prio); 975 v4l2_prio_init(&dev->prio);
@@ -1078,7 +1078,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1078 1078
1079static void __devexit saa7134_finidev(struct pci_dev *pci_dev) 1079static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
1080{ 1080{
1081 struct saa7134_dev *dev = pci_get_drvdata(pci_dev); 1081 struct saa7134_dev *dev = pci_get_drvdata(pci_dev);
1082 struct list_head *item; 1082 struct list_head *item;
1083 struct saa7134_mpeg_ops *mops; 1083 struct saa7134_mpeg_ops *mops;
1084 1084
@@ -1173,10 +1173,10 @@ EXPORT_SYMBOL(saa7134_ts_unregister);
1173/* ----------------------------------------------------------- */ 1173/* ----------------------------------------------------------- */
1174 1174
1175static struct pci_driver saa7134_pci_driver = { 1175static struct pci_driver saa7134_pci_driver = {
1176 .name = "saa7134", 1176 .name = "saa7134",
1177 .id_table = saa7134_pci_tbl, 1177 .id_table = saa7134_pci_tbl,
1178 .probe = saa7134_initdev, 1178 .probe = saa7134_initdev,
1179 .remove = __devexit_p(saa7134_finidev), 1179 .remove = __devexit_p(saa7134_finidev),
1180}; 1180};
1181 1181
1182static int saa7134_init(void) 1182static int saa7134_init(void)
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 87641f7e432..5aadd44c2fa 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_
547 u8 tuner_buf[14]; 547 u8 tuner_buf[14];
548 548
549 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf, 549 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf,
550 .len = sizeof(tuner_buf) }; 550 .len = sizeof(tuner_buf) };
551 int i, tuner_freq, if_freq; 551 int i, tuner_freq, if_freq;
552 u32 N; 552 u32 N;
553 switch (params->u.ofdm.bandwidth) { 553 switch (params->u.ofdm.bandwidth) {
@@ -606,7 +606,7 @@ static void philips_tda827x_pll_sleep(struct dvb_frontend *fe)
606 struct saa7134_dev *dev = fe->dvb->priv; 606 struct saa7134_dev *dev = fe->dvb->priv;
607 static u8 tda827x_sleep[] = { 0x30, 0xd0}; 607 static u8 tda827x_sleep[] = { 0x30, 0xd0};
608 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, 608 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep,
609 .len = sizeof(tda827x_sleep) }; 609 .len = sizeof(tda827x_sleep) };
610 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 610 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
611} 611}
612 612
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 77b627eb648..e9ec69efb4c 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)
55 55
56 saa_writeb(SAA7134_SPECIAL_MODE, 0x00); 56 saa_writeb(SAA7134_SPECIAL_MODE, 0x00);
57 msleep(10); 57 msleep(10);
58 saa_writeb(SAA7134_SPECIAL_MODE, 0x01); 58 saa_writeb(SAA7134_SPECIAL_MODE, 0x01);
59 msleep(100); 59 msleep(100);
60 dev->empress_started = 0; 60 dev->empress_started = 0;
61} 61}
@@ -65,7 +65,7 @@ static int ts_init_encoder(struct saa7134_dev* dev)
65 ts_reset_encoder(dev); 65 ts_reset_encoder(dev);
66 saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, NULL); 66 saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, NULL);
67 dev->empress_started = 1; 67 dev->empress_started = 1;
68 return 0; 68 return 0;
69} 69}
70 70
71/* ------------------------------------------------------------------ */ 71/* ------------------------------------------------------------------ */
@@ -169,7 +169,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
169 struct v4l2_capability *cap = arg; 169 struct v4l2_capability *cap = arg;
170 170
171 memset(cap,0,sizeof(*cap)); 171 memset(cap,0,sizeof(*cap));
172 strcpy(cap->driver, "saa7134"); 172 strcpy(cap->driver, "saa7134");
173 strlcpy(cap->card, saa7134_boards[dev->board].name, 173 strlcpy(cap->card, saa7134_boards[dev->board].name,
174 sizeof(cap->card)); 174 sizeof(cap->card));
175 sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); 175 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 711aa8e85fa..2577d03485b 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,
239 unsigned char data; 239 unsigned char data;
240 int addr,rc,i,byte; 240 int addr,rc,i,byte;
241 241
242 status = i2c_get_status(dev); 242 status = i2c_get_status(dev);
243 if (!i2c_is_idle(status)) 243 if (!i2c_is_idle(status))
244 if (!i2c_reset(dev)) 244 if (!i2c_reset(dev))
245 return -EIO; 245 return -EIO;
@@ -296,7 +296,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
296 rc = -EIO; 296 rc = -EIO;
297 if (!i2c_is_busy_wait(dev)) 297 if (!i2c_is_busy_wait(dev))
298 goto err; 298 goto err;
299 status = i2c_get_status(dev); 299 status = i2c_get_status(dev);
300 if (i2c_is_error(status)) 300 if (i2c_is_error(status))
301 goto err; 301 goto err;
302 /* ensure that the bus is idle for at least one bit slot */ 302 /* ensure that the bus is idle for at least one bit slot */
@@ -348,12 +348,12 @@ static int attach_inform(struct i2c_client *client)
348 348
349 client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup); 349 client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup);
350 } 350 }
351 } 351 }
352 352
353 if (tuner != UNSET) { 353 if (tuner != UNSET) {
354 354
355 tun_setup.type = tuner; 355 tun_setup.type = tuner;
356 tun_setup.addr = saa7134_boards[dev->board].tuner_addr; 356 tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
357 357
358 if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) { 358 if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) {
359 359
@@ -361,11 +361,11 @@ static int attach_inform(struct i2c_client *client)
361 361
362 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup); 362 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup);
363 } 363 }
364 } 364 }
365 365
366 client->driver->command(client, TDA9887_SET_CONFIG, &conf); 366 client->driver->command(client, TDA9887_SET_CONFIG, &conf);
367 367
368 return 0; 368 return 0;
369} 369}
370 370
371static struct i2c_algorithm saa7134_algo = { 371static struct i2c_algorithm saa7134_algo = {
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 9dc41c1427a..7ce0459989b 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] = {
114/* Alfons Geser <a.geser@cox.net> 114/* Alfons Geser <a.geser@cox.net>
115 * updates from Job D. R. Borges <jobdrb@ig.com.br> */ 115 * updates from Job D. R. Borges <jobdrb@ig.com.br> */
116static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = { 116static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = {
117 [ 18 ] = KEY_POWER, 117 [ 18 ] = KEY_POWER,
118 [ 1 ] = KEY_TV, // DVR 118 [ 1 ] = KEY_TV, // DVR
119 [ 21 ] = KEY_DVD, // DVD 119 [ 21 ] = KEY_DVD, // DVD
120 [ 23 ] = KEY_AUDIO, // music 120 [ 23 ] = KEY_AUDIO, // music
121 // DVR mode / DVD mode / music mode 121 // DVR mode / DVD mode / music mode
122 122
123 [ 27 ] = KEY_MUTE, // mute 123 [ 27 ] = KEY_MUTE, // mute
124 [ 2 ] = KEY_LANGUAGE, // MTS/SAP / audio / autoseek 124 [ 2 ] = KEY_LANGUAGE, // MTS/SAP / audio / autoseek
125 [ 30 ] = KEY_SUBTITLE, // closed captioning / subtitle / seek 125 [ 30 ] = KEY_SUBTITLE, // closed captioning / subtitle / seek
126 [ 22 ] = KEY_ZOOM, // full screen 126 [ 22 ] = KEY_ZOOM, // full screen
127 [ 28 ] = KEY_VIDEO, // video source / eject / delall 127 [ 28 ] = KEY_VIDEO, // video source / eject / delall
128 [ 29 ] = KEY_RESTART, // playback / angle / del 128 [ 29 ] = KEY_RESTART, // playback / angle / del
129 [ 47 ] = KEY_SEARCH, // scan / menu / playlist 129 [ 47 ] = KEY_SEARCH, // scan / menu / playlist
130 [ 48 ] = KEY_CHANNEL, // CH surfing / bookmark / memo 130 [ 48 ] = KEY_CHANNEL, // CH surfing / bookmark / memo
131 131
132 [ 49 ] = KEY_HELP, // help 132 [ 49 ] = KEY_HELP, // help
133 [ 50 ] = KEY_MODE, // num/memo 133 [ 50 ] = KEY_MODE, // num/memo
134 [ 51 ] = KEY_ESC, // cancel 134 [ 51 ] = KEY_ESC, // cancel
135 135
136 [ 12 ] = KEY_UP, // up 136 [ 12 ] = KEY_UP, // up
137 [ 16 ] = KEY_DOWN, // down 137 [ 16 ] = KEY_DOWN, // down
@@ -148,24 +148,24 @@ static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = {
148 [ 45 ] = KEY_PLAY, // play 148 [ 45 ] = KEY_PLAY, // play
149 [ 46 ] = KEY_SHUFFLE, // snapshot / shuffle 149 [ 46 ] = KEY_SHUFFLE, // snapshot / shuffle
150 150
151 [ 0 ] = KEY_KP0, 151 [ 0 ] = KEY_KP0,
152 [ 5 ] = KEY_KP1, 152 [ 5 ] = KEY_KP1,
153 [ 6 ] = KEY_KP2, 153 [ 6 ] = KEY_KP2,
154 [ 7 ] = KEY_KP3, 154 [ 7 ] = KEY_KP3,
155 [ 9 ] = KEY_KP4, 155 [ 9 ] = KEY_KP4,
156 [ 10 ] = KEY_KP5, 156 [ 10 ] = KEY_KP5,
157 [ 11 ] = KEY_KP6, 157 [ 11 ] = KEY_KP6,
158 [ 13 ] = KEY_KP7, 158 [ 13 ] = KEY_KP7,
159 [ 14 ] = KEY_KP8, 159 [ 14 ] = KEY_KP8,
160 [ 15 ] = KEY_KP9, 160 [ 15 ] = KEY_KP9,
161 161
162 [ 42 ] = KEY_VOLUMEUP, 162 [ 42 ] = KEY_VOLUMEUP,
163 [ 17 ] = KEY_VOLUMEDOWN, 163 [ 17 ] = KEY_VOLUMEDOWN,
164 [ 24 ] = KEY_CHANNELUP, // CH.tracking up 164 [ 24 ] = KEY_CHANNELUP, // CH.tracking up
165 [ 25 ] = KEY_CHANNELDOWN, // CH.tracking down 165 [ 25 ] = KEY_CHANNELDOWN, // CH.tracking down
166 166
167 [ 19 ] = KEY_KPENTER, // enter 167 [ 19 ] = KEY_KPENTER, // enter
168 [ 33 ] = KEY_KPDOT, // . (decimal dot) 168 [ 33 ] = KEY_KPDOT, // . (decimal dot)
169}; 169};
170 170
171static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = { 171static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = {
@@ -455,13 +455,13 @@ static int build_key(struct saa7134_dev *dev)
455 saa_setb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN); 455 saa_setb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN);
456 456
457 gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2); 457 gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
458 if (ir->polling) { 458 if (ir->polling) {
459 if (ir->last_gpio == gpio) 459 if (ir->last_gpio == gpio)
460 return 0; 460 return 0;
461 ir->last_gpio = gpio; 461 ir->last_gpio = gpio;
462 } 462 }
463 463
464 data = ir_extract_bits(gpio, ir->mask_keycode); 464 data = ir_extract_bits(gpio, ir->mask_keycode);
465 dprintk("build_key gpio=0x%x mask=0x%x data=%d\n", 465 dprintk("build_key gpio=0x%x mask=0x%x data=%d\n",
466 gpio, ir->mask_keycode, data); 466 gpio, ir->mask_keycode, data);
467 467
@@ -478,9 +478,9 @@ static int build_key(struct saa7134_dev *dev)
478 478
479void saa7134_input_irq(struct saa7134_dev *dev) 479void saa7134_input_irq(struct saa7134_dev *dev)
480{ 480{
481 struct saa7134_ir *ir = dev->remote; 481 struct saa7134_ir *ir = dev->remote;
482 482
483 if (!ir->polling) 483 if (!ir->polling)
484 build_key(dev); 484 build_key(dev);
485} 485}
486 486
@@ -515,7 +515,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
515 switch (dev->board) { 515 switch (dev->board) {
516 case SAA7134_BOARD_FLYVIDEO2000: 516 case SAA7134_BOARD_FLYVIDEO2000:
517 case SAA7134_BOARD_FLYVIDEO3000: 517 case SAA7134_BOARD_FLYVIDEO3000:
518 case SAA7134_BOARD_FLYTVPLATINUM_FM: 518 case SAA7134_BOARD_FLYTVPLATINUM_FM:
519 case SAA7134_BOARD_FLYTVPLATINUM_MINI2: 519 case SAA7134_BOARD_FLYTVPLATINUM_MINI2:
520 ir_codes = flyvideo_codes; 520 ir_codes = flyvideo_codes;
521 mask_keycode = 0xEC00000; 521 mask_keycode = 0xEC00000;
@@ -557,7 +557,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
557 saa_setb(SAA7134_GPIO_GPMODE0, 0x4); 557 saa_setb(SAA7134_GPIO_GPMODE0, 0x4);
558 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); 558 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);
559 break; 559 break;
560 case SAA7134_BOARD_KWORLD_TERMINATOR: 560 case SAA7134_BOARD_KWORLD_TERMINATOR:
561 ir_codes = avacssmart_codes; 561 ir_codes = avacssmart_codes;
562 mask_keycode = 0x00001f; 562 mask_keycode = 0x00001f;
563 mask_keyup = 0x000060; 563 mask_keyup = 0x000060;
@@ -571,7 +571,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
571 mask_keyup = 0x004000; 571 mask_keyup = 0x004000;
572 polling = 50; // ms 572 polling = 50; // ms
573 break; 573 break;
574 case SAA7134_BOARD_GOTVIEW_7135: 574 case SAA7134_BOARD_GOTVIEW_7135:
575 ir_codes = gotview7135_codes; 575 ir_codes = gotview7135_codes;
576 mask_keycode = 0x0003EC; 576 mask_keycode = 0x0003EC;
577 mask_keyup = 0x008000; 577 mask_keyup = 0x008000;
@@ -585,8 +585,8 @@ int saa7134_input_init1(struct saa7134_dev *dev)
585 mask_keyup = 0x400000; 585 mask_keyup = 0x400000;
586 polling = 50; // ms 586 polling = 50; // ms
587 break; 587 break;
588 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 588 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
589 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 589 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
590 ir_codes = videomate_tv_pvr_codes; 590 ir_codes = videomate_tv_pvr_codes;
591 mask_keycode = 0x003F00; 591 mask_keycode = 0x003F00;
592 mask_keyup = 0x040000; 592 mask_keyup = 0x040000;
@@ -610,7 +610,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
610 ir->mask_keycode = mask_keycode; 610 ir->mask_keycode = mask_keycode;
611 ir->mask_keydown = mask_keydown; 611 ir->mask_keydown = mask_keydown;
612 ir->mask_keyup = mask_keyup; 612 ir->mask_keyup = mask_keyup;
613 ir->polling = polling; 613 ir->polling = polling;
614 614
615 /* init input device */ 615 /* init input device */
616 snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)", 616 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 b1dcb4d1078..f1b0e0d93d7 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)
64 dev->oss.bufsize = blksize * blocks; 64 dev->oss.bufsize = blksize * blocks;
65 65
66 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", 66 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n",
67 blocks,blksize,blksize * blocks / 1024); 67 blocks,blksize,blksize * blocks / 1024);
68 return 0; 68 return 0;
69} 69}
70 70
@@ -371,20 +371,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
371 371
372 if (oss_debug > 1) 372 if (oss_debug > 1)
373 saa7134_print_ioctl(dev->name,cmd); 373 saa7134_print_ioctl(dev->name,cmd);
374 switch (cmd) { 374 switch (cmd) {
375 case OSS_GETVERSION: 375 case OSS_GETVERSION:
376 return put_user(SOUND_VERSION, p); 376 return put_user(SOUND_VERSION, p);
377 case SNDCTL_DSP_GETCAPS: 377 case SNDCTL_DSP_GETCAPS:
378 return 0; 378 return 0;
379 379
380 case SNDCTL_DSP_SPEED: 380 case SNDCTL_DSP_SPEED:
381 if (get_user(val, p)) 381 if (get_user(val, p))
382 return -EFAULT; 382 return -EFAULT;
383 /* fall through */ 383 /* fall through */
384 case SOUND_PCM_READ_RATE: 384 case SOUND_PCM_READ_RATE:
385 return put_user(dev->oss.rate, p); 385 return put_user(dev->oss.rate, p);
386 386
387 case SNDCTL_DSP_STEREO: 387 case SNDCTL_DSP_STEREO:
388 if (get_user(val, p)) 388 if (get_user(val, p))
389 return -EFAULT; 389 return -EFAULT;
390 down(&dev->oss.lock); 390 down(&dev->oss.lock);
@@ -396,7 +396,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
396 up(&dev->oss.lock); 396 up(&dev->oss.lock);
397 return put_user(dev->oss.channels-1, p); 397 return put_user(dev->oss.channels-1, p);
398 398
399 case SNDCTL_DSP_CHANNELS: 399 case SNDCTL_DSP_CHANNELS:
400 if (get_user(val, p)) 400 if (get_user(val, p))
401 return -EFAULT; 401 return -EFAULT;
402 if (val != 1 && val != 2) 402 if (val != 1 && val != 2)
@@ -409,15 +409,15 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
409 } 409 }
410 up(&dev->oss.lock); 410 up(&dev->oss.lock);
411 /* fall through */ 411 /* fall through */
412 case SOUND_PCM_READ_CHANNELS: 412 case SOUND_PCM_READ_CHANNELS:
413 return put_user(dev->oss.channels, p); 413 return put_user(dev->oss.channels, p);
414 414
415 case SNDCTL_DSP_GETFMTS: /* Returns a mask */ 415 case SNDCTL_DSP_GETFMTS: /* Returns a mask */
416 return put_user(AFMT_U8 | AFMT_S8 | 416 return put_user(AFMT_U8 | AFMT_S8 |
417 AFMT_U16_LE | AFMT_U16_BE | 417 AFMT_U16_LE | AFMT_U16_BE |
418 AFMT_S16_LE | AFMT_S16_BE, p); 418 AFMT_S16_LE | AFMT_S16_BE, p);
419 419
420 case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */ 420 case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */
421 if (get_user(val, p)) 421 if (get_user(val, p))
422 return -EFAULT; 422 return -EFAULT;
423 switch (val) { 423 switch (val) {
@@ -442,7 +442,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
442 return -EINVAL; 442 return -EINVAL;
443 } 443 }
444 444
445 case SOUND_PCM_READ_BITS: 445 case SOUND_PCM_READ_BITS:
446 switch (dev->oss.afmt) { 446 switch (dev->oss.afmt) {
447 case AFMT_U8: 447 case AFMT_U8:
448 case AFMT_S8: 448 case AFMT_S8:
@@ -456,20 +456,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
456 return -EINVAL; 456 return -EINVAL;
457 } 457 }
458 458
459 case SNDCTL_DSP_NONBLOCK: 459 case SNDCTL_DSP_NONBLOCK:
460 file->f_flags |= O_NONBLOCK; 460 file->f_flags |= O_NONBLOCK;
461 return 0; 461 return 0;
462 462
463 case SNDCTL_DSP_RESET: 463 case SNDCTL_DSP_RESET:
464 down(&dev->oss.lock); 464 down(&dev->oss.lock);
465 if (dev->oss.recording_on) 465 if (dev->oss.recording_on)
466 dsp_rec_stop(dev); 466 dsp_rec_stop(dev);
467 up(&dev->oss.lock); 467 up(&dev->oss.lock);
468 return 0; 468 return 0;
469 case SNDCTL_DSP_GETBLKSIZE: 469 case SNDCTL_DSP_GETBLKSIZE:
470 return put_user(dev->oss.blksize, p); 470 return put_user(dev->oss.blksize, p);
471 471
472 case SNDCTL_DSP_SETFRAGMENT: 472 case SNDCTL_DSP_SETFRAGMENT:
473 if (get_user(val, p)) 473 if (get_user(val, p))
474 return -EFAULT; 474 return -EFAULT;
475 if (dev->oss.recording_on) 475 if (dev->oss.recording_on)
@@ -480,7 +480,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
480 dsp_buffer_init(dev); 480 dsp_buffer_init(dev);
481 return 0; 481 return 0;
482 482
483 case SNDCTL_DSP_SYNC: 483 case SNDCTL_DSP_SYNC:
484 /* NOP */ 484 /* NOP */
485 return 0; 485 return 0;
486 486
@@ -563,7 +563,7 @@ mixer_recsrc_7133(struct saa7134_dev *dev)
563 switch (dev->oss.input) { 563 switch (dev->oss.input) {
564 case TV: 564 case TV:
565 xbarin = 0; // Demodulator 565 xbarin = 0; // Demodulator
566 anabar = 2; // DACs 566 anabar = 2; // DACs
567 break; 567 break;
568 case LINE1: 568 case LINE1:
569 anabar = 0; // aux1, aux1 569 anabar = 0; // aux1, aux1
@@ -667,28 +667,28 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
667 667
668 if (oss_debug > 1) 668 if (oss_debug > 1)
669 saa7134_print_ioctl(dev->name,cmd); 669 saa7134_print_ioctl(dev->name,cmd);
670 switch (cmd) { 670 switch (cmd) {
671 case OSS_GETVERSION: 671 case OSS_GETVERSION:
672 return put_user(SOUND_VERSION, p); 672 return put_user(SOUND_VERSION, p);
673 case SOUND_MIXER_INFO: 673 case SOUND_MIXER_INFO:
674 { 674 {
675 mixer_info info; 675 mixer_info info;
676 memset(&info,0,sizeof(info)); 676 memset(&info,0,sizeof(info));
677 strlcpy(info.id, "TV audio", sizeof(info.id)); 677 strlcpy(info.id, "TV audio", sizeof(info.id));
678 strlcpy(info.name, dev->name, sizeof(info.name)); 678 strlcpy(info.name, dev->name, sizeof(info.name));
679 info.modify_counter = dev->oss.count; 679 info.modify_counter = dev->oss.count;
680 if (copy_to_user(argp, &info, sizeof(info))) 680 if (copy_to_user(argp, &info, sizeof(info)))
681 return -EFAULT; 681 return -EFAULT;
682 return 0; 682 return 0;
683 } 683 }
684 case SOUND_OLD_MIXER_INFO: 684 case SOUND_OLD_MIXER_INFO:
685 { 685 {
686 _old_mixer_info info; 686 _old_mixer_info info;
687 memset(&info,0,sizeof(info)); 687 memset(&info,0,sizeof(info));
688 strlcpy(info.id, "TV audio", sizeof(info.id)); 688 strlcpy(info.id, "TV audio", sizeof(info.id));
689 strlcpy(info.name, dev->name, sizeof(info.name)); 689 strlcpy(info.name, dev->name, sizeof(info.name));
690 if (copy_to_user(argp, &info, sizeof(info))) 690 if (copy_to_user(argp, &info, sizeof(info)))
691 return -EFAULT; 691 return -EFAULT;
692 return 0; 692 return 0;
693 } 693 }
694 case MIXER_READ(SOUND_MIXER_CAPS): 694 case MIXER_READ(SOUND_MIXER_CAPS):
@@ -771,7 +771,7 @@ struct file_operations saa7134_mixer_fops = {
771int saa7134_oss_init1(struct saa7134_dev *dev) 771int saa7134_oss_init1(struct saa7134_dev *dev)
772{ 772{
773 /* general */ 773 /* general */
774 init_MUTEX(&dev->oss.lock); 774 init_MUTEX(&dev->oss.lock);
775 init_waitqueue_head(&dev->oss.wq); 775 init_waitqueue_head(&dev->oss.wq);
776 776
777 switch (dev->pci->device) { 777 switch (dev->pci->device) {
diff --git a/drivers/media/video/saa7134/saa7134-reg.h b/drivers/media/video/saa7134/saa7134-reg.h
index 58c521fade8..ac6431ba4fc 100644
--- a/drivers/media/video/saa7134/saa7134-reg.h
+++ b/drivers/media/video/saa7134/saa7134-reg.h
@@ -27,7 +27,7 @@
27 27
28/* DMA channels, n = 0 ... 6 */ 28/* DMA channels, n = 0 ... 6 */
29#define SAA7134_RS_BA1(n) ((0x200 >> 2) + 4*n) 29#define SAA7134_RS_BA1(n) ((0x200 >> 2) + 4*n)
30#define SAA7134_RS_BA2(n) ((0x204 >> 2) + 4*n) 30#define SAA7134_RS_BA2(n) ((0x204 >> 2) + 4*n)
31#define SAA7134_RS_PITCH(n) ((0x208 >> 2) + 4*n) 31#define SAA7134_RS_PITCH(n) ((0x208 >> 2) + 4*n)
32#define SAA7134_RS_CONTROL(n) ((0x20c >> 2) + 4*n) 32#define SAA7134_RS_CONTROL(n) ((0x20c >> 2) + 4*n)
33#define SAA7134_RS_CONTROL_WSWAP (0x01 << 25) 33#define SAA7134_RS_CONTROL_WSWAP (0x01 << 25)
@@ -53,14 +53,14 @@
53 53
54/* main control */ 54/* main control */
55#define SAA7134_MAIN_CTRL (0x2a8 >> 2) 55#define SAA7134_MAIN_CTRL (0x2a8 >> 2)
56#define SAA7134_MAIN_CTRL_VPLLE (1 << 15) 56#define SAA7134_MAIN_CTRL_VPLLE (1 << 15)
57#define SAA7134_MAIN_CTRL_APLLE (1 << 14) 57#define SAA7134_MAIN_CTRL_APLLE (1 << 14)
58#define SAA7134_MAIN_CTRL_EXOSC (1 << 13) 58#define SAA7134_MAIN_CTRL_EXOSC (1 << 13)
59#define SAA7134_MAIN_CTRL_EVFE1 (1 << 12) 59#define SAA7134_MAIN_CTRL_EVFE1 (1 << 12)
60#define SAA7134_MAIN_CTRL_EVFE2 (1 << 11) 60#define SAA7134_MAIN_CTRL_EVFE2 (1 << 11)
61#define SAA7134_MAIN_CTRL_ESFE (1 << 10) 61#define SAA7134_MAIN_CTRL_ESFE (1 << 10)
62#define SAA7134_MAIN_CTRL_EBADC (1 << 9) 62#define SAA7134_MAIN_CTRL_EBADC (1 << 9)
63#define SAA7134_MAIN_CTRL_EBDAC (1 << 8) 63#define SAA7134_MAIN_CTRL_EBDAC (1 << 8)
64#define SAA7134_MAIN_CTRL_TE6 (1 << 6) 64#define SAA7134_MAIN_CTRL_TE6 (1 << 6)
65#define SAA7134_MAIN_CTRL_TE5 (1 << 5) 65#define SAA7134_MAIN_CTRL_TE5 (1 << 5)
66#define SAA7134_MAIN_CTRL_TE4 (1 << 4) 66#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 cdfd69873ba..470903e2f5e 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,
111 111
112 /* dma: setup channel 5 (= TS) */ 112 /* dma: setup channel 5 (= TS) */
113 control = SAA7134_RS_CONTROL_BURST_16 | 113 control = SAA7134_RS_CONTROL_BURST_16 |
114 SAA7134_RS_CONTROL_ME | 114 SAA7134_RS_CONTROL_ME |
115 (buf->pt->dma >> 12); 115 (buf->pt->dma >> 12);
116 116
117 saa_writeb(SAA7134_TS_DMA0, ((lines-1)&0xff)); 117 saa_writeb(SAA7134_TS_DMA0, ((lines-1)&0xff));
118 saa_writeb(SAA7134_TS_DMA1, (((lines-1)>>8)&0xff)); 118 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 fdca6c563b9..3daf1b59795 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)
246 if (PCI_DEVICE_ID_PHILIPS_SAA7134 == dev->pci->device) 246 if (PCI_DEVICE_ID_PHILIPS_SAA7134 == dev->pci->device)
247 /* 7134 mute */ 247 /* 7134 mute */
248 saa_writeb(SAA7134_AUDIO_MUTE_CTRL, mute ? 248 saa_writeb(SAA7134_AUDIO_MUTE_CTRL, mute ?
249 SAA7134_MUTE_MASK | 249 SAA7134_MUTE_MASK |
250 SAA7134_MUTE_ANALOG | 250 SAA7134_MUTE_ANALOG |
251 SAA7134_MUTE_I2S : 251 SAA7134_MUTE_I2S :
252 SAA7134_MUTE_MASK); 252 SAA7134_MUTE_MASK);
@@ -761,17 +761,17 @@ static int mute_input_7133(struct saa7134_dev *dev)
761 761
762 762
763 /* switch gpio-connected external audio mux */ 763 /* switch gpio-connected external audio mux */
764 if (0 != card(dev).gpiomask) { 764 if (0 != card(dev).gpiomask) {
765 mask = card(dev).gpiomask; 765 mask = card(dev).gpiomask;
766 766
767 if (card(dev).mute.name && dev->ctl_mute) 767 if (card(dev).mute.name && dev->ctl_mute)
768 in = &card(dev).mute; 768 in = &card(dev).mute;
769 else 769 else
770 in = dev->input; 770 in = dev->input;
771 771
772 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask); 772 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask);
773 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, in->gpio); 773 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, in->gpio);
774 saa7134_track_gpio(dev,in->name); 774 saa7134_track_gpio(dev,in->name);
775 } 775 }
776 776
777 return 0; 777 return 0;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index cd5545b2d60..86db7fb96ef 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[] = {
310 310
311 .h_start = 0, 311 .h_start = 0,
312 .h_stop = 719, 312 .h_stop = 719,
313 .video_v_start = 23, 313 .video_v_start = 23,
314 .video_v_stop = 262, 314 .video_v_stop = 262,
315 .vbi_v_start_0 = 10, 315 .vbi_v_start_0 = 10,
316 .vbi_v_stop_0 = 21, 316 .vbi_v_stop_0 = 21,
317 .vbi_v_start_1 = 273, 317 .vbi_v_start_1 = 273,
318 .src_timing = 7, 318 .src_timing = 7,
319 319
320 .sync_control = 0x18, 320 .sync_control = 0x18,
321 .luma_control = 0x40, 321 .luma_control = 0x40,
@@ -659,7 +659,7 @@ static void set_size(struct saa7134_dev *dev, int task,
659 prescale = 1; 659 prescale = 1;
660 xscale = 1024 * dev->crop_current.width / prescale / width; 660 xscale = 1024 * dev->crop_current.width / prescale / width;
661 yscale = 512 * div * dev->crop_current.height / height; 661 yscale = 512 * div * dev->crop_current.height / height;
662 dprintk("prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale); 662 dprintk("prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale);
663 set_h_prescale(dev,task,prescale); 663 set_h_prescale(dev,task,prescale);
664 saa_writeb(SAA7134_H_SCALE_INC1(task), xscale & 0xff); 664 saa_writeb(SAA7134_H_SCALE_INC1(task), xscale & 0xff);
665 saa_writeb(SAA7134_H_SCALE_INC2(task), xscale >> 8); 665 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)
789 maxh = dev->crop_current.height; 789 maxh = dev->crop_current.height;
790 790
791 if (V4L2_FIELD_ANY == field) { 791 if (V4L2_FIELD_ANY == field) {
792 field = (win->w.height > maxh/2) 792 field = (win->w.height > maxh/2)
793 ? V4L2_FIELD_INTERLACED 793 ? V4L2_FIELD_INTERLACED
794 : V4L2_FIELD_TOP; 794 : V4L2_FIELD_TOP;
795 } 795 }
796 switch (field) { 796 switch (field) {
797 case V4L2_FIELD_TOP: 797 case V4L2_FIELD_TOP:
798 case V4L2_FIELD_BOTTOM: 798 case V4L2_FIELD_BOTTOM:
799 maxh = maxh / 2; 799 maxh = maxh / 2;
800 break; 800 break;
801 case V4L2_FIELD_INTERLACED: 801 case V4L2_FIELD_INTERLACED:
802 break; 802 break;
803 default: 803 default:
804 return -EINVAL; 804 return -EINVAL;
805 } 805 }
806 806
807 win->field = field; 807 win->field = field;
808 if (win->w.width > maxw) 808 if (win->w.width > maxw)
@@ -1343,13 +1343,13 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1343 if (res_locked(fh->dev,RESOURCE_VIDEO)) { 1343 if (res_locked(fh->dev,RESOURCE_VIDEO)) {
1344 up(&fh->cap.lock); 1344 up(&fh->cap.lock);
1345 return POLLERR; 1345 return POLLERR;
1346 } 1346 }
1347 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { 1347 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) {
1348 up(&fh->cap.lock); 1348 up(&fh->cap.lock);
1349 return POLLERR; 1349 return POLLERR;
1350 } 1350 }
1351 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); 1351 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
1352 fh->cap.read_off = 0; 1352 fh->cap.read_off = 0;
1353 } 1353 }
1354 up(&fh->cap.lock); 1354 up(&fh->cap.lock);
1355 buf = fh->cap.read_buf; 1355 buf = fh->cap.read_buf;
@@ -1706,7 +1706,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1706 unsigned int tuner_type = dev->tuner_type; 1706 unsigned int tuner_type = dev->tuner_type;
1707 1707
1708 memset(cap,0,sizeof(*cap)); 1708 memset(cap,0,sizeof(*cap));
1709 strcpy(cap->driver, "saa7134"); 1709 strcpy(cap->driver, "saa7134");
1710 strlcpy(cap->card, saa7134_boards[dev->board].name, 1710 strlcpy(cap->card, saa7134_boards[dev->board].name,
1711 sizeof(cap->card)); 1711 sizeof(cap->card));
1712 sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); 1712 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,
1934 } 1934 }
1935 case VIDIOC_S_AUDIO: 1935 case VIDIOC_S_AUDIO:
1936 return 0; 1936 return 0;
1937 case VIDIOC_G_PARM: 1937 case VIDIOC_G_PARM:
1938 { 1938 {
1939 struct v4l2_captureparm *parm = arg; 1939 struct v4l2_captureparm *parm = arg;
1940 memset(parm,0,sizeof(*parm)); 1940 memset(parm,0,sizeof(*parm));
1941 return 0; 1941 return 0;
1942 } 1942 }
1943 1943
1944 case VIDIOC_G_PRIORITY: 1944 case VIDIOC_G_PRIORITY:
1945 { 1945 {
1946 enum v4l2_priority *p = arg; 1946 enum v4l2_priority *p = arg;
1947 1947
1948 *p = v4l2_prio_max(&dev->prio); 1948 *p = v4l2_prio_max(&dev->prio);
1949 return 0; 1949 return 0;
1950 } 1950 }
1951 case VIDIOC_S_PRIORITY: 1951 case VIDIOC_S_PRIORITY:
1952 { 1952 {
1953 enum v4l2_priority *prio = arg; 1953 enum v4l2_priority *prio = arg;
1954 1954
1955 return v4l2_prio_change(&dev->prio, &fh->prio, *prio); 1955 return v4l2_prio_change(&dev->prio, &fh->prio, *prio);
1956 } 1956 }
1957 1957
1958 /* --- preview ioctls ---------------------------------------- */ 1958 /* --- preview ioctls ---------------------------------------- */
1959 case VIDIOC_ENUM_FMT: 1959 case VIDIOC_ENUM_FMT:
@@ -2102,7 +2102,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
2102 { 2102 {
2103 int res = saa7134_resource(fh); 2103 int res = saa7134_resource(fh);
2104 2104
2105 if (!res_get(dev,fh,res)) 2105 if (!res_get(dev,fh,res))
2106 return -EBUSY; 2106 return -EBUSY;
2107 return videobuf_streamon(saa7134_queue(fh)); 2107 return videobuf_streamon(saa7134_queue(fh));
2108 } 2108 }
@@ -2144,7 +2144,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
2144 struct v4l2_capability *cap = arg; 2144 struct v4l2_capability *cap = arg;
2145 2145
2146 memset(cap,0,sizeof(*cap)); 2146 memset(cap,0,sizeof(*cap));
2147 strcpy(cap->driver, "saa7134"); 2147 strcpy(cap->driver, "saa7134");
2148 strlcpy(cap->card, saa7134_boards[dev->board].name, 2148 strlcpy(cap->card, saa7134_boards[dev->board].name,
2149 sizeof(cap->card)); 2149 sizeof(cap->card));
2150 sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); 2150 sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci));
@@ -2275,7 +2275,7 @@ struct video_device saa7134_video_template =
2275{ 2275{
2276 .name = "saa7134-video", 2276 .name = "saa7134-video",
2277 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| 2277 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
2278 VID_TYPE_CLIPPING|VID_TYPE_SCALES, 2278 VID_TYPE_CLIPPING|VID_TYPE_SCALES,
2279 .hardware = 0, 2279 .hardware = 0,
2280 .fops = &video_fops, 2280 .fops = &video_fops,
2281 .minor = -1, 2281 .minor = -1,
@@ -2322,7 +2322,7 @@ int saa7134_video_init1(struct saa7134_dev *dev)
2322 dev->tda9887_conf |= TDA9887_AUTOMUTE; 2322 dev->tda9887_conf |= TDA9887_AUTOMUTE;
2323 dev->automute = 0; 2323 dev->automute = 0;
2324 2324
2325 INIT_LIST_HEAD(&dev->video_q.queue); 2325 INIT_LIST_HEAD(&dev->video_q.queue);
2326 init_timer(&dev->video_q.timeout); 2326 init_timer(&dev->video_q.timeout);
2327 dev->video_q.timeout.function = saa7134_buffer_timeout; 2327 dev->video_q.timeout.function = saa7134_buffer_timeout;
2328 dev->video_q.timeout.data = (unsigned long)(&dev->video_q); 2328 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 99bbdcf727c..064c2f7a8c1 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -346,7 +346,7 @@ struct saa7134_fh {
346 346
347/* oss dsp status */ 347/* oss dsp status */
348struct saa7134_oss { 348struct saa7134_oss {
349 struct semaphore lock; 349 struct semaphore lock;
350 int minor_mixer; 350 int minor_mixer;
351 int minor_dsp; 351 int minor_dsp;
352 unsigned int users_dsp; 352 unsigned int users_dsp;
@@ -384,9 +384,9 @@ struct saa7134_ir {
384 u32 mask_keycode; 384 u32 mask_keycode;
385 u32 mask_keydown; 385 u32 mask_keydown;
386 u32 mask_keyup; 386 u32 mask_keyup;
387 int polling; 387 int polling;
388 u32 last_gpio; 388 u32 last_gpio;
389 struct timer_list timer; 389 struct timer_list timer;
390}; 390};
391 391
392/* ts/mpeg status */ 392/* ts/mpeg status */
@@ -409,8 +409,8 @@ struct saa7134_mpeg_ops {
409/* global device status */ 409/* global device status */
410struct saa7134_dev { 410struct saa7134_dev {
411 struct list_head devlist; 411 struct list_head devlist;
412 struct semaphore lock; 412 struct semaphore lock;
413 spinlock_t slock; 413 spinlock_t slock;
414#ifdef VIDIOC_G_PRIORITY 414#ifdef VIDIOC_G_PRIORITY
415 struct v4l2_prio_state prio; 415 struct v4l2_prio_state prio;
416#endif 416#endif
diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c
index 255b6088ebf..14cf1d357c3 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)
310 memset(t,0,sizeof *t); 310 memset(t,0,sizeof *t);
311 311
312 client = &t->c; 312 client = &t->c;
313 memcpy(client,&client_template,sizeof(struct i2c_client)); 313 memcpy(client,&client_template,sizeof(struct i2c_client));
314 client->adapter = adap; 314 client->adapter = adap;
315 client->addr = addr; 315 client->addr = addr;
316 i2c_set_clientdata(client, t); 316 i2c_set_clientdata(client, t);
317 317
318 do_tda7432_init(client); 318 do_tda7432_init(client);
@@ -472,7 +472,7 @@ static int tda7432_command(struct i2c_client *client,
472 } 472 }
473 } 473 }
474 474
475 t->muted=(va->flags & VIDEO_AUDIO_MUTE); 475 t->muted=(va->flags & VIDEO_AUDIO_MUTE);
476 if (t->muted) 476 if (t->muted)
477 { 477 {
478 /* Mute & update balance*/ 478 /* Mute & update balance*/
@@ -503,12 +503,12 @@ static int tda7432_command(struct i2c_client *client,
503 503
504static struct i2c_driver driver = { 504static struct i2c_driver driver = {
505 .owner = THIS_MODULE, 505 .owner = THIS_MODULE,
506 .name = "i2c tda7432 driver", 506 .name = "i2c tda7432 driver",
507 .id = I2C_DRIVERID_TDA7432, 507 .id = I2C_DRIVERID_TDA7432,
508 .flags = I2C_DF_NOTIFY, 508 .flags = I2C_DF_NOTIFY,
509 .attach_adapter = tda7432_probe, 509 .attach_adapter = tda7432_probe,
510 .detach_client = tda7432_detach, 510 .detach_client = tda7432_detach,
511 .command = tda7432_command, 511 .command = tda7432_command,
512}; 512};
513 513
514static struct i2c_client client_template = 514static struct i2c_client client_template =
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 1e2acc4abbe..e2027dada5d 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -48,7 +48,7 @@ static struct freq_entry div_table[] = {
48 { 0x1C34, 3 }, 48 { 0x1C34, 3 },
49 { 0x0D34, 2 }, 49 { 0x0D34, 2 },
50 { 0x067B, 1 }, 50 { 0x067B, 1 },
51 { 0x0000, 0 }, 51 { 0x0000, 0 },
52}; 52};
53 53
54static struct freq_entry agc_table[] = { 54static struct freq_entry agc_table[] = {
diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
index 7e3dcdb262b..5a9faefc364 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
126 126
127static int i2c_read_register(struct i2c_adapter *adap, int addr, int reg) 127static int i2c_read_register(struct i2c_adapter *adap, int addr, int reg)
128{ 128{
129 unsigned char write[1]; 129 unsigned char write[1];
130 unsigned char read[1]; 130 unsigned char read[1];
131 struct i2c_msg msgs[2] = { 131 struct i2c_msg msgs[2] = {
132 { addr, 0, 1, write }, 132 { addr, 0, 1, write },
133 { addr, I2C_M_RD, 1, read } 133 { addr, I2C_M_RD, 1, read }
134 }; 134 };
135 write[0] = reg; 135 write[0] = reg;
136 136
137 if (2 != i2c_transfer(adap,msgs,2)) { 137 if (2 != i2c_transfer(adap,msgs,2)) {
138 printk(KERN_WARNING "tda9875: I/O error (read2)\n"); 138 printk(KERN_WARNING "tda9875: I/O error (read2)\n");
139 return -1; 139 return -1;
140 } 140 }
141 dprintk("tda9875: chip_read2: reg%d=0x%x\n",reg,read[0]); 141 dprintk("tda9875: chip_read2: reg%d=0x%x\n",reg,read[0]);
142 return read[0]; 142 return read[0];
143} 143}
144 144
145static void tda9875_set(struct i2c_client *client) 145static void tda9875_set(struct i2c_client *client)
@@ -184,7 +184,7 @@ static void do_tda9875_init(struct i2c_client *client)
184 tda9875_write(client, TDA9875_DACOS, 0x02 ); /* sig DAC i/o(in:nicam)*/ 184 tda9875_write(client, TDA9875_DACOS, 0x02 ); /* sig DAC i/o(in:nicam)*/
185 tda9875_write(client, TDA9875_ADCIS, 0x6f ); /* sig ADC input(in:mono)*/ 185 tda9875_write(client, TDA9875_ADCIS, 0x6f ); /* sig ADC input(in:mono)*/
186 tda9875_write(client, TDA9875_LOSR, 0x00 ); /* line out (in:mono)*/ 186 tda9875_write(client, TDA9875_LOSR, 0x00 ); /* line out (in:mono)*/
187 tda9875_write(client, TDA9875_AER, 0x00 ); /*06 Effect (AVL+PSEUDO) */ 187 tda9875_write(client, TDA9875_AER, 0x00 ); /*06 Effect (AVL+PSEUDO) */
188 tda9875_write(client, TDA9875_MCS, 0x44 ); /* Main ch select (DAC) */ 188 tda9875_write(client, TDA9875_MCS, 0x44 ); /* Main ch select (DAC) */
189 tda9875_write(client, TDA9875_MVL, 0x03 ); /* Vol Main left 10dB */ 189 tda9875_write(client, TDA9875_MVL, 0x03 ); /* Vol Main left 10dB */
190 tda9875_write(client, TDA9875_MVR, 0x03 ); /* Vol Main right 10dB*/ 190 tda9875_write(client, TDA9875_MVR, 0x03 ); /* Vol Main right 10dB*/
@@ -200,7 +200,7 @@ static void do_tda9875_init(struct i2c_client *client)
200 200
201 t->mode=AUDIO_UNMUTE; 201 t->mode=AUDIO_UNMUTE;
202 t->lvol=t->rvol =0; /* 0dB */ 202 t->lvol=t->rvol =0; /* 0dB */
203 t->bass=0; /* 0dB */ 203 t->bass=0; /* 0dB */
204 t->treble=0; /* 0dB */ 204 t->treble=0; /* 0dB */
205 tda9875_set(client); 205 tda9875_set(client);
206 206
@@ -239,9 +239,9 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind)
239 memset(t,0,sizeof *t); 239 memset(t,0,sizeof *t);
240 240
241 client = &t->c; 241 client = &t->c;
242 memcpy(client,&client_template,sizeof(struct i2c_client)); 242 memcpy(client,&client_template,sizeof(struct i2c_client));
243 client->adapter = adap; 243 client->adapter = adap;
244 client->addr = addr; 244 client->addr = addr;
245 i2c_set_clientdata(client, t); 245 i2c_set_clientdata(client, t);
246 246
247 if(!tda9875_checkit(adap,addr)) { 247 if(!tda9875_checkit(adap,addr)) {
@@ -287,7 +287,7 @@ static int tda9875_command(struct i2c_client *client,
287 dprintk("In tda9875_command...\n"); 287 dprintk("In tda9875_command...\n");
288 288
289 switch (cmd) { 289 switch (cmd) {
290 /* --- v4l ioctls --- */ 290 /* --- v4l ioctls --- */
291 /* take care: bttv does userspace copying, we'll get a 291 /* take care: bttv does userspace copying, we'll get a
292 kernel pointer here... */ 292 kernel pointer here... */
293 case VIDIOCGAUDIO: 293 case VIDIOCGAUDIO:
@@ -355,7 +355,7 @@ static int tda9875_command(struct i2c_client *client,
355//printk("tda9875 bal:%04x vol:%04x bass:%04x treble:%04x\n",va->balance,va->volume,va->bass,va->treble); 355//printk("tda9875 bal:%04x vol:%04x bass:%04x treble:%04x\n",va->balance,va->volume,va->bass,va->treble);
356 356
357 357
358 tda9875_set(client); 358 tda9875_set(client);
359 359
360 break; 360 break;
361 361
@@ -374,18 +374,18 @@ static int tda9875_command(struct i2c_client *client,
374 374
375static struct i2c_driver driver = { 375static struct i2c_driver driver = {
376 .owner = THIS_MODULE, 376 .owner = THIS_MODULE,
377 .name = "i2c tda9875 driver", 377 .name = "i2c tda9875 driver",
378 .id = I2C_DRIVERID_TDA9875, 378 .id = I2C_DRIVERID_TDA9875,
379 .flags = I2C_DF_NOTIFY, 379 .flags = I2C_DF_NOTIFY,
380 .attach_adapter = tda9875_probe, 380 .attach_adapter = tda9875_probe,
381 .detach_client = tda9875_detach, 381 .detach_client = tda9875_detach,
382 .command = tda9875_command, 382 .command = tda9875_command,
383}; 383};
384 384
385static struct i2c_client client_template = 385static struct i2c_client client_template =
386{ 386{
387 .name = "tda9875", 387 .name = "tda9875",
388 .driver = &driver, 388 .driver = &driver,
389}; 389};
390 390
391static int __init tda9875_init(void) 391static int __init tda9875_init(void)
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 6d2914f738f..9d6b6f57abc 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -46,11 +46,11 @@ MODULE_LICENSE("GPL");
46#define UNSET (-1U) 46#define UNSET (-1U)
47#define tda9887_info(fmt, arg...) do {\ 47#define tda9887_info(fmt, arg...) do {\
48 printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \ 48 printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \
49 i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) 49 i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0)
50#define tda9887_dbg(fmt, arg...) do {\ 50#define tda9887_dbg(fmt, arg...) do {\
51 if (debug) \ 51 if (debug) \
52 printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \ 52 printk(KERN_INFO "%s %d-%04x: " fmt, t->client.name, \
53 i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0) 53 i2c_adapter_id(t->client.adapter), t->client.addr , ##arg); } while (0)
54 54
55struct tda9887 { 55struct tda9887 {
56 struct i2c_client client; 56 struct i2c_client client;
@@ -484,11 +484,11 @@ static int tda9887_set_pinnacle(struct tda9887 *t, char *buf)
484 } 484 }
485 } 485 }
486 if (t->std & V4L2_STD_525_60) { 486 if (t->std & V4L2_STD_525_60) {
487 if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) { 487 if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
488 bCarrierMode = cIntercarrier; 488 bCarrierMode = cIntercarrier;
489 } else { 489 } else {
490 bCarrierMode = cQSS; 490 bCarrierMode = cQSS;
491 } 491 }
492 } 492 }
493 493
494 if (bCarrierMode != UNSET) { 494 if (bCarrierMode != UNSET) {
@@ -568,8 +568,8 @@ static int tda9887_status(struct tda9887 *t)
568 int rc; 568 int rc;
569 569
570 memset(buf,0,sizeof(buf)); 570 memset(buf,0,sizeof(buf));
571 if (1 != (rc = i2c_master_recv(&t->client,buf,1))) 571 if (1 != (rc = i2c_master_recv(&t->client,buf,1)))
572 tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc); 572 tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc);
573 dump_read_message(t, buf); 573 dump_read_message(t, buf);
574 return 0; 574 return 0;
575} 575}
@@ -600,8 +600,8 @@ static int tda9887_configure(struct tda9887 *t)
600 if (debug > 1) 600 if (debug > 1)
601 dump_write_message(t, t->data); 601 dump_write_message(t, t->data);
602 602
603 if (4 != (rc = i2c_master_send(&t->client,t->data,4))) 603 if (4 != (rc = i2c_master_send(&t->client,t->data,4)))
604 tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); 604 tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc);
605 605
606 if (debug > 2) { 606 if (debug > 2) {
607 msleep_interruptible(1000); 607 msleep_interruptible(1000);
@@ -616,11 +616,11 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
616{ 616{
617 struct tda9887 *t; 617 struct tda9887 *t;
618 618
619 client_template.adapter = adap; 619 client_template.adapter = adap;
620 client_template.addr = addr; 620 client_template.addr = addr;
621 621
622 if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL))) 622 if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
623 return -ENOMEM; 623 return -ENOMEM;
624 memset(t,0,sizeof(*t)); 624 memset(t,0,sizeof(*t));
625 625
626 t->client = client_template; 626 t->client = client_template;
@@ -628,7 +628,7 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
628 t->pinnacle_id = UNSET; 628 t->pinnacle_id = UNSET;
629 t->radio_mode = V4L2_TUNER_MODE_STEREO; 629 t->radio_mode = V4L2_TUNER_MODE_STEREO;
630 630
631 tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name); 631 tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name);
632 632
633 i2c_set_clientdata(&t->client, t); 633 i2c_set_clientdata(&t->client, t);
634 i2c_attach_client(&t->client); 634 i2c_attach_client(&t->client);
@@ -663,18 +663,18 @@ static int tda9887_detach(struct i2c_client *client)
663} 663}
664 664
665#define SWITCH_V4L2 if (!t->using_v4l2 && debug) \ 665#define SWITCH_V4L2 if (!t->using_v4l2 && debug) \
666 tda9887_info("switching to v4l2\n"); \ 666 tda9887_info("switching to v4l2\n"); \
667 t->using_v4l2 = 1; 667 t->using_v4l2 = 1;
668#define CHECK_V4L2 if (t->using_v4l2) { if (debug) \ 668#define CHECK_V4L2 if (t->using_v4l2) { if (debug) \
669 tda9887_info("ignore v4l1 call\n"); \ 669 tda9887_info("ignore v4l1 call\n"); \
670 return 0; } 670 return 0; }
671 671
672static int 672static int
673tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) 673tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
674{ 674{
675 struct tda9887 *t = i2c_get_clientdata(client); 675 struct tda9887 *t = i2c_get_clientdata(client);
676 676
677 switch (cmd) { 677 switch (cmd) {
678 678
679 /* --- configuration --- */ 679 /* --- configuration --- */
680 case AUDC_SET_RADIO: 680 case AUDC_SET_RADIO:
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c
index 38bf5094379..a9375ef05de 100644
--- a/drivers/media/video/tea5767.c
+++ b/drivers/media/video/tea5767.c
@@ -117,10 +117,10 @@
117#define TEA5767_RESERVED_MASK 0xff 117#define TEA5767_RESERVED_MASK 0xff
118 118
119enum tea5767_xtal_freq { 119enum tea5767_xtal_freq {
120 TEA5767_LOW_LO_32768 = 0, 120 TEA5767_LOW_LO_32768 = 0,
121 TEA5767_HIGH_LO_32768 = 1, 121 TEA5767_HIGH_LO_32768 = 1,
122 TEA5767_LOW_LO_13MHz = 2, 122 TEA5767_LOW_LO_13MHz = 2,
123 TEA5767_HIGH_LO_13MHz = 3, 123 TEA5767_HIGH_LO_13MHz = 3,
124}; 124};
125 125
126 126
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 44fa1423c1a..e677869afcf 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)
432 432
433static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd) 433static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd)
434{ 434{
435 if (mode == t->mode) 435 if (mode == t->mode)
436 return 0; 436 return 0;
437 437
438 t->mode = mode; 438 t->mode = mode;
439 439
440 if (check_mode(t, cmd) == EINVAL) { 440 if (check_mode(t, cmd) == EINVAL) {
441 t->mode = T_STANDBY; 441 t->mode = T_STANDBY;
442 if (t->standby) 442 if (t->standby)
443 t->standby (client); 443 t->standby (client);
444 return EINVAL; 444 return EINVAL;
445 } 445 }
446 return 0; 446 return 0;
447} 447}
448 448
449#define switch_v4l2() if (!t->using_v4l2) \ 449#define switch_v4l2() if (!t->using_v4l2) \
450 tuner_dbg("switching to v4l2\n"); \ 450 tuner_dbg("switching to v4l2\n"); \
451 t->using_v4l2 = 1; 451 t->using_v4l2 = 1;
452 452
453static inline int check_v4l2(struct tuner *t) 453static inline int check_v4l2(struct tuner *t)
454{ 454{
@@ -623,7 +623,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
623 switch_v4l2(); 623 switch_v4l2();
624 if (V4L2_TUNER_RADIO == f->type && 624 if (V4L2_TUNER_RADIO == f->type &&
625 V4L2_TUNER_RADIO != t->mode) { 625 V4L2_TUNER_RADIO != t->mode) {
626 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") 626 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
627 == EINVAL) 627 == EINVAL)
628 return 0; 628 return 0;
629 } 629 }
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index e67d9e77c75..84338f1e303 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -102,7 +102,7 @@ struct tunertype
102 */ 102 */
103static struct tunertype tuners[] = { 103static struct tunertype tuners[] = {
104 /* 0-9 */ 104 /* 0-9 */
105 { "Temic PAL (4002 FH5)", TEMIC, PAL, 105 { "Temic PAL (4002 FH5)", TEMIC, PAL,
106 16*140.25,16*463.25,0x02,0x04,0x01,0x8e,623}, 106 16*140.25,16*463.25,0x02,0x04,0x01,0x8e,623},
107 { "Philips PAL_I (FI1246 and compatibles)", Philips, PAL_I, 107 { "Philips PAL_I (FI1246 and compatibles)", Philips, PAL_I,
108 16*140.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, 108 16*140.25,16*463.25,0xa0,0x90,0x30,0x8e,623},
@@ -118,41 +118,41 @@ static struct tunertype tuners[] = {
118 16*157.25,16*463.25,0x02,0x04,0x01,0x8e,732}, 118 16*157.25,16*463.25,0x02,0x04,0x01,0x8e,732},
119 { "Temic PAL_I (4062 FY5)", TEMIC, PAL_I, 119 { "Temic PAL_I (4062 FY5)", TEMIC, PAL_I,
120 16*170.00,16*450.00,0x02,0x04,0x01,0x8e,623}, 120 16*170.00,16*450.00,0x02,0x04,0x01,0x8e,623},
121 { "Temic NTSC (4036 FY5)", TEMIC, NTSC, 121 { "Temic NTSC (4036 FY5)", TEMIC, NTSC,
122 16*157.25,16*463.25,0xa0,0x90,0x30,0x8e,732}, 122 16*157.25,16*463.25,0xa0,0x90,0x30,0x8e,732},
123 { "Alps HSBH1", TEMIC, NTSC, 123 { "Alps HSBH1", TEMIC, NTSC,
124 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732}, 124 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732},
125 125
126 /* 10-19 */ 126 /* 10-19 */
127 { "Alps TSBE1", TEMIC, PAL, 127 { "Alps TSBE1", TEMIC, PAL,
128 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732}, 128 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,732},
129 { "Alps TSBB5", Alps, PAL_I, /* tested (UK UHF) with Modulartech MM205 */ 129 { "Alps TSBB5", Alps, PAL_I, /* tested (UK UHF) with Modulartech MM205 */
130 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,632}, 130 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,632},
131 { "Alps TSBE5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ 131 { "Alps TSBE5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */
132 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,622}, 132 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,622},
133 { "Alps TSBC5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */ 133 { "Alps TSBC5", Alps, PAL, /* untested - data sheet guess. Only IF differs. */
134 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,608}, 134 16*133.25,16*351.25,0x01,0x02,0x08,0x8e,608},
135 { "Temic PAL_BG (4006FH5)", TEMIC, PAL, 135 { "Temic PAL_BG (4006FH5)", TEMIC, PAL,
136 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, 136 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623},
137 { "Alps TSCH6", Alps, NTSC, 137 { "Alps TSCH6", Alps, NTSC,
138 16*137.25,16*385.25,0x14,0x12,0x11,0x8e,732}, 138 16*137.25,16*385.25,0x14,0x12,0x11,0x8e,732},
139 { "Temic PAL_DK (4016 FY5)", TEMIC, PAL, 139 { "Temic PAL_DK (4016 FY5)", TEMIC, PAL,
140 16*168.25,16*456.25,0xa0,0x90,0x30,0x8e,623}, 140 16*168.25,16*456.25,0xa0,0x90,0x30,0x8e,623},
141 { "Philips NTSC_M (MK2)", Philips, NTSC, 141 { "Philips NTSC_M (MK2)", Philips, NTSC,
142 16*160.00,16*454.00,0xa0,0x90,0x30,0x8e,732}, 142 16*160.00,16*454.00,0xa0,0x90,0x30,0x8e,732},
143 { "Temic PAL_I (4066 FY5)", TEMIC, PAL_I, 143 { "Temic PAL_I (4066 FY5)", TEMIC, PAL_I,
144 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, 144 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623},
145 { "Temic PAL* auto (4006 FN5)", TEMIC, PAL, 145 { "Temic PAL* auto (4006 FN5)", TEMIC, PAL,
146 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, 146 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623},
147 147
148 /* 20-29 */ 148 /* 20-29 */
149 { "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", TEMIC, PAL, 149 { "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", TEMIC, PAL,
150 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, 150 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623},
151 { "Temic NTSC (4039 FR5)", TEMIC, NTSC, 151 { "Temic NTSC (4039 FR5)", TEMIC, NTSC,
152 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, 152 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732},
153 { "Temic PAL/SECAM multi (4046 FM5)", TEMIC, PAL, 153 { "Temic PAL/SECAM multi (4046 FM5)", TEMIC, PAL,
154 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623}, 154 16*169.00, 16*454.00, 0xa0,0x90,0x30,0x8e,623},
155 { "Philips PAL_DK (FI1256 and compatibles)", Philips, PAL, 155 { "Philips PAL_DK (FI1256 and compatibles)", Philips, PAL,
156 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, 156 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623},
157 { "Philips PAL/SECAM multi (FQ1216ME)", Philips, PAL, 157 { "Philips PAL/SECAM multi (FQ1216ME)", Philips, PAL,
158 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623}, 158 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,623},
@@ -173,21 +173,21 @@ static struct tunertype tuners[] = {
173 { "SHARP NTSC_JP (2U5JF5540)", SHARP, NTSC, /* 940=16*58.75 NTSC@Japan */ 173 { "SHARP NTSC_JP (2U5JF5540)", SHARP, NTSC, /* 940=16*58.75 NTSC@Japan */
174 16*137.25,16*317.25,0x01,0x02,0x08,0x8e,940 }, 174 16*137.25,16*317.25,0x01,0x02,0x08,0x8e,940 },
175 { "Samsung PAL TCPM9091PD27", Samsung, PAL, /* from sourceforge v3tv */ 175 { "Samsung PAL TCPM9091PD27", Samsung, PAL, /* from sourceforge v3tv */
176 16*169,16*464,0xA0,0x90,0x30,0x8e,623}, 176 16*169,16*464,0xA0,0x90,0x30,0x8e,623},
177 { "MT20xx universal", Microtune, PAL|NTSC, 177 { "MT20xx universal", Microtune, PAL|NTSC,
178 /* see mt20xx.c for details */ }, 178 /* see mt20xx.c for details */ },
179 { "Temic PAL_BG (4106 FH5)", TEMIC, PAL, 179 { "Temic PAL_BG (4106 FH5)", TEMIC, PAL,
180 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623}, 180 16*141.00, 16*464.00, 0xa0,0x90,0x30,0x8e,623},
181 { "Temic PAL_DK/SECAM_L (4012 FY5)", TEMIC, PAL, 181 { "Temic PAL_DK/SECAM_L (4012 FY5)", TEMIC, PAL,
182 16*140.25, 16*463.25, 0x02,0x04,0x01,0x8e,623}, 182 16*140.25, 16*463.25, 0x02,0x04,0x01,0x8e,623},
183 { "Temic NTSC (4136 FY5)", TEMIC, NTSC, 183 { "Temic NTSC (4136 FY5)", TEMIC, NTSC,
184 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732}, 184 16*158.00, 16*453.00, 0xa0,0x90,0x30,0x8e,732},
185 { "LG PAL (newer TAPC series)", LGINNOTEK, PAL, 185 { "LG PAL (newer TAPC series)", LGINNOTEK, PAL,
186 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,623}, 186 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,623},
187 { "Philips PAL/SECAM multi (FM1216ME MK3)", Philips, PAL, 187 { "Philips PAL/SECAM multi (FM1216ME MK3)", Philips, PAL,
188 16*158.00,16*442.00,0x01,0x02,0x04,0x8e,623 }, 188 16*158.00,16*442.00,0x01,0x02,0x04,0x8e,623 },
189 { "LG NTSC (newer TAPC series)", LGINNOTEK, NTSC, 189 { "LG NTSC (newer TAPC series)", LGINNOTEK, NTSC,
190 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,732}, 190 16*170.00, 16*450.00, 0x01,0x02,0x08,0x8e,732},
191 191
192 /* 40-49 */ 192 /* 40-49 */
193 { "HITACHI V7-J180AT", HITACHI, NTSC, 193 { "HITACHI V7-J180AT", HITACHI, NTSC,
@@ -196,24 +196,24 @@ static struct tunertype tuners[] = {
196 16*140.25,16*463.25,0x01,0xc2,0xcf,0x8e,623}, 196 16*140.25,16*463.25,0x01,0xc2,0xcf,0x8e,623},
197 { "Philips 1236D ATSC/NTSC daul in", Philips, ATSC, 197 { "Philips 1236D ATSC/NTSC daul in", Philips, ATSC,
198 16*157.25,16*454.00,0xa0,0x90,0x30,0x8e,732}, 198 16*157.25,16*454.00,0xa0,0x90,0x30,0x8e,732},
199 { "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", Philips, NTSC, 199 { "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", Philips, NTSC,
200 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, 200 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732},
201 { "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", Philips, NTSC, 201 { "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", Philips, NTSC,
202 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732}, 202 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732},
203 { "Microtune 4049 FM5", Microtune, PAL, 203 { "Microtune 4049 FM5", Microtune, PAL,
204 16*141.00,16*464.00,0xa0,0x90,0x30,0x8e,623}, 204 16*141.00,16*464.00,0xa0,0x90,0x30,0x8e,623},
205 { "Panasonic VP27s/ENGE4324D", Panasonic, NTSC, 205 { "Panasonic VP27s/ENGE4324D", Panasonic, NTSC,
206 16*160.00,16*454.00,0x01,0x02,0x08,0xce,940}, 206 16*160.00,16*454.00,0x01,0x02,0x08,0xce,940},
207 { "LG NTSC (TAPE series)", LGINNOTEK, NTSC, 207 { "LG NTSC (TAPE series)", LGINNOTEK, NTSC,
208 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, 208 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 },
209 { "Tenna TNF 8831 BGFF)", Philips, PAL, 209 { "Tenna TNF 8831 BGFF)", Philips, PAL,
210 16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, 210 16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623},
211 { "Microtune 4042 FI5 ATSC/NTSC dual in", Microtune, NTSC, 211 { "Microtune 4042 FI5 ATSC/NTSC dual in", Microtune, NTSC,
212 16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732}, 212 16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732},
213 213
214 /* 50-59 */ 214 /* 50-59 */
215 { "TCL 2002N", TCL, NTSC, 215 { "TCL 2002N", TCL, NTSC,
216 16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732}, 216 16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732},
217 { "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL, 217 { "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL,
218 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 }, 218 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 },
219 { "Thomson DDT 7610 (ATSC/NTSC)", THOMSON, ATSC, 219 { "Thomson DDT 7610 (ATSC/NTSC)", THOMSON, ATSC,
@@ -223,7 +223,7 @@ static struct tunertype tuners[] = {
223 { "tda8290+75", Philips, PAL|NTSC, 223 { "tda8290+75", Philips, PAL|NTSC,
224 /* see tda8290.c for details */ }, 224 /* see tda8290.c for details */ },
225 { "TCL 2002MB", TCL, PAL, 225 { "TCL 2002MB", TCL, PAL,
226 16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623}, 226 16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623},
227 { "Philips PAL/SECAM multi (FQ1216AME MK4)", Philips, PAL, 227 { "Philips PAL/SECAM multi (FQ1216AME MK4)", Philips, PAL,
228 16*160.00,16*442.00,0x01,0x02,0x04,0xce,623 }, 228 16*160.00,16*442.00,0x01,0x02,0x04,0xce,623 },
229 { "Philips FQ1236A MK4", Philips, NTSC, 229 { "Philips FQ1236A MK4", Philips, NTSC,
@@ -237,16 +237,16 @@ static struct tunertype tuners[] = {
237 { "Thomson DDT 7611 (ATSC/NTSC)", THOMSON, ATSC, 237 { "Thomson DDT 7611 (ATSC/NTSC)", THOMSON, ATSC,
238 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732}, 238 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732},
239 { "Tena TNF9533-D/IF/TNF9533-B/DF", Philips, PAL, 239 { "Tena TNF9533-D/IF/TNF9533-B/DF", Philips, PAL,
240 16*160.25,16*464.25,0x01,0x02,0x04,0x8e,623}, 240 16*160.25,16*464.25,0x01,0x02,0x04,0x8e,623},
241 { "Philips TEA5767HN FM Radio", Philips, RADIO, 241 { "Philips TEA5767HN FM Radio", Philips, RADIO,
242 /* see tea5767.c for details */}, 242 /* see tea5767.c for details */},
243 { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, 243 { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL,
244 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, 244 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 },
245 { "LG TDVS-H062F/TUA6034", LGINNOTEK, ATSC, 245 { "LG TDVS-H062F/TUA6034", LGINNOTEK, ATSC,
246 16*160.00,16*455.00,0x01,0x02,0x04,0x8e,732}, 246 16*160.00,16*455.00,0x01,0x02,0x04,0x8e,732},
247 { "Ymec TVF66T5-B/DFF", Philips, PAL, 247 { "Ymec TVF66T5-B/DFF", Philips, PAL,
248 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623}, 248 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623},
249 { "LG NTSC (TALN mini series)", LGINNOTEK, NTSC, 249 { "LG NTSC (TALN mini series)", LGINNOTEK, NTSC,
250 16*137.25,16*373.25,0x01,0x02,0x08,0x8e,732 }, 250 16*137.25,16*373.25,0x01,0x02,0x08,0x8e,732 },
251 { "Philips TD1316 Hybrid Tuner", Philips, PAL, 251 { "Philips TD1316 Hybrid Tuner", Philips, PAL,
252 16*160.00,16*442.00,0xa1,0xa2,0xa4,0xc8,623 }, 252 16*160.00,16*442.00,0xa1,0xa2,0xa4,0xc8,623 },
@@ -281,7 +281,7 @@ static int tuner_stereo(struct i2c_client *c)
281 status = tuner_getstatus (c); 281 status = tuner_getstatus (c);
282 282
283 switch (t->type) { 283 switch (t->type) {
284 case TUNER_PHILIPS_FM1216ME_MK3: 284 case TUNER_PHILIPS_FM1216ME_MK3:
285 case TUNER_PHILIPS_FM1236_MK3: 285 case TUNER_PHILIPS_FM1236_MK3:
286 case TUNER_PHILIPS_FM1256_IH3: 286 case TUNER_PHILIPS_FM1256_IH3:
287 stereo = ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); 287 stereo = ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3);
@@ -302,7 +302,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
302 u8 config; 302 u8 config;
303 u16 div; 303 u16 div;
304 struct tunertype *tun; 304 struct tunertype *tun;
305 unsigned char buffer[4]; 305 unsigned char buffer[4];
306 int rc; 306 int rc;
307 307
308 tun = &tuners[t->type]; 308 tun = &tuners[t->type];
@@ -419,7 +419,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
419 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 419 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
420 buffer[0],buffer[1],buffer[2],buffer[3]); 420 buffer[0],buffer[1],buffer[2],buffer[3]);
421 421
422 if (4 != (rc = i2c_master_send(c,buffer,4))) 422 if (4 != (rc = i2c_master_send(c,buffer,4)))
423 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 423 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
424 424
425 if (t->type == TUNER_MICROTUNE_4042FI5) { 425 if (t->type == TUNER_MICROTUNE_4042FI5) {
@@ -458,7 +458,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
458{ 458{
459 struct tunertype *tun; 459 struct tunertype *tun;
460 struct tuner *t = i2c_get_clientdata(c); 460 struct tuner *t = i2c_get_clientdata(c);
461 unsigned char buffer[4]; 461 unsigned char buffer[4];
462 unsigned div; 462 unsigned div;
463 int rc; 463 int rc;
464 464
@@ -491,13 +491,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
491 buffer[3] = 0xa4; 491 buffer[3] = 0xa4;
492 break; 492 break;
493 } 493 }
494 buffer[0] = (div>>8) & 0x7f; 494 buffer[0] = (div>>8) & 0x7f;
495 buffer[1] = div & 0xff; 495 buffer[1] = div & 0xff;
496 496
497 tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n", 497 tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n",
498 buffer[0],buffer[1],buffer[2],buffer[3]); 498 buffer[0],buffer[1],buffer[2],buffer[3]);
499 499
500 if (4 != (rc = i2c_master_send(c,buffer,4))) 500 if (4 != (rc = i2c_master_send(c,buffer,4)))
501 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 501 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
502} 502}
503 503
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 1c31ef52f86..e1639a24f77 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)
458#define TDA9855_LOUD 1<<5 /* Loudness, 1==off */ 458#define TDA9855_LOUD 1<<5 /* Loudness, 1==off */
459#define TDA9855_SUR 1<<3 /* Surround / Subwoofer 1==.5(L-R) 0==.5(L+R) */ 459#define TDA9855_SUR 1<<3 /* Surround / Subwoofer 1==.5(L-R) 0==.5(L+R) */
460 /* Bits 0 to 3 select various combinations 460 /* Bits 0 to 3 select various combinations
461 * of line in and line out, only the 461 * of line in and line out, only the
462 * interesting ones are defined */ 462 * interesting ones are defined */
463#define TDA9855_EXT 1<<2 /* Selects inputs LIR and LIL. Pins 41 & 12 */ 463#define TDA9855_EXT 1<<2 /* Selects inputs LIR and LIL. Pins 41 & 12 */
464#define TDA9855_INT 0 /* Selects inputs LOR and LOL. (internal) */ 464#define TDA9855_INT 0 /* Selects inputs LOR and LOL. (internal) */
465 465
@@ -1028,7 +1028,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip)
1028#define TEA6300_TR 0x03 /* treble */ 1028#define TEA6300_TR 0x03 /* treble */
1029#define TEA6300_FA 0x04 /* fader control */ 1029#define TEA6300_FA 0x04 /* fader control */
1030#define TEA6300_S 0x05 /* switch register */ 1030#define TEA6300_S 0x05 /* switch register */
1031 /* values for those registers: */ 1031 /* values for those registers: */
1032#define TEA6300_S_SA 0x01 /* stereo A input */ 1032#define TEA6300_S_SA 0x01 /* stereo A input */
1033#define TEA6300_S_SB 0x02 /* stereo B */ 1033#define TEA6300_S_SB 0x02 /* stereo B */
1034#define TEA6300_S_SC 0x04 /* stereo C */ 1034#define TEA6300_S_SC 0x04 /* stereo C */
@@ -1042,7 +1042,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip)
1042#define TEA6320_BA 0x05 /* bass (0-4) */ 1042#define TEA6320_BA 0x05 /* bass (0-4) */
1043#define TEA6320_TR 0x06 /* treble (0-4) */ 1043#define TEA6320_TR 0x06 /* treble (0-4) */
1044#define TEA6320_S 0x07 /* switch register */ 1044#define TEA6320_S 0x07 /* switch register */
1045 /* values for those registers: */ 1045 /* values for those registers: */
1046#define TEA6320_S_SA 0x07 /* stereo A input */ 1046#define TEA6320_S_SA 0x07 /* stereo A input */
1047#define TEA6320_S_SB 0x06 /* stereo B */ 1047#define TEA6320_S_SB 0x06 /* stereo B */
1048#define TEA6320_S_SC 0x05 /* stereo C */ 1048#define TEA6320_S_SC 0x05 /* stereo C */
@@ -1082,7 +1082,7 @@ static int tea6320_initialize(struct CHIPSTATE * chip)
1082#define TDA8425_BA 0x02 /* bass */ 1082#define TDA8425_BA 0x02 /* bass */
1083#define TDA8425_TR 0x03 /* treble */ 1083#define TDA8425_TR 0x03 /* treble */
1084#define TDA8425_S1 0x08 /* switch functions */ 1084#define TDA8425_S1 0x08 /* switch functions */
1085 /* values for those registers: */ 1085 /* values for those registers: */
1086#define TDA8425_S1_OFF 0xEE /* audio off (mute on) */ 1086#define TDA8425_S1_OFF 0xEE /* audio off (mute on) */
1087#define TDA8425_S1_CH1 0xCE /* audio channel 1 (mute off) - "linear stereo" mode */ 1087#define TDA8425_S1_CH1 0xCE /* audio channel 1 (mute off) - "linear stereo" mode */
1088#define TDA8425_S1_CH2 0xCF /* audio channel 2 (mute off) - "linear stereo" mode */ 1088#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)
1148 1148
1149/* bit definition of the RESET register, I2C data. */ 1149/* bit definition of the RESET register, I2C data. */
1150#define PIC16C54_MISC_RESET_REMOTE_CTL 0x01 /* bit 0, Reset to receive the key */ 1150#define PIC16C54_MISC_RESET_REMOTE_CTL 0x01 /* bit 0, Reset to receive the key */
1151 /* code of remote controller */ 1151 /* code of remote controller */
1152#define PIC16C54_MISC_MTS_MAIN 0x02 /* bit 1 */ 1152#define PIC16C54_MISC_MTS_MAIN 0x02 /* bit 1 */
1153#define PIC16C54_MISC_MTS_SAP 0x04 /* bit 2 */ 1153#define PIC16C54_MISC_MTS_SAP 0x04 /* bit 2 */
1154#define PIC16C54_MISC_MTS_BOTH 0x08 /* bit 3 */ 1154#define PIC16C54_MISC_MTS_BOTH 0x08 /* bit 3 */
@@ -1281,7 +1281,7 @@ static struct CHIPDESC chiplist[] = {
1281 .setmode = tda9840_setmode, 1281 .setmode = tda9840_setmode,
1282 .checkmode = generic_checkmode, 1282 .checkmode = generic_checkmode,
1283 1283
1284 .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN 1284 .init = { 2, { TDA9840_TEST, TDA9840_TEST_INT1SN
1285 /* ,TDA9840_SW, TDA9840_MONO */} } 1285 /* ,TDA9840_SW, TDA9840_MONO */} }
1286 }, 1286 },
1287 { 1287 {
@@ -1467,7 +1467,7 @@ static struct CHIPDESC chiplist[] = {
1467 .setmode = ta8874z_setmode, 1467 .setmode = ta8874z_setmode,
1468 .checkmode = generic_checkmode, 1468 .checkmode = generic_checkmode,
1469 1469
1470 .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}}, 1470 .init = {2, { TA8874Z_MONO_SET, TA8874Z_SEPARATION_DEFAULT}},
1471 }, 1471 },
1472 { .name = NULL } /* EOF */ 1472 { .name = NULL } /* EOF */
1473}; 1473};
@@ -1486,8 +1486,8 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
1486 return -ENOMEM; 1486 return -ENOMEM;
1487 memset(chip,0,sizeof(*chip)); 1487 memset(chip,0,sizeof(*chip));
1488 memcpy(&chip->c,&client_template,sizeof(struct i2c_client)); 1488 memcpy(&chip->c,&client_template,sizeof(struct i2c_client));
1489 chip->c.adapter = adap; 1489 chip->c.adapter = adap;
1490 chip->c.addr = addr; 1490 chip->c.addr = addr;
1491 i2c_set_clientdata(&chip->c, chip); 1491 i2c_set_clientdata(&chip->c, chip);
1492 1492
1493 /* find description for the chip */ 1493 /* find description for the chip */
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index ee605712bf1..68128e04dac 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -6,12 +6,12 @@
6 * which are: 6 * which are:
7 7
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) 8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de) 9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de> 10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
11 11
12 * Adjustments to fit a more general model and all bugs: 12 * Adjustments to fit a more general model and all bugs:
13 13
14 Copyright (C) 2003 John Klar <linpvr at projectplasma.com> 14 Copyright (C) 2003 John Klar <linpvr at projectplasma.com>
15 15
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by 17 * 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)");
54 54
55#define tveeprom_info(fmt, arg...) do {\ 55#define tveeprom_info(fmt, arg...) do {\
56 printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ 56 printk(KERN_INFO "tveeprom %d-%04x: " fmt, \
57 c->adapter->nr, c->addr , ##arg); } while (0) 57 c->adapter->nr, c->addr , ##arg); } while (0)
58#define tveeprom_warn(fmt, arg...) do {\ 58#define tveeprom_warn(fmt, arg...) do {\
59 printk(KERN_WARNING "tveeprom %d-%04x: " fmt, \ 59 printk(KERN_WARNING "tveeprom %d-%04x: " fmt, \
60 c->adapter->nr, c->addr , ##arg); } while (0) 60 c->adapter->nr, c->addr , ##arg); } while (0)
61#define tveeprom_dbg(fmt, arg...) do {\ 61#define tveeprom_dbg(fmt, arg...) do {\
62 if (debug) \ 62 if (debug) \
63 printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ 63 printk(KERN_INFO "tveeprom %d-%04x: " fmt, \
64 c->adapter->nr, c->addr , ##arg); } while (0) 64 c->adapter->nr, c->addr , ##arg); } while (0)
65 65
66 66
67/* ----------------------------------------------------------------------- */ 67/* ----------------------------------------------------------------------- */
@@ -294,7 +294,7 @@ static const char *decoderIC[] = {
294 294
295static int hasRadioTuner(int tunerType) 295static int hasRadioTuner(int tunerType)
296{ 296{
297 switch (tunerType) { 297 switch (tunerType) {
298 case 18: //PNPEnv_TUNER_FR1236_MK2: 298 case 18: //PNPEnv_TUNER_FR1236_MK2:
299 case 23: //PNPEnv_TUNER_FM1236: 299 case 23: //PNPEnv_TUNER_FM1236:
300 case 38: //PNPEnv_TUNER_FMR1236: 300 case 38: //PNPEnv_TUNER_FMR1236:
@@ -326,12 +326,12 @@ static int hasRadioTuner(int tunerType)
326 case 89: //PNPEnv_TUNER_TCL_MFPE05_2: 326 case 89: //PNPEnv_TUNER_TCL_MFPE05_2:
327 case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4: 327 case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4:
328 return 1; 328 return 1;
329 } 329 }
330 return 0; 330 return 0;
331} 331}
332 332
333void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, 333void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
334 unsigned char *eeprom_data) 334 unsigned char *eeprom_data)
335{ 335{
336 /* ---------------------------------------------- 336 /* ----------------------------------------------
337 ** The hauppauge eeprom format is tagged 337 ** The hauppauge eeprom format is tagged
diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c
index d86e08ebddf..8318bd1aad0 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
79{ 79{
80 struct video_audio va; 80 struct video_audio va;
81 int left,right,ret,val = 0; 81 int left,right,ret,val = 0;
82 struct TVMIXER *mix = file->private_data; 82 struct TVMIXER *mix = file->private_data;
83 struct i2c_client *client = mix->dev; 83 struct i2c_client *client = mix->dev;
84 void __user *argp = (void __user *)arg; 84 void __user *argp = (void __user *)arg;
85 int __user *p = argp; 85 int __user *p = argp;
@@ -87,25 +87,25 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
87 if (NULL == client) 87 if (NULL == client)
88 return -ENODEV; 88 return -ENODEV;
89 89
90 if (cmd == SOUND_MIXER_INFO) { 90 if (cmd == SOUND_MIXER_INFO) {
91 mixer_info info; 91 mixer_info info;
92 strlcpy(info.id, "tv card", sizeof(info.id)); 92 strlcpy(info.id, "tv card", sizeof(info.id));
93 strlcpy(info.name, client->name, sizeof(info.name)); 93 strlcpy(info.name, client->name, sizeof(info.name));
94 info.modify_counter = 42 /* FIXME */; 94 info.modify_counter = 42 /* FIXME */;
95 if (copy_to_user(argp, &info, sizeof(info))) 95 if (copy_to_user(argp, &info, sizeof(info)))
96 return -EFAULT; 96 return -EFAULT;
97 return 0; 97 return 0;
98 } 98 }
99 if (cmd == SOUND_OLD_MIXER_INFO) { 99 if (cmd == SOUND_OLD_MIXER_INFO) {
100 _old_mixer_info info; 100 _old_mixer_info info;
101 strlcpy(info.id, "tv card", sizeof(info.id)); 101 strlcpy(info.id, "tv card", sizeof(info.id));
102 strlcpy(info.name, client->name, sizeof(info.name)); 102 strlcpy(info.name, client->name, sizeof(info.name));
103 if (copy_to_user(argp, &info, sizeof(info))) 103 if (copy_to_user(argp, &info, sizeof(info)))
104 return -EFAULT; 104 return -EFAULT;
105 return 0; 105 return 0;
106 } 106 }
107 if (cmd == OSS_GETVERSION) 107 if (cmd == OSS_GETVERSION)
108 return put_user(SOUND_VERSION, p); 108 return put_user(SOUND_VERSION, p);
109 109
110 if (_SIOC_DIR(cmd) & _SIOC_WRITE) 110 if (_SIOC_DIR(cmd) & _SIOC_WRITE)
111 if (get_user(val, p)) 111 if (get_user(val, p))
@@ -181,8 +181,8 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
181 181
182static int tvmixer_open(struct inode *inode, struct file *file) 182static int tvmixer_open(struct inode *inode, struct file *file)
183{ 183{
184 int i, minor = iminor(inode); 184 int i, minor = iminor(inode);
185 struct TVMIXER *mix = NULL; 185 struct TVMIXER *mix = NULL;
186 struct i2c_client *client = NULL; 186 struct i2c_client *client = NULL;
187 187
188 for (i = 0; i < DEV_MAX; i++) { 188 for (i = 0; i < DEV_MAX; i++) {
@@ -204,7 +204,7 @@ static int tvmixer_open(struct inode *inode, struct file *file)
204#endif 204#endif
205 if (client->adapter->owner) 205 if (client->adapter->owner)
206 try_module_get(client->adapter->owner); 206 try_module_get(client->adapter->owner);
207 return 0; 207 return 0;
208} 208}
209 209
210static int tvmixer_release(struct inode *inode, struct file *file) 210static int tvmixer_release(struct inode *inode, struct file *file)
@@ -231,15 +231,15 @@ static struct i2c_driver driver = {
231 .owner = THIS_MODULE, 231 .owner = THIS_MODULE,
232#endif 232#endif
233 .name = "tv card mixer driver", 233 .name = "tv card mixer driver",
234 .id = I2C_DRIVERID_TVMIXER, 234 .id = I2C_DRIVERID_TVMIXER,
235#ifdef I2C_DF_DUMMY 235#ifdef I2C_DF_DUMMY
236 .flags = I2C_DF_DUMMY, 236 .flags = I2C_DF_DUMMY,
237#else 237#else
238 .flags = I2C_DF_NOTIFY, 238 .flags = I2C_DF_NOTIFY,
239 .detach_adapter = tvmixer_adapters, 239 .detach_adapter = tvmixer_adapters,
240#endif 240#endif
241 .attach_adapter = tvmixer_adapters, 241 .attach_adapter = tvmixer_adapters,
242 .detach_client = tvmixer_clients, 242 .detach_client = tvmixer_clients,
243}; 243};
244 244
245static struct file_operations tvmixer_fops = { 245static struct file_operations tvmixer_fops = {
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 88beb5a3be1..4134549d11a 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,
960 fmt->start[1] = fmt2->fmt.vbi.start[1]; 960 fmt->start[1] = fmt2->fmt.vbi.start[1];
961 fmt->count[1] = fmt2->fmt.vbi.count[1]; 961 fmt->count[1] = fmt2->fmt.vbi.count[1];
962 fmt->flags = fmt2->fmt.vbi.flags & 0x03; 962 fmt->flags = fmt2->fmt.vbi.flags & 0x03;
963 break; 963 break;
964 } 964 }
965 case VIDIOCSVBIFMT: 965 case VIDIOCSVBIFMT:
966 { 966 {
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c
index 574b8e36f3c..acfd3a103f3 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,
147 data,size,dma->nr_pages); 147 data,size,dma->nr_pages);
148 148
149 down_read(&current->mm->mmap_sem); 149 down_read(&current->mm->mmap_sem);
150 err = get_user_pages(current,current->mm, 150 err = get_user_pages(current,current->mm,
151 data & PAGE_MASK, dma->nr_pages, 151 data & PAGE_MASK, dma->nr_pages,
152 rw == READ, 1, /* force */ 152 rw == READ, 1, /* force */
153 dma->pages, NULL); 153 dma->pages, NULL);
@@ -750,9 +750,9 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data,
750{ 750{
751 enum v4l2_field field; 751 enum v4l2_field field;
752 unsigned long flags; 752 unsigned long flags;
753 int retval; 753 int retval;
754 754
755 /* setup stuff */ 755 /* setup stuff */
756 retval = -ENOMEM; 756 retval = -ENOMEM;
757 q->read_buf = videobuf_alloc(q->msize); 757 q->read_buf = videobuf_alloc(q->msize);
758 if (NULL == q->read_buf) 758 if (NULL == q->read_buf)
@@ -760,18 +760,18 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data,
760 760
761 q->read_buf->memory = V4L2_MEMORY_USERPTR; 761 q->read_buf->memory = V4L2_MEMORY_USERPTR;
762 q->read_buf->baddr = (unsigned long)data; 762 q->read_buf->baddr = (unsigned long)data;
763 q->read_buf->bsize = count; 763 q->read_buf->bsize = count;
764 field = videobuf_next_field(q); 764 field = videobuf_next_field(q);
765 retval = q->ops->buf_prepare(q,q->read_buf,field); 765 retval = q->ops->buf_prepare(q,q->read_buf,field);
766 if (0 != retval) 766 if (0 != retval)
767 goto done; 767 goto done;
768 768
769 /* start capture & wait */ 769 /* start capture & wait */
770 spin_lock_irqsave(q->irqlock,flags); 770 spin_lock_irqsave(q->irqlock,flags);
771 q->ops->buf_queue(q,q->read_buf); 771 q->ops->buf_queue(q,q->read_buf);
772 spin_unlock_irqrestore(q->irqlock,flags); 772 spin_unlock_irqrestore(q->irqlock,flags);
773 retval = videobuf_waiton(q->read_buf,0,0); 773 retval = videobuf_waiton(q->read_buf,0,0);
774 if (0 == retval) { 774 if (0 == retval) {
775 videobuf_dma_pci_sync(q->pci,&q->read_buf->dma); 775 videobuf_dma_pci_sync(q->pci,&q->read_buf->dma);
776 if (STATE_ERROR == q->read_buf->state) 776 if (STATE_ERROR == q->read_buf->state)
777 retval = -EIO; 777 retval = -EIO;
@@ -828,7 +828,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
828 } 828 }
829 829
830 /* wait until capture is done */ 830 /* wait until capture is done */
831 retval = videobuf_waiton(q->read_buf, nonblocking, 1); 831 retval = videobuf_waiton(q->read_buf, nonblocking, 1);
832 if (0 != retval) 832 if (0 != retval)
833 goto done; 833 goto done;
834 videobuf_dma_pci_sync(q->pci,&q->read_buf->dma); 834 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,
1096 1096
1097 dprintk(3,"nopage: fault @ %08lx [vma %08lx-%08lx]\n", 1097 dprintk(3,"nopage: fault @ %08lx [vma %08lx-%08lx]\n",
1098 vaddr,vma->vm_start,vma->vm_end); 1098 vaddr,vma->vm_start,vma->vm_end);
1099 if (vaddr > vma->vm_end) 1099 if (vaddr > vma->vm_end)
1100 return NOPAGE_SIGBUS; 1100 return NOPAGE_SIGBUS;
1101 page = alloc_page(GFP_USER); 1101 page = alloc_page(GFP_USER);
1102 if (!page) 1102 if (!page)
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c
index 8200f3dad0c..5bd592673b9 100644
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@ -36,10 +36,10 @@ MODULE_LICENSE("GPL");
36 36
37#define wm8775_err(fmt, arg...) do { \ 37#define wm8775_err(fmt, arg...) do { \
38 printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ 38 printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
39 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) 39 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
40#define wm8775_info(fmt, arg...) do { \ 40#define wm8775_info(fmt, arg...) do { \
41 printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ 41 printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
42 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) 42 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
43 43
44 44
45static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END }; 45static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END };