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