aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-11-09 00:37:43 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:20 -0500
commit4ac97914c6c35f6bf132071c718e034d0846b9f5 (patch)
tree98c7eb827bb8ba99730ed89d32703a30448fd813 /drivers/media/video/saa7134
parenta8900fc242406f25f315190a6d650f1d54617c2f (diff)
[PATCH] v4l: 800: whitespace cleanups
- Whitespace Cleanups. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134')
-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
14 files changed, 631 insertions, 631 deletions
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
index dac720ea3b06..2bf5cf79eec1 100644
--- a/drivers/media/video/saa7134/saa6752hs.c
+++ b/drivers/media/video/saa7134/saa6752hs.c
@@ -169,31 +169,31 @@ static int saa6752hs_chip_command(struct i2c_client* client,
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 465beac941d7..e9ffe8f144ac 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -80,11 +80,11 @@ typedef struct snd_card_saa7134 {
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 17b0549f2e1b..a60d49af341d 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2114,16 +2114,16 @@ struct saa7134_board saa7134_boards[] = {
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 907dbd4de7c9..afa0cfce6578 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -201,10 +201,10 @@ static int pending_call(struct notifier_block *self, unsigned long state,
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 87641f7e4322..5aadd44c2fa2 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -547,7 +547,7 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
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 77b627eb6483..e9ec69efb4c9 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -55,7 +55,7 @@ static void ts_reset_encoder(struct saa7134_dev* dev)
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 711aa8e85fac..2577d03485b8 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -239,7 +239,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
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 9dc41c1427a8..7ce0459989b5 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -114,24 +114,24 @@ static IR_KEYTAB_TYPE cinergy_codes[IR_KEYTAB_SIZE] = {
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 b1dcb4d10788..f1b0e0d93d7b 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -64,7 +64,7 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks)
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 58c521fade85..ac6431ba4fc3 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 cdfd69873ba9..470903e2f5e5 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -111,8 +111,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
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 fdca6c563b96..3daf1b597958 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -246,7 +246,7 @@ static void mute_input_7134(struct saa7134_dev *dev)
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 cd5545b2d60b..86db7fb96efd 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -310,12 +310,12 @@ static struct saa7134_tvnorm tvnorms[] = {
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 99bbdcf727c3..064c2f7a8c12 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