Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (26 commits)
V4L/DVB (4380): Bttv: Revert VBI_OFFSET to previous value, it works better
V4L/DVB (4379): Videodev: Check return value of class_device_register() correctly
V4L/DVB (4373): Correctly handle sysfs error leg file removal in pvrusb2
V4L/DVB (4368): Bttv: use class_device_create_file and handle errors
V4L/DVB (4367): Videodev: Handle class_device related errors
V4L/DVB (4365): OVERLAY flag were enabled by mistake
V4L/DVB (4344): Fix broken dependencies on media Kconfig
V4L/DVB (4343): Fix for compilation without V4L1 or V4L1_COMPAT
V4L/DVB (4342): Fix ext_controls align on 64 bit architectures
V4L/DVB (4341): VIDIOCSMICROCODE were missing on compat_ioctl32
V4L/DVB (4322): Fix dvb-pll autoprobing
V4L/DVB (4311): Fix possible dvb-pll oops
V4L/DVB (4337): Refine dead code elimination in pvrusb2
V4L/DVB (4323): [budget/budget-av/budget-ci/budget-patch drivers] fixed DMA start/stop code
V4L/DVB (4316): Check __must_check warnings
V4L/DVB (4314): Set the Auxiliary Byte when tuning LG H06xF in analog mode
V4L/DVB (4313): Bugfix for keycode calculation on NPG remotes
V4L/DVB (4310): Saa7134: rename dmasound_{init, exit}
V4L/DVB (4306): Support non interlaced capture by default for saa713x
V4L/DVB (4298): Check all __must_check warnings in bttv.
...

+354 -143
+9 -6
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 526 526 fepriv->delay = 3*HZ; 527 527 fepriv->status = 0; 528 528 fepriv->wakeup = 0; 529 - fepriv->reinitialise = 1; 529 + fepriv->reinitialise = 0; 530 + 531 + dvb_frontend_init(fe); 530 532 531 533 while (1) { 532 534 up(&fepriv->sem); /* is locked when we enter the thread... */ ··· 1015 1013 return ret; 1016 1014 1017 1015 if ((file->f_flags & O_ACCMODE) != O_RDONLY) { 1016 + 1017 + /* normal tune mode when opened R/W */ 1018 + fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; 1019 + fepriv->tone = -1; 1020 + fepriv->voltage = -1; 1021 + 1018 1022 ret = dvb_frontend_start (fe); 1019 1023 if (ret) 1020 1024 dvb_generic_release (inode, file); 1021 1025 1022 1026 /* empty event queue */ 1023 1027 fepriv->events.eventr = fepriv->events.eventw = 0; 1024 - 1025 - /* normal tune mode when opened R/W */ 1026 - fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; 1027 - fepriv->tone = -1; 1028 - fepriv->voltage = -1; 1029 1028 } 1030 1029 1031 1030 return ret;
+19 -5
drivers/media/dvb/frontends/dvb-pll.c
··· 194 194 { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ }, 195 195 { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ }, 196 196 { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ }, 197 - { 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ }, 198 - { 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ }, 199 - { 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ }, 200 - { 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ }, 201 - { 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ }, 197 + { 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ }, 198 + { 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ }, 199 + { 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ }, 200 + { 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ }, 201 + { 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ }, 202 202 } 203 203 }; 204 204 EXPORT_SYMBOL(dvb_pll_tda665x); ··· 613 613 614 614 int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc) 615 615 { 616 + u8 b1 [] = { 0 }; 617 + struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 }; 616 618 struct dvb_pll_priv *priv = NULL; 619 + int ret; 620 + 621 + if (i2c != NULL) { 622 + if (fe->ops.i2c_gate_ctrl) 623 + fe->ops.i2c_gate_ctrl(fe, 1); 624 + 625 + ret = i2c_transfer (i2c, &msg, 1); 626 + if (ret != 1) 627 + return -1; 628 + if (fe->ops.i2c_gate_ctrl) 629 + fe->ops.i2c_gate_ctrl(fe, 0); 630 + } 617 631 618 632 priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); 619 633 if (priv == NULL)
+2 -2
drivers/media/dvb/ttpci/av7110.c
··· 2203 2203 av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params; 2204 2204 2205 2205 /* set TDA9819 into DVB mode */ 2206 - saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 2207 - saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 2206 + saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD) 2207 + saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF) 2208 2208 2209 2209 /* tuner on this needs a slower i2c bus speed */ 2210 2210 av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
+6 -6
drivers/media/dvb/ttpci/av7110_v4l.c
··· 272 272 if (ves1820_writereg(dev, 0x09, 0x0f, 0x60)) 273 273 dprintk(1, "setting band in demodulator failed.\n"); 274 274 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 275 - saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD) 276 - saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9198 pin30(VIF) 275 + saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD) 276 + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF) 277 277 } 278 278 if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1) 279 279 dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num); ··· 308 308 if (ves1820_writereg(dev, 0x09, 0x0f, 0x20)) 309 309 dprintk(1, "setting band in demodulator failed.\n"); 310 310 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 311 - saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 312 - saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 311 + saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD) 312 + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF) 313 313 } 314 314 } 315 315 ··· 750 750 if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20)) 751 751 dprintk(1, "setting band in demodulator failed.\n"); 752 752 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 753 - saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 754 - saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 753 + saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD) 754 + saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF) 755 755 } 756 756 757 757 /* init the saa7113 */
+3
drivers/media/dvb/ttpci/budget-av.c
··· 1303 1303 budget_av->budget.dvb_adapter.priv = budget_av; 1304 1304 frontend_init(budget_av); 1305 1305 ciintf_init(budget_av); 1306 + 1307 + ttpci_budget_init_hooks(&budget_av->budget); 1308 + 1306 1309 return 0; 1307 1310 } 1308 1311
+2
drivers/media/dvb/ttpci/budget-ci.c
··· 1101 1101 budget_ci->budget.dvb_adapter.priv = budget_ci; 1102 1102 frontend_init(budget_ci); 1103 1103 1104 + ttpci_budget_init_hooks(&budget_ci->budget); 1105 + 1104 1106 return 0; 1105 1107 } 1106 1108
+44 -13
drivers/media/dvb/ttpci/budget-core.c
··· 63 63 { 64 64 dprintk(2, "budget: %p\n", budget); 65 65 66 - if (--budget->feeding) 67 - return budget->feeding; 68 - 69 66 saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off 70 67 SAA7146_IER_DISABLE(budget->dev, MASK_10); 71 68 return 0; ··· 74 77 75 78 dprintk(2, "budget: %p\n", budget); 76 79 77 - if (budget->feeding) 78 - return ++budget->feeding; 80 + if (!budget->feeding || !budget->fe_synced) 81 + return 0; 79 82 80 83 saa7146_write(dev, MC1, MASK_20); // DMA3 off 81 84 ··· 136 139 SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */ 137 140 saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */ 138 141 139 - return ++budget->feeding; 142 + return 0; 143 + } 144 + 145 + static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status) 146 + { 147 + struct budget *budget = (struct budget *) fe->dvb->priv; 148 + int synced; 149 + int ret; 150 + 151 + if (budget->read_fe_status) 152 + ret = budget->read_fe_status(fe, status); 153 + else 154 + ret = -EINVAL; 155 + 156 + if (!ret) { 157 + synced = (*status & FE_HAS_LOCK); 158 + if (synced != budget->fe_synced) { 159 + budget->fe_synced = synced; 160 + spin_lock(&budget->feedlock); 161 + if (synced) 162 + start_ts_capture(budget); 163 + else 164 + stop_ts_capture(budget); 165 + spin_unlock(&budget->feedlock); 166 + } 167 + } 168 + return ret; 140 169 } 141 170 142 171 static void vpeirq(unsigned long data) ··· 290 267 { 291 268 struct dvb_demux *demux = feed->demux; 292 269 struct budget *budget = (struct budget *) demux->priv; 293 - int status; 270 + int status = 0; 294 271 295 272 dprintk(2, "budget: %p\n", budget); 296 273 ··· 299 276 300 277 spin_lock(&budget->feedlock); 301 278 feed->pusi_seen = 0; /* have a clean section start */ 302 - status = start_ts_capture(budget); 279 + if (budget->feeding++ == 0) 280 + status = start_ts_capture(budget); 303 281 spin_unlock(&budget->feedlock); 304 282 return status; 305 283 } ··· 309 285 { 310 286 struct dvb_demux *demux = feed->demux; 311 287 struct budget *budget = (struct budget *) demux->priv; 312 - int status; 288 + int status = 0; 313 289 314 290 dprintk(2, "budget: %p\n", budget); 315 291 316 292 spin_lock(&budget->feedlock); 317 - status = stop_ts_capture(budget); 293 + if (--budget->feeding == 0) 294 + status = stop_ts_capture(budget); 318 295 spin_unlock(&budget->feedlock); 319 296 return status; 320 297 } ··· 495 470 return ret; 496 471 } 497 472 473 + void ttpci_budget_init_hooks(struct budget *budget) 474 + { 475 + if (budget->dvb_frontend && !budget->read_fe_status) { 476 + budget->read_fe_status = budget->dvb_frontend->ops.read_status; 477 + budget->dvb_frontend->ops.read_status = budget_read_fe_status; 478 + } 479 + } 480 + 498 481 int ttpci_budget_deinit(struct budget *budget) 499 482 { 500 483 struct saa7146_dev *dev = budget->dev; ··· 541 508 spin_lock(&budget->feedlock); 542 509 budget->video_port = video_port; 543 510 if (budget->feeding) { 544 - int oldfeeding = budget->feeding; 545 - budget->feeding = 1; 546 511 stop_ts_capture(budget); 547 512 start_ts_capture(budget); 548 - budget->feeding = oldfeeding; 549 513 } 550 514 spin_unlock(&budget->feedlock); 551 515 } ··· 550 520 EXPORT_SYMBOL_GPL(ttpci_budget_debiread); 551 521 EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite); 552 522 EXPORT_SYMBOL_GPL(ttpci_budget_init); 523 + EXPORT_SYMBOL_GPL(ttpci_budget_init_hooks); 553 524 EXPORT_SYMBOL_GPL(ttpci_budget_deinit); 554 525 EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler); 555 526 EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port);
+2
drivers/media/dvb/ttpci/budget-patch.c
··· 617 617 budget->dvb_adapter.priv = budget; 618 618 frontend_init(budget); 619 619 620 + ttpci_budget_init_hooks(budget); 621 + 620 622 return 0; 621 623 } 622 624
+2 -3
drivers/media/dvb/ttpci/budget.c
··· 375 375 if (budget->dvb_frontend) { 376 376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 377 377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 378 - budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 379 - budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; 380 - budget->dvb_frontend->ops.set_tone = budget_set_tone; 381 378 break; 382 379 } 383 380 break; ··· 470 473 471 474 budget->dvb_adapter.priv = budget; 472 475 frontend_init(budget); 476 + 477 + ttpci_budget_init_hooks(budget); 473 478 474 479 return 0; 475 480 }
+4 -3
drivers/media/dvb/ttpci/budget.h
··· 52 52 struct dmx_frontend hw_frontend; 53 53 struct dmx_frontend mem_frontend; 54 54 55 - int fe_synced; 56 - struct mutex pid_mutex; 57 - 58 55 int ci_present; 59 56 int video_port; 60 57 ··· 71 74 72 75 struct dvb_adapter dvb_adapter; 73 76 struct dvb_frontend *dvb_frontend; 77 + int (*read_fe_status)(struct dvb_frontend *fe, fe_status_t *status); 78 + int fe_synced; 79 + 74 80 void *priv; 75 81 }; 76 82 ··· 106 106 extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev, 107 107 struct saa7146_pci_extension_data *info, 108 108 struct module *owner); 109 + extern void ttpci_budget_init_hooks(struct budget *budget); 109 110 extern int ttpci_budget_deinit(struct budget *budget); 110 111 extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr); 111 112 extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
+2 -2
drivers/media/video/Kconfig
··· 145 145 146 146 config VIDEO_SAA5249 147 147 tristate "SAA5249 Teletext processor" 148 - depends on VIDEO_DEV && I2C 148 + depends on VIDEO_DEV && I2C && VIDEO_V4L1 149 149 help 150 150 Support for I2C bus based teletext using the SAA5249 chip. At the 151 151 moment this is only useful on some European WinTV cards. ··· 155 155 156 156 config TUNER_3036 157 157 tristate "SAB3036 tuner" 158 - depends on VIDEO_DEV && I2C 158 + depends on VIDEO_DEV && I2C && VIDEO_V4L1 159 159 help 160 160 Say Y here to include support for Philips SAB3036 compatible tuners. 161 161 If in doubt, say N.
+1 -1
drivers/media/video/bt8xx/Kconfig
··· 1 1 config VIDEO_BT848 2 2 tristate "BT848 Video For Linux" 3 - depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 3 + depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1 4 4 select I2C_ALGOBIT 5 5 select FW_LOADER 6 6 select VIDEO_BTCX
+13 -2
drivers/media/video/bt8xx/bttv-driver.c
··· 3923 3923 goto err; 3924 3924 printk(KERN_INFO "bttv%d: registered device video%d\n", 3925 3925 btv->c.nr,btv->video_dev->minor & 0x1f); 3926 - video_device_create_file(btv->video_dev, &class_device_attr_card); 3926 + if (class_device_create_file(&btv->video_dev->class_dev, 3927 + &class_device_attr_card)<0) { 3928 + printk(KERN_ERR "bttv%d: class_device_create_file 'card' " 3929 + "failed\n", btv->c.nr); 3930 + goto err; 3931 + } 3927 3932 3928 3933 /* vbi */ 3929 3934 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); ··· 4292 4287 4293 4288 static int bttv_init_module(void) 4294 4289 { 4290 + int ret; 4291 + 4295 4292 bttv_num = 0; 4296 4293 4297 4294 printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n", ··· 4315 4308 4316 4309 bttv_check_chipset(); 4317 4310 4318 - bus_register(&bttv_sub_bus_type); 4311 + ret = bus_register(&bttv_sub_bus_type); 4312 + if (ret < 0) { 4313 + printk(KERN_WARNING "bttv: bus_register error: %d\n", ret); 4314 + return ret; 4315 + } 4319 4316 return pci_register_driver(&bttv_pci_driver); 4320 4317 } 4321 4318
+10 -5
drivers/media/video/bt8xx/bttv-vbi.c
··· 31 31 #include <asm/io.h> 32 32 #include "bttvp.h" 33 33 34 - /* Offset from line sync pulse leading edge (0H) in 1 / sampling_rate: 35 - bt8x8 /HRESET pulse starts at 0H and has length 64 / fCLKx1 (E|O_VTC 36 - HSFMT = 0). VBI_HDELAY (always 0) is an offset from the trailing edge 37 - of /HRESET in 1 / fCLKx1, and the sampling_rate tvnorm->Fsc is fCLKx2. */ 38 - #define VBI_OFFSET ((64 + 0) * 2) 34 + /* Offset from line sync pulse leading edge (0H) to start of VBI capture, 35 + in fCLKx2 pixels. According to the datasheet, VBI capture starts 36 + VBI_HDELAY fCLKx1 pixels from the tailing edgeof /HRESET, and /HRESET 37 + is 64 fCLKx1 pixels wide. VBI_HDELAY is set to 0, so this should be 38 + (64 + 0) * 2 = 128 fCLKx2 pixels. But it's not! The datasheet is 39 + Just Plain Wrong. The real value appears to be different for 40 + different revisions of the bt8x8 chips, and to be affected by the 41 + horizontal scaling factor. Experimentally, the value is measured 42 + to be about 244. */ 43 + #define VBI_OFFSET 244 39 44 40 45 #define VBI_DEFLINES 16 41 46 #define VBI_MAXLINES 32
+24
drivers/media/video/compat_ioctl32.c
··· 490 490 return 0; 491 491 } 492 492 493 + struct video_code32 494 + { 495 + char loadwhat[16]; /* name or tag of file being passed */ 496 + compat_int_t datasize; 497 + unsigned char *data; 498 + }; 499 + 500 + static inline int microcode32(struct video_code *kp, struct video_code32 __user *up) 501 + { 502 + if(!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) || 503 + copy_from_user(kp->loadwhat, up->loadwhat, sizeof (up->loadwhat)) || 504 + get_user(kp->datasize, &up->datasize) || 505 + copy_from_user(kp->data, up->data, up->datasize)) 506 + return -EFAULT; 507 + return 0; 508 + } 509 + 493 510 #define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32) 494 511 #define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32) 495 512 #define VIDIOCGWIN32 _IOR('v',9, struct video_window32) ··· 515 498 #define VIDIOCSFBUF32 _IOW('v',12, struct video_buffer32) 516 499 #define VIDIOCGFREQ32 _IOR('v',14, u32) 517 500 #define VIDIOCSFREQ32 _IOW('v',15, u32) 501 + #define VIDIOCSMICROCODE32 _IOW('v',27, struct video_code32) 518 502 519 503 /* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */ 520 504 #define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4) ··· 608 590 struct video_tuner vt; 609 591 struct video_buffer vb; 610 592 struct video_window vw; 593 + struct video_code vc; 611 594 struct v4l2_format v2f; 612 595 struct v4l2_buffer v2b; 613 596 struct v4l2_framebuffer v2fb; ··· 647 628 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break; 648 629 case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break; 649 630 case VIDIOC_TRY_FMT32: cmd = VIDIOC_TRY_FMT; break; 631 + case VIDIOCSMICROCODE32: cmd = VIDIOCSMICROCODE; break; 650 632 }; 651 633 652 634 switch(cmd) { ··· 723 703 case VIDIOC_G_FBUF: 724 704 case VIDIOC_G_INPUT: 725 705 compatible_arg = 0; 706 + case VIDIOCSMICROCODE: 707 + err = microcode32(&karg.vc, up); 708 + compatible_arg = 0; 709 + break; 726 710 }; 727 711 728 712 if(err)
+1 -1
drivers/media/video/cpia2/Kconfig
··· 1 1 config VIDEO_CPIA2 2 2 tristate "CPiA2 Video For Linux" 3 - depends on VIDEO_DEV && USB 3 + depends on VIDEO_DEV && USB && VIDEO_V4L1 4 4 ---help--- 5 5 This is the video4linux driver for cameras based on Vision's CPiA2 6 6 (Colour Processor Interface ASIC), such as the Digital Blue QX5
+1 -1
drivers/media/video/cx88/cx88-input.c
··· 89 89 90 90 auxgpio = cx_read(MO_GP1_IO); 91 91 /* Take out the parity part */ 92 - gpio+=(gpio & 0x7fd) + (auxgpio & 0xef); 92 + gpio=(gpio & 0x7fd) + (auxgpio & 0xef); 93 93 } else 94 94 auxgpio = gpio; 95 95
+2 -3
drivers/media/video/cx88/cx88-video.c
··· 1180 1180 V4L2_CAP_READWRITE | 1181 1181 V4L2_CAP_STREAMING | 1182 1182 V4L2_CAP_VBI_CAPTURE | 1183 - V4L2_CAP_VIDEO_OVERLAY | 1184 1183 0; 1185 1184 if (UNSET != core->tuner_type) 1186 1185 cap->capabilities |= V4L2_CAP_TUNER; ··· 1225 1226 struct v4l2_format *f = arg; 1226 1227 return cx8800_try_fmt(dev,fh,f); 1227 1228 } 1228 - #ifdef HAVE_V4L1 1229 + #ifdef CONFIG_V4L1_COMPAT 1229 1230 /* --- streaming capture ------------------------------------- */ 1230 1231 case VIDIOCGMBUF: 1231 1232 { ··· 1584 1585 *id = 0; 1585 1586 return 0; 1586 1587 } 1587 - #ifdef HAVE_V4L1 1588 + #ifdef CONFIG_V4L1_COMPAT 1588 1589 case VIDIOCSTUNER: 1589 1590 { 1590 1591 struct video_tuner *v = arg;
+9 -1
drivers/media/video/msp3400-driver.c
··· 362 362 } 363 363 364 364 /* ------------------------------------------------------------------------ */ 365 - 365 + #ifdef CONFIG_VIDEO_V4L1 366 366 static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode) 367 367 { 368 368 if (rxsubchans == V4L2_TUNER_SUB_MONO) ··· 384 384 return V4L2_TUNER_MODE_LANG1; 385 385 return V4L2_TUNER_MODE_MONO; 386 386 } 387 + #endif 387 388 388 389 static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) 389 390 { ··· 510 509 /* --- v4l ioctls --- */ 511 510 /* take care: bttv does userspace copying, we'll get a 512 511 kernel pointer here... */ 512 + #ifdef CONFIG_VIDEO_V4L1 513 513 case VIDIOCGAUDIO: 514 514 { 515 515 struct video_audio *va = arg; ··· 579 577 } 580 578 581 579 case VIDIOCSFREQ: 580 + { 581 + /* new channel -- kick audio carrier scan */ 582 + msp_wake_thread(client); 583 + break; 584 + } 585 + #endif 582 586 case VIDIOC_S_FREQUENCY: 583 587 { 584 588 /* new channel -- kick audio carrier scan */
+6 -2
drivers/media/video/pvrusb2/pvrusb2-hdw.c
··· 852 852 return hdw->serial_number; 853 853 } 854 854 855 - 856 855 int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) 857 856 { 858 857 return hdw->unit_number; ··· 2317 2318 } 2318 2319 } 2319 2320 2320 - 2321 2321 /* Return name for this driver instance */ 2322 2322 const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) 2323 2323 { ··· 2540 2542 } 2541 2543 2542 2544 2545 + /* Issue a command and get a response from the device. This extended 2546 + version includes a probe flag (which if set means that device errors 2547 + should not be logged or treated as fatal) and a timeout in jiffies. 2548 + This can be used to non-lethally probe the health of endpoint 1. */ 2543 2549 static int pvr2_send_request_ex(struct pvr2_hdw *hdw, 2544 2550 unsigned int timeout,int probe_fl, 2545 2551 void *write_data,unsigned int write_len, ··· 2972 2970 } 2973 2971 2974 2972 2973 + /* Stop / start video stream transport */ 2975 2974 static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) 2976 2975 { 2977 2976 int status; ··· 3071 3068 } 3072 3069 3073 3070 3071 + /* Find I2C address of eeprom */ 3074 3072 static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) 3075 3073 { 3076 3074 int result;
+6 -3
drivers/media/video/pvrusb2/pvrusb2-io.c
··· 26 26 #include <linux/slab.h> 27 27 #include <linux/mutex.h> 28 28 29 + static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); 30 + 29 31 #define BUFFER_SIG 0x47653271 30 32 31 33 // #define SANITY_CHECK_BUFFERS ··· 517 515 } 518 516 519 517 /* Query / set the nominal buffer count */ 518 + int pvr2_stream_get_buffer_count(struct pvr2_stream *sp) 519 + { 520 + return sp->buffer_target_count; 521 + } 520 522 521 523 int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) 522 524 { ··· 558 552 { 559 553 return sp->r_count; 560 554 } 561 - 562 555 563 556 void pvr2_stream_kill(struct pvr2_stream *sp) 564 557 { ··· 612 607 return ret; 613 608 } 614 609 615 - 616 610 int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) 617 611 { 618 612 int ret = 0; ··· 649 645 { 650 646 return bp->status; 651 647 } 652 - 653 648 654 649 int pvr2_buffer_get_id(struct pvr2_buffer *bp) 655 650 {
+2
drivers/media/video/pvrusb2/pvrusb2-io.h
··· 47 47 void *data); 48 48 49 49 /* Query / set the nominal buffer count */ 50 + int pvr2_stream_get_buffer_count(struct pvr2_stream *); 50 51 int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int); 51 52 52 53 /* Get a pointer to a buffer that is either idle, ready, or is specified ··· 58 57 59 58 /* Find out how many buffers are idle or ready */ 60 59 int pvr2_stream_get_ready_count(struct pvr2_stream *); 60 + 61 61 62 62 /* Kill all pending buffers and throw away any ready buffers as well */ 63 63 void pvr2_stream_kill(struct pvr2_stream *);
+3 -2
drivers/media/video/pvrusb2/pvrusb2-ioread.c
··· 213 213 " pvr2_ioread_setup (tear-down) id=%p",cp); 214 214 pvr2_ioread_stop(cp); 215 215 pvr2_stream_kill(cp->stream); 216 - pvr2_stream_set_buffer_count(cp->stream,0); 216 + if (pvr2_stream_get_buffer_count(cp->stream)) { 217 + pvr2_stream_set_buffer_count(cp->stream,0); 218 + } 217 219 cp->stream = NULL; 218 220 } 219 221 if (sp) { ··· 252 250 } while (0); mutex_unlock(&cp->mutex); 253 251 return ret; 254 252 } 255 - 256 253 257 254 static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) 258 255 {
+73 -12
drivers/media/video/pvrusb2/pvrusb2-sysfs.c
··· 44 44 struct kobj_type ktype; 45 45 struct class_device_attribute attr_v4l_minor_number; 46 46 struct class_device_attribute attr_unit_number; 47 + int v4l_minor_number_created_ok; 48 + int unit_number_created_ok; 47 49 }; 48 50 49 51 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC 50 52 struct pvr2_sysfs_debugifc { 51 53 struct class_device_attribute attr_debugcmd; 52 54 struct class_device_attribute attr_debuginfo; 55 + int debugcmd_created_ok; 56 + int debuginfo_created_ok; 53 57 }; 54 58 #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ 55 59 ··· 71 67 struct pvr2_sysfs_ctl_item *item_next; 72 68 struct attribute *attr_gen[7]; 73 69 struct attribute_group grp; 70 + int created_ok; 74 71 char name[80]; 75 72 }; 76 73 ··· 492 487 struct pvr2_sysfs_func_set *fp; 493 488 struct pvr2_ctrl *cptr; 494 489 unsigned int cnt,acnt; 490 + int ret; 495 491 496 492 if ((ctl_id < 0) || (ctl_id >= (sizeof(funcs)/sizeof(funcs[0])))) { 497 493 return; ··· 595 589 cip->grp.name = cip->name; 596 590 cip->grp.attrs = cip->attr_gen; 597 591 598 - sysfs_create_group(&sfp->class_dev->kobj,&cip->grp); 592 + ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp); 593 + if (ret) { 594 + printk(KERN_WARNING "%s: sysfs_create_group error: %d\n", 595 + __FUNCTION__, ret); 596 + return; 597 + } 598 + cip->created_ok = !0; 599 599 } 600 600 601 601 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC ··· 612 600 static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) 613 601 { 614 602 struct pvr2_sysfs_debugifc *dip; 603 + int ret; 604 + 615 605 dip = kmalloc(sizeof(*dip),GFP_KERNEL); 616 606 if (!dip) return; 617 607 memset(dip,0,sizeof(*dip)); ··· 627 613 dip->attr_debuginfo.attr.mode = S_IRUGO; 628 614 dip->attr_debuginfo.show = debuginfo_show; 629 615 sfp->debugifc = dip; 630 - class_device_create_file(sfp->class_dev,&dip->attr_debugcmd); 631 - class_device_create_file(sfp->class_dev,&dip->attr_debuginfo); 616 + ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd); 617 + if (ret < 0) { 618 + printk(KERN_WARNING "%s: class_device_create_file error: %d\n", 619 + __FUNCTION__, ret); 620 + } else { 621 + dip->debugcmd_created_ok = !0; 622 + } 623 + ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo); 624 + if (ret < 0) { 625 + printk(KERN_WARNING "%s: class_device_create_file error: %d\n", 626 + __FUNCTION__, ret); 627 + } else { 628 + dip->debuginfo_created_ok = !0; 629 + } 632 630 } 633 631 634 632 635 633 static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp) 636 634 { 637 635 if (!sfp->debugifc) return; 638 - class_device_remove_file(sfp->class_dev, 639 - &sfp->debugifc->attr_debuginfo); 640 - class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); 636 + if (sfp->debugifc->debuginfo_created_ok) { 637 + class_device_remove_file(sfp->class_dev, 638 + &sfp->debugifc->attr_debuginfo); 639 + } 640 + if (sfp->debugifc->debugcmd_created_ok) { 641 + class_device_remove_file(sfp->class_dev, 642 + &sfp->debugifc->attr_debugcmd); 643 + } 641 644 kfree(sfp->debugifc); 642 645 sfp->debugifc = NULL; 643 646 } ··· 676 645 struct pvr2_sysfs_ctl_item *cip1,*cip2; 677 646 for (cip1 = sfp->item_first; cip1; cip1 = cip2) { 678 647 cip2 = cip1->item_next; 679 - sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp); 648 + if (cip1->created_ok) { 649 + sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp); 650 + } 680 651 pvr2_sysfs_trace("Destroying pvr2_sysfs_ctl_item id=%p",cip1); 681 652 kfree(cip1); 682 653 } ··· 708 675 pvr2_sysfs_tear_down_debugifc(sfp); 709 676 #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ 710 677 pvr2_sysfs_tear_down_controls(sfp); 711 - class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 712 - class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); 678 + if (sfp->v4l_minor_number_created_ok) { 679 + class_device_remove_file(sfp->class_dev, 680 + &sfp->attr_v4l_minor_number); 681 + } 682 + if (sfp->unit_number_created_ok) { 683 + class_device_remove_file(sfp->class_dev, 684 + &sfp->attr_unit_number); 685 + } 713 686 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); 714 687 sfp->class_dev->class_data = NULL; 715 688 class_device_unregister(sfp->class_dev); ··· 748 709 { 749 710 struct usb_device *usb_dev; 750 711 struct class_device *class_dev; 712 + int ret; 713 + 751 714 usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); 752 715 if (!usb_dev) return; 753 716 class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); ··· 774 733 775 734 sfp->class_dev = class_dev; 776 735 class_dev->class_data = sfp; 777 - class_device_register(class_dev); 736 + ret = class_device_register(class_dev); 737 + if (ret) { 738 + printk(KERN_ERR "%s: class_device_register failed\n", 739 + __FUNCTION__); 740 + kfree(class_dev); 741 + return; 742 + } 778 743 779 744 sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE; 780 745 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; 781 746 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; 782 747 sfp->attr_v4l_minor_number.show = v4l_minor_number_show; 783 748 sfp->attr_v4l_minor_number.store = NULL; 784 - class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 749 + ret = class_device_create_file(sfp->class_dev, 750 + &sfp->attr_v4l_minor_number); 751 + if (ret < 0) { 752 + printk(KERN_WARNING "%s: class_device_create_file error: %d\n", 753 + __FUNCTION__, ret); 754 + } else { 755 + sfp->v4l_minor_number_created_ok = !0; 756 + } 757 + 785 758 sfp->attr_unit_number.attr.owner = THIS_MODULE; 786 759 sfp->attr_unit_number.attr.name = "unit_number"; 787 760 sfp->attr_unit_number.attr.mode = S_IRUGO; 788 761 sfp->attr_unit_number.show = unit_number_show; 789 762 sfp->attr_unit_number.store = NULL; 790 - class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); 763 + ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); 764 + if (ret < 0) { 765 + printk(KERN_WARNING "%s: class_device_create_file error: %d\n", 766 + __FUNCTION__, ret); 767 + } else { 768 + sfp->unit_number_created_ok = !0; 769 + } 791 770 792 771 pvr2_sysfs_add_controls(sfp); 793 772 #ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
+5 -5
drivers/media/video/saa7134/saa7134-alsa.c
··· 997 997 struct saa7134_dev *dev = NULL; 998 998 struct list_head *list; 999 999 1000 - if (!dmasound_init && !dmasound_exit) { 1001 - dmasound_init = alsa_device_init; 1002 - dmasound_exit = alsa_device_exit; 1000 + if (!saa7134_dmasound_init && !saa7134_dmasound_exit) { 1001 + saa7134_dmasound_init = alsa_device_init; 1002 + saa7134_dmasound_exit = alsa_device_exit; 1003 1003 } else { 1004 1004 printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); 1005 1005 return -EBUSY; ··· 1036 1036 snd_card_free(snd_saa7134_cards[idx]); 1037 1037 } 1038 1038 1039 - dmasound_init = NULL; 1040 - dmasound_exit = NULL; 1039 + saa7134_dmasound_init = NULL; 1040 + saa7134_dmasound_exit = NULL; 1041 1041 printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); 1042 1042 1043 1043 return;
+8 -8
drivers/media/video/saa7134/saa7134-core.c
··· 95 95 static LIST_HEAD(mops_list); 96 96 static unsigned int saa7134_devcount; 97 97 98 - int (*dmasound_init)(struct saa7134_dev *dev); 99 - int (*dmasound_exit)(struct saa7134_dev *dev); 98 + int (*saa7134_dmasound_init)(struct saa7134_dev *dev); 99 + int (*saa7134_dmasound_exit)(struct saa7134_dev *dev); 100 100 101 101 #define dprintk(fmt, arg...) if (core_debug) \ 102 102 printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) ··· 1008 1008 /* check for signal */ 1009 1009 saa7134_irq_video_intl(dev); 1010 1010 1011 - if (dmasound_init && !dev->dmasound.priv_data) { 1012 - dmasound_init(dev); 1011 + if (saa7134_dmasound_init && !dev->dmasound.priv_data) { 1012 + saa7134_dmasound_init(dev); 1013 1013 } 1014 1014 1015 1015 return 0; ··· 1036 1036 struct saa7134_mpeg_ops *mops; 1037 1037 1038 1038 /* Release DMA sound modules if present */ 1039 - if (dmasound_exit && dev->dmasound.priv_data) { 1040 - dmasound_exit(dev); 1039 + if (saa7134_dmasound_exit && dev->dmasound.priv_data) { 1040 + saa7134_dmasound_exit(dev); 1041 1041 } 1042 1042 1043 1043 /* debugging ... */ ··· 1169 1169 1170 1170 /* ----------------- for the DMA sound modules --------------- */ 1171 1171 1172 - EXPORT_SYMBOL(dmasound_init); 1173 - EXPORT_SYMBOL(dmasound_exit); 1172 + EXPORT_SYMBOL(saa7134_dmasound_init); 1173 + EXPORT_SYMBOL(saa7134_dmasound_exit); 1174 1174 EXPORT_SYMBOL(saa7134_pgtable_free); 1175 1175 EXPORT_SYMBOL(saa7134_pgtable_build); 1176 1176 EXPORT_SYMBOL(saa7134_pgtable_alloc);
+5 -5
drivers/media/video/saa7134/saa7134-oss.c
··· 993 993 struct saa7134_dev *dev = NULL; 994 994 struct list_head *list; 995 995 996 - if (!dmasound_init && !dmasound_exit) { 997 - dmasound_init = oss_device_init; 998 - dmasound_exit = oss_device_exit; 996 + if (!saa7134_dmasound_init && !saa7134_dmasound_exit) { 997 + saa7134_dmasound_init = oss_device_init; 998 + saa7134_dmasound_exit = oss_device_exit; 999 999 } else { 1000 1000 printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); 1001 1001 return -EBUSY; ··· 1037 1037 1038 1038 } 1039 1039 1040 - dmasound_init = NULL; 1041 - dmasound_exit = NULL; 1040 + saa7134_dmasound_init = NULL; 1041 + saa7134_dmasound_exit = NULL; 1042 1042 1043 1043 printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); 1044 1044
+3 -3
drivers/media/video/saa7134/saa7134-video.c
··· 40 40 41 41 static unsigned int video_debug = 0; 42 42 static unsigned int gbuffers = 8; 43 - static unsigned int noninterlaced = 0; 43 + static unsigned int noninterlaced = 1; 44 44 static unsigned int gbufsize = 720*576*4; 45 45 static unsigned int gbufsize_max = 720*576*4; 46 46 module_param(video_debug, int, 0644); ··· 48 48 module_param(gbuffers, int, 0444); 49 49 MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); 50 50 module_param(noninterlaced, int, 0644); 51 - MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced"); 51 + MODULE_PARM_DESC(noninterlaced,"capture non interlaced video"); 52 52 53 53 #define dprintk(fmt, arg...) if (video_debug) \ 54 54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) ··· 2087 2087 struct v4l2_format *f = arg; 2088 2088 return saa7134_try_fmt(dev,fh,f); 2089 2089 } 2090 - #ifdef HAVE_V4L1 2090 + #ifdef CONFIG_V4L1_COMPAT 2091 2091 case VIDIOCGMBUF: 2092 2092 { 2093 2093 struct video_mbuf *mbuf = arg;
+2 -2
drivers/media/video/saa7134/saa7134.h
··· 586 586 587 587 int saa7134_set_dmabits(struct saa7134_dev *dev); 588 588 589 - extern int (*dmasound_init)(struct saa7134_dev *dev); 590 - extern int (*dmasound_exit)(struct saa7134_dev *dev); 589 + extern int (*saa7134_dmasound_init)(struct saa7134_dev *dev); 590 + extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev); 591 591 592 592 593 593 /* ----------------------------------------------------------- */
-1
drivers/media/video/stradis.c
··· 2181 2181 { 0 } 2182 2182 }; 2183 2183 2184 - MODULE_DEVICE_TABLE(pci, stradis_pci_tbl); 2185 2184 2186 2185 static struct pci_driver stradis_driver = { 2187 2186 .name = "stradis",
+12 -19
drivers/media/video/tuner-core.c
··· 196 196 i2c_master_send(c, buffer, 4); 197 197 default_tuner_init(c); 198 198 break; 199 - case TUNER_LG_TDVS_H06XF: 200 - /* Set the Auxiliary Byte. */ 201 - buffer[2] &= ~0x20; 202 - buffer[2] |= 0x18; 203 - buffer[3] = 0x20; 204 - i2c_master_send(c, buffer, 4); 205 - default_tuner_init(c); 206 - break; 207 199 case TUNER_PHILIPS_TD1316: 208 200 buffer[0] = 0x0b; 209 201 buffer[1] = 0xdc; ··· 590 598 if (t->standby) 591 599 t->standby (client); 592 600 break; 601 + #ifdef CONFIG_VIDEO_V4L1 593 602 case VIDIOCSAUDIO: 594 603 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 595 604 return 0; ··· 600 607 /* Should be implemented, since bttv calls it */ 601 608 tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 602 609 break; 603 - case TDA9887_SET_CONFIG: 604 - if (t->type == TUNER_TDA9887) { 605 - int *i = arg; 606 - 607 - t->tda9887_config = *i; 608 - set_freq(client, t->tv_freq); 609 - } 610 - break; 611 - /* --- v4l ioctls --- */ 612 - /* take care: bttv does userspace copying, we'll get a 613 - kernel pointer here... */ 614 610 case VIDIOCSCHAN: 615 611 { 616 612 static const v4l2_std_id map[] = { ··· 683 701 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; 684 702 return 0; 685 703 } 704 + #endif 705 + case TDA9887_SET_CONFIG: 706 + if (t->type == TUNER_TDA9887) { 707 + int *i = arg; 686 708 709 + t->tda9887_config = *i; 710 + set_freq(client, t->tv_freq); 711 + } 712 + break; 713 + /* --- v4l ioctls --- */ 714 + /* take care: bttv does userspace copying, we'll get a 715 + kernel pointer here... */ 687 716 case VIDIOC_S_STD: 688 717 { 689 718 v4l2_std_id *id = arg;
+17 -2
drivers/media/video/tuner-simple.c
··· 339 339 if (4 != (rc = i2c_master_send(c,buffer,4))) 340 340 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 341 341 342 - if (t->type == TUNER_MICROTUNE_4042FI5) { 342 + switch (t->type) { 343 + case TUNER_LG_TDVS_H06XF: 344 + /* Set the Auxiliary Byte. */ 345 + buffer[0] = buffer[2]; 346 + buffer[0] &= ~0x20; 347 + buffer[0] |= 0x18; 348 + buffer[1] = 0x20; 349 + tuner_dbg("tv 0x%02x 0x%02x\n",buffer[0],buffer[1]); 350 + 351 + if (2 != (rc = i2c_master_send(c,buffer,2))) 352 + tuner_warn("i2c i/o error: rc == %d (should be 2)\n",rc); 353 + break; 354 + case TUNER_MICROTUNE_4042FI5: 355 + { 343 356 // FIXME - this may also work for other tuners 344 357 unsigned long timeout = jiffies + msecs_to_jiffies(1); 345 358 u8 status_byte = 0; ··· 377 364 buffer[2] = config; 378 365 buffer[3] = cb; 379 366 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 380 - buffer[0],buffer[1],buffer[2],buffer[3]); 367 + buffer[0],buffer[1],buffer[2],buffer[3]); 381 368 382 369 if (4 != (rc = i2c_master_send(c,buffer,4))) 383 370 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 371 + break; 372 + } 384 373 } 385 374 } 386 375
+4 -4
drivers/media/video/usbvideo/Kconfig
··· 3 3 4 4 config USB_VICAM 5 5 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" 6 - depends on USB && VIDEO_V4L1 && EXPERIMENTAL 6 + depends on USB && VIDEO_DEV && VIDEO_V4L1 && EXPERIMENTAL 7 7 select VIDEO_USBVIDEO 8 8 ---help--- 9 9 Say Y here if you have 3com homeconnect camera (vicam). ··· 13 13 14 14 config USB_IBMCAM 15 15 tristate "USB IBM (Xirlink) C-it Camera support" 16 - depends on USB && VIDEO_V4L1 16 + depends on USB && VIDEO_DEV && VIDEO_V4L1 17 17 select VIDEO_USBVIDEO 18 18 ---help--- 19 19 Say Y here if you want to connect a IBM "C-It" camera, also known as ··· 28 28 29 29 config USB_KONICAWC 30 30 tristate "USB Konica Webcam support" 31 - depends on USB && VIDEO_V4L1 31 + depends on USB && VIDEO_DEV && VIDEO_V4L1 32 32 select VIDEO_USBVIDEO 33 33 ---help--- 34 34 Say Y here if you want support for webcams based on a Konica ··· 39 39 40 40 config USB_QUICKCAM_MESSENGER 41 41 tristate "USB Logitech Quickcam Messenger" 42 - depends on USB && VIDEO_DEV 42 + depends on USB && VIDEO_DEV && VIDEO_V4L1 43 43 select VIDEO_USBVIDEO 44 44 ---help--- 45 45 Say Y or M here to enable support for the USB Logitech Quickcam
+14 -10
drivers/media/video/v4l2-common.c
··· 202 202 /* ------------------------------------------------------------------ */ 203 203 /* debug help functions */ 204 204 205 - #ifdef HAVE_V4L1 205 + #ifdef CONFIG_V4L1_COMPAT 206 206 static const char *v4l1_ioctls[] = { 207 207 [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP", 208 208 [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN", ··· 301 301 #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) 302 302 303 303 static const char *v4l2_int_ioctls[] = { 304 - #ifdef HAVE_VIDEO_DECODER 304 + #ifdef CONFIG_V4L1_COMPAT 305 305 [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES", 306 306 [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS", 307 307 [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM", ··· 367 367 (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ? 368 368 v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd); 369 369 break; 370 - #ifdef HAVE_V4L1 370 + #ifdef CONFIG_V4L1_COMPAT 371 371 case 'v': 372 372 printk("v4l1 ioctl %s, dir=%s (0x%08x)\n", 373 373 (_IOC_NR(cmd) < V4L1_IOCTLS) ? ··· 414 414 printk ("%s: tuner type=%d\n", s, *p); 415 415 break; 416 416 } 417 + #ifdef CONFIG_VIDEO_V4L1_COMPAT 417 418 case DECODER_SET_VBI_BYPASS: 418 419 case DECODER_ENABLE_OUTPUT: 419 420 case DECODER_GET_STATUS: ··· 425 424 case VIDIOCCAPTURE: 426 425 case VIDIOCSYNC: 427 426 case VIDIOCSWRITEMODE: 427 + #endif 428 428 case TUNER_SET_TYPE_ADDR: 429 429 case TUNER_SET_STANDBY: 430 430 case TDA9887_SET_CONFIG: ··· 757 755 p->afc); 758 756 break; 759 757 } 758 + #ifdef CONFIG_VIDEO_V4L1_COMPAT 760 759 case VIDIOCGVBIFMT: 761 760 case VIDIOCSVBIFMT: 762 761 { ··· 927 924 p->clipcount); 928 925 break; 929 926 } 927 + case VIDIOCGFREQ: 928 + case VIDIOCSFREQ: 929 + { 930 + unsigned long *p=arg; 931 + printk ("%s: value=%lu\n", s, *p); 932 + break; 933 + } 934 + #endif 930 935 case VIDIOC_INT_AUDIO_CLOCK_FREQ: 931 936 case VIDIOC_INT_I2S_CLOCK_FREQ: 932 937 case VIDIOC_INT_S_STANDBY: ··· 942 931 u32 *p=arg; 943 932 944 933 printk ("%s: value=%d\n", s, *p); 945 - break; 946 - } 947 - case VIDIOCGFREQ: 948 - case VIDIOCSFREQ: 949 - { 950 - unsigned long *p=arg; 951 - printk ("%s: value=%lu\n", s, *p); 952 934 break; 953 935 } 954 936 case VIDIOC_G_STD:
+25 -4
drivers/media/video/videodev.c
··· 760 760 ret=vfd->vidioc_overlay(file, fh, *i); 761 761 break; 762 762 } 763 - #ifdef HAVE_V4L1 763 + #ifdef CONFIG_V4L1_COMPAT 764 764 /* --- streaming capture ------------------------------------- */ 765 765 case VIDIOCGMBUF: 766 766 { ··· 1512 1512 int i=0; 1513 1513 int base; 1514 1514 int end; 1515 + int ret; 1515 1516 char *name_base; 1516 1517 1517 1518 switch(type) ··· 1538 1537 name_base = "radio"; 1539 1538 break; 1540 1539 default: 1540 + printk(KERN_ERR "%s called with unknown type: %d\n", 1541 + __FUNCTION__, type); 1541 1542 return -1; 1542 1543 } 1543 1544 ··· 1574 1571 vfd->class_dev.class = &video_class; 1575 1572 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); 1576 1573 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); 1577 - class_device_register(&vfd->class_dev); 1578 - class_device_create_file(&vfd->class_dev, 1579 - &class_device_attr_name); 1574 + ret = class_device_register(&vfd->class_dev); 1575 + if (ret < 0) { 1576 + printk(KERN_ERR "%s: class_device_register failed\n", 1577 + __FUNCTION__); 1578 + goto fail_minor; 1579 + } 1580 + ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name); 1581 + if (ret < 0) { 1582 + printk(KERN_ERR "%s: class_device_create_file 'name' failed\n", 1583 + __FUNCTION__); 1584 + goto fail_classdev; 1585 + } 1580 1586 1581 1587 #if 1 1582 1588 /* needed until all drivers are fixed */ ··· 1595 1583 "http://lwn.net/Articles/36850/\n", vfd->name); 1596 1584 #endif 1597 1585 return 0; 1586 + 1587 + fail_classdev: 1588 + class_device_unregister(&vfd->class_dev); 1589 + fail_minor: 1590 + mutex_lock(&videodev_lock); 1591 + video_device[vfd->minor] = NULL; 1592 + vfd->minor = -1; 1593 + mutex_unlock(&videodev_lock); 1594 + return ret; 1598 1595 } 1599 1596 1600 1597 /**
+2 -2
drivers/media/video/vivi.c
··· 986 986 file->f_flags & O_NONBLOCK)); 987 987 } 988 988 989 - #ifdef HAVE_V4L1 989 + #ifdef CONFIG_V4L1_COMPAT 990 990 static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf) 991 991 { 992 992 struct vivi_fh *fh=priv; ··· 1328 1328 .vidioc_s_ctrl = vidioc_s_ctrl, 1329 1329 .vidioc_streamon = vidioc_streamon, 1330 1330 .vidioc_streamoff = vidioc_streamoff, 1331 - #ifdef HAVE_V4L1 1331 + #ifdef CONFIG_V4L1_COMPAT 1332 1332 .vidiocgmbuf = vidiocgmbuf, 1333 1333 #endif 1334 1334 .tvnorms = tvnorms,
+5 -2
include/linux/videodev.h
··· 12 12 #ifndef __LINUX_VIDEODEV_H 13 13 #define __LINUX_VIDEODEV_H 14 14 15 - #define HAVE_V4L1 1 16 - 17 15 #include <linux/videodev2.h> 16 + 17 + #ifdef CONFIG_VIDEO_V4L1_COMPAT 18 + #define HAVE_V4L1 1 18 19 19 20 struct video_capability 20 21 { ··· 336 335 #define VID_HARDWARE_SAA7114H 37 337 336 #define VID_HARDWARE_SN9C102 38 338 337 #define VID_HARDWARE_ARV 39 338 + 339 + #endif /* CONFIG_VIDEO_V4L1_COMPAT */ 339 340 340 341 #endif /* __LINUX_VIDEODEV_H */ 341 342
+1 -1
include/linux/videodev2.h
··· 716 716 __s64 value64; 717 717 void *reserved; 718 718 }; 719 - }; 719 + } __attribute__ ((packed)); 720 720 721 721 struct v4l2_ext_controls 722 722 {
+5 -2
include/media/v4l2-dev.h
··· 341 341 extern struct video_device* video_devdata(struct file*); 342 342 343 343 #define to_video_device(cd) container_of(cd, struct video_device, class_dev) 344 - static inline void 344 + static inline int 345 345 video_device_create_file(struct video_device *vfd, 346 346 struct class_device_attribute *attr) 347 347 { 348 - class_device_create_file(&vfd->class_dev, attr); 348 + int ret = class_device_create_file(&vfd->class_dev, attr); 349 + if (ret < 0) 350 + printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret); 351 + return ret; 349 352 } 350 353 static inline void 351 354 video_device_remove_file(struct video_device *vfd,