Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
V4L/DVB (10173): Missing v4l2_prio_close in radio_release
V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
V4L/DVB (10171): Use usb_set_intfdata
V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
V4L/DVB (10167): sms1xxx: add support for inverted gpio
V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments
V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2
V4L/DVB (10164): Add missing S2 caps flag to S2API
V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev
V4L/DVB (10162): tuner-simple: Fix tuner type set message
V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
V4L/DVB (10160): em28xx: update chip id for em2710
V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme
V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus
V4L/DVB (10155): Add TEA5764 radio driver
V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources.
V4L/DVB (10152): Change configuration of the Beholder H6 card
V4L/DVB (10151): Fix I2C bridge error in zl10353
...

+1629 -1106
+1
Documentation/video4linux/CARDLIST.saa7134
··· 152 152 151 -> ADS Tech Instant HDTV [1421:0380] 153 153 152 -> Asus Tiger Rev:1.00 [1043:4857] 154 154 153 -> Kworld Plus TV Analog Lite PCI [17de:7128] 155 + 154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d]
+1
Documentation/video4linux/si470x.txt
··· 41 41 - 10c4:818a: Silicon Labs USB FM Radio Reference Design 42 42 - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) 43 43 - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) 44 + - 10c5:819a: DealExtreme USB Radio 44 45 45 46 46 47 Software
+10 -9
Documentation/video4linux/v4l2-framework.txt
··· 184 184 It looks like this: 185 185 186 186 struct v4l2_subdev_core_ops { 187 - int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip); 187 + int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 188 188 int (*log_status)(struct v4l2_subdev *sd); 189 189 int (*init)(struct v4l2_subdev *sd, u32 val); 190 190 ... ··· 390 390 391 391 You should also set these fields: 392 392 393 - - parent: set to the parent device (same device as was used to register 394 - v4l2_device). 393 + - v4l2_dev: set to the v4l2_device parent device. 395 394 - name: set to something descriptive and unique. 396 - - fops: set to the file_operations struct. 395 + - fops: set to the v4l2_file_operations struct. 397 396 - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance 398 397 (highly recommended to use this and it might become compulsory in the 399 398 future!), then set this to your v4l2_ioctl_ops struct. 400 399 401 - If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to 402 - __video_ioctl2 or .ioctl to video_ioctl2 in your file_operations struct. 400 + If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or 401 + .ioctl to video_ioctl2 in your v4l2_file_operations struct. 402 + 403 + The v4l2_file_operations struct is a subset of file_operations. The main 404 + difference is that the inode argument is omitted since it is never used. 403 405 404 406 405 407 video_device registration ··· 412 410 413 411 err = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 414 412 if (err) { 415 - video_device_release(vdev); // or kfree(my_vdev); 413 + video_device_release(vdev); /* or kfree(my_vdev); */ 416 414 return err; 417 415 } 418 416 ··· 518 516 519 517 You can go from a video_device struct to the v4l2_device struct using: 520 518 521 - struct v4l2_device *v4l2_dev = dev_get_drvdata(vdev->parent); 522 - 519 + struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
+10 -11
drivers/media/common/saa7146_fops.c
··· 192 192 /********************************************************************************/ 193 193 /* file operations */ 194 194 195 - static int fops_open(struct inode *inode, struct file *file) 195 + static int fops_open(struct file *file) 196 196 { 197 - unsigned int minor = iminor(inode); 197 + unsigned int minor = video_devdata(file)->minor; 198 198 struct saa7146_dev *h = NULL, *dev = NULL; 199 199 struct list_head *list; 200 200 struct saa7146_fh *fh = NULL; ··· 202 202 203 203 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 204 204 205 - DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor)); 205 + DEB_EE(("file:%p, minor:%d\n", file, minor)); 206 206 207 207 if (mutex_lock_interruptible(&saa7146_devices_lock)) 208 208 return -ERESTARTSYS; ··· 255 255 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) 256 256 result = saa7146_vbi_uops.open(dev,file); 257 257 if (dev->ext_vv_data->vbi_fops.open) 258 - dev->ext_vv_data->vbi_fops.open(inode, file); 258 + dev->ext_vv_data->vbi_fops.open(file); 259 259 } else { 260 260 DEB_S(("initializing video...\n")); 261 261 result = saa7146_video_uops.open(dev,file); ··· 280 280 return result; 281 281 } 282 282 283 - static int fops_release(struct inode *inode, struct file *file) 283 + static int fops_release(struct file *file) 284 284 { 285 285 struct saa7146_fh *fh = file->private_data; 286 286 struct saa7146_dev *dev = fh->dev; 287 287 288 - DEB_EE(("inode:%p, file:%p\n",inode,file)); 288 + DEB_EE(("file:%p\n", file)); 289 289 290 290 if (mutex_lock_interruptible(&saa7146_devices_lock)) 291 291 return -ERESTARTSYS; ··· 294 294 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) 295 295 saa7146_vbi_uops.release(dev,file); 296 296 if (dev->ext_vv_data->vbi_fops.release) 297 - dev->ext_vv_data->vbi_fops.release(inode, file); 297 + dev->ext_vv_data->vbi_fops.release(file); 298 298 } else { 299 299 saa7146_video_uops.release(dev,file); 300 300 } ··· 308 308 return 0; 309 309 } 310 310 311 - static int fops_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 311 + static long fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 312 312 { 313 313 /* 314 - DEB_EE(("inode:%p, file:%p, cmd:%d, arg:%li\n",inode, file, cmd, arg)); 314 + DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg)); 315 315 */ 316 316 return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl); 317 317 } ··· 416 416 } 417 417 } 418 418 419 - static const struct file_operations video_fops = 419 + static const struct v4l2_file_operations video_fops = 420 420 { 421 421 .owner = THIS_MODULE, 422 422 .open = fops_open, ··· 426 426 .poll = fops_poll, 427 427 .mmap = fops_mmap, 428 428 .ioctl = fops_ioctl, 429 - .llseek = no_llseek, 430 429 }; 431 430 432 431 static void vv_callback(struct saa7146_dev *dev, unsigned long status)
+3 -2
drivers/media/common/saa7146_video.c
··· 834 834 * copying is done already, arg is a kernel pointer. 835 835 */ 836 836 837 - int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) 837 + long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) 838 838 { 839 839 struct saa7146_fh *fh = file->private_data; 840 840 struct saa7146_dev *dev = fh->dev; 841 841 struct saa7146_vv *vv = dev->vv_data; 842 842 843 - int err = 0, result = 0, ee = 0; 843 + long err = 0; 844 + int result = 0, ee = 0; 844 845 845 846 struct saa7146_use_ops *ops; 846 847 struct videobuf_queue *q;
+15 -1
drivers/media/common/tuners/tuner-simple.c
··· 820 820 int ret; 821 821 unsigned frequency = params->frequency / 62500; 822 822 823 + if (!tun->stepsize) { 824 + /* tuner-core was loaded before the digital tuner was 825 + * configured and somehow picked the wrong tuner type */ 826 + tuner_err("attempt to treat tuner %d (%s) as digital tuner " 827 + "without stepsize defined.\n", 828 + priv->type, priv->tun->name); 829 + return 0; /* failure */ 830 + } 831 + 823 832 t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL); 824 833 ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb); 825 834 if (ret < 0) ··· 1068 1059 memcpy(&fe->ops.tuner_ops, &simple_tuner_ops, 1069 1060 sizeof(struct dvb_tuner_ops)); 1070 1061 1071 - tuner_info("type set to %d (%s)\n", type, priv->tun->name); 1062 + if (type != priv->type) 1063 + tuner_warn("couldn't set type to %d. Using %d (%s) instead\n", 1064 + type, priv->type, priv->tun->name); 1065 + else 1066 + tuner_info("type set to %d (%s)\n", 1067 + priv->type, priv->tun->name); 1072 1068 1073 1069 if ((debug) || ((atv_input[priv->nr] > 0) || 1074 1070 (dtv_input[priv->nr] > 0))) {
+2 -1
drivers/media/dvb/dvb-core/dvbdev.c
··· 436 436 { 437 437 struct dvb_device *dvbdev = dev_get_drvdata(dev); 438 438 439 - add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id); 440 439 add_uevent_var(env, "DVB_ADAPTER_NUM=%d", dvbdev->adapter->num); 440 + add_uevent_var(env, "DVB_DEVICE_TYPE=%s", dnames[dvbdev->type]); 441 + add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id); 441 442 return 0; 442 443 } 443 444
+1 -1
drivers/media/dvb/dvb-usb/gp8psk.c
··· 187 187 /* load BCM4500 firmware */ 188 188 if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) 189 189 if (gp8psk_load_bcm4500fw(d)) 190 - return EINVAL; 190 + return -EINVAL; 191 191 return 0; 192 192 } 193 193
+1
drivers/media/dvb/frontends/cx24116.c
··· 1463 1463 FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | 1464 1464 FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | 1465 1465 FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | 1466 + FE_CAN_2G_MODULATION | 1466 1467 FE_CAN_QPSK | FE_CAN_RECOVER 1467 1468 }, 1468 1469
+2 -1
drivers/media/dvb/frontends/cx24116.h
··· 37 37 u8 mpg_clk_pos_pol:0x02; 38 38 }; 39 39 40 - #if defined(CONFIG_DVB_CX24116) || defined(CONFIG_DVB_CX24116_MODULE) 40 + #if defined(CONFIG_DVB_CX24116) || \ 41 + (defined(CONFIG_DVB_CX24116_MODULE) && defined(MODULE)) 41 42 extern struct dvb_frontend *cx24116_attach( 42 43 const struct cx24116_config *config, 43 44 struct i2c_adapter *i2c);
+1
drivers/media/dvb/frontends/stb0899_drv.c
··· 1618 1618 1619 1619 .caps = FE_CAN_INVERSION_AUTO | 1620 1620 FE_CAN_FEC_AUTO | 1621 + FE_CAN_2G_MODULATION | 1621 1622 FE_CAN_QPSK 1622 1623 }, 1623 1624
+7
drivers/media/dvb/frontends/zl10353.c
··· 587 587 588 588 static int zl10353_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) 589 589 { 590 + struct zl10353_state *state = fe->demodulator_priv; 590 591 u8 val = 0x0a; 592 + 593 + if (state->config.no_tuner) { 594 + /* No tuner attached to the internal I2C bus */ 595 + /* If set enable I2C bridge, the main I2C bus stopped hardly */ 596 + return 0; 597 + } 591 598 592 599 if (enable) 593 600 val |= 0x10;
+14 -5
drivers/media/dvb/siano/sms-cards.c
··· 120 120 .name = "Hauppauge WinTV MiniCard", 121 121 .type = SMS_NOVA_B0, 122 122 .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", 123 - .lna_ctrl = 1, 123 + .lna_ctrl = -1, 124 124 }, 125 125 }; 126 126 ··· 131 131 return &sms_boards[id]; 132 132 } 133 133 134 - static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable) 134 + static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) 135 135 { 136 - int ret; 136 + int lvl, ret; 137 + u32 gpio; 137 138 struct smscore_gpio_config gpioconfig = { 138 139 .direction = SMS_GPIO_DIRECTION_OUTPUT, 139 140 .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, ··· 146 145 if (pin == 0) 147 146 return -EINVAL; 148 147 149 - ret = smscore_configure_gpio(coredev, pin, &gpioconfig); 148 + if (pin < 0) { 149 + /* inverted gpio */ 150 + gpio = pin * -1; 151 + lvl = enable ? 0 : 1; 152 + } else { 153 + gpio = pin; 154 + lvl = enable ? 1 : 0; 155 + } 150 156 157 + ret = smscore_configure_gpio(coredev, gpio, &gpioconfig); 151 158 if (ret < 0) 152 159 return ret; 153 160 154 - return smscore_set_gpio(coredev, pin, enable); 161 + return smscore_set_gpio(coredev, gpio, lvl); 155 162 } 156 163 157 164 int sms_board_setup(struct smscore_device_t *coredev)
+2 -2
drivers/media/dvb/ttpci/av7110_v4l.c
··· 316 316 return 0; 317 317 } 318 318 319 - static int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 319 + static long av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 320 320 { 321 321 struct saa7146_dev *dev = fh->dev; 322 322 struct av7110 *av7110 = (struct av7110*) dev->ext_priv; ··· 567 567 return 0; 568 568 } 569 569 570 - static int av7110_vbi_reset(struct inode *inode, struct file *file) 570 + static int av7110_vbi_reset(struct file *file) 571 571 { 572 572 struct saa7146_fh *fh = file->private_data; 573 573 struct saa7146_dev *dev = fh->dev;
+1 -1
drivers/media/dvb/ttpci/budget-av.c
··· 1493 1493 {0, 0} 1494 1494 }; 1495 1495 1496 - static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 1496 + static long av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 1497 1497 { 1498 1498 struct saa7146_dev *dev = fh->dev; 1499 1499 struct budget_av *budget_av = (struct budget_av *) dev->ext_priv;
+1 -1
drivers/media/dvb/ttusb-budget/Kconfig
··· 1 1 config DVB_TTUSB_BUDGET 2 2 tristate "Technotrend/Hauppauge Nova-USB devices" 3 - depends on DVB_CORE && USB && I2C 3 + depends on DVB_CORE && USB && I2C && PCI 4 4 select DVB_CX22700 if !DVB_FE_CUSTOMISE 5 5 select DVB_TDA1004X if !DVB_FE_CUSTOMISE 6 6 select DVB_VES1820 if !DVB_FE_CUSTOMISE
+1 -1
drivers/media/dvb/ttusb-dec/Kconfig
··· 1 1 config DVB_TTUSB_DEC 2 2 tristate "Technotrend/Hauppauge USB DEC devices" 3 - depends on DVB_CORE && USB && INPUT 3 + depends on DVB_CORE && USB && INPUT && PCI 4 4 select CRC32 5 5 help 6 6 Support for external USB adapters designed by Technotrend and
+19
drivers/media/radio/Kconfig
··· 387 387 To compile this driver as a module, choose M here: the 388 388 module will be called radio-mr800. 389 389 390 + config RADIO_TEA5764 391 + tristate "TEA5764 I2C FM radio support" 392 + depends on I2C && VIDEO_V4L2 393 + ---help--- 394 + Say Y here if you want to use the TEA5764 FM chip found in 395 + EZX phones. This FM chip is present in EZX phones from Motorola, 396 + connected to internal pxa I2C bus. 397 + 398 + To compile this driver as a module, choose M here: the 399 + module will be called radio-tea5764. 400 + 401 + config RADIO_TEA5764_XTAL 402 + bool "TEA5764 crystal reference" 403 + depends on RADIO_TEA5764=y 404 + default y 405 + help 406 + Say Y here if TEA5764 have a 32768 Hz crystal in circuit, say N 407 + here if TEA5764 reference frequency is connected in FREQIN. 408 + 390 409 endif # RADIO_ADAPTERS
+1
drivers/media/radio/Makefile
··· 19 19 obj-$(CONFIG_USB_DSBR) += dsbr100.o 20 20 obj-$(CONFIG_USB_SI470X) += radio-si470x.o 21 21 obj-$(CONFIG_USB_MR800) += radio-mr800.o 22 + obj-$(CONFIG_RADIO_TEA5764) += radio-tea5764.o 22 23 23 24 EXTRA_CFLAGS += -Isound
+5 -9
drivers/media/radio/dsbr100.c
··· 154 154 static int usb_dsbr100_probe(struct usb_interface *intf, 155 155 const struct usb_device_id *id); 156 156 static void usb_dsbr100_disconnect(struct usb_interface *intf); 157 - static int usb_dsbr100_open(struct inode *inode, struct file *file); 158 - static int usb_dsbr100_close(struct inode *inode, struct file *file); 157 + static int usb_dsbr100_open(struct file *file); 158 + static int usb_dsbr100_close(struct file *file); 159 159 static int usb_dsbr100_suspend(struct usb_interface *intf, 160 160 pm_message_t message); 161 161 static int usb_dsbr100_resume(struct usb_interface *intf); ··· 566 566 return 0; 567 567 } 568 568 569 - static int usb_dsbr100_open(struct inode *inode, struct file *file) 569 + static int usb_dsbr100_open(struct file *file) 570 570 { 571 571 struct dsbr100_device *radio = video_drvdata(file); 572 572 int retval; ··· 593 593 return 0; 594 594 } 595 595 596 - static int usb_dsbr100_close(struct inode *inode, struct file *file) 596 + static int usb_dsbr100_close(struct file *file) 597 597 { 598 598 struct dsbr100_device *radio = video_drvdata(file); 599 599 int retval; ··· 653 653 } 654 654 655 655 /* File system interface */ 656 - static const struct file_operations usb_dsbr100_fops = { 656 + static const struct v4l2_file_operations usb_dsbr100_fops = { 657 657 .owner = THIS_MODULE, 658 658 .open = usb_dsbr100_open, 659 659 .release = usb_dsbr100_close, 660 660 .ioctl = video_ioctl2, 661 - #ifdef CONFIG_COMPAT 662 - .compat_ioctl = v4l_compat_ioctl32, 663 - #endif 664 - .llseek = no_llseek, 665 661 }; 666 662 667 663 static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = {
+3 -7
drivers/media/radio/radio-aimslab.c
··· 374 374 375 375 static struct rt_device rtrack_unit; 376 376 377 - static int rtrack_exclusive_open(struct inode *inode, struct file *file) 377 + static int rtrack_exclusive_open(struct file *file) 378 378 { 379 379 return test_and_set_bit(0, &rtrack_unit.in_use) ? -EBUSY : 0; 380 380 } 381 381 382 - static int rtrack_exclusive_release(struct inode *inode, struct file *file) 382 + static int rtrack_exclusive_release(struct file *file) 383 383 { 384 384 clear_bit(0, &rtrack_unit.in_use); 385 385 return 0; 386 386 } 387 387 388 - static const struct file_operations rtrack_fops = { 388 + static const struct v4l2_file_operations rtrack_fops = { 389 389 .owner = THIS_MODULE, 390 390 .open = rtrack_exclusive_open, 391 391 .release = rtrack_exclusive_release, 392 392 .ioctl = video_ioctl2, 393 - #ifdef CONFIG_COMPAT 394 - .compat_ioctl = v4l_compat_ioctl32, 395 - #endif 396 - .llseek = no_llseek, 397 393 }; 398 394 399 395 static const struct v4l2_ioctl_ops rtrack_ioctl_ops = {
+3 -7
drivers/media/radio/radio-aztech.c
··· 338 338 339 339 static struct az_device aztech_unit; 340 340 341 - static int aztech_exclusive_open(struct inode *inode, struct file *file) 341 + static int aztech_exclusive_open(struct file *file) 342 342 { 343 343 return test_and_set_bit(0, &aztech_unit.in_use) ? -EBUSY : 0; 344 344 } 345 345 346 - static int aztech_exclusive_release(struct inode *inode, struct file *file) 346 + static int aztech_exclusive_release(struct file *file) 347 347 { 348 348 clear_bit(0, &aztech_unit.in_use); 349 349 return 0; 350 350 } 351 351 352 - static const struct file_operations aztech_fops = { 352 + static const struct v4l2_file_operations aztech_fops = { 353 353 .owner = THIS_MODULE, 354 354 .open = aztech_exclusive_open, 355 355 .release = aztech_exclusive_release, 356 356 .ioctl = video_ioctl2, 357 - #ifdef CONFIG_COMPAT 358 - .compat_ioctl = v4l_compat_ioctl32, 359 - #endif 360 - .llseek = no_llseek, 361 357 }; 362 358 363 359 static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
+3 -7
drivers/media/radio/radio-cadet.c
··· 529 529 } 530 530 531 531 static int 532 - cadet_open(struct inode *inode, struct file *file) 532 + cadet_open(struct file *file) 533 533 { 534 534 users++; 535 535 if (1 == users) init_waitqueue_head(&read_queue); ··· 537 537 } 538 538 539 539 static int 540 - cadet_release(struct inode *inode, struct file *file) 540 + cadet_release(struct file *file) 541 541 { 542 542 users--; 543 543 if (0 == users){ ··· 557 557 } 558 558 559 559 560 - static const struct file_operations cadet_fops = { 560 + static const struct v4l2_file_operations cadet_fops = { 561 561 .owner = THIS_MODULE, 562 562 .open = cadet_open, 563 563 .release = cadet_release, 564 564 .read = cadet_read, 565 565 .ioctl = video_ioctl2, 566 566 .poll = cadet_poll, 567 - #ifdef CONFIG_COMPAT 568 - .compat_ioctl = v4l_compat_ioctl32, 569 - #endif 570 - .llseek = no_llseek, 571 567 }; 572 568 573 569 static const struct v4l2_ioctl_ops cadet_ioctl_ops = {
+3 -7
drivers/media/radio/radio-gemtek-pci.c
··· 358 358 359 359 static int mx = 1; 360 360 361 - static int gemtek_pci_exclusive_open(struct inode *inode, struct file *file) 361 + static int gemtek_pci_exclusive_open(struct file *file) 362 362 { 363 363 return test_and_set_bit(0, &in_use) ? -EBUSY : 0; 364 364 } 365 365 366 - static int gemtek_pci_exclusive_release(struct inode *inode, struct file *file) 366 + static int gemtek_pci_exclusive_release(struct file *file) 367 367 { 368 368 clear_bit(0, &in_use); 369 369 return 0; 370 370 } 371 371 372 - static const struct file_operations gemtek_pci_fops = { 372 + static const struct v4l2_file_operations gemtek_pci_fops = { 373 373 .owner = THIS_MODULE, 374 374 .open = gemtek_pci_exclusive_open, 375 375 .release = gemtek_pci_exclusive_release, 376 376 .ioctl = video_ioctl2, 377 - #ifdef CONFIG_COMPAT 378 - .compat_ioctl = v4l_compat_ioctl32, 379 - #endif 380 - .llseek = no_llseek, 381 377 }; 382 378 383 379 static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = {
+3 -7
drivers/media/radio/radio-gemtek.c
··· 394 394 } 395 395 }; 396 396 397 - static int gemtek_exclusive_open(struct inode *inode, struct file *file) 397 + static int gemtek_exclusive_open(struct file *file) 398 398 { 399 399 return test_and_set_bit(0, &in_use) ? -EBUSY : 0; 400 400 } 401 401 402 - static int gemtek_exclusive_release(struct inode *inode, struct file *file) 402 + static int gemtek_exclusive_release(struct file *file) 403 403 { 404 404 clear_bit(0, &in_use); 405 405 return 0; 406 406 } 407 407 408 - static const struct file_operations gemtek_fops = { 408 + static const struct v4l2_file_operations gemtek_fops = { 409 409 .owner = THIS_MODULE, 410 410 .open = gemtek_exclusive_open, 411 411 .release = gemtek_exclusive_release, 412 412 .ioctl = video_ioctl2, 413 - #ifdef CONFIG_COMPAT 414 - .compat_ioctl = v4l_compat_ioctl32, 415 - #endif 416 - .llseek = no_llseek 417 413 }; 418 414 419 415 static int vidioc_querycap(struct file *file, void *priv,
+3 -7
drivers/media/radio/radio-maestro.c
··· 79 79 80 80 static int maestro_probe(struct pci_dev *pdev, const struct pci_device_id *ent); 81 81 82 - static int maestro_exclusive_open(struct inode *inode, struct file *file) 82 + static int maestro_exclusive_open(struct file *file) 83 83 { 84 84 return test_and_set_bit(0, &in_use) ? -EBUSY : 0; 85 85 } 86 86 87 - static int maestro_exclusive_release(struct inode *inode, struct file *file) 87 + static int maestro_exclusive_release(struct file *file) 88 88 { 89 89 clear_bit(0, &in_use); 90 90 return 0; ··· 110 110 .remove = __devexit_p(maestro_remove), 111 111 }; 112 112 113 - static const struct file_operations maestro_fops = { 113 + static const struct v4l2_file_operations maestro_fops = { 114 114 .owner = THIS_MODULE, 115 115 .open = maestro_exclusive_open, 116 116 .release = maestro_exclusive_release, 117 117 .ioctl = video_ioctl2, 118 - #ifdef CONFIG_COMPAT 119 - .compat_ioctl = v4l_compat_ioctl32, 120 - #endif 121 - .llseek = no_llseek, 122 118 }; 123 119 124 120 struct radio_device {
+3 -7
drivers/media/radio/radio-maxiradio.c
··· 100 100 #define BITS2FREQ(x) ((x) * FREQ_STEP - FREQ_IF) 101 101 102 102 103 - static int maxiradio_exclusive_open(struct inode *inode, struct file *file) 103 + static int maxiradio_exclusive_open(struct file *file) 104 104 { 105 105 return test_and_set_bit(0, &in_use) ? -EBUSY : 0; 106 106 } 107 107 108 - static int maxiradio_exclusive_release(struct inode *inode, struct file *file) 108 + static int maxiradio_exclusive_release(struct file *file) 109 109 { 110 110 clear_bit(0, &in_use); 111 111 return 0; 112 112 } 113 113 114 - static const struct file_operations maxiradio_fops = { 114 + static const struct v4l2_file_operations maxiradio_fops = { 115 115 .owner = THIS_MODULE, 116 116 .open = maxiradio_exclusive_open, 117 117 .release = maxiradio_exclusive_release, 118 118 .ioctl = video_ioctl2, 119 - #ifdef CONFIG_COMPAT 120 - .compat_ioctl = v4l_compat_ioctl32, 121 - #endif 122 - .llseek = no_llseek, 123 119 }; 124 120 125 121 static struct radio_device
+5 -9
drivers/media/radio/radio-mr800.c
··· 127 127 static int usb_amradio_probe(struct usb_interface *intf, 128 128 const struct usb_device_id *id); 129 129 static void usb_amradio_disconnect(struct usb_interface *intf); 130 - static int usb_amradio_open(struct inode *inode, struct file *file); 131 - static int usb_amradio_close(struct inode *inode, struct file *file); 130 + static int usb_amradio_open(struct file *file); 131 + static int usb_amradio_close(struct file *file); 132 132 static int usb_amradio_suspend(struct usb_interface *intf, 133 133 pm_message_t message); 134 134 static int usb_amradio_resume(struct usb_interface *intf); ··· 500 500 } 501 501 502 502 /* open device - amradio_start() and amradio_setfreq() */ 503 - static int usb_amradio_open(struct inode *inode, struct file *file) 503 + static int usb_amradio_open(struct file *file) 504 504 { 505 505 struct amradio_device *radio = video_get_drvdata(video_devdata(file)); 506 506 ··· 525 525 } 526 526 527 527 /*close device */ 528 - static int usb_amradio_close(struct inode *inode, struct file *file) 528 + static int usb_amradio_close(struct file *file) 529 529 { 530 530 struct amradio_device *radio = video_get_drvdata(video_devdata(file)); 531 531 int retval; ··· 572 572 } 573 573 574 574 /* File system interface */ 575 - static const struct file_operations usb_amradio_fops = { 575 + static const struct v4l2_file_operations usb_amradio_fops = { 576 576 .owner = THIS_MODULE, 577 577 .open = usb_amradio_open, 578 578 .release = usb_amradio_close, 579 579 .ioctl = video_ioctl2, 580 - #ifdef CONFIG_COMPAT 581 - .compat_ioctl = v4l_compat_ioctl32, 582 - #endif 583 - .llseek = no_llseek, 584 580 }; 585 581 586 582 static const struct v4l2_ioctl_ops usb_amradio_ioctl_ops = {
+3 -7
drivers/media/radio/radio-rtrack2.c
··· 280 280 281 281 static struct rt_device rtrack2_unit; 282 282 283 - static int rtrack2_exclusive_open(struct inode *inode, struct file *file) 283 + static int rtrack2_exclusive_open(struct file *file) 284 284 { 285 285 return test_and_set_bit(0, &rtrack2_unit.in_use) ? -EBUSY : 0; 286 286 } 287 287 288 - static int rtrack2_exclusive_release(struct inode *inode, struct file *file) 288 + static int rtrack2_exclusive_release(struct file *file) 289 289 { 290 290 clear_bit(0, &rtrack2_unit.in_use); 291 291 return 0; 292 292 } 293 293 294 - static const struct file_operations rtrack2_fops = { 294 + static const struct v4l2_file_operations rtrack2_fops = { 295 295 .owner = THIS_MODULE, 296 296 .open = rtrack2_exclusive_open, 297 297 .release = rtrack2_exclusive_release, 298 298 .ioctl = video_ioctl2, 299 - #ifdef CONFIG_COMPAT 300 - .compat_ioctl = v4l_compat_ioctl32, 301 - #endif 302 - .llseek = no_llseek, 303 299 }; 304 300 305 301 static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = {
+3 -7
drivers/media/radio/radio-sf16fmi.c
··· 280 280 281 281 static struct fmi_device fmi_unit; 282 282 283 - static int fmi_exclusive_open(struct inode *inode, struct file *file) 283 + static int fmi_exclusive_open(struct file *file) 284 284 { 285 285 return test_and_set_bit(0, &fmi_unit.in_use) ? -EBUSY : 0; 286 286 } 287 287 288 - static int fmi_exclusive_release(struct inode *inode, struct file *file) 288 + static int fmi_exclusive_release(struct file *file) 289 289 { 290 290 clear_bit(0, &fmi_unit.in_use); 291 291 return 0; 292 292 } 293 293 294 - static const struct file_operations fmi_fops = { 294 + static const struct v4l2_file_operations fmi_fops = { 295 295 .owner = THIS_MODULE, 296 296 .open = fmi_exclusive_open, 297 297 .release = fmi_exclusive_release, 298 298 .ioctl = video_ioctl2, 299 - #ifdef CONFIG_COMPAT 300 - .compat_ioctl = v4l_compat_ioctl32, 301 - #endif 302 - .llseek = no_llseek, 303 299 }; 304 300 305 301 static const struct v4l2_ioctl_ops fmi_ioctl_ops = {
+3 -7
drivers/media/radio/radio-sf16fmr2.c
··· 396 396 397 397 static struct fmr2_device fmr2_unit; 398 398 399 - static int fmr2_exclusive_open(struct inode *inode, struct file *file) 399 + static int fmr2_exclusive_open(struct file *file) 400 400 { 401 401 return test_and_set_bit(0, &fmr2_unit.in_use) ? -EBUSY : 0; 402 402 } 403 403 404 - static int fmr2_exclusive_release(struct inode *inode, struct file *file) 404 + static int fmr2_exclusive_release(struct file *file) 405 405 { 406 406 clear_bit(0, &fmr2_unit.in_use); 407 407 return 0; 408 408 } 409 409 410 - static const struct file_operations fmr2_fops = { 410 + static const struct v4l2_file_operations fmr2_fops = { 411 411 .owner = THIS_MODULE, 412 412 .open = fmr2_exclusive_open, 413 413 .release = fmr2_exclusive_release, 414 414 .ioctl = video_ioctl2, 415 - #ifdef CONFIG_COMPAT 416 - .compat_ioctl = v4l_compat_ioctl32, 417 - #endif 418 - .llseek = no_llseek, 419 415 }; 420 416 421 417 static const struct v4l2_ioctl_ops fmr2_ioctl_ops = {
+7 -7
drivers/media/radio/radio-si470x.c
··· 96 96 * 2008-10-20 Alexey Klimov <klimov.linux@gmail.com> 97 97 * - add support for KWorld USB FM Radio FM700 98 98 * - blacklisted KWorld radio in hid-core.c and hid-ids.h 99 + * 2008-12-03 Mark Lord <mlord@pobox.com> 100 + * - add support for DealExtreme USB Radio 99 101 * 100 102 * ToDo: 101 103 * - add firmware download/update support ··· 140 138 { USB_DEVICE_AND_INTERFACE_INFO(0x06e1, 0xa155, USB_CLASS_HID, 0, 0) }, 141 139 /* KWorld USB FM Radio SnapMusic Mobile 700 (FM700) */ 142 140 { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) }, 141 + /* DealExtreme USB Radio */ 142 + { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) }, 143 143 /* Terminating entry */ 144 144 { } 145 145 }; ··· 1079 1075 /* 1080 1076 * si470x_fops_open - file open 1081 1077 */ 1082 - static int si470x_fops_open(struct inode *inode, struct file *file) 1078 + static int si470x_fops_open(struct file *file) 1083 1079 { 1084 1080 struct si470x_device *radio = video_drvdata(file); 1085 1081 int retval; ··· 1109 1105 /* 1110 1106 * si470x_fops_release - file release 1111 1107 */ 1112 - static int si470x_fops_release(struct inode *inode, struct file *file) 1108 + static int si470x_fops_release(struct file *file) 1113 1109 { 1114 1110 struct si470x_device *radio = video_drvdata(file); 1115 1111 int retval = 0; ··· 1151 1147 /* 1152 1148 * si470x_fops - file operations interface 1153 1149 */ 1154 - static const struct file_operations si470x_fops = { 1150 + static const struct v4l2_file_operations si470x_fops = { 1155 1151 .owner = THIS_MODULE, 1156 - .llseek = no_llseek, 1157 1152 .read = si470x_fops_read, 1158 1153 .poll = si470x_fops_poll, 1159 1154 .ioctl = video_ioctl2, 1160 - #ifdef CONFIG_COMPAT 1161 - .compat_ioctl = v4l_compat_ioctl32, 1162 - #endif 1163 1155 .open = si470x_fops_open, 1164 1156 .release = si470x_fops_release, 1165 1157 };
+634
drivers/media/radio/radio-tea5764.c
··· 1 + /* 2 + * driver/media/radio/radio-tea5764.c 3 + * 4 + * Driver for TEA5764 radio chip for linux 2.6. 5 + * This driver is for TEA5764 chip from NXP, used in EZX phones from Motorola. 6 + * The I2C protocol is used for communicate with chip. 7 + * 8 + * Based in radio-tea5761.c Copyright (C) 2005 Nokia Corporation 9 + * 10 + * Copyright (c) 2008 Fabio Belavenuto <belavenuto@gmail.com> 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License as published by 14 + * the Free Software Foundation; either version 2 of the License, or 15 + * (at your option) any later version. 16 + * 17 + * This program is distributed in the hope that it will be useful, 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * You should have received a copy of the GNU General Public License 23 + * along with this program; if not, write to the Free Software 24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 + * 26 + * History: 27 + * 2008-12-06 Fabio Belavenuto <belavenuto@gmail.com> 28 + * initial code 29 + * 30 + * TODO: 31 + * add platform_data support for IRQs platform dependencies 32 + * add RDS support 33 + */ 34 + #include <linux/kernel.h> 35 + #include <linux/module.h> 36 + #include <linux/init.h> /* Initdata */ 37 + #include <linux/videodev2.h> /* kernel radio structs */ 38 + #include <linux/i2c.h> /* I2C */ 39 + #include <media/v4l2-common.h> 40 + #include <media/v4l2-ioctl.h> 41 + #include <linux/version.h> /* for KERNEL_VERSION MACRO */ 42 + 43 + #define DRIVER_VERSION "v0.01" 44 + #define RADIO_VERSION KERNEL_VERSION(0, 0, 1) 45 + 46 + #define DRIVER_AUTHOR "Fabio Belavenuto <belavenuto@gmail.com>" 47 + #define DRIVER_DESC "A driver for the TEA5764 radio chip for EZX Phones." 48 + 49 + #define PINFO(format, ...)\ 50 + printk(KERN_INFO KBUILD_MODNAME ": "\ 51 + DRIVER_VERSION ": " format "\n", ## __VA_ARGS__) 52 + #define PWARN(format, ...)\ 53 + printk(KERN_WARNING KBUILD_MODNAME ": "\ 54 + DRIVER_VERSION ": " format "\n", ## __VA_ARGS__) 55 + # define PDEBUG(format, ...)\ 56 + printk(KERN_DEBUG KBUILD_MODNAME ": "\ 57 + DRIVER_VERSION ": " format "\n", ## __VA_ARGS__) 58 + 59 + /* Frequency limits in MHz -- these are European values. For Japanese 60 + devices, that would be 76000 and 91000. */ 61 + #define FREQ_MIN 87500 62 + #define FREQ_MAX 108000 63 + #define FREQ_MUL 16 64 + 65 + /* TEA5764 registers */ 66 + #define TEA5764_MANID 0x002b 67 + #define TEA5764_CHIPID 0x5764 68 + 69 + #define TEA5764_INTREG_BLMSK 0x0001 70 + #define TEA5764_INTREG_FRRMSK 0x0002 71 + #define TEA5764_INTREG_LEVMSK 0x0008 72 + #define TEA5764_INTREG_IFMSK 0x0010 73 + #define TEA5764_INTREG_BLMFLAG 0x0100 74 + #define TEA5764_INTREG_FRRFLAG 0x0200 75 + #define TEA5764_INTREG_LEVFLAG 0x0800 76 + #define TEA5764_INTREG_IFFLAG 0x1000 77 + 78 + #define TEA5764_FRQSET_SUD 0x8000 79 + #define TEA5764_FRQSET_SM 0x4000 80 + 81 + #define TEA5764_TNCTRL_PUPD1 0x8000 82 + #define TEA5764_TNCTRL_PUPD0 0x4000 83 + #define TEA5764_TNCTRL_BLIM 0x2000 84 + #define TEA5764_TNCTRL_SWPM 0x1000 85 + #define TEA5764_TNCTRL_IFCTC 0x0800 86 + #define TEA5764_TNCTRL_AFM 0x0400 87 + #define TEA5764_TNCTRL_SMUTE 0x0200 88 + #define TEA5764_TNCTRL_SNC 0x0100 89 + #define TEA5764_TNCTRL_MU 0x0080 90 + #define TEA5764_TNCTRL_SSL1 0x0040 91 + #define TEA5764_TNCTRL_SSL0 0x0020 92 + #define TEA5764_TNCTRL_HLSI 0x0010 93 + #define TEA5764_TNCTRL_MST 0x0008 94 + #define TEA5764_TNCTRL_SWP 0x0004 95 + #define TEA5764_TNCTRL_DTC 0x0002 96 + #define TEA5764_TNCTRL_AHLSI 0x0001 97 + 98 + #define TEA5764_TUNCHK_LEVEL(x) (((x) & 0x00F0) >> 4) 99 + #define TEA5764_TUNCHK_IFCNT(x) (((x) & 0xFE00) >> 9) 100 + #define TEA5764_TUNCHK_TUNTO 0x0100 101 + #define TEA5764_TUNCHK_LD 0x0008 102 + #define TEA5764_TUNCHK_STEREO 0x0004 103 + 104 + #define TEA5764_TESTREG_TRIGFR 0x0800 105 + 106 + struct tea5764_regs { 107 + u16 intreg; /* INTFLAG & INTMSK */ 108 + u16 frqset; /* FRQSETMSB & FRQSETLSB */ 109 + u16 tnctrl; /* TNCTRL1 & TNCTRL2 */ 110 + u16 frqchk; /* FRQCHKMSB & FRQCHKLSB */ 111 + u16 tunchk; /* IFCHK & LEVCHK */ 112 + u16 testreg; /* TESTBITS & TESTMODE */ 113 + u16 rdsstat; /* RDSSTAT1 & RDSSTAT2 */ 114 + u16 rdslb; /* RDSLBMSB & RDSLBLSB */ 115 + u16 rdspb; /* RDSPBMSB & RDSPBLSB */ 116 + u16 rdsbc; /* RDSBBC & RDSGBC */ 117 + u16 rdsctrl; /* RDSCTRL1 & RDSCTRL2 */ 118 + u16 rdsbbl; /* PAUSEDET & RDSBBL */ 119 + u16 manid; /* MANID1 & MANID2 */ 120 + u16 chipid; /* CHIPID1 & CHIPID2 */ 121 + } __attribute__ ((packed)); 122 + 123 + struct tea5764_write_regs { 124 + u8 intreg; /* INTMSK */ 125 + u16 frqset; /* FRQSETMSB & FRQSETLSB */ 126 + u16 tnctrl; /* TNCTRL1 & TNCTRL2 */ 127 + u16 testreg; /* TESTBITS & TESTMODE */ 128 + u16 rdsctrl; /* RDSCTRL1 & RDSCTRL2 */ 129 + u16 rdsbbl; /* PAUSEDET & RDSBBL */ 130 + } __attribute__ ((packed)); 131 + 132 + #ifndef RADIO_TEA5764_XTAL 133 + #define RADIO_TEA5764_XTAL 1 134 + #endif 135 + 136 + static int radio_nr = -1; 137 + static int use_xtal = RADIO_TEA5764_XTAL; 138 + 139 + struct tea5764_device { 140 + struct i2c_client *i2c_client; 141 + struct video_device *videodev; 142 + struct tea5764_regs regs; 143 + struct mutex mutex; 144 + int users; 145 + }; 146 + 147 + /* I2C code related */ 148 + int tea5764_i2c_read(struct tea5764_device *radio) 149 + { 150 + int i; 151 + u16 *p = (u16 *) &radio->regs; 152 + 153 + struct i2c_msg msgs[1] = { 154 + { radio->i2c_client->addr, I2C_M_RD, sizeof(radio->regs), 155 + (void *)&radio->regs }, 156 + }; 157 + if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1) 158 + return -EIO; 159 + for (i = 0; i < sizeof(struct tea5764_regs) / sizeof(u16); i++) 160 + p[i] = __be16_to_cpu(p[i]); 161 + 162 + return 0; 163 + } 164 + 165 + int tea5764_i2c_write(struct tea5764_device *radio) 166 + { 167 + struct tea5764_write_regs wr; 168 + struct tea5764_regs *r = &radio->regs; 169 + struct i2c_msg msgs[1] = { 170 + { radio->i2c_client->addr, 0, sizeof(wr), (void *) &wr }, 171 + }; 172 + wr.intreg = r->intreg & 0xff; 173 + wr.frqset = __cpu_to_be16(r->frqset); 174 + wr.tnctrl = __cpu_to_be16(r->tnctrl); 175 + wr.testreg = __cpu_to_be16(r->testreg); 176 + wr.rdsctrl = __cpu_to_be16(r->rdsctrl); 177 + wr.rdsbbl = __cpu_to_be16(r->rdsbbl); 178 + if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1) 179 + return -EIO; 180 + return 0; 181 + } 182 + 183 + /* V4L2 code related */ 184 + static struct v4l2_queryctrl radio_qctrl[] = { 185 + { 186 + .id = V4L2_CID_AUDIO_MUTE, 187 + .name = "Mute", 188 + .minimum = 0, 189 + .maximum = 1, 190 + .default_value = 1, 191 + .type = V4L2_CTRL_TYPE_BOOLEAN, 192 + } 193 + }; 194 + 195 + static void tea5764_power_up(struct tea5764_device *radio) 196 + { 197 + struct tea5764_regs *r = &radio->regs; 198 + 199 + if (!(r->tnctrl & TEA5764_TNCTRL_PUPD0)) { 200 + r->tnctrl &= ~(TEA5764_TNCTRL_AFM | TEA5764_TNCTRL_MU | 201 + TEA5764_TNCTRL_HLSI); 202 + if (!use_xtal) 203 + r->testreg |= TEA5764_TESTREG_TRIGFR; 204 + else 205 + r->testreg &= ~TEA5764_TESTREG_TRIGFR; 206 + 207 + r->tnctrl |= TEA5764_TNCTRL_PUPD0; 208 + tea5764_i2c_write(radio); 209 + } 210 + } 211 + 212 + static void tea5764_power_down(struct tea5764_device *radio) 213 + { 214 + struct tea5764_regs *r = &radio->regs; 215 + 216 + if (r->tnctrl & TEA5764_TNCTRL_PUPD0) { 217 + r->tnctrl &= ~TEA5764_TNCTRL_PUPD0; 218 + tea5764_i2c_write(radio); 219 + } 220 + } 221 + 222 + static void tea5764_set_freq(struct tea5764_device *radio, int freq) 223 + { 224 + struct tea5764_regs *r = &radio->regs; 225 + 226 + /* formula: (freq [+ or -] 225000) / 8192 */ 227 + if (r->tnctrl & TEA5764_TNCTRL_HLSI) 228 + r->frqset = (freq + 225000) / 8192; 229 + else 230 + r->frqset = (freq - 225000) / 8192; 231 + } 232 + 233 + static int tea5764_get_freq(struct tea5764_device *radio) 234 + { 235 + struct tea5764_regs *r = &radio->regs; 236 + 237 + if (r->tnctrl & TEA5764_TNCTRL_HLSI) 238 + return (r->frqchk * 8192) - 225000; 239 + else 240 + return (r->frqchk * 8192) + 225000; 241 + } 242 + 243 + /* tune an frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */ 244 + static void tea5764_tune(struct tea5764_device *radio, int freq) 245 + { 246 + tea5764_set_freq(radio, freq); 247 + if (tea5764_i2c_write(radio)) 248 + PWARN("Could not set frequency!"); 249 + } 250 + 251 + static void tea5764_set_audout_mode(struct tea5764_device *radio, int audmode) 252 + { 253 + struct tea5764_regs *r = &radio->regs; 254 + int tnctrl = r->tnctrl; 255 + 256 + if (audmode == V4L2_TUNER_MODE_MONO) 257 + r->tnctrl |= TEA5764_TNCTRL_MST; 258 + else 259 + r->tnctrl &= ~TEA5764_TNCTRL_MST; 260 + if (tnctrl != r->tnctrl) 261 + tea5764_i2c_write(radio); 262 + } 263 + 264 + static int tea5764_get_audout_mode(struct tea5764_device *radio) 265 + { 266 + struct tea5764_regs *r = &radio->regs; 267 + 268 + if (r->tnctrl & TEA5764_TNCTRL_MST) 269 + return V4L2_TUNER_MODE_MONO; 270 + else 271 + return V4L2_TUNER_MODE_STEREO; 272 + } 273 + 274 + static void tea5764_mute(struct tea5764_device *radio, int on) 275 + { 276 + struct tea5764_regs *r = &radio->regs; 277 + int tnctrl = r->tnctrl; 278 + 279 + if (on) 280 + r->tnctrl |= TEA5764_TNCTRL_MU; 281 + else 282 + r->tnctrl &= ~TEA5764_TNCTRL_MU; 283 + if (tnctrl != r->tnctrl) 284 + tea5764_i2c_write(radio); 285 + } 286 + 287 + static int tea5764_is_muted(struct tea5764_device *radio) 288 + { 289 + return radio->regs.tnctrl & TEA5764_TNCTRL_MU; 290 + } 291 + 292 + /* V4L2 vidioc */ 293 + static int vidioc_querycap(struct file *file, void *priv, 294 + struct v4l2_capability *v) 295 + { 296 + struct tea5764_device *radio = video_drvdata(file); 297 + struct video_device *dev = radio->videodev; 298 + 299 + strlcpy(v->driver, dev->dev.driver->name, sizeof(v->driver)); 300 + strlcpy(v->card, dev->name, sizeof(v->card)); 301 + snprintf(v->bus_info, sizeof(v->bus_info), "I2C:%s", dev->dev.bus_id); 302 + v->version = RADIO_VERSION; 303 + v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; 304 + return 0; 305 + } 306 + 307 + static int vidioc_g_tuner(struct file *file, void *priv, 308 + struct v4l2_tuner *v) 309 + { 310 + struct tea5764_device *radio = video_drvdata(file); 311 + struct tea5764_regs *r = &radio->regs; 312 + 313 + if (v->index > 0) 314 + return -EINVAL; 315 + 316 + memset(v, 0, sizeof(v)); 317 + strcpy(v->name, "FM"); 318 + v->type = V4L2_TUNER_RADIO; 319 + tea5764_i2c_read(radio); 320 + v->rangelow = FREQ_MIN * FREQ_MUL; 321 + v->rangehigh = FREQ_MAX * FREQ_MUL; 322 + v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; 323 + if (r->tunchk & TEA5764_TUNCHK_STEREO) 324 + v->rxsubchans = V4L2_TUNER_SUB_STEREO; 325 + v->audmode = tea5764_get_audout_mode(radio); 326 + v->signal = TEA5764_TUNCHK_LEVEL(r->tunchk) * 0xffff / 0xf; 327 + v->afc = TEA5764_TUNCHK_IFCNT(r->tunchk); 328 + 329 + return 0; 330 + } 331 + 332 + static int vidioc_s_tuner(struct file *file, void *priv, 333 + struct v4l2_tuner *v) 334 + { 335 + struct tea5764_device *radio = video_drvdata(file); 336 + 337 + if (v->index > 0) 338 + return -EINVAL; 339 + 340 + tea5764_set_audout_mode(radio, v->audmode); 341 + return 0; 342 + } 343 + 344 + static int vidioc_s_frequency(struct file *file, void *priv, 345 + struct v4l2_frequency *f) 346 + { 347 + struct tea5764_device *radio = video_drvdata(file); 348 + 349 + if (f->tuner != 0) 350 + return -EINVAL; 351 + if (f->frequency == 0) { 352 + /* We special case this as a power down control. */ 353 + tea5764_power_down(radio); 354 + } 355 + if (f->frequency < (FREQ_MIN * FREQ_MUL)) 356 + return -EINVAL; 357 + if (f->frequency > (FREQ_MAX * FREQ_MUL)) 358 + return -EINVAL; 359 + tea5764_power_up(radio); 360 + tea5764_tune(radio, (f->frequency * 125) / 2); 361 + return 0; 362 + } 363 + 364 + static int vidioc_g_frequency(struct file *file, void *priv, 365 + struct v4l2_frequency *f) 366 + { 367 + struct tea5764_device *radio = video_drvdata(file); 368 + struct tea5764_regs *r = &radio->regs; 369 + 370 + tea5764_i2c_read(radio); 371 + memset(f, 0, sizeof(f)); 372 + f->type = V4L2_TUNER_RADIO; 373 + if (r->tnctrl & TEA5764_TNCTRL_PUPD0) 374 + f->frequency = (tea5764_get_freq(radio) * 2) / 125; 375 + else 376 + f->frequency = 0; 377 + 378 + return 0; 379 + } 380 + 381 + static int vidioc_queryctrl(struct file *file, void *priv, 382 + struct v4l2_queryctrl *qc) 383 + { 384 + int i; 385 + 386 + for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { 387 + if (qc->id && qc->id == radio_qctrl[i].id) { 388 + memcpy(qc, &(radio_qctrl[i]), sizeof(*qc)); 389 + return 0; 390 + } 391 + } 392 + return -EINVAL; 393 + } 394 + 395 + static int vidioc_g_ctrl(struct file *file, void *priv, 396 + struct v4l2_control *ctrl) 397 + { 398 + struct tea5764_device *radio = video_drvdata(file); 399 + 400 + switch (ctrl->id) { 401 + case V4L2_CID_AUDIO_MUTE: 402 + tea5764_i2c_read(radio); 403 + ctrl->value = tea5764_is_muted(radio) ? 1 : 0; 404 + return 0; 405 + } 406 + return -EINVAL; 407 + } 408 + 409 + static int vidioc_s_ctrl(struct file *file, void *priv, 410 + struct v4l2_control *ctrl) 411 + { 412 + struct tea5764_device *radio = video_drvdata(file); 413 + 414 + switch (ctrl->id) { 415 + case V4L2_CID_AUDIO_MUTE: 416 + tea5764_mute(radio, ctrl->value); 417 + return 0; 418 + } 419 + return -EINVAL; 420 + } 421 + 422 + static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i) 423 + { 424 + *i = 0; 425 + return 0; 426 + } 427 + 428 + static int vidioc_s_input(struct file *filp, void *priv, unsigned int i) 429 + { 430 + if (i != 0) 431 + return -EINVAL; 432 + return 0; 433 + } 434 + 435 + static int vidioc_g_audio(struct file *file, void *priv, 436 + struct v4l2_audio *a) 437 + { 438 + if (a->index > 1) 439 + return -EINVAL; 440 + 441 + strcpy(a->name, "Radio"); 442 + a->capability = V4L2_AUDCAP_STEREO; 443 + return 0; 444 + } 445 + 446 + static int vidioc_s_audio(struct file *file, void *priv, 447 + struct v4l2_audio *a) 448 + { 449 + if (a->index != 0) 450 + return -EINVAL; 451 + 452 + return 0; 453 + } 454 + 455 + static int tea5764_open(struct file *file) 456 + { 457 + /* Currently we support only one device */ 458 + int minor = video_devdata(file)->minor; 459 + struct tea5764_device *radio = video_drvdata(file); 460 + 461 + if (radio->videodev->minor != minor) 462 + return -ENODEV; 463 + 464 + mutex_lock(&radio->mutex); 465 + /* Only exclusive access */ 466 + if (radio->users) { 467 + mutex_unlock(&radio->mutex); 468 + return -EBUSY; 469 + } 470 + radio->users++; 471 + mutex_unlock(&radio->mutex); 472 + file->private_data = radio; 473 + return 0; 474 + } 475 + 476 + static int tea5764_close(struct file *file) 477 + { 478 + struct tea5764_device *radio = video_drvdata(file); 479 + 480 + if (!radio) 481 + return -ENODEV; 482 + mutex_lock(&radio->mutex); 483 + radio->users--; 484 + mutex_unlock(&radio->mutex); 485 + return 0; 486 + } 487 + 488 + /* File system interface */ 489 + static const struct v4l2_file_operations tea5764_fops = { 490 + .owner = THIS_MODULE, 491 + .open = tea5764_open, 492 + .release = tea5764_close, 493 + .ioctl = video_ioctl2, 494 + }; 495 + 496 + static const struct v4l2_ioctl_ops tea5764_ioctl_ops = { 497 + .vidioc_querycap = vidioc_querycap, 498 + .vidioc_g_tuner = vidioc_g_tuner, 499 + .vidioc_s_tuner = vidioc_s_tuner, 500 + .vidioc_g_audio = vidioc_g_audio, 501 + .vidioc_s_audio = vidioc_s_audio, 502 + .vidioc_g_input = vidioc_g_input, 503 + .vidioc_s_input = vidioc_s_input, 504 + .vidioc_g_frequency = vidioc_g_frequency, 505 + .vidioc_s_frequency = vidioc_s_frequency, 506 + .vidioc_queryctrl = vidioc_queryctrl, 507 + .vidioc_g_ctrl = vidioc_g_ctrl, 508 + .vidioc_s_ctrl = vidioc_s_ctrl, 509 + }; 510 + 511 + /* V4L2 interface */ 512 + static struct video_device tea5764_radio_template = { 513 + .name = "TEA5764 FM-Radio", 514 + .fops = &tea5764_fops, 515 + .ioctl_ops = &tea5764_ioctl_ops, 516 + .release = video_device_release, 517 + }; 518 + 519 + /* I2C probe: check if the device exists and register with v4l if it is */ 520 + static int __devinit tea5764_i2c_probe(struct i2c_client *client, 521 + const struct i2c_device_id *id) 522 + { 523 + struct tea5764_device *radio; 524 + struct tea5764_regs *r; 525 + int ret; 526 + 527 + PDEBUG("probe"); 528 + radio = kmalloc(sizeof(struct tea5764_device), GFP_KERNEL); 529 + if (!radio) 530 + return -ENOMEM; 531 + 532 + mutex_init(&radio->mutex); 533 + radio->i2c_client = client; 534 + ret = tea5764_i2c_read(radio); 535 + if (ret) 536 + goto errfr; 537 + r = &radio->regs; 538 + PDEBUG("chipid = %04X, manid = %04X", r->chipid, r->manid); 539 + if (r->chipid != TEA5764_CHIPID || 540 + (r->manid & 0x0fff) != TEA5764_MANID) { 541 + PWARN("This chip is not a TEA5764!"); 542 + ret = -EINVAL; 543 + goto errfr; 544 + } 545 + 546 + radio->videodev = video_device_alloc(); 547 + if (!(radio->videodev)) { 548 + ret = -ENOMEM; 549 + goto errfr; 550 + } 551 + memcpy(radio->videodev, &tea5764_radio_template, 552 + sizeof(tea5764_radio_template)); 553 + 554 + i2c_set_clientdata(client, radio); 555 + video_set_drvdata(radio->videodev, radio); 556 + 557 + ret = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr); 558 + if (ret < 0) { 559 + PWARN("Could not register video device!"); 560 + goto errrel; 561 + } 562 + 563 + /* initialize and power off the chip */ 564 + tea5764_i2c_read(radio); 565 + tea5764_set_audout_mode(radio, V4L2_TUNER_MODE_STEREO); 566 + tea5764_mute(radio, 1); 567 + tea5764_power_down(radio); 568 + 569 + PINFO("registered."); 570 + return 0; 571 + errrel: 572 + video_device_release(radio->videodev); 573 + errfr: 574 + kfree(radio); 575 + return ret; 576 + } 577 + 578 + static int __devexit tea5764_i2c_remove(struct i2c_client *client) 579 + { 580 + struct tea5764_device *radio = i2c_get_clientdata(client); 581 + 582 + PDEBUG("remove"); 583 + if (radio) { 584 + tea5764_power_down(radio); 585 + video_unregister_device(radio->videodev); 586 + kfree(radio); 587 + } 588 + return 0; 589 + } 590 + 591 + /* I2C subsystem interface */ 592 + static const struct i2c_device_id tea5764_id[] = { 593 + { "radio-tea5764", 0 }, 594 + { } /* Terminating entry */ 595 + }; 596 + MODULE_DEVICE_TABLE(i2c, tea5764_id); 597 + 598 + static struct i2c_driver tea5764_i2c_driver = { 599 + .driver = { 600 + .name = "radio-tea5764", 601 + .owner = THIS_MODULE, 602 + }, 603 + .probe = tea5764_i2c_probe, 604 + .remove = __devexit_p(tea5764_i2c_remove), 605 + .id_table = tea5764_id, 606 + }; 607 + 608 + /* init the driver */ 609 + static int __init tea5764_init(void) 610 + { 611 + int ret = i2c_add_driver(&tea5764_i2c_driver); 612 + 613 + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ": " 614 + DRIVER_DESC "\n"); 615 + return ret; 616 + } 617 + 618 + /* cleanup the driver */ 619 + static void __exit tea5764_exit(void) 620 + { 621 + i2c_del_driver(&tea5764_i2c_driver); 622 + } 623 + 624 + MODULE_AUTHOR(DRIVER_AUTHOR); 625 + MODULE_DESCRIPTION(DRIVER_DESC); 626 + MODULE_LICENSE("GPL"); 627 + 628 + module_param(use_xtal, int, 1); 629 + MODULE_PARM_DESC(use_xtal, "Chip have a xtal connected in board"); 630 + module_param(radio_nr, int, 0); 631 + MODULE_PARM_DESC(radio_nr, "video4linux device number to use"); 632 + 633 + module_init(tea5764_init); 634 + module_exit(tea5764_exit);
+3 -7
drivers/media/radio/radio-terratec.c
··· 352 352 353 353 static struct tt_device terratec_unit; 354 354 355 - static int terratec_exclusive_open(struct inode *inode, struct file *file) 355 + static int terratec_exclusive_open(struct file *file) 356 356 { 357 357 return test_and_set_bit(0, &terratec_unit.in_use) ? -EBUSY : 0; 358 358 } 359 359 360 - static int terratec_exclusive_release(struct inode *inode, struct file *file) 360 + static int terratec_exclusive_release(struct file *file) 361 361 { 362 362 clear_bit(0, &terratec_unit.in_use); 363 363 return 0; 364 364 } 365 365 366 - static const struct file_operations terratec_fops = { 366 + static const struct v4l2_file_operations terratec_fops = { 367 367 .owner = THIS_MODULE, 368 368 .open = terratec_exclusive_open, 369 369 .release = terratec_exclusive_release, 370 370 .ioctl = video_ioctl2, 371 - #ifdef CONFIG_COMPAT 372 - .compat_ioctl = v4l_compat_ioctl32, 373 - #endif 374 - .llseek = no_llseek, 375 371 }; 376 372 377 373 static const struct v4l2_ioctl_ops terratec_ioctl_ops = {
+3 -7
drivers/media/radio/radio-trust.c
··· 337 337 return 0; 338 338 } 339 339 340 - static int trust_exclusive_open(struct inode *inode, struct file *file) 340 + static int trust_exclusive_open(struct file *file) 341 341 { 342 342 return test_and_set_bit(0, &in_use) ? -EBUSY : 0; 343 343 } 344 344 345 - static int trust_exclusive_release(struct inode *inode, struct file *file) 345 + static int trust_exclusive_release(struct file *file) 346 346 { 347 347 clear_bit(0, &in_use); 348 348 return 0; 349 349 } 350 350 351 - static const struct file_operations trust_fops = { 351 + static const struct v4l2_file_operations trust_fops = { 352 352 .owner = THIS_MODULE, 353 353 .open = trust_exclusive_open, 354 354 .release = trust_exclusive_release, 355 355 .ioctl = video_ioctl2, 356 - #ifdef CONFIG_COMPAT 357 - .compat_ioctl = v4l_compat_ioctl32, 358 - #endif 359 - .llseek = no_llseek, 360 356 }; 361 357 362 358 static const struct v4l2_ioctl_ops trust_ioctl_ops = {
+3 -7
drivers/media/radio/radio-typhoon.c
··· 330 330 .mutefreq = CONFIG_RADIO_TYPHOON_MUTEFREQ, 331 331 }; 332 332 333 - static int typhoon_exclusive_open(struct inode *inode, struct file *file) 333 + static int typhoon_exclusive_open(struct file *file) 334 334 { 335 335 return test_and_set_bit(0, &typhoon_unit.in_use) ? -EBUSY : 0; 336 336 } 337 337 338 - static int typhoon_exclusive_release(struct inode *inode, struct file *file) 338 + static int typhoon_exclusive_release(struct file *file) 339 339 { 340 340 clear_bit(0, &typhoon_unit.in_use); 341 341 return 0; 342 342 } 343 343 344 - static const struct file_operations typhoon_fops = { 344 + static const struct v4l2_file_operations typhoon_fops = { 345 345 .owner = THIS_MODULE, 346 346 .open = typhoon_exclusive_open, 347 347 .release = typhoon_exclusive_release, 348 348 .ioctl = video_ioctl2, 349 - #ifdef CONFIG_COMPAT 350 - .compat_ioctl = v4l_compat_ioctl32, 351 - #endif 352 - .llseek = no_llseek, 353 349 }; 354 350 355 351 static const struct v4l2_ioctl_ops typhoon_ioctl_ops = {
+3 -7
drivers/media/radio/radio-zoltrix.c
··· 401 401 402 402 static struct zol_device zoltrix_unit; 403 403 404 - static int zoltrix_exclusive_open(struct inode *inode, struct file *file) 404 + static int zoltrix_exclusive_open(struct file *file) 405 405 { 406 406 return test_and_set_bit(0, &zoltrix_unit.in_use) ? -EBUSY : 0; 407 407 } 408 408 409 - static int zoltrix_exclusive_release(struct inode *inode, struct file *file) 409 + static int zoltrix_exclusive_release(struct file *file) 410 410 { 411 411 clear_bit(0, &zoltrix_unit.in_use); 412 412 return 0; 413 413 } 414 414 415 - static const struct file_operations zoltrix_fops = 415 + static const struct v4l2_file_operations zoltrix_fops = 416 416 { 417 417 .owner = THIS_MODULE, 418 418 .open = zoltrix_exclusive_open, 419 419 .release = zoltrix_exclusive_release, 420 420 .ioctl = video_ioctl2, 421 - #ifdef CONFIG_COMPAT 422 - .compat_ioctl = v4l_compat_ioctl32, 423 - #endif 424 - .llseek = no_llseek, 425 421 }; 426 422 427 423 static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = {
+4 -1
drivers/media/video/Makefile
··· 12 12 13 13 videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-subdev.o 14 14 15 - obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-compat-ioctl32.o v4l2-int-device.o 15 + obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-int-device.o 16 + ifeq ($(CONFIG_COMPAT),y) 17 + obj-$(CONFIG_VIDEO_DEV) += v4l2-compat-ioctl32.o 18 + endif 16 19 17 20 obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o 18 21
+5 -9
drivers/media/video/arv.c
··· 396 396 return ret; 397 397 } 398 398 399 - static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg) 399 + static long ar_do_ioctl(struct file *file, unsigned int cmd, void *arg) 400 400 { 401 401 struct video_device *dev = video_devdata(file); 402 402 struct ar_device *ar = video_get_drvdata(dev); ··· 539 539 return 0; 540 540 } 541 541 542 - static int ar_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 542 + static long ar_ioctl(struct file *file, unsigned int cmd, 543 543 unsigned long arg) 544 544 { 545 545 return video_usercopy(file, cmd, arg, ar_do_ioctl); ··· 744 744 ****************************************************************************/ 745 745 static struct ar_device ardev; 746 746 747 - static int ar_exclusive_open(struct inode *inode, struct file *file) 747 + static int ar_exclusive_open(struct file *file) 748 748 { 749 749 return test_and_set_bit(0, &ardev.in_use) ? -EBUSY : 0; 750 750 } 751 751 752 - static int ar_exclusive_release(struct inode *inode, struct file *file) 752 + static int ar_exclusive_release(struct file *file) 753 753 { 754 754 clear_bit(0, &ardev.in_use); 755 755 return 0; 756 756 } 757 757 758 - static const struct file_operations ar_fops = { 758 + static const struct v4l2_file_operations ar_fops = { 759 759 .owner = THIS_MODULE, 760 760 .open = ar_exclusive_open, 761 761 .release = ar_exclusive_release, 762 762 .read = ar_read, 763 763 .ioctl = ar_ioctl, 764 - #ifdef CONFIG_COMPAT 765 - .compat_ioctl = v4l_compat_ioctl32, 766 - #endif 767 - .llseek = no_llseek, 768 764 }; 769 765 770 766 static struct video_device ar_template = {
+14 -16
drivers/media/video/bt8xx/bttv-driver.c
··· 2039 2039 2040 2040 #ifdef CONFIG_VIDEO_ADV_DEBUG 2041 2041 static int bttv_g_register(struct file *file, void *f, 2042 - struct v4l2_register *reg) 2042 + struct v4l2_dbg_register *reg) 2043 2043 { 2044 2044 struct bttv_fh *fh = f; 2045 2045 struct bttv *btv = fh->btv; ··· 2047 2047 if (!capable(CAP_SYS_ADMIN)) 2048 2048 return -EPERM; 2049 2049 2050 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 2050 + if (!v4l2_chip_match_host(&reg->match)) 2051 2051 return -EINVAL; 2052 2052 2053 2053 /* bt848 has a 12-bit register space */ 2054 2054 reg->reg &= 0xfff; 2055 2055 reg->val = btread(reg->reg); 2056 + reg->size = 1; 2056 2057 2057 2058 return 0; 2058 2059 } 2059 2060 2060 2061 static int bttv_s_register(struct file *file, void *f, 2061 - struct v4l2_register *reg) 2062 + struct v4l2_dbg_register *reg) 2062 2063 { 2063 2064 struct bttv_fh *fh = f; 2064 2065 struct bttv *btv = fh->btv; ··· 2067 2066 if (!capable(CAP_SYS_ADMIN)) 2068 2067 return -EPERM; 2069 2068 2070 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 2069 + if (!v4l2_chip_match_host(&reg->match)) 2071 2070 return -EINVAL; 2072 2071 2073 2072 /* bt848 has a 12-bit register space */ ··· 3209 3208 return POLLERR; 3210 3209 } 3211 3210 3212 - static int bttv_open(struct inode *inode, struct file *file) 3211 + static int bttv_open(struct file *file) 3213 3212 { 3214 - int minor = iminor(inode); 3213 + int minor = video_devdata(file)->minor; 3215 3214 struct bttv *btv = NULL; 3216 3215 struct bttv_fh *fh; 3217 3216 enum v4l2_buf_type type = 0; ··· 3292 3291 return 0; 3293 3292 } 3294 3293 3295 - static int bttv_release(struct inode *inode, struct file *file) 3294 + static int bttv_release(struct file *file) 3296 3295 { 3297 3296 struct bttv_fh *fh = file->private_data; 3298 3297 struct bttv *btv = fh->btv; ··· 3347 3346 return videobuf_mmap_mapper(bttv_queue(fh),vma); 3348 3347 } 3349 3348 3350 - static const struct file_operations bttv_fops = 3349 + static const struct v4l2_file_operations bttv_fops = 3351 3350 { 3352 3351 .owner = THIS_MODULE, 3353 3352 .open = bttv_open, 3354 3353 .release = bttv_release, 3355 3354 .ioctl = video_ioctl2, 3356 - .compat_ioctl = v4l_compat_ioctl32, 3357 - .llseek = no_llseek, 3358 3355 .read = bttv_read, 3359 3356 .mmap = bttv_mmap, 3360 3357 .poll = bttv_poll, ··· 3421 3422 /* ----------------------------------------------------------------------- */ 3422 3423 /* radio interface */ 3423 3424 3424 - static int radio_open(struct inode *inode, struct file *file) 3425 + static int radio_open(struct file *file) 3425 3426 { 3426 - int minor = iminor(inode); 3427 + int minor = video_devdata(file)->minor; 3427 3428 struct bttv *btv = NULL; 3428 3429 struct bttv_fh *fh; 3429 3430 unsigned int i; ··· 3466 3467 return 0; 3467 3468 } 3468 3469 3469 - static int radio_release(struct inode *inode, struct file *file) 3470 + static int radio_release(struct file *file) 3470 3471 { 3471 3472 struct bttv_fh *fh = file->private_data; 3472 3473 struct bttv *btv = fh->btv; 3473 3474 struct rds_command cmd; 3474 3475 3476 + v4l2_prio_close(&btv->prio,&fh->prio); 3475 3477 file->private_data = NULL; 3476 3478 kfree(fh); 3477 3479 ··· 3633 3633 return cmd.result; 3634 3634 } 3635 3635 3636 - static const struct file_operations radio_fops = 3636 + static const struct v4l2_file_operations radio_fops = 3637 3637 { 3638 3638 .owner = THIS_MODULE, 3639 3639 .open = radio_open, 3640 3640 .read = radio_read, 3641 3641 .release = radio_release, 3642 - .compat_ioctl = v4l_compat_ioctl32, 3643 3642 .ioctl = video_ioctl2, 3644 - .llseek = no_llseek, 3645 3643 .poll = radio_poll, 3646 3644 }; 3647 3645
+5 -9
drivers/media/video/bw-qcam.c
··· 706 706 * Video4linux interfacing 707 707 */ 708 708 709 - static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 709 + static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 710 710 { 711 711 struct video_device *dev = video_devdata(file); 712 712 struct qcam_device *qcam=(struct qcam_device *)dev; ··· 863 863 return 0; 864 864 } 865 865 866 - static int qcam_ioctl(struct inode *inode, struct file *file, 866 + static long qcam_ioctl(struct file *file, 867 867 unsigned int cmd, unsigned long arg) 868 868 { 869 869 return video_usercopy(file, cmd, arg, qcam_do_ioctl); ··· 893 893 return len; 894 894 } 895 895 896 - static int qcam_exclusive_open(struct inode *inode, struct file *file) 896 + static int qcam_exclusive_open(struct file *file) 897 897 { 898 898 struct video_device *dev = video_devdata(file); 899 899 struct qcam_device *qcam = (struct qcam_device *)dev; ··· 901 901 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0; 902 902 } 903 903 904 - static int qcam_exclusive_release(struct inode *inode, struct file *file) 904 + static int qcam_exclusive_release(struct file *file) 905 905 { 906 906 struct video_device *dev = video_devdata(file); 907 907 struct qcam_device *qcam = (struct qcam_device *)dev; ··· 910 910 return 0; 911 911 } 912 912 913 - static const struct file_operations qcam_fops = { 913 + static const struct v4l2_file_operations qcam_fops = { 914 914 .owner = THIS_MODULE, 915 915 .open = qcam_exclusive_open, 916 916 .release = qcam_exclusive_release, 917 917 .ioctl = qcam_ioctl, 918 - #ifdef CONFIG_COMPAT 919 - .compat_ioctl = v4l_compat_ioctl32, 920 - #endif 921 918 .read = qcam_read, 922 - .llseek = no_llseek, 923 919 }; 924 920 static struct video_device qcam_template= 925 921 {
+5 -9
drivers/media/video/c-qcam.c
··· 500 500 * Video4linux interfacing 501 501 */ 502 502 503 - static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 503 + static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg) 504 504 { 505 505 struct video_device *dev = video_devdata(file); 506 506 struct qcam_device *qcam=(struct qcam_device *)dev; ··· 665 665 return 0; 666 666 } 667 667 668 - static int qcam_ioctl(struct inode *inode, struct file *file, 668 + static long qcam_ioctl(struct file *file, 669 669 unsigned int cmd, unsigned long arg) 670 670 { 671 671 return video_usercopy(file, cmd, arg, qcam_do_ioctl); ··· 687 687 return len; 688 688 } 689 689 690 - static int qcam_exclusive_open(struct inode *inode, struct file *file) 690 + static int qcam_exclusive_open(struct file *file) 691 691 { 692 692 struct video_device *dev = video_devdata(file); 693 693 struct qcam_device *qcam = (struct qcam_device *)dev; ··· 695 695 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0; 696 696 } 697 697 698 - static int qcam_exclusive_release(struct inode *inode, struct file *file) 698 + static int qcam_exclusive_release(struct file *file) 699 699 { 700 700 struct video_device *dev = video_devdata(file); 701 701 struct qcam_device *qcam = (struct qcam_device *)dev; ··· 705 705 } 706 706 707 707 /* video device template */ 708 - static const struct file_operations qcam_fops = { 708 + static const struct v4l2_file_operations qcam_fops = { 709 709 .owner = THIS_MODULE, 710 710 .open = qcam_exclusive_open, 711 711 .release = qcam_exclusive_release, 712 712 .ioctl = qcam_ioctl, 713 - #ifdef CONFIG_COMPAT 714 - .compat_ioctl = v4l_compat_ioctl32, 715 - #endif 716 713 .read = qcam_read, 717 - .llseek = no_llseek, 718 714 }; 719 715 720 716 static struct video_device qcam_template=
+8 -8
drivers/media/video/cafe_ccic.c
··· 859 859 */ 860 860 static int cafe_cam_init(struct cafe_camera *cam) 861 861 { 862 - struct v4l2_chip_ident chip = { V4L2_CHIP_MATCH_I2C_ADDR, 0, 0, 0 }; 862 + struct v4l2_dbg_chip_ident chip; 863 863 int ret; 864 864 865 865 mutex_lock(&cam->s_mutex); ··· 869 869 ret = __cafe_cam_reset(cam); 870 870 if (ret) 871 871 goto out; 872 - chip.match_chip = cam->sensor->addr; 873 - ret = __cafe_cam_cmd(cam, VIDIOC_G_CHIP_IDENT, &chip); 872 + chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR; 873 + chip.match.addr = cam->sensor->addr; 874 + ret = __cafe_cam_cmd(cam, VIDIOC_DBG_G_CHIP_IDENT, &chip); 874 875 if (ret) 875 876 goto out; 876 877 cam->sensor_type = chip.ident; ··· 1473 1472 1474 1473 1475 1474 1476 - static int cafe_v4l_open(struct inode *inode, struct file *filp) 1475 + static int cafe_v4l_open(struct file *filp) 1477 1476 { 1478 1477 struct cafe_camera *cam; 1479 1478 1480 - cam = cafe_find_dev(iminor(inode)); 1479 + cam = cafe_find_dev(video_devdata(filp)->minor); 1481 1480 if (cam == NULL) 1482 1481 return -ENODEV; 1483 1482 filp->private_data = cam; ··· 1495 1494 } 1496 1495 1497 1496 1498 - static int cafe_v4l_release(struct inode *inode, struct file *filp) 1497 + static int cafe_v4l_release(struct file *filp) 1499 1498 { 1500 1499 struct cafe_camera *cam = filp->private_data; 1501 1500 ··· 1760 1759 * clone it for specific real devices. 1761 1760 */ 1762 1761 1763 - static const struct file_operations cafe_v4l_fops = { 1762 + static const struct v4l2_file_operations cafe_v4l_fops = { 1764 1763 .owner = THIS_MODULE, 1765 1764 .open = cafe_v4l_open, 1766 1765 .release = cafe_v4l_release, ··· 1768 1767 .poll = cafe_v4l_poll, 1769 1768 .mmap = cafe_v4l_mmap, 1770 1769 .ioctl = video_ioctl2, 1771 - .llseek = no_llseek, 1772 1770 }; 1773 1771 1774 1772 static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = {
+5 -9
drivers/media/video/cpia.c
··· 3148 3148 } 3149 3149 3150 3150 /* ------------------------- V4L interface --------------------- */ 3151 - static int cpia_open(struct inode *inode, struct file *file) 3151 + static int cpia_open(struct file *file) 3152 3152 { 3153 3153 struct video_device *dev = video_devdata(file); 3154 3154 struct cam_data *cam = video_get_drvdata(dev); ··· 3225 3225 return err; 3226 3226 } 3227 3227 3228 - static int cpia_close(struct inode *inode, struct file *file) 3228 + static int cpia_close(struct file *file) 3229 3229 { 3230 3230 struct video_device *dev = file->private_data; 3231 3231 struct cam_data *cam = video_get_drvdata(dev); ··· 3333 3333 return cam->decompressed_frame.count; 3334 3334 } 3335 3335 3336 - static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg) 3336 + static long cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg) 3337 3337 { 3338 3338 struct video_device *dev = file->private_data; 3339 3339 struct cam_data *cam = video_get_drvdata(dev); ··· 3720 3720 return retval; 3721 3721 } 3722 3722 3723 - static int cpia_ioctl(struct inode *inode, struct file *file, 3723 + static long cpia_ioctl(struct file *file, 3724 3724 unsigned int cmd, unsigned long arg) 3725 3725 { 3726 3726 return video_usercopy(file, cmd, arg, cpia_do_ioctl); ··· 3780 3780 return 0; 3781 3781 } 3782 3782 3783 - static const struct file_operations cpia_fops = { 3783 + static const struct v4l2_file_operations cpia_fops = { 3784 3784 .owner = THIS_MODULE, 3785 3785 .open = cpia_open, 3786 3786 .release = cpia_close, 3787 3787 .read = cpia_read, 3788 3788 .mmap = cpia_mmap, 3789 3789 .ioctl = cpia_ioctl, 3790 - #ifdef CONFIG_COMPAT 3791 - .compat_ioctl = v4l_compat_ioctl32, 3792 - #endif 3793 - .llseek = no_llseek, 3794 3790 }; 3795 3791 3796 3792 static struct video_device cpia_template = {
+6 -10
drivers/media/video/cpia2/cpia2_v4l.c
··· 239 239 * cpia2_open 240 240 * 241 241 *****************************************************************************/ 242 - static int cpia2_open(struct inode *inode, struct file *file) 242 + static int cpia2_open(struct file *file) 243 243 { 244 244 struct camera_data *cam = video_drvdata(file); 245 245 int retval = 0; ··· 302 302 * cpia2_close 303 303 * 304 304 *****************************************************************************/ 305 - static int cpia2_close(struct inode *inode, struct file *file) 305 + static int cpia2_close(struct file *file) 306 306 { 307 307 struct video_device *dev = video_devdata(file); 308 308 struct camera_data *cam = video_get_drvdata(dev); ··· 1572 1572 * cpia2_ioctl 1573 1573 * 1574 1574 *****************************************************************************/ 1575 - static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1575 + static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1576 1576 { 1577 1577 struct camera_data *cam = video_drvdata(file); 1578 - int retval = 0; 1578 + long retval = 0; 1579 1579 1580 1580 if (!cam) 1581 1581 return -ENOTTY; ··· 1841 1841 return retval; 1842 1842 } 1843 1843 1844 - static int cpia2_ioctl(struct inode *inode, struct file *file, 1844 + static long cpia2_ioctl(struct file *file, 1845 1845 unsigned int cmd, unsigned long arg) 1846 1846 { 1847 1847 return video_usercopy(file, cmd, arg, cpia2_do_ioctl); ··· 1912 1912 /*** 1913 1913 * The v4l video device structure initialized for this device 1914 1914 ***/ 1915 - static const struct file_operations fops_template = { 1915 + static const struct v4l2_file_operations fops_template = { 1916 1916 .owner = THIS_MODULE, 1917 1917 .open = cpia2_open, 1918 1918 .release = cpia2_close, 1919 1919 .read = cpia2_v4l_read, 1920 1920 .poll = cpia2_v4l_poll, 1921 1921 .ioctl = cpia2_ioctl, 1922 - .llseek = no_llseek, 1923 - #ifdef CONFIG_COMPAT 1924 - .compat_ioctl = v4l_compat_ioctl32, 1925 - #endif 1926 1922 .mmap = cpia2_mmap, 1927 1923 }; 1928 1924
+6 -7
drivers/media/video/cs5345.c
··· 95 95 } 96 96 97 97 #ifdef CONFIG_VIDEO_ADV_DEBUG 98 - static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 98 + static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 99 99 { 100 100 struct i2c_client *client = v4l2_get_subdevdata(sd); 101 101 102 - if (!v4l2_chip_match_i2c_client(client, 103 - reg->match_type, reg->match_chip)) 102 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 104 103 return -EINVAL; 105 104 if (!capable(CAP_SYS_ADMIN)) 106 105 return -EPERM; 106 + reg->size = 1; 107 107 reg->val = cs5345_read(sd, reg->reg & 0x1f); 108 108 return 0; 109 109 } 110 110 111 - static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 111 + static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 112 112 { 113 113 struct i2c_client *client = v4l2_get_subdevdata(sd); 114 114 115 - if (!v4l2_chip_match_i2c_client(client, 116 - reg->match_type, reg->match_chip)) 115 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 117 116 return -EINVAL; 118 117 if (!capable(CAP_SYS_ADMIN)) 119 118 return -EPERM; ··· 121 122 } 122 123 #endif 123 124 124 - static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 125 + static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 125 126 { 126 127 struct i2c_client *client = v4l2_get_subdevdata(sd); 127 128
+1 -1
drivers/media/video/cs53l32a.c
··· 102 102 return 0; 103 103 } 104 104 105 - static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 105 + static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 106 106 { 107 107 struct i2c_client *client = v4l2_get_subdevdata(sd); 108 108
+3 -3
drivers/media/video/cx18/cx18-fileops.c
··· 552 552 } 553 553 } 554 554 555 - int cx18_v4l2_close(struct inode *inode, struct file *filp) 555 + int cx18_v4l2_close(struct file *filp) 556 556 { 557 557 struct cx18_open_id *id = filp->private_data; 558 558 struct cx18 *cx = id->cx; ··· 650 650 return 0; 651 651 } 652 652 653 - int cx18_v4l2_open(struct inode *inode, struct file *filp) 653 + int cx18_v4l2_open(struct file *filp) 654 654 { 655 655 int res, x, y = 0; 656 656 struct cx18 *cx = NULL; 657 657 struct cx18_stream *s = NULL; 658 - int minor = iminor(inode); 658 + int minor = video_devdata(filp)->minor; 659 659 660 660 /* Find which card this open was on */ 661 661 spin_lock(&cx18_cards_lock);
+2 -2
drivers/media/video/cx18/cx18-fileops.h
··· 22 22 */ 23 23 24 24 /* Testing/Debugging */ 25 - int cx18_v4l2_open(struct inode *inode, struct file *filp); 25 + int cx18_v4l2_open(struct file *filp); 26 26 ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count, 27 27 loff_t *pos); 28 28 ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count, 29 29 loff_t *pos); 30 - int cx18_v4l2_close(struct inode *inode, struct file *filp); 30 + int cx18_v4l2_close(struct file *filp); 31 31 unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait); 32 32 int cx18_start_capture(struct cx18_open_id *id); 33 33 void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
+1 -27
drivers/media/video/cx18/cx18-i2c.c
··· 242 242 return retval; 243 243 } 244 244 } 245 - if (cmd != VIDIOC_G_CHIP_IDENT) 245 + if (cmd != VIDIOC_DBG_G_CHIP_IDENT) 246 246 CX18_ERR("i2c addr 0x%02x not found for cmd 0x%x!\n", 247 247 addr, cmd); 248 248 return -ENODEV; ··· 266 266 } 267 267 } 268 268 return retval; 269 - } 270 - 271 - /* Find the i2c device name matching the DRIVERID */ 272 - static const char *cx18_i2c_id_name(u32 id) 273 - { 274 - int i; 275 - 276 - for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 277 - if (hw_driverids[i] == id) 278 - return hw_devicenames[i]; 279 - return "unknown device"; 280 269 } 281 270 282 271 /* Find the i2c device name matching the CX18_HW_ flag */ ··· 310 321 if (addr < 0) { 311 322 CX18_ERR("i2c hardware 0x%08x (%s) not found for cmd 0x%x!\n", 312 323 hw, cx18_i2c_hw_name(hw), cmd); 313 - return addr; 314 - } 315 - return cx18_call_i2c_client(cx, addr, cmd, arg); 316 - } 317 - 318 - /* Calls i2c device based on I2C driver ID. */ 319 - int cx18_i2c_id(struct cx18 *cx, u32 id, unsigned int cmd, void *arg) 320 - { 321 - int addr; 322 - 323 - addr = cx18_i2c_id_addr(cx, id); 324 - if (addr < 0) { 325 - if (cmd != VIDIOC_G_CHIP_IDENT) 326 - CX18_ERR("i2c ID 0x%08x (%s) not found for cmd 0x%x!\n", 327 - id, cx18_i2c_id_name(id), cmd); 328 324 return addr; 329 325 } 330 326 return cx18_call_i2c_client(cx, addr, cmd, arg);
-1
drivers/media/video/cx18/cx18-i2c.h
··· 23 23 24 24 int cx18_i2c_hw_addr(struct cx18 *cx, u32 hw); 25 25 int cx18_i2c_hw(struct cx18 *cx, u32 hw, unsigned int cmd, void *arg); 26 - int cx18_i2c_id(struct cx18 *cx, u32 id, unsigned int cmd, void *arg); 27 26 int cx18_call_i2c_client(struct cx18 *cx, int addr, unsigned cmd, void *arg); 28 27 void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg); 29 28 int cx18_i2c_register(struct cx18 *cx, unsigned idx);
+19 -30
drivers/media/video/cx18/cx18-ioctl.c
··· 254 254 } 255 255 256 256 static int cx18_g_chip_ident(struct file *file, void *fh, 257 - struct v4l2_chip_ident *chip) 257 + struct v4l2_dbg_chip_ident *chip) 258 258 { 259 259 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 260 260 261 261 chip->ident = V4L2_IDENT_NONE; 262 262 chip->revision = 0; 263 - if (chip->match_type == V4L2_CHIP_MATCH_HOST) { 264 - if (v4l2_chip_match_host(chip->match_type, chip->match_chip)) 265 - chip->ident = V4L2_IDENT_CX23418; 263 + if (v4l2_chip_match_host(&chip->match)) { 264 + chip->ident = V4L2_IDENT_CX23418; 266 265 return 0; 267 266 } 268 - if (chip->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) 269 - return cx18_i2c_id(cx, chip->match_chip, VIDIOC_G_CHIP_IDENT, 270 - chip); 271 - if (chip->match_type == V4L2_CHIP_MATCH_I2C_ADDR) 272 - return cx18_call_i2c_client(cx, chip->match_chip, 273 - VIDIOC_G_CHIP_IDENT, chip); 274 - return -EINVAL; 267 + cx18_call_i2c_clients(cx, VIDIOC_DBG_G_CHIP_IDENT, chip); 268 + return 0; 275 269 } 276 270 277 271 #ifdef CONFIG_VIDEO_ADV_DEBUG 278 272 static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg) 279 273 { 280 - struct v4l2_register *regs = arg; 274 + struct v4l2_dbg_register *regs = arg; 281 275 unsigned long flags; 282 276 283 277 if (!capable(CAP_SYS_ADMIN)) ··· 280 286 return -EINVAL; 281 287 282 288 spin_lock_irqsave(&cx18_cards_lock, flags); 289 + regs->size = 4; 283 290 if (cmd == VIDIOC_DBG_G_REGISTER) 284 291 regs->val = cx18_read_enc(cx, regs->reg); 285 292 else ··· 290 295 } 291 296 292 297 static int cx18_g_register(struct file *file, void *fh, 293 - struct v4l2_register *reg) 298 + struct v4l2_dbg_register *reg) 294 299 { 295 300 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 296 301 297 - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 302 + if (v4l2_chip_match_host(&reg->match)) 298 303 return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg); 299 - if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) 300 - return cx18_i2c_id(cx, reg->match_chip, VIDIOC_DBG_G_REGISTER, 301 - reg); 302 - return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_G_REGISTER, 303 - reg); 304 + cx18_call_i2c_clients(cx, VIDIOC_DBG_G_REGISTER, reg); 305 + return 0; 304 306 } 305 307 306 308 static int cx18_s_register(struct file *file, void *fh, 307 - struct v4l2_register *reg) 309 + struct v4l2_dbg_register *reg) 308 310 { 309 311 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 310 312 311 - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 313 + if (v4l2_chip_match_host(&reg->match)) 312 314 return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg); 313 - if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) 314 - return cx18_i2c_id(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER, 315 - reg); 316 - return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER, 317 - reg); 315 + cx18_call_i2c_clients(cx, VIDIOC_DBG_S_REGISTER, reg); 316 + return 0; 318 317 } 319 318 #endif 320 319 ··· 744 755 return 0; 745 756 } 746 757 747 - static int cx18_default(struct file *file, void *fh, int cmd, void *arg) 758 + static long cx18_default(struct file *file, void *fh, int cmd, void *arg) 748 759 { 749 760 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 750 761 ··· 772 783 return 0; 773 784 } 774 785 775 - int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 786 + long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd, 776 787 unsigned long arg) 777 788 { 778 789 struct video_device *vfd = video_devdata(filp); 779 790 struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data; 780 791 struct cx18 *cx = id->cx; 781 - int res; 792 + long res; 782 793 783 794 mutex_lock(&cx->serialize_lock); 784 795 785 796 if (cx18_debug & CX18_DBGFLG_IOCTL) 786 797 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 787 - res = video_ioctl2(inode, filp, cmd, arg); 798 + res = video_ioctl2(filp, cmd, arg); 788 799 vfd->debug = 0; 789 800 mutex_unlock(&cx->serialize_lock); 790 801 return res;
+1 -1
drivers/media/video/cx18/cx18-ioctl.h
··· 29 29 int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std); 30 30 int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 31 31 int cx18_s_input(struct file *file, void *fh, unsigned int inp); 32 - int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 32 + long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd, 33 33 unsigned long arg);
+2 -11
drivers/media/video/cx18/cx18-streams.c
··· 37 37 38 38 #define CX18_DSP0_INTERRUPT_MASK 0xd0004C 39 39 40 - static struct file_operations cx18_v4l2_enc_fops = { 40 + static struct v4l2_file_operations cx18_v4l2_enc_fops = { 41 41 .owner = THIS_MODULE, 42 42 .read = cx18_v4l2_read, 43 43 .open = cx18_v4l2_open, 44 44 /* FIXME change to video_ioctl2 if serialization lock can be removed */ 45 45 .ioctl = cx18_v4l2_ioctl, 46 - .compat_ioctl = v4l_compat_ioctl32, 47 46 .release = cx18_v4l2_close, 48 47 .poll = cx18_v4l2_enc_poll, 49 48 }; ··· 60 61 int num_offset; 61 62 int dma; 62 63 enum v4l2_buf_type buf_type; 63 - struct file_operations *fops; 64 64 } cx18_stream_info[] = { 65 65 { /* CX18_ENC_STREAM_TYPE_MPG */ 66 66 "encoder MPEG", 67 67 VFL_TYPE_GRABBER, 0, 68 68 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 69 - &cx18_v4l2_enc_fops 70 69 }, 71 70 { /* CX18_ENC_STREAM_TYPE_TS */ 72 71 "TS", 73 72 VFL_TYPE_GRABBER, -1, 74 73 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 75 - &cx18_v4l2_enc_fops 76 74 }, 77 75 { /* CX18_ENC_STREAM_TYPE_YUV */ 78 76 "encoder YUV", 79 77 VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET, 80 78 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 81 - &cx18_v4l2_enc_fops 82 79 }, 83 80 { /* CX18_ENC_STREAM_TYPE_VBI */ 84 81 "encoder VBI", 85 82 VFL_TYPE_VBI, 0, 86 83 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VBI_CAPTURE, 87 - &cx18_v4l2_enc_fops 88 84 }, 89 85 { /* CX18_ENC_STREAM_TYPE_PCM */ 90 86 "encoder PCM audio", 91 87 VFL_TYPE_GRABBER, CX18_V4L2_ENC_PCM_OFFSET, 92 88 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_PRIVATE, 93 - &cx18_v4l2_enc_fops 94 89 }, 95 90 { /* CX18_ENC_STREAM_TYPE_IDX */ 96 91 "encoder IDX", 97 92 VFL_TYPE_GRABBER, -1, 98 93 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 99 - &cx18_v4l2_enc_fops 100 94 }, 101 95 { /* CX18_ENC_STREAM_TYPE_RAD */ 102 96 "encoder radio", 103 97 VFL_TYPE_RADIO, 0, 104 98 PCI_DMA_NONE, V4L2_BUF_TYPE_PRIVATE, 105 - &cx18_v4l2_enc_fops 106 99 }, 107 100 }; 108 101 ··· 175 184 176 185 s->v4l2dev->num = num; 177 186 s->v4l2dev->parent = &cx->dev->dev; 178 - s->v4l2dev->fops = cx18_stream_info[type].fops; 187 + s->v4l2dev->fops = &cx18_v4l2_enc_fops; 179 188 s->v4l2dev->release = video_device_release; 180 189 s->v4l2dev->tvnorms = V4L2_STD_ALL; 181 190 cx18_set_funcs(s->v4l2dev);
+7 -8
drivers/media/video/cx23885/cx23885-417.c
··· 1027 1027 printk(KERN_ERR "%s() f/w load failed\n", __func__); 1028 1028 return retval; 1029 1029 } 1030 - dev->cx23417_mailbox = cx23885_find_mailbox(dev); 1031 - if (dev->cx23417_mailbox < 0) { 1030 + retval = cx23885_find_mailbox(dev); 1031 + if (retval < 0) { 1032 1032 printk(KERN_ERR "%s() mailbox < 0, error\n", 1033 1033 __func__); 1034 1034 return -1; 1035 1035 } 1036 + dev->cx23417_mailbox = retval; 1036 1037 retval = cx23885_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); 1037 1038 if (retval < 0) { 1038 1039 printk(KERN_ERR ··· 1574 1573 return cx23885_queryctrl(dev, c); 1575 1574 } 1576 1575 1577 - static int mpeg_open(struct inode *inode, struct file *file) 1576 + static int mpeg_open(struct file *file) 1578 1577 { 1579 - int minor = iminor(inode); 1578 + int minor = video_devdata(file)->minor; 1580 1579 struct cx23885_dev *h, *dev = NULL; 1581 1580 struct list_head *list; 1582 1581 struct cx23885_fh *fh; ··· 1618 1617 return 0; 1619 1618 } 1620 1619 1621 - static int mpeg_release(struct inode *inode, struct file *file) 1620 + static int mpeg_release(struct file *file) 1622 1621 { 1623 1622 struct cx23885_fh *fh = file->private_data; 1624 1623 struct cx23885_dev *dev = fh->dev; ··· 1695 1694 return videobuf_mmap_mapper(&fh->mpegq, vma); 1696 1695 } 1697 1696 1698 - static struct file_operations mpeg_fops = { 1697 + static struct v4l2_file_operations mpeg_fops = { 1699 1698 .owner = THIS_MODULE, 1700 1699 .open = mpeg_open, 1701 1700 .release = mpeg_release, 1702 1701 .read = mpeg_read, 1703 1702 .poll = mpeg_poll, 1704 1703 .mmap = mpeg_mmap, 1705 - .ioctl = video_ioctl2, 1706 - .llseek = no_llseek, 1707 1704 }; 1708 1705 1709 1706 static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
+9 -13
drivers/media/video/cx23885/cx23885-video.c
··· 718 718 } 719 719 } 720 720 721 - static int video_open(struct inode *inode, struct file *file) 721 + static int video_open(struct file *file) 722 722 { 723 - int minor = iminor(inode); 723 + int minor = video_devdata(file)->minor; 724 724 struct cx23885_dev *h, *dev = NULL; 725 725 struct cx23885_fh *fh; 726 726 struct list_head *list; ··· 834 834 return 0; 835 835 } 836 836 837 - static int video_release(struct inode *inode, struct file *file) 837 + static int video_release(struct file *file) 838 838 { 839 839 struct cx23885_fh *fh = file->private_data; 840 840 struct cx23885_dev *dev = fh->dev; ··· 1326 1326 1327 1327 #ifdef CONFIG_VIDEO_ADV_DEBUG 1328 1328 static int vidioc_g_register(struct file *file, void *fh, 1329 - struct v4l2_register *reg) 1329 + struct v4l2_dbg_register *reg) 1330 1330 { 1331 1331 struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; 1332 1332 1333 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1333 + if (!v4l2_chip_match_host(&reg->match)) 1334 1334 return -EINVAL; 1335 1335 1336 1336 cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_G_REGISTER, reg); ··· 1339 1339 } 1340 1340 1341 1341 static int vidioc_s_register(struct file *file, void *fh, 1342 - struct v4l2_register *reg) 1342 + struct v4l2_dbg_register *reg) 1343 1343 { 1344 1344 struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; 1345 1345 1346 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1346 + if (!v4l2_chip_match_host(&reg->match)) 1347 1347 return -EINVAL; 1348 1348 1349 1349 cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg); ··· 1422 1422 /* ----------------------------------------------------------- */ 1423 1423 /* exported stuff */ 1424 1424 1425 - static const struct file_operations video_fops = { 1425 + static const struct v4l2_file_operations video_fops = { 1426 1426 .owner = THIS_MODULE, 1427 1427 .open = video_open, 1428 1428 .release = video_release, ··· 1430 1430 .poll = video_poll, 1431 1431 .mmap = video_mmap, 1432 1432 .ioctl = video_ioctl2, 1433 - .compat_ioctl = v4l_compat_ioctl32, 1434 - .llseek = no_llseek, 1435 1433 }; 1436 1434 1437 1435 static const struct v4l2_ioctl_ops video_ioctl_ops = { ··· 1477 1479 .current_norm = V4L2_STD_NTSC_M, 1478 1480 }; 1479 1481 1480 - static const struct file_operations radio_fops = { 1482 + static const struct v4l2_file_operations radio_fops = { 1481 1483 .owner = THIS_MODULE, 1482 1484 .open = video_open, 1483 1485 .release = video_release, 1484 1486 .ioctl = video_ioctl2, 1485 - .compat_ioctl = v4l_compat_ioctl32, 1486 - .llseek = no_llseek, 1487 1487 }; 1488 1488 1489 1489
+6 -7
drivers/media/video/cx25840/cx25840-core.c
··· 1120 1120 } 1121 1121 1122 1122 #ifdef CONFIG_VIDEO_ADV_DEBUG 1123 - static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1123 + static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1124 1124 { 1125 1125 struct i2c_client *client = v4l2_get_subdevdata(sd); 1126 1126 1127 - if (!v4l2_chip_match_i2c_client(client, 1128 - reg->match_type, reg->match_chip)) 1127 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1129 1128 return -EINVAL; 1130 1129 if (!capable(CAP_SYS_ADMIN)) 1131 1130 return -EPERM; 1131 + reg->size = 1; 1132 1132 reg->val = cx25840_read(client, reg->reg & 0x0fff); 1133 1133 return 0; 1134 1134 } 1135 1135 1136 - static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1136 + static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1137 1137 { 1138 1138 struct i2c_client *client = v4l2_get_subdevdata(sd); 1139 1139 1140 - if (!v4l2_chip_match_i2c_client(client, 1141 - reg->match_type, reg->match_chip)) 1140 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1142 1141 return -EINVAL; 1143 1142 if (!capable(CAP_SYS_ADMIN)) 1144 1143 return -EPERM; ··· 1361 1362 return 0; 1362 1363 } 1363 1364 1364 - static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 1365 + static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 1365 1366 { 1366 1367 struct cx25840_state *state = to_state(sd); 1367 1368 struct i2c_client *client = v4l2_get_subdevdata(sd);
+6 -7
drivers/media/video/cx88/cx88-blackbird.c
··· 1049 1049 1050 1050 /* FIXME: cx88_ioctl_hook not implemented */ 1051 1051 1052 - static int mpeg_open(struct inode *inode, struct file *file) 1052 + static int mpeg_open(struct file *file) 1053 1053 { 1054 - int minor = iminor(inode); 1054 + int minor = video_devdata(file)->minor; 1055 1055 struct cx8802_dev *dev = NULL; 1056 1056 struct cx8802_fh *fh; 1057 1057 struct cx8802_driver *drv = NULL; 1058 1058 int err; 1059 1059 1060 1060 lock_kernel(); 1061 - dev = cx8802_get_device(inode); 1061 + dev = cx8802_get_device(minor); 1062 1062 1063 1063 dprintk( 1, "%s\n", __func__); 1064 1064 ··· 1114 1114 return 0; 1115 1115 } 1116 1116 1117 - static int mpeg_release(struct inode *inode, struct file *file) 1117 + static int mpeg_release(struct file *file) 1118 1118 { 1119 1119 struct cx8802_fh *fh = file->private_data; 1120 1120 struct cx8802_dev *dev = fh->dev; ··· 1132 1132 kfree(fh); 1133 1133 1134 1134 /* Make sure we release the hardware */ 1135 - dev = cx8802_get_device(inode); 1135 + dev = cx8802_get_device(video_devdata(file)->minor); 1136 1136 if (dev == NULL) 1137 1137 return -ENODEV; 1138 1138 ··· 1178 1178 return videobuf_mmap_mapper(&fh->mpegq, vma); 1179 1179 } 1180 1180 1181 - static const struct file_operations mpeg_fops = 1181 + static const struct v4l2_file_operations mpeg_fops = 1182 1182 { 1183 1183 .owner = THIS_MODULE, 1184 1184 .open = mpeg_open, ··· 1187 1187 .poll = mpeg_poll, 1188 1188 .mmap = mpeg_mmap, 1189 1189 .ioctl = video_ioctl2, 1190 - .llseek = no_llseek, 1191 1190 }; 1192 1191 1193 1192 static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
+1 -2
drivers/media/video/cx88/cx88-mpeg.c
··· 578 578 579 579 #if defined(CONFIG_VIDEO_CX88_BLACKBIRD) || \ 580 580 defined(CONFIG_VIDEO_CX88_BLACKBIRD_MODULE) 581 - struct cx8802_dev * cx8802_get_device(struct inode *inode) 581 + struct cx8802_dev *cx8802_get_device(int minor) 582 582 { 583 - int minor = iminor(inode); 584 583 struct cx8802_dev *dev; 585 584 586 585 list_for_each_entry(dev, &cx8802_devlist, devlist)
+12 -15
drivers/media/video/cx88/cx88-video.c
··· 757 757 } 758 758 } 759 759 760 - static int video_open(struct inode *inode, struct file *file) 760 + static int video_open(struct file *file) 761 761 { 762 - int minor = iminor(inode); 762 + int minor = video_devdata(file)->minor; 763 763 struct cx8800_dev *h,*dev = NULL; 764 764 struct cx88_core *core; 765 765 struct cx8800_fh *fh; ··· 904 904 return 0; 905 905 } 906 906 907 - static int video_release(struct inode *inode, struct file *file) 907 + static int video_release(struct file *file) 908 908 { 909 909 struct cx8800_fh *fh = file->private_data; 910 910 struct cx8800_dev *dev = fh->dev; ··· 1447 1447 1448 1448 #ifdef CONFIG_VIDEO_ADV_DEBUG 1449 1449 static int vidioc_g_register (struct file *file, void *fh, 1450 - struct v4l2_register *reg) 1450 + struct v4l2_dbg_register *reg) 1451 1451 { 1452 1452 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; 1453 1453 1454 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1454 + if (!v4l2_chip_match_host(&reg->match)) 1455 1455 return -EINVAL; 1456 1456 /* cx2388x has a 24-bit register space */ 1457 - reg->val = cx_read(reg->reg&0xffffff); 1457 + reg->val = cx_read(reg->reg & 0xffffff); 1458 + reg->size = 4; 1458 1459 return 0; 1459 1460 } 1460 1461 1461 1462 static int vidioc_s_register (struct file *file, void *fh, 1462 - struct v4l2_register *reg) 1463 + struct v4l2_dbg_register *reg) 1463 1464 { 1464 1465 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; 1465 1466 1466 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1467 + if (!v4l2_chip_match_host(&reg->match)) 1467 1468 return -EINVAL; 1468 - cx_write(reg->reg&0xffffff, reg->val); 1469 + cx_write(reg->reg & 0xffffff, reg->val); 1469 1470 return 0; 1470 1471 } 1471 1472 #endif ··· 1694 1693 /* ----------------------------------------------------------- */ 1695 1694 /* exported stuff */ 1696 1695 1697 - static const struct file_operations video_fops = 1696 + static const struct v4l2_file_operations video_fops = 1698 1697 { 1699 1698 .owner = THIS_MODULE, 1700 1699 .open = video_open, ··· 1703 1702 .poll = video_poll, 1704 1703 .mmap = video_mmap, 1705 1704 .ioctl = video_ioctl2, 1706 - .compat_ioctl = v4l_compat_ioctl32, 1707 - .llseek = no_llseek, 1708 1705 }; 1709 1706 1710 1707 static const struct v4l2_ioctl_ops video_ioctl_ops = { ··· 1751 1752 .current_norm = V4L2_STD_NTSC_M, 1752 1753 }; 1753 1754 1754 - static const struct file_operations radio_fops = 1755 + static const struct v4l2_file_operations radio_fops = 1755 1756 { 1756 1757 .owner = THIS_MODULE, 1757 1758 .open = video_open, 1758 1759 .release = video_release, 1759 1760 .ioctl = video_ioctl2, 1760 - .compat_ioctl = v4l_compat_ioctl32, 1761 - .llseek = no_llseek, 1762 1761 }; 1763 1762 1764 1763 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
+1 -1
drivers/media/video/cx88/cx88.h
··· 643 643 644 644 int cx8802_register_driver(struct cx8802_driver *drv); 645 645 int cx8802_unregister_driver(struct cx8802_driver *drv); 646 - struct cx8802_dev * cx8802_get_device(struct inode *inode); 646 + struct cx8802_dev *cx8802_get_device(int minor); 647 647 struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype); 648 648 649 649 /* ----------------------------------------------------------- */
+41 -50
drivers/media/video/em28xx/em28xx-audio.c
··· 62 62 63 63 dprintk("Stopping isoc\n"); 64 64 for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { 65 - usb_unlink_urb(dev->adev->urb[i]); 66 - usb_free_urb(dev->adev->urb[i]); 67 - dev->adev->urb[i] = NULL; 65 + usb_unlink_urb(dev->adev.urb[i]); 66 + usb_free_urb(dev->adev.urb[i]); 67 + dev->adev.urb[i] = NULL; 68 68 } 69 69 70 70 return 0; ··· 81 81 unsigned int stride; 82 82 struct snd_pcm_substream *substream; 83 83 struct snd_pcm_runtime *runtime; 84 - if (dev->adev->capture_pcm_substream) { 85 - substream = dev->adev->capture_pcm_substream; 84 + if (dev->adev.capture_pcm_substream) { 85 + substream = dev->adev.capture_pcm_substream; 86 86 runtime = substream->runtime; 87 87 stride = runtime->frame_bits >> 3; 88 88 ··· 95 95 if (!length) 96 96 continue; 97 97 98 - oldptr = dev->adev->hwptr_done_capture; 98 + oldptr = dev->adev.hwptr_done_capture; 99 99 if (oldptr + length >= runtime->buffer_size) { 100 100 unsigned int cnt = 101 101 runtime->buffer_size - oldptr; ··· 110 110 111 111 snd_pcm_stream_lock(substream); 112 112 113 - dev->adev->hwptr_done_capture += length; 114 - if (dev->adev->hwptr_done_capture >= 113 + dev->adev.hwptr_done_capture += length; 114 + if (dev->adev.hwptr_done_capture >= 115 115 runtime->buffer_size) 116 - dev->adev->hwptr_done_capture -= 116 + dev->adev.hwptr_done_capture -= 117 117 runtime->buffer_size; 118 118 119 - dev->adev->capture_transfer_done += length; 120 - if (dev->adev->capture_transfer_done >= 119 + dev->adev.capture_transfer_done += length; 120 + if (dev->adev.capture_transfer_done >= 121 121 runtime->period_size) { 122 - dev->adev->capture_transfer_done -= 122 + dev->adev.capture_transfer_done -= 123 123 runtime->period_size; 124 124 period_elapsed = 1; 125 125 } ··· 131 131 } 132 132 urb->status = 0; 133 133 134 - if (dev->adev->shutdown) 134 + if (dev->adev.shutdown) 135 135 return; 136 136 137 137 status = usb_submit_urb(urb, GFP_ATOMIC); ··· 154 154 struct urb *urb; 155 155 int j, k; 156 156 157 - dev->adev->transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC); 158 - if (!dev->adev->transfer_buffer[i]) 157 + dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC); 158 + if (!dev->adev.transfer_buffer[i]) 159 159 return -ENOMEM; 160 160 161 - memset(dev->adev->transfer_buffer[i], 0x80, sb_size); 161 + memset(dev->adev.transfer_buffer[i], 0x80, sb_size); 162 162 urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); 163 163 if (!urb) { 164 164 em28xx_errdev("usb_alloc_urb failed!\n"); 165 165 for (j = 0; j < i; j++) { 166 - usb_free_urb(dev->adev->urb[j]); 167 - kfree(dev->adev->transfer_buffer[j]); 166 + usb_free_urb(dev->adev.urb[j]); 167 + kfree(dev->adev.transfer_buffer[j]); 168 168 } 169 169 return -ENOMEM; 170 170 } ··· 173 173 urb->context = dev; 174 174 urb->pipe = usb_rcvisocpipe(dev->udev, 0x83); 175 175 urb->transfer_flags = URB_ISO_ASAP; 176 - urb->transfer_buffer = dev->adev->transfer_buffer[i]; 176 + urb->transfer_buffer = dev->adev.transfer_buffer[i]; 177 177 urb->interval = 1; 178 178 urb->complete = em28xx_audio_isocirq; 179 179 urb->number_of_packets = EM28XX_NUM_AUDIO_PACKETS; ··· 185 185 urb->iso_frame_desc[j].length = 186 186 EM28XX_AUDIO_MAX_PACKET_SIZE; 187 187 } 188 - dev->adev->urb[i] = urb; 188 + dev->adev.urb[i] = urb; 189 189 } 190 190 191 191 for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { 192 - errCode = usb_submit_urb(dev->adev->urb[i], GFP_ATOMIC); 192 + errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); 193 193 if (errCode) { 194 194 em28xx_isoc_audio_deinit(dev); 195 195 ··· 202 202 203 203 static int em28xx_cmd(struct em28xx *dev, int cmd, int arg) 204 204 { 205 - dprintk("%s transfer\n", (dev->adev->capture_stream == STREAM_ON)? 205 + dprintk("%s transfer\n", (dev->adev.capture_stream == STREAM_ON) ? 206 206 "stop" : "start"); 207 207 208 208 switch (cmd) { 209 209 case EM28XX_CAPTURE_STREAM_EN: 210 - if (dev->adev->capture_stream == STREAM_OFF && arg == 1) { 211 - dev->adev->capture_stream = STREAM_ON; 210 + if (dev->adev.capture_stream == STREAM_OFF && arg == 1) { 211 + dev->adev.capture_stream = STREAM_ON; 212 212 em28xx_init_audio_isoc(dev); 213 - } else if (dev->adev->capture_stream == STREAM_ON && arg == 0) { 214 - dev->adev->capture_stream = STREAM_OFF; 213 + } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) { 214 + dev->adev.capture_stream = STREAM_OFF; 215 215 em28xx_isoc_audio_deinit(dev); 216 216 } else { 217 217 printk(KERN_ERR "An underrun very likely occurred. " ··· 289 289 goto err; 290 290 291 291 runtime->hw = snd_em28xx_hw_capture; 292 - if (dev->alt == 0 && dev->adev->users == 0) { 292 + if (dev->alt == 0 && dev->adev.users == 0) { 293 293 int errCode; 294 294 dev->alt = 7; 295 295 errCode = usb_set_interface(dev->udev, 0, 7); 296 296 dprintk("changing alternate number to 7\n"); 297 297 } 298 298 299 - dev->adev->users++; 299 + dev->adev.users++; 300 300 301 301 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 302 - dev->adev->capture_pcm_substream = substream; 302 + dev->adev.capture_pcm_substream = substream; 303 303 runtime->private_data = dev; 304 304 305 305 return 0; ··· 311 311 static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) 312 312 { 313 313 struct em28xx *dev = snd_pcm_substream_chip(substream); 314 - dev->adev->users--; 314 + dev->adev.users--; 315 315 316 316 dprintk("closing device\n"); 317 317 ··· 320 320 em28xx_audio_analog_set(dev); 321 321 mutex_unlock(&dev->lock); 322 322 323 - if (dev->adev->users == 0 && dev->adev->shutdown == 1) { 324 - dprintk("audio users: %d\n", dev->adev->users); 323 + if (dev->adev.users == 0 && dev->adev.shutdown == 1) { 324 + dprintk("audio users: %d\n", dev->adev.users); 325 325 dprintk("disabling audio stream!\n"); 326 - dev->adev->shutdown = 0; 326 + dev->adev.shutdown = 0; 327 327 dprintk("released lock\n"); 328 328 em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); 329 329 } ··· 356 356 357 357 dprintk("Stop capture, if needed\n"); 358 358 359 - if (dev->adev->capture_stream == STREAM_ON) 359 + if (dev->adev.capture_stream == STREAM_ON) 360 360 em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); 361 361 362 362 return 0; ··· 379 379 em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); 380 380 return 0; 381 381 case SNDRV_PCM_TRIGGER_STOP: 382 - dev->adev->shutdown = 1; 382 + dev->adev.shutdown = 1; 383 383 return 0; 384 384 default: 385 385 return -EINVAL; ··· 393 393 394 394 snd_pcm_uframes_t hwptr_done; 395 395 dev = snd_pcm_substream_chip(substream); 396 - hwptr_done = dev->adev->hwptr_done_capture; 396 + hwptr_done = dev->adev.hwptr_done_capture; 397 397 398 398 return hwptr_done; 399 399 } ··· 420 420 421 421 static int em28xx_audio_init(struct em28xx *dev) 422 422 { 423 - struct em28xx_audio *adev; 423 + struct em28xx_audio *adev = &dev->adev; 424 424 struct snd_pcm *pcm; 425 425 struct snd_card *card; 426 426 static int devnr; ··· 438 438 printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus " 439 439 "Rechberger\n"); 440 440 441 - adev = kzalloc(sizeof(*adev), GFP_KERNEL); 442 - if (!adev) { 443 - printk(KERN_ERR "em28xx-audio.c: out of memory\n"); 444 - return -1; 445 - } 446 441 card = snd_card_new(index[devnr], "Em28xx Audio", THIS_MODULE, 0); 447 - if (card == NULL) { 448 - kfree(adev); 442 + if (card == NULL) 449 443 return -ENOMEM; 450 - } 451 444 452 445 spin_lock_init(&adev->slock); 453 446 err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm); ··· 464 471 } 465 472 adev->sndcard = card; 466 473 adev->udev = dev->udev; 467 - dev->adev = adev; 468 474 469 475 return 0; 470 476 } ··· 480 488 return 0; 481 489 } 482 490 483 - if (dev->adev) { 484 - snd_card_free(dev->adev->sndcard); 485 - kfree(dev->adev); 486 - dev->adev = NULL; 491 + if (dev->adev.sndcard) { 492 + snd_card_free(dev->adev.sndcard); 493 + dev->adev.sndcard = NULL; 487 494 } 488 495 489 496 return 0;
+1 -2
drivers/media/video/em28xx/em28xx-core.c
··· 1000 1000 static LIST_HEAD(em28xx_devlist); 1001 1001 static DEFINE_MUTEX(em28xx_devlist_mutex); 1002 1002 1003 - struct em28xx *em28xx_get_device(struct inode *inode, 1003 + struct em28xx *em28xx_get_device(int minor, 1004 1004 enum v4l2_buf_type *fh_type, 1005 1005 int *has_radio) 1006 1006 { 1007 1007 struct em28xx *h, *dev = NULL; 1008 - int minor = iminor(inode); 1009 1008 1010 1009 *fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1011 1010 *has_radio = 0;
+1 -1
drivers/media/video/em28xx/em28xx-reg.h
··· 160 160 161 161 /* FIXME: Need to be populated with the other chip ID's */ 162 162 enum em28xx_chip_id { 163 - CHIP_ID_EM2820 = 18, 163 + CHIP_ID_EM2820 = 18, /* Also used by em2710 */ 164 164 CHIP_ID_EM2840 = 20, 165 165 CHIP_ID_EM2750 = 33, 166 166 CHIP_ID_EM2860 = 34,
+21 -23
drivers/media/video/em28xx/em28xx-video.c
··· 1154 1154 } 1155 1155 1156 1156 static int vidioc_g_chip_ident(struct file *file, void *priv, 1157 - struct v4l2_chip_ident *chip) 1157 + struct v4l2_dbg_chip_ident *chip) 1158 1158 { 1159 1159 struct em28xx_fh *fh = priv; 1160 1160 struct em28xx *dev = fh->dev; ··· 1162 1162 chip->ident = V4L2_IDENT_NONE; 1163 1163 chip->revision = 0; 1164 1164 1165 - em28xx_i2c_call_clients(dev, VIDIOC_G_CHIP_IDENT, chip); 1165 + em28xx_i2c_call_clients(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); 1166 1166 1167 1167 return 0; 1168 1168 } 1169 1169 1170 1170 1171 1171 static int vidioc_g_register(struct file *file, void *priv, 1172 - struct v4l2_register *reg) 1172 + struct v4l2_dbg_register *reg) 1173 1173 { 1174 1174 struct em28xx_fh *fh = priv; 1175 1175 struct em28xx *dev = fh->dev; 1176 1176 int ret; 1177 1177 1178 - switch (reg->match_type) { 1178 + switch (reg->match.type) { 1179 1179 case V4L2_CHIP_MATCH_AC97: 1180 1180 mutex_lock(&dev->lock); 1181 1181 ret = em28xx_read_ac97(dev, reg->reg); ··· 1184 1184 return ret; 1185 1185 1186 1186 reg->val = ret; 1187 + reg->size = 1; 1187 1188 return 0; 1188 1189 case V4L2_CHIP_MATCH_I2C_DRIVER: 1189 1190 em28xx_i2c_call_clients(dev, VIDIOC_DBG_G_REGISTER, reg); ··· 1193 1192 /* Not supported yet */ 1194 1193 return -EINVAL; 1195 1194 default: 1196 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1195 + if (!v4l2_chip_match_host(&reg->match)) 1197 1196 return -EINVAL; 1198 1197 } 1199 1198 1200 1199 /* Match host */ 1201 - if (em28xx_reg_len(reg->reg) == 1) { 1200 + reg->size = em28xx_reg_len(reg->reg); 1201 + if (reg->size == 1) { 1202 1202 mutex_lock(&dev->lock); 1203 1203 ret = em28xx_read_reg(dev, reg->reg); 1204 1204 mutex_unlock(&dev->lock); ··· 1209 1207 1210 1208 reg->val = ret; 1211 1209 } else { 1212 - __le64 val = 0; 1210 + __le16 val = 0; 1213 1211 mutex_lock(&dev->lock); 1214 1212 ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS, 1215 1213 reg->reg, (char *)&val, 2); ··· 1217 1215 if (ret < 0) 1218 1216 return ret; 1219 1217 1220 - reg->val = le64_to_cpu(val); 1218 + reg->val = le16_to_cpu(val); 1221 1219 } 1222 1220 1223 1221 return 0; 1224 1222 } 1225 1223 1226 1224 static int vidioc_s_register(struct file *file, void *priv, 1227 - struct v4l2_register *reg) 1225 + struct v4l2_dbg_register *reg) 1228 1226 { 1229 1227 struct em28xx_fh *fh = priv; 1230 1228 struct em28xx *dev = fh->dev; 1231 - __le64 buf; 1229 + __le16 buf; 1232 1230 int rc; 1233 1231 1234 - switch (reg->match_type) { 1232 + switch (reg->match.type) { 1235 1233 case V4L2_CHIP_MATCH_AC97: 1236 1234 mutex_lock(&dev->lock); 1237 1235 rc = em28xx_write_ac97(dev, reg->reg, reg->val); ··· 1245 1243 /* Not supported yet */ 1246 1244 return -EINVAL; 1247 1245 default: 1248 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 1246 + if (!v4l2_chip_match_host(&reg->match)) 1249 1247 return -EINVAL; 1250 1248 } 1251 1249 1252 1250 /* Match host */ 1253 - buf = cpu_to_le64(reg->val); 1251 + buf = cpu_to_le16(reg->val); 1254 1252 1255 1253 mutex_lock(&dev->lock); 1256 1254 rc = em28xx_write_regs(dev, reg->reg, (char *)&buf, ··· 1584 1582 * em28xx_v4l2_open() 1585 1583 * inits the device and starts isoc transfer 1586 1584 */ 1587 - static int em28xx_v4l2_open(struct inode *inode, struct file *filp) 1585 + static int em28xx_v4l2_open(struct file *filp) 1588 1586 { 1589 - int minor = iminor(inode); 1587 + int minor = video_devdata(filp)->minor; 1590 1588 int errCode = 0, radio; 1591 1589 struct em28xx *dev; 1592 1590 enum v4l2_buf_type fh_type; 1593 1591 struct em28xx_fh *fh; 1594 1592 1595 - dev = em28xx_get_device(inode, &fh_type, &radio); 1593 + dev = em28xx_get_device(minor, &fh_type, &radio); 1596 1594 1597 1595 if (NULL == dev) 1598 1596 return -ENODEV; ··· 1688 1686 * stops streaming and deallocates all resources allocated by the v4l2 1689 1687 * calls and ioctls 1690 1688 */ 1691 - static int em28xx_v4l2_close(struct inode *inode, struct file *filp) 1689 + static int em28xx_v4l2_close(struct file *filp) 1692 1690 { 1693 1691 struct em28xx_fh *fh = filp->private_data; 1694 1692 struct em28xx *dev = fh->dev; ··· 1828 1826 return rc; 1829 1827 } 1830 1828 1831 - static const struct file_operations em28xx_v4l_fops = { 1829 + static const struct v4l2_file_operations em28xx_v4l_fops = { 1832 1830 .owner = THIS_MODULE, 1833 1831 .open = em28xx_v4l2_open, 1834 1832 .release = em28xx_v4l2_close, ··· 1836 1834 .poll = em28xx_v4l2_poll, 1837 1835 .mmap = em28xx_v4l2_mmap, 1838 1836 .ioctl = video_ioctl2, 1839 - .llseek = no_llseek, 1840 - .compat_ioctl = v4l_compat_ioctl32, 1841 1837 }; 1842 1838 1843 1839 static const struct v4l2_ioctl_ops video_ioctl_ops = { ··· 1890 1890 .current_norm = V4L2_STD_PAL, 1891 1891 }; 1892 1892 1893 - static const struct file_operations radio_fops = { 1893 + static const struct v4l2_file_operations radio_fops = { 1894 1894 .owner = THIS_MODULE, 1895 1895 .open = em28xx_v4l2_open, 1896 1896 .release = em28xx_v4l2_close, 1897 1897 .ioctl = video_ioctl2, 1898 - .compat_ioctl = v4l_compat_ioctl32, 1899 - .llseek = no_llseek, 1900 1898 }; 1901 1899 1902 1900 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
+2 -2
drivers/media/video/em28xx/em28xx.h
··· 473 473 unsigned long i2c_hash; /* i2c devicelist hash - 474 474 for boards with generic ID */ 475 475 476 - struct em28xx_audio *adev; 476 + struct em28xx_audio adev; 477 477 478 478 /* states */ 479 479 enum em28xx_dev_state state; ··· 583 583 void em28xx_wake_i2c(struct em28xx *dev); 584 584 void em28xx_remove_from_devlist(struct em28xx *dev); 585 585 void em28xx_add_into_devlist(struct em28xx *dev); 586 - struct em28xx *em28xx_get_device(struct inode *inode, 586 + struct em28xx *em28xx_get_device(int minor, 587 587 enum v4l2_buf_type *fh_type, 588 588 int *has_radio); 589 589 int em28xx_register_extension(struct em28xx_ops *dev);
+8 -12
drivers/media/video/et61x251/et61x251_core.c
··· 1206 1206 } 1207 1207 1208 1208 1209 - static int et61x251_open(struct inode* inode, struct file* filp) 1209 + static int et61x251_open(struct file *filp) 1210 1210 { 1211 1211 struct et61x251_device* cam; 1212 1212 int err = 0; ··· 1291 1291 } 1292 1292 1293 1293 1294 - static int et61x251_release(struct inode* inode, struct file* filp) 1294 + static int et61x251_release(struct file *filp) 1295 1295 { 1296 1296 struct et61x251_device* cam; 1297 1297 ··· 2392 2392 } 2393 2393 2394 2394 2395 - static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, 2396 - unsigned int cmd, void __user * arg) 2395 + static long et61x251_ioctl_v4l2(struct file *filp, 2396 + unsigned int cmd, void __user *arg) 2397 2397 { 2398 2398 struct et61x251_device *cam = video_drvdata(filp); 2399 2399 ··· 2487 2487 } 2488 2488 2489 2489 2490 - static int et61x251_ioctl(struct inode* inode, struct file* filp, 2490 + static long et61x251_ioctl(struct file *filp, 2491 2491 unsigned int cmd, unsigned long arg) 2492 2492 { 2493 2493 struct et61x251_device *cam = video_drvdata(filp); 2494 - int err = 0; 2494 + long err = 0; 2495 2495 2496 2496 if (mutex_lock_interruptible(&cam->fileop_mutex)) 2497 2497 return -ERESTARTSYS; ··· 2511 2511 2512 2512 V4LDBG(3, "et61x251", cmd); 2513 2513 2514 - err = et61x251_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 2514 + err = et61x251_ioctl_v4l2(filp, cmd, (void __user *)arg); 2515 2515 2516 2516 mutex_unlock(&cam->fileop_mutex); 2517 2517 ··· 2519 2519 } 2520 2520 2521 2521 2522 - static const struct file_operations et61x251_fops = { 2522 + static const struct v4l2_file_operations et61x251_fops = { 2523 2523 .owner = THIS_MODULE, 2524 2524 .open = et61x251_open, 2525 2525 .release = et61x251_release, 2526 2526 .ioctl = et61x251_ioctl, 2527 - #ifdef CONFIG_COMPAT 2528 - .compat_ioctl = v4l_compat_ioctl32, 2529 - #endif 2530 2527 .read = et61x251_read, 2531 2528 .poll = et61x251_poll, 2532 2529 .mmap = et61x251_mmap, 2533 - .llseek = no_llseek, 2534 2530 }; 2535 2531 2536 2532 /*****************************************************************************/
+4 -8
drivers/media/video/gspca/gspca.c
··· 875 875 kfree(gspca_dev); 876 876 } 877 877 878 - static int dev_open(struct inode *inode, struct file *file) 878 + static int dev_open(struct file *file) 879 879 { 880 880 struct gspca_dev *gspca_dev; 881 881 int ret; ··· 922 922 return ret; 923 923 } 924 924 925 - static int dev_close(struct inode *inode, struct file *file) 925 + static int dev_close(struct file *file) 926 926 { 927 927 struct gspca_dev *gspca_dev = file->private_data; 928 928 ··· 1802 1802 return ret; 1803 1803 } 1804 1804 1805 - static struct file_operations dev_fops = { 1805 + static struct v4l2_file_operations dev_fops = { 1806 1806 .owner = THIS_MODULE, 1807 1807 .open = dev_open, 1808 1808 .release = dev_close, 1809 1809 .read = dev_read, 1810 1810 .mmap = dev_mmap, 1811 - .unlocked_ioctl = __video_ioctl2, 1812 - #ifdef CONFIG_COMPAT 1813 - .compat_ioctl = v4l_compat_ioctl32, 1814 - #endif 1815 - .llseek = no_llseek, 1811 + .unlocked_ioctl = video_ioctl2, 1816 1812 .poll = dev_poll, 1817 1813 }; 1818 1814
+1 -1
drivers/media/video/hexium_gemini.c
··· 306 306 return 0; 307 307 } 308 308 309 - static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 309 + static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 310 310 { 311 311 struct saa7146_dev *dev = fh->dev; 312 312 struct hexium *hexium = (struct hexium *) dev->ext_priv;
+1 -1
drivers/media/video/hexium_orion.c
··· 370 370 return 0; 371 371 } 372 372 373 - static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 373 + static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 374 374 { 375 375 struct saa7146_dev *dev = fh->dev; 376 376 struct hexium *hexium = (struct hexium *) dev->ext_priv;
+4 -3
drivers/media/video/ivtv/ivtv-driver.c
··· 902 902 } 903 903 904 904 if (hw & IVTV_HW_SAA711X) { 905 - struct v4l2_chip_ident v = { V4L2_CHIP_MATCH_I2C_DRIVER, I2C_DRIVERID_SAA711X }; 905 + struct v4l2_dbg_chip_ident v; 906 906 907 907 /* determine the exact saa711x model */ 908 908 itv->hw_flags &= ~IVTV_HW_SAA711X; 909 909 910 + v.match.type = V4L2_CHIP_MATCH_I2C_DRIVER; 911 + strlcpy(v.match.name, "saa7115", sizeof(v.match.name)); 910 912 ivtv_call_hw(itv, IVTV_HW_SAA711X, core, g_chip_ident, &v); 911 913 if (v.ident == V4L2_IDENT_SAA7114) { 912 914 itv->hw_flags |= IVTV_HW_SAA7114; 913 915 /* VBI is not yet supported by the saa7114 driver. */ 914 916 itv->v4l2_cap &= ~(V4L2_CAP_SLICED_VBI_CAPTURE|V4L2_CAP_VBI_CAPTURE); 915 - } 916 - else { 917 + } else { 917 918 itv->hw_flags |= IVTV_HW_SAA7115; 918 919 } 919 920 itv->vbi.raw_decoder_line_size = 1443;
+2 -2
drivers/media/video/ivtv/ivtv-fileops.c
··· 831 831 ivtv_release_stream(s); 832 832 } 833 833 834 - int ivtv_v4l2_close(struct inode *inode, struct file *filp) 834 + int ivtv_v4l2_close(struct file *filp) 835 835 { 836 836 struct ivtv_open_id *id = filp->private_data; 837 837 struct ivtv *itv = id->itv; ··· 978 978 return 0; 979 979 } 980 980 981 - int ivtv_v4l2_open(struct inode *inode, struct file *filp) 981 + int ivtv_v4l2_open(struct file *filp) 982 982 { 983 983 int res; 984 984 struct ivtv *itv = NULL;
+2 -2
drivers/media/video/ivtv/ivtv-fileops.h
··· 22 22 #define IVTV_FILEOPS_H 23 23 24 24 /* Testing/Debugging */ 25 - int ivtv_v4l2_open(struct inode *inode, struct file *filp); 25 + int ivtv_v4l2_open(struct file *filp); 26 26 ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count, 27 27 loff_t * pos); 28 28 ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count, 29 29 loff_t * pos); 30 - int ivtv_v4l2_close(struct inode *inode, struct file *filp); 30 + int ivtv_v4l2_close(struct file *filp); 31 31 unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait); 32 32 unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait); 33 33 int ivtv_start_capture(struct ivtv_open_id *id);
+13 -12
drivers/media/video/ivtv/ivtv-ioctl.c
··· 674 674 return ret; 675 675 } 676 676 677 - static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident *chip) 677 + static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident *chip) 678 678 { 679 679 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 680 680 681 681 chip->ident = V4L2_IDENT_NONE; 682 682 chip->revision = 0; 683 - if (chip->match_type == V4L2_CHIP_MATCH_HOST) { 684 - if (v4l2_chip_match_host(chip->match_type, chip->match_chip)) 683 + if (chip->match.type == V4L2_CHIP_MATCH_HOST) { 684 + if (v4l2_chip_match_host(&chip->match)) 685 685 chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; 686 686 return 0; 687 687 } 688 - if (chip->match_type != V4L2_CHIP_MATCH_I2C_DRIVER && 689 - chip->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 688 + if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER && 689 + chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 690 690 return -EINVAL; 691 691 /* TODO: is this correct? */ 692 692 return ivtv_call_all_err(itv, core, g_chip_ident, chip); ··· 695 695 #ifdef CONFIG_VIDEO_ADV_DEBUG 696 696 static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg) 697 697 { 698 - struct v4l2_register *regs = arg; 698 + struct v4l2_dbg_register *regs = arg; 699 699 volatile u8 __iomem *reg_start; 700 700 701 701 if (!capable(CAP_SYS_ADMIN)) ··· 710 710 else 711 711 return -EINVAL; 712 712 713 + regs->size = 4; 713 714 if (cmd == VIDIOC_DBG_G_REGISTER) 714 715 regs->val = readl(regs->reg + reg_start); 715 716 else ··· 718 717 return 0; 719 718 } 720 719 721 - static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *reg) 720 + static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg) 722 721 { 723 722 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 724 723 725 - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 724 + if (v4l2_chip_match_host(&reg->match)) 726 725 return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg); 727 726 /* TODO: subdev errors should not be ignored, this should become a 728 727 subdev helper function. */ ··· 730 729 return 0; 731 730 } 732 731 733 - static int ivtv_s_register(struct file *file, void *fh, struct v4l2_register *reg) 732 + static int ivtv_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg) 734 733 { 735 734 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 736 735 737 - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) 736 + if (v4l2_chip_match_host(&reg->match)) 738 737 return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg); 739 738 /* TODO: subdev errors should not be ignored, this should become a 740 739 subdev helper function. */ ··· 1726 1725 return 0; 1727 1726 } 1728 1727 1729 - static int ivtv_default(struct file *file, void *fh, int cmd, void *arg) 1728 + static long ivtv_default(struct file *file, void *fh, int cmd, void *arg) 1730 1729 { 1731 1730 struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; 1732 1731 ··· 1828 1827 1829 1828 if (ivtv_debug & IVTV_DBGFLG_IOCTL) 1830 1829 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 1831 - ret = __video_ioctl2(filp, cmd, arg); 1830 + ret = video_ioctl2(filp, cmd, arg); 1832 1831 vfd->debug = 0; 1833 1832 return ret; 1834 1833 }
+3 -5
drivers/media/video/ivtv/ivtv-streams.c
··· 43 43 #include "ivtv-cards.h" 44 44 #include "ivtv-streams.h" 45 45 46 - static const struct file_operations ivtv_v4l2_enc_fops = { 46 + static const struct v4l2_file_operations ivtv_v4l2_enc_fops = { 47 47 .owner = THIS_MODULE, 48 48 .read = ivtv_v4l2_read, 49 49 .write = ivtv_v4l2_write, 50 50 .open = ivtv_v4l2_open, 51 51 .unlocked_ioctl = ivtv_v4l2_ioctl, 52 - .compat_ioctl = v4l_compat_ioctl32, 53 52 .release = ivtv_v4l2_close, 54 53 .poll = ivtv_v4l2_enc_poll, 55 54 }; 56 55 57 - static const struct file_operations ivtv_v4l2_dec_fops = { 56 + static const struct v4l2_file_operations ivtv_v4l2_dec_fops = { 58 57 .owner = THIS_MODULE, 59 58 .read = ivtv_v4l2_read, 60 59 .write = ivtv_v4l2_write, 61 60 .open = ivtv_v4l2_open, 62 61 .unlocked_ioctl = ivtv_v4l2_ioctl, 63 - .compat_ioctl = v4l_compat_ioctl32, 64 62 .release = ivtv_v4l2_close, 65 63 .poll = ivtv_v4l2_dec_poll, 66 64 }; ··· 76 78 int num_offset; 77 79 int dma, pio; 78 80 enum v4l2_buf_type buf_type; 79 - const struct file_operations *fops; 81 + const struct v4l2_file_operations *fops; 80 82 } ivtv_stream_info[] = { 81 83 { /* IVTV_ENC_STREAM_TYPE_MPG */ 82 84 "encoder MPG",
+6 -7
drivers/media/video/m52790.c
··· 80 80 } 81 81 82 82 #ifdef CONFIG_VIDEO_ADV_DEBUG 83 - static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 83 + static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 84 84 { 85 85 struct m52790_state *state = to_state(sd); 86 86 struct i2c_client *client = v4l2_get_subdevdata(sd); 87 87 88 - if (!v4l2_chip_match_i2c_client(client, 89 - reg->match_type, reg->match_chip)) 88 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 90 89 return -EINVAL; 91 90 if (!capable(CAP_SYS_ADMIN)) 92 91 return -EPERM; 93 92 if (reg->reg != 0) 94 93 return -EINVAL; 94 + reg->size = 1; 95 95 reg->val = state->input | state->output; 96 96 return 0; 97 97 } 98 98 99 - static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 99 + static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 100 100 { 101 101 struct m52790_state *state = to_state(sd); 102 102 struct i2c_client *client = v4l2_get_subdevdata(sd); 103 103 104 - if (!v4l2_chip_match_i2c_client(client, 105 - reg->match_type, reg->match_chip)) 104 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 106 105 return -EINVAL; 107 106 if (!capable(CAP_SYS_ADMIN)) 108 107 return -EPERM; ··· 114 115 } 115 116 #endif 116 117 117 - static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 118 + static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 118 119 { 119 120 struct i2c_client *client = v4l2_get_subdevdata(sd); 120 121
+4 -8
drivers/media/video/meye.c
··· 841 841 /* video4linux integration */ 842 842 /****************************************************************************/ 843 843 844 - static int meye_open(struct inode *inode, struct file *file) 844 + static int meye_open(struct file *file) 845 845 { 846 846 int i; 847 847 ··· 863 863 return 0; 864 864 } 865 865 866 - static int meye_release(struct inode *inode, struct file *file) 866 + static int meye_release(struct file *file) 867 867 { 868 868 mchip_hic_stop(); 869 869 mchip_dma_free(); ··· 1577 1577 return 0; 1578 1578 } 1579 1579 1580 - static int vidioc_default(struct file *file, void *fh, int cmd, void *arg) 1580 + static long vidioc_default(struct file *file, void *fh, int cmd, void *arg) 1581 1581 { 1582 1582 switch (cmd) { 1583 1583 case MEYEIOC_G_PARAMS: ··· 1684 1684 return 0; 1685 1685 } 1686 1686 1687 - static const struct file_operations meye_fops = { 1687 + static const struct v4l2_file_operations meye_fops = { 1688 1688 .owner = THIS_MODULE, 1689 1689 .open = meye_open, 1690 1690 .release = meye_release, 1691 1691 .mmap = meye_mmap, 1692 1692 .ioctl = video_ioctl2, 1693 - #ifdef CONFIG_COMPAT 1694 - .compat_ioctl = v4l_compat_ioctl32, 1695 - #endif 1696 1693 .poll = meye_poll, 1697 - .llseek = no_llseek, 1698 1694 }; 1699 1695 1700 1696 static const struct v4l2_ioctl_ops meye_ioctl_ops = {
+2 -2
drivers/media/video/msp3400-driver.c
··· 483 483 } 484 484 485 485 #ifdef CONFIG_VIDEO_ALLOW_V4L1 486 - static int msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 486 + static long msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 487 487 { 488 488 struct msp_state *state = to_state(sd); 489 489 struct i2c_client *client = v4l2_get_subdevdata(sd); ··· 733 733 return 0; 734 734 } 735 735 736 - static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 736 + static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 737 737 { 738 738 struct msp_state *state = to_state(sd); 739 739 struct i2c_client *client = v4l2_get_subdevdata(sd);
+10 -9
drivers/media/video/mt9m001.c
··· 343 343 } 344 344 345 345 static int mt9m001_get_chip_id(struct soc_camera_device *icd, 346 - struct v4l2_chip_ident *id) 346 + struct v4l2_dbg_chip_ident *id) 347 347 { 348 348 struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); 349 349 350 - if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 350 + if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 351 351 return -EINVAL; 352 352 353 - if (id->match_chip != mt9m001->client->addr) 353 + if (id->match.addr != mt9m001->client->addr) 354 354 return -ENODEV; 355 355 356 356 id->ident = mt9m001->model; ··· 361 361 362 362 #ifdef CONFIG_VIDEO_ADV_DEBUG 363 363 static int mt9m001_get_register(struct soc_camera_device *icd, 364 - struct v4l2_register *reg) 364 + struct v4l2_dbg_register *reg) 365 365 { 366 366 struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); 367 367 368 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 368 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 369 369 return -EINVAL; 370 370 371 - if (reg->match_chip != mt9m001->client->addr) 371 + if (reg->match.addr != mt9m001->client->addr) 372 372 return -ENODEV; 373 373 374 + reg->size = 2; 374 375 reg->val = reg_read(icd, reg->reg); 375 376 376 377 if (reg->val > 0xffff) ··· 381 380 } 382 381 383 382 static int mt9m001_set_register(struct soc_camera_device *icd, 384 - struct v4l2_register *reg) 383 + struct v4l2_dbg_register *reg) 385 384 { 386 385 struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); 387 386 388 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 387 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 389 388 return -EINVAL; 390 389 391 - if (reg->match_chip != mt9m001->client->addr) 390 + if (reg->match.addr != mt9m001->client->addr) 392 391 return -ENODEV; 393 392 394 393 if (reg_write(icd, reg->reg, reg->val) < 0)
+10 -9
drivers/media/video/mt9m111.c
··· 514 514 } 515 515 516 516 static int mt9m111_get_chip_id(struct soc_camera_device *icd, 517 - struct v4l2_chip_ident *id) 517 + struct v4l2_dbg_chip_ident *id) 518 518 { 519 519 struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); 520 520 521 - if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 521 + if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 522 522 return -EINVAL; 523 523 524 - if (id->match_chip != mt9m111->client->addr) 524 + if (id->match.addr != mt9m111->client->addr) 525 525 return -ENODEV; 526 526 527 527 id->ident = mt9m111->model; ··· 532 532 533 533 #ifdef CONFIG_VIDEO_ADV_DEBUG 534 534 static int mt9m111_get_register(struct soc_camera_device *icd, 535 - struct v4l2_register *reg) 535 + struct v4l2_dbg_register *reg) 536 536 { 537 537 int val; 538 538 539 539 struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); 540 540 541 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 541 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 542 542 return -EINVAL; 543 - if (reg->match_chip != mt9m111->client->addr) 543 + if (reg->match.addr != mt9m111->client->addr) 544 544 return -ENODEV; 545 545 546 546 val = mt9m111_reg_read(icd, reg->reg); 547 + reg->size = 2; 547 548 reg->val = (u64)val; 548 549 549 550 if (reg->val > 0xffff) ··· 554 553 } 555 554 556 555 static int mt9m111_set_register(struct soc_camera_device *icd, 557 - struct v4l2_register *reg) 556 + struct v4l2_dbg_register *reg) 558 557 { 559 558 struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); 560 559 561 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 560 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff) 562 561 return -EINVAL; 563 562 564 - if (reg->match_chip != mt9m111->client->addr) 563 + if (reg->match.addr != mt9m111->client->addr) 565 564 return -ENODEV; 566 565 567 566 if (mt9m111_reg_write(icd, reg->reg, reg->val) < 0)
+9 -9
drivers/media/video/mt9t031.c
··· 326 326 } 327 327 328 328 static int mt9t031_get_chip_id(struct soc_camera_device *icd, 329 - struct v4l2_chip_ident *id) 329 + struct v4l2_dbg_chip_ident *id) 330 330 { 331 331 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 332 332 333 - if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 333 + if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 334 334 return -EINVAL; 335 335 336 - if (id->match_chip != mt9t031->client->addr) 336 + if (id->match.addr != mt9t031->client->addr) 337 337 return -ENODEV; 338 338 339 339 id->ident = mt9t031->model; ··· 344 344 345 345 #ifdef CONFIG_VIDEO_ADV_DEBUG 346 346 static int mt9t031_get_register(struct soc_camera_device *icd, 347 - struct v4l2_register *reg) 347 + struct v4l2_dbg_register *reg) 348 348 { 349 349 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 350 350 351 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 351 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 352 352 return -EINVAL; 353 353 354 - if (reg->match_chip != mt9t031->client->addr) 354 + if (reg->match.addr != mt9t031->client->addr) 355 355 return -ENODEV; 356 356 357 357 reg->val = reg_read(icd, reg->reg); ··· 363 363 } 364 364 365 365 static int mt9t031_set_register(struct soc_camera_device *icd, 366 - struct v4l2_register *reg) 366 + struct v4l2_dbg_register *reg) 367 367 { 368 368 struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd); 369 369 370 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 370 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 371 371 return -EINVAL; 372 372 373 - if (reg->match_chip != mt9t031->client->addr) 373 + if (reg->match.addr != mt9t031->client->addr) 374 374 return -ENODEV; 375 375 376 376 if (reg_write(icd, reg->reg, reg->val) < 0)
+10 -9
drivers/media/video/mt9v022.c
··· 422 422 } 423 423 424 424 static int mt9v022_get_chip_id(struct soc_camera_device *icd, 425 - struct v4l2_chip_ident *id) 425 + struct v4l2_dbg_chip_ident *id) 426 426 { 427 427 struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); 428 428 429 - if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR) 429 + if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 430 430 return -EINVAL; 431 431 432 - if (id->match_chip != mt9v022->client->addr) 432 + if (id->match.addr != mt9v022->client->addr) 433 433 return -ENODEV; 434 434 435 435 id->ident = mt9v022->model; ··· 440 440 441 441 #ifdef CONFIG_VIDEO_ADV_DEBUG 442 442 static int mt9v022_get_register(struct soc_camera_device *icd, 443 - struct v4l2_register *reg) 443 + struct v4l2_dbg_register *reg) 444 444 { 445 445 struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); 446 446 447 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 447 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 448 448 return -EINVAL; 449 449 450 - if (reg->match_chip != mt9v022->client->addr) 450 + if (reg->match.addr != mt9v022->client->addr) 451 451 return -ENODEV; 452 452 453 + reg->size = 2; 453 454 reg->val = reg_read(icd, reg->reg); 454 455 455 456 if (reg->val > 0xffff) ··· 460 459 } 461 460 462 461 static int mt9v022_set_register(struct soc_camera_device *icd, 463 - struct v4l2_register *reg) 462 + struct v4l2_dbg_register *reg) 464 463 { 465 464 struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); 466 465 467 - if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 466 + if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) 468 467 return -EINVAL; 469 468 470 - if (reg->match_chip != mt9v022->client->addr) 469 + if (reg->match.addr != mt9v022->client->addr) 471 470 return -ENODEV; 472 471 473 472 if (reg_write(icd, reg->reg, reg->val) < 0)
+1 -1
drivers/media/video/mxb.c
··· 489 489 return 0; 490 490 } 491 491 492 - static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 492 + static long mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 493 493 { 494 494 struct saa7146_dev *dev = fh->dev; 495 495 struct mxb *mxb = (struct mxb *)dev->ext_priv;
+4 -5
drivers/media/video/omap24xxcam.c
··· 1454 1454 return rval; 1455 1455 } 1456 1456 1457 - static int omap24xxcam_open(struct inode *inode, struct file *file) 1457 + static int omap24xxcam_open(struct file *file) 1458 1458 { 1459 - int minor = iminor(inode); 1459 + int minor = video_devdata(file)->minor; 1460 1460 struct omap24xxcam_device *cam = omap24xxcam.priv; 1461 1461 struct omap24xxcam_fh *fh; 1462 1462 struct v4l2_format format; ··· 1511 1511 return -ENODEV; 1512 1512 } 1513 1513 1514 - static int omap24xxcam_release(struct inode *inode, struct file *file) 1514 + static int omap24xxcam_release(struct file *file) 1515 1515 { 1516 1516 struct omap24xxcam_fh *fh = file->private_data; 1517 1517 struct omap24xxcam_device *cam = fh->cam; ··· 1559 1559 return 0; 1560 1560 } 1561 1561 1562 - static struct file_operations omap24xxcam_fops = { 1563 - .llseek = no_llseek, 1562 + static struct v4l2_file_operations omap24xxcam_fops = { 1564 1563 .ioctl = video_ioctl2, 1565 1564 .poll = omap24xxcam_poll, 1566 1565 .mmap = omap24xxcam_mmap,
+6 -10
drivers/media/video/ov511.c
··· 3915 3915 ***************************************************************************/ 3916 3916 3917 3917 static int 3918 - ov51x_v4l1_open(struct inode *inode, struct file *file) 3918 + ov51x_v4l1_open(struct file *file) 3919 3919 { 3920 3920 struct video_device *vdev = video_devdata(file); 3921 3921 struct usb_ov511 *ov = video_get_drvdata(vdev); ··· 3972 3972 } 3973 3973 3974 3974 static int 3975 - ov51x_v4l1_close(struct inode *inode, struct file *file) 3975 + ov51x_v4l1_close(struct file *file) 3976 3976 { 3977 3977 struct video_device *vdev = file->private_data; 3978 3978 struct usb_ov511 *ov = video_get_drvdata(vdev); ··· 4010 4010 } 4011 4011 4012 4012 /* Do not call this function directly! */ 4013 - static int 4013 + static long 4014 4014 ov51x_v4l1_ioctl_internal(struct file *file, unsigned int cmd, void *arg) 4015 4015 { 4016 4016 struct video_device *vdev = file->private_data; ··· 4449 4449 return 0; 4450 4450 } 4451 4451 4452 - static int 4453 - ov51x_v4l1_ioctl(struct inode *inode, struct file *file, 4452 + static long 4453 + ov51x_v4l1_ioctl(struct file *file, 4454 4454 unsigned int cmd, unsigned long arg) 4455 4455 { 4456 4456 struct video_device *vdev = file->private_data; ··· 4661 4661 return 0; 4662 4662 } 4663 4663 4664 - static const struct file_operations ov511_fops = { 4664 + static const struct v4l2_file_operations ov511_fops = { 4665 4665 .owner = THIS_MODULE, 4666 4666 .open = ov51x_v4l1_open, 4667 4667 .release = ov51x_v4l1_close, 4668 4668 .read = ov51x_v4l1_read, 4669 4669 .mmap = ov51x_v4l1_mmap, 4670 4670 .ioctl = ov51x_v4l1_ioctl, 4671 - #ifdef CONFIG_COMPAT 4672 - .compat_ioctl = v4l_compat_ioctl32, 4673 - #endif 4674 - .llseek = no_llseek, 4675 4671 }; 4676 4672 4677 4673 static struct video_device vdev_template = {
+1 -1
drivers/media/video/ov7670.c
··· 1310 1310 void *arg) 1311 1311 { 1312 1312 switch (cmd) { 1313 - case VIDIOC_G_CHIP_IDENT: 1313 + case VIDIOC_DBG_G_CHIP_IDENT: 1314 1314 return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_OV7670, 0); 1315 1315 1316 1316 case VIDIOC_INT_RESET:
+4 -3
drivers/media/video/ov772x.c
··· 724 724 } 725 725 726 726 static int ov772x_get_chip_id(struct soc_camera_device *icd, 727 - struct v4l2_chip_ident *id) 727 + struct v4l2_dbg_chip_ident *id) 728 728 { 729 729 struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); 730 730 ··· 736 736 737 737 #ifdef CONFIG_VIDEO_ADV_DEBUG 738 738 static int ov772x_get_register(struct soc_camera_device *icd, 739 - struct v4l2_register *reg) 739 + struct v4l2_dbg_register *reg) 740 740 { 741 741 struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); 742 742 int ret; 743 743 744 + reg->size = 1; 744 745 if (reg->reg > 0xff) 745 746 return -EINVAL; 746 747 ··· 755 754 } 756 755 757 756 static int ov772x_set_register(struct soc_camera_device *icd, 758 - struct v4l2_register *reg) 757 + struct v4l2_dbg_register *reg) 759 758 { 760 759 struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); 761 760
+5 -9
drivers/media/video/pms.c
··· 680 680 * Video4linux interfacing 681 681 */ 682 682 683 - static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg) 683 + static long pms_do_ioctl(struct file *file, unsigned int cmd, void *arg) 684 684 { 685 685 struct video_device *dev = video_devdata(file); 686 686 struct pms_device *pd=(struct pms_device *)dev; ··· 862 862 return 0; 863 863 } 864 864 865 - static int pms_ioctl(struct inode *inode, struct file *file, 865 + static long pms_ioctl(struct file *file, 866 866 unsigned int cmd, unsigned long arg) 867 867 { 868 868 return video_usercopy(file, cmd, arg, pms_do_ioctl); ··· 881 881 return len; 882 882 } 883 883 884 - static int pms_exclusive_open(struct inode *inode, struct file *file) 884 + static int pms_exclusive_open(struct file *file) 885 885 { 886 886 struct video_device *v = video_devdata(file); 887 887 struct pms_device *pd = (struct pms_device *)v; ··· 889 889 return test_and_set_bit(0, &pd->in_use) ? -EBUSY : 0; 890 890 } 891 891 892 - static int pms_exclusive_release(struct inode *inode, struct file *file) 892 + static int pms_exclusive_release(struct file *file) 893 893 { 894 894 struct video_device *v = video_devdata(file); 895 895 struct pms_device *pd = (struct pms_device *)v; ··· 898 898 return 0; 899 899 } 900 900 901 - static const struct file_operations pms_fops = { 901 + static const struct v4l2_file_operations pms_fops = { 902 902 .owner = THIS_MODULE, 903 903 .open = pms_exclusive_open, 904 904 .release = pms_exclusive_release, 905 905 .ioctl = pms_ioctl, 906 - #ifdef CONFIG_COMPAT 907 - .compat_ioctl = v4l_compat_ioctl32, 908 - #endif 909 906 .read = pms_read, 910 - .llseek = no_llseek, 911 907 }; 912 908 913 909 static struct video_device pms_template=
+5 -6
drivers/media/video/pvrusb2/pvrusb2-hdw.c
··· 4732 4732 4733 4733 4734 4734 int pvr2_hdw_register_access(struct pvr2_hdw *hdw, 4735 - u32 match_type, u32 match_chip, u64 reg_id, 4736 - int setFl,u64 *val_ptr) 4735 + struct v4l2_dbg_match *match, u64 reg_id, 4736 + int setFl, u64 *val_ptr) 4737 4737 { 4738 4738 #ifdef CONFIG_VIDEO_ADV_DEBUG 4739 4739 struct pvr2_i2c_client *cp; 4740 - struct v4l2_register req; 4740 + struct v4l2_dbg_register req; 4741 4741 int stat = 0; 4742 4742 int okFl = 0; 4743 4743 4744 4744 if (!capable(CAP_SYS_ADMIN)) return -EPERM; 4745 4745 4746 - req.match_type = match_type; 4747 - req.match_chip = match_chip; 4746 + req.match = *match; 4748 4747 req.reg = reg_id; 4749 4748 if (setFl) req.val = *val_ptr; 4750 4749 mutex_lock(&hdw->i2c_list_lock); do { 4751 4750 list_for_each_entry(cp, &hdw->i2c_clients, list) { 4752 4751 if (!v4l2_chip_match_i2c_client( 4753 4752 cp->client, 4754 - req.match_type, req.match_chip)) { 4753 + &req.match)) { 4755 4754 continue; 4756 4755 } 4757 4756 stat = pvr2_i2c_client_cmd(
+2 -2
drivers/media/video/pvrusb2/pvrusb2-hdw.h
··· 242 242 setFl - true to set the register, false to read it 243 243 val_ptr - storage location for source / result. */ 244 244 int pvr2_hdw_register_access(struct pvr2_hdw *, 245 - u32 match_type, u32 match_chip,u64 reg_id, 246 - int setFl,u64 *val_ptr); 245 + struct v4l2_dbg_match *match, u64 reg_id, 246 + int setFl, u64 *val_ptr); 247 247 248 248 /* The following entry points are all lower level things you normally don't 249 249 want to worry about. */
+14 -15
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
··· 168 168 * This is part of Video 4 Linux API. The procedure handles ioctl() calls. 169 169 * 170 170 */ 171 - static int pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 171 + static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 172 172 { 173 173 struct pvr2_v4l2_fh *fh = file->private_data; 174 174 struct pvr2_v4l2 *vp = fh->vhead; 175 175 struct pvr2_v4l2_dev *dev_info = fh->dev_info; 176 176 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; 177 - int ret = -EINVAL; 177 + long ret = -EINVAL; 178 178 179 179 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 180 180 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),cmd); ··· 851 851 case VIDIOC_DBG_G_REGISTER: 852 852 { 853 853 u64 val; 854 - struct v4l2_register *req = (struct v4l2_register *)arg; 854 + struct v4l2_dbg_register *req = (struct v4l2_dbg_register *)arg; 855 855 if (cmd == VIDIOC_DBG_S_REGISTER) val = req->val; 856 856 ret = pvr2_hdw_register_access( 857 - hdw,req->match_type,req->match_chip,req->reg, 858 - cmd == VIDIOC_DBG_S_REGISTER,&val); 857 + hdw, &req->match, req->reg, 858 + cmd == VIDIOC_DBG_S_REGISTER, &val); 859 859 if (cmd == VIDIOC_DBG_G_REGISTER) req->val = val; 860 860 break; 861 861 } ··· 871 871 if (ret < 0) { 872 872 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 873 873 pvr2_trace(PVR2_TRACE_V4LIOCTL, 874 - "pvr2_v4l2_do_ioctl failure, ret=%d",ret); 874 + "pvr2_v4l2_do_ioctl failure, ret=%ld", ret); 875 875 } else { 876 876 if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { 877 877 pvr2_trace(PVR2_TRACE_V4LIOCTL, 878 - "pvr2_v4l2_do_ioctl failure, ret=%d" 879 - " command was:",ret); 878 + "pvr2_v4l2_do_ioctl failure, ret=%ld" 879 + " command was:", ret); 880 880 v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), 881 881 cmd); 882 882 } 883 883 } 884 884 } else { 885 885 pvr2_trace(PVR2_TRACE_V4LIOCTL, 886 - "pvr2_v4l2_do_ioctl complete, ret=%d (0x%x)", 887 - ret,ret); 886 + "pvr2_v4l2_do_ioctl complete, ret=%ld (0x%lx)", 887 + ret, ret); 888 888 } 889 889 return ret; 890 890 } ··· 948 948 } 949 949 950 950 951 - static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, 951 + static long pvr2_v4l2_ioctl(struct file *file, 952 952 unsigned int cmd, unsigned long arg) 953 953 { 954 954 ··· 960 960 } 961 961 962 962 963 - static int pvr2_v4l2_release(struct inode *inode, struct file *file) 963 + static int pvr2_v4l2_release(struct file *file) 964 964 { 965 965 struct pvr2_v4l2_fh *fhp = file->private_data; 966 966 struct pvr2_v4l2 *vp = fhp->vhead; ··· 1008 1008 } 1009 1009 1010 1010 1011 - static int pvr2_v4l2_open(struct inode *inode, struct file *file) 1011 + static int pvr2_v4l2_open(struct file *file) 1012 1012 { 1013 1013 struct pvr2_v4l2_dev *dip; /* Our own context pointer */ 1014 1014 struct pvr2_v4l2_fh *fhp; ··· 1235 1235 } 1236 1236 1237 1237 1238 - static const struct file_operations vdev_fops = { 1238 + static const struct v4l2_file_operations vdev_fops = { 1239 1239 .owner = THIS_MODULE, 1240 1240 .open = pvr2_v4l2_open, 1241 1241 .release = pvr2_v4l2_release, 1242 1242 .read = pvr2_v4l2_read, 1243 1243 .ioctl = pvr2_v4l2_ioctl, 1244 - .llseek = no_llseek, 1245 1244 .poll = pvr2_v4l2_poll, 1246 1245 }; 1247 1246
+2 -2
drivers/media/video/pwc/pwc-ctrl.c
··· 1266 1266 /* copy local variable to arg */ 1267 1267 #define ARG_OUT(ARG_name) /* nothing */ 1268 1268 1269 - int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) 1269 + long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) 1270 1270 { 1271 - int ret = 0; 1271 + long ret = 0; 1272 1272 1273 1273 switch(cmd) { 1274 1274 case VIDIOCPWCRUSER:
+8 -12
drivers/media/video/pwc/pwc-if.c
··· 142 142 143 143 /***/ 144 144 145 - static int pwc_video_open(struct inode *inode, struct file *file); 146 - static int pwc_video_close(struct inode *inode, struct file *file); 145 + static int pwc_video_open(struct file *file); 146 + static int pwc_video_close(struct file *file); 147 147 static ssize_t pwc_video_read(struct file *file, char __user *buf, 148 148 size_t count, loff_t *ppos); 149 149 static unsigned int pwc_video_poll(struct file *file, poll_table *wait); 150 - static int pwc_video_ioctl(struct inode *inode, struct file *file, 150 + static long pwc_video_ioctl(struct file *file, 151 151 unsigned int ioctlnr, unsigned long arg); 152 152 static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma); 153 153 154 - static const struct file_operations pwc_fops = { 154 + static const struct v4l2_file_operations pwc_fops = { 155 155 .owner = THIS_MODULE, 156 156 .open = pwc_video_open, 157 157 .release = pwc_video_close, ··· 159 159 .poll = pwc_video_poll, 160 160 .mmap = pwc_video_mmap, 161 161 .ioctl = pwc_video_ioctl, 162 - #ifdef CONFIG_COMPAT 163 - .compat_ioctl = v4l_compat_ioctl32, 164 - #endif 165 - .llseek = no_llseek, 166 162 }; 167 163 static struct video_device pwc_template = { 168 164 .name = "Philips Webcam", /* Filled in later */ ··· 1100 1104 /***************************************************************************/ 1101 1105 /* Video4Linux functions */ 1102 1106 1103 - static int pwc_video_open(struct inode *inode, struct file *file) 1107 + static int pwc_video_open(struct file *file) 1104 1108 { 1105 1109 int i, ret; 1106 1110 struct video_device *vdev = video_devdata(file); ··· 1220 1224 } 1221 1225 1222 1226 /* Note that all cleanup is done in the reverse order as in _open */ 1223 - static int pwc_video_close(struct inode *inode, struct file *file) 1227 + static int pwc_video_close(struct file *file) 1224 1228 { 1225 1229 struct video_device *vdev = file->private_data; 1226 1230 struct pwc_device *pdev; ··· 1395 1399 return 0; 1396 1400 } 1397 1401 1398 - static int pwc_video_ioctl(struct inode *inode, struct file *file, 1402 + static long pwc_video_ioctl(struct file *file, 1399 1403 unsigned int cmd, unsigned long arg) 1400 1404 { 1401 1405 struct video_device *vdev = file->private_data; 1402 1406 struct pwc_device *pdev; 1403 - int r = -ENODEV; 1407 + long r = -ENODEV; 1404 1408 1405 1409 if (!vdev) 1406 1410 goto out;
+1 -1
drivers/media/video/pwc/pwc-v4l.c
··· 337 337 338 338 } 339 339 340 - int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) 340 + long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg) 341 341 { 342 342 struct video_device *vdev = video_devdata(file); 343 343 struct pwc_device *pdev;
+2 -2
drivers/media/video/pwc/pwc.h
··· 337 337 extern int pwc_camera_power(struct pwc_device *pdev, int power); 338 338 339 339 /* Private ioctl()s; see pwc-ioctl.h */ 340 - extern int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg); 340 + extern long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg); 341 341 342 342 /** Functions in pwc-v4l.c */ 343 - extern int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 343 + extern long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 344 344 345 345 /** pwc-uncompress.c */ 346 346 /* Expand frame to image, possibly including decompression. Uses read_frame and fill_image */
+5 -7
drivers/media/video/s2255drv.c
··· 1502 1502 dprintk(2, "setting jpeg quality %d\n", jc->quality); 1503 1503 return 0; 1504 1504 } 1505 - static int s2255_open(struct inode *inode, struct file *file) 1505 + static int s2255_open(struct file *file) 1506 1506 { 1507 - int minor = iminor(inode); 1507 + int minor = video_devdata(file)->minor; 1508 1508 struct s2255_dev *h, *dev = NULL; 1509 1509 struct s2255_fh *fh; 1510 1510 struct list_head *list; ··· 1711 1711 mutex_unlock(&dev->open_lock); 1712 1712 } 1713 1713 1714 - static int s2255_close(struct inode *inode, struct file *file) 1714 + static int s2255_close(struct file *file) 1715 1715 { 1716 1716 struct s2255_fh *fh = file->private_data; 1717 1717 struct s2255_dev *dev = fh->dev; 1718 - int minor = iminor(inode); 1718 + int minor = video_devdata(file)->minor; 1719 1719 if (!dev) 1720 1720 return -ENODEV; 1721 1721 ··· 1759 1759 return ret; 1760 1760 } 1761 1761 1762 - static const struct file_operations s2255_fops_v4l = { 1762 + static const struct v4l2_file_operations s2255_fops_v4l = { 1763 1763 .owner = THIS_MODULE, 1764 1764 .open = s2255_open, 1765 1765 .release = s2255_close, 1766 1766 .poll = s2255_poll, 1767 1767 .ioctl = video_ioctl2, /* V4L2 ioctl handler */ 1768 - .compat_ioctl = v4l_compat_ioctl32, 1769 1768 .mmap = s2255_mmap_v4l, 1770 - .llseek = no_llseek, 1771 1769 }; 1772 1770 1773 1771 static const struct v4l2_ioctl_ops s2255_ioctl_ops = {
+6 -7
drivers/media/video/saa5246a.c
··· 804 804 * 805 805 * Returns 0 if successful 806 806 */ 807 - static int do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg) 807 + static long do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg) 808 808 { 809 809 struct saa5246a_device *t = video_drvdata(file); 810 810 ··· 944 944 /* 945 945 * Handle the locking 946 946 */ 947 - static int saa5246a_ioctl(struct inode *inode, struct file *file, 947 + static long saa5246a_ioctl(struct file *file, 948 948 unsigned int cmd, unsigned long arg) 949 949 { 950 950 struct saa5246a_device *t = video_drvdata(file); 951 - int err; 951 + long err; 952 952 953 953 cmd = vtx_fix_command(cmd); 954 954 mutex_lock(&t->lock); ··· 957 957 return err; 958 958 } 959 959 960 - static int saa5246a_open(struct inode *inode, struct file *file) 960 + static int saa5246a_open(struct file *file) 961 961 { 962 962 struct saa5246a_device *t = video_drvdata(file); 963 963 ··· 999 999 return 0; 1000 1000 } 1001 1001 1002 - static int saa5246a_release(struct inode *inode, struct file *file) 1002 + static int saa5246a_release(struct file *file) 1003 1003 { 1004 1004 struct saa5246a_device *t = video_drvdata(file); 1005 1005 ··· 1018 1018 return 0; 1019 1019 } 1020 1020 1021 - static const struct file_operations saa_fops = { 1021 + static const struct v4l2_file_operations saa_fops = { 1022 1022 .owner = THIS_MODULE, 1023 1023 .open = saa5246a_open, 1024 1024 .release = saa5246a_release, 1025 1025 .ioctl = saa5246a_ioctl, 1026 - .llseek = no_llseek, 1027 1026 }; 1028 1027 1029 1028 static struct video_device saa_template =
+6 -10
drivers/media/video/saa5249.c
··· 190 190 * Standard character-device-driver functions 191 191 */ 192 192 193 - static int do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg) 193 + static long do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg) 194 194 { 195 195 static int virtual_mode = false; 196 196 struct saa5249_device *t = video_drvdata(file); ··· 479 479 * Handle the locking 480 480 */ 481 481 482 - static int saa5249_ioctl(struct inode *inode, struct file *file, 482 + static long saa5249_ioctl(struct file *file, 483 483 unsigned int cmd, unsigned long arg) 484 484 { 485 485 struct saa5249_device *t = video_drvdata(file); 486 - int err; 486 + long err; 487 487 488 488 cmd = vtx_fix_command(cmd); 489 489 mutex_lock(&t->lock); ··· 492 492 return err; 493 493 } 494 494 495 - static int saa5249_open(struct inode *inode, struct file *file) 495 + static int saa5249_open(struct file *file) 496 496 { 497 497 struct saa5249_device *t = video_drvdata(file); 498 498 int pgbuf; ··· 529 529 530 530 531 531 532 - static int saa5249_release(struct inode *inode, struct file *file) 532 + static int saa5249_release(struct file *file) 533 533 { 534 534 struct saa5249_device *t = video_drvdata(file); 535 535 ··· 539 539 return 0; 540 540 } 541 541 542 - static const struct file_operations saa_fops = { 542 + static const struct v4l2_file_operations saa_fops = { 543 543 .owner = THIS_MODULE, 544 544 .open = saa5249_open, 545 545 .release = saa5249_release, 546 546 .ioctl = saa5249_ioctl, 547 - #ifdef CONFIG_COMPAT 548 - .compat_ioctl = v4l_compat_ioctl32, 549 - #endif 550 - .llseek = no_llseek, 551 547 }; 552 548 553 549 static struct video_device saa_template =
+6 -7
drivers/media/video/saa7115.c
··· 1371 1371 } 1372 1372 1373 1373 #ifdef CONFIG_VIDEO_ADV_DEBUG 1374 - static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1374 + static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1375 1375 { 1376 1376 struct i2c_client *client = v4l2_get_subdevdata(sd); 1377 1377 1378 - if (!v4l2_chip_match_i2c_client(client, 1379 - reg->match_type, reg->match_chip)) 1378 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1380 1379 return -EINVAL; 1381 1380 if (!capable(CAP_SYS_ADMIN)) 1382 1381 return -EPERM; 1383 1382 reg->val = saa711x_read(sd, reg->reg & 0xff); 1383 + reg->size = 1; 1384 1384 return 0; 1385 1385 } 1386 1386 1387 - static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1387 + static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1388 1388 { 1389 1389 struct i2c_client *client = v4l2_get_subdevdata(sd); 1390 1390 1391 - if (!v4l2_chip_match_i2c_client(client, 1392 - reg->match_type, reg->match_chip)) 1391 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1393 1392 return -EINVAL; 1394 1393 if (!capable(CAP_SYS_ADMIN)) 1395 1394 return -EPERM; ··· 1397 1398 } 1398 1399 #endif 1399 1400 1400 - static int saa711x_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 1401 + static int saa711x_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 1401 1402 { 1402 1403 struct saa711x_state *state = to_state(sd); 1403 1404 struct i2c_client *client = v4l2_get_subdevdata(sd);
+6 -7
drivers/media/video/saa7127.c
··· 623 623 } 624 624 625 625 #ifdef CONFIG_VIDEO_ADV_DEBUG 626 - static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 626 + static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 627 627 { 628 628 struct i2c_client *client = v4l2_get_subdevdata(sd); 629 629 630 - if (!v4l2_chip_match_i2c_client(client, 631 - reg->match_type, reg->match_chip)) 630 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 632 631 return -EINVAL; 633 632 if (!capable(CAP_SYS_ADMIN)) 634 633 return -EPERM; 635 634 reg->val = saa7127_read(sd, reg->reg & 0xff); 635 + reg->size = 1; 636 636 return 0; 637 637 } 638 638 639 - static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 639 + static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 640 640 { 641 641 struct i2c_client *client = v4l2_get_subdevdata(sd); 642 642 643 - if (!v4l2_chip_match_i2c_client(client, 644 - reg->match_type, reg->match_chip)) 643 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 645 644 return -EINVAL; 646 645 if (!capable(CAP_SYS_ADMIN)) 647 646 return -EPERM; ··· 649 650 } 650 651 #endif 651 652 652 - static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 653 + static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 653 654 { 654 655 struct saa7127_state *state = to_state(sd); 655 656 struct i2c_client *client = v4l2_get_subdevdata(sd);
+1 -1
drivers/media/video/saa7134/saa6752hs.c
··· 838 838 h->standard = *((v4l2_std_id *) arg); 839 839 break; 840 840 841 - case VIDIOC_G_CHIP_IDENT: 841 + case VIDIOC_DBG_G_CHIP_IDENT: 842 842 return v4l2_chip_ident_i2c_client(client, 843 843 arg, h->chip, h->revision); 844 844
+42 -2
drivers/media/video/saa7134/saa7134-cards.c
··· 4462 4462 .tuner_addr = ADDR_UNSET, 4463 4463 .radio_addr = ADDR_UNSET, 4464 4464 .tda9887_conf = TDA9887_PRESENT, 4465 + .mpeg = SAA7134_MPEG_DVB, 4465 4466 .inputs = {{ 4466 4467 .name = name_tv, 4467 4468 .vmux = 3, ··· 4481 4480 .name = name_radio, 4482 4481 .amux = LINE2, 4483 4482 }, 4484 - /* no DVB support for now */ 4485 - /* .mpeg = SAA7134_MPEG_DVB, */ 4486 4483 }, 4487 4484 [SAA7134_BOARD_ASUSTeK_TIGER_3IN1] = { 4488 4485 .name = "Asus Tiger 3in1", ··· 4640 4641 .name = name_mute, 4641 4642 .vmux = 8, 4642 4643 .amux = 2, 4644 + }, 4645 + }, 4646 + [SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS] = { 4647 + .name = "Avermedia AVerTV GO 007 FM Plus", 4648 + .audio_clock = 0x00187de7, 4649 + .tuner_type = TUNER_PHILIPS_TDA8290, 4650 + .radio_type = UNSET, 4651 + .tuner_addr = ADDR_UNSET, 4652 + .radio_addr = ADDR_UNSET, 4653 + .gpiomask = 0x00300003, 4654 + /* .gpiomask = 0x8c240003, */ 4655 + .inputs = { { 4656 + .name = name_tv, 4657 + .vmux = 1, 4658 + .amux = TV, 4659 + .tv = 1, 4660 + .gpio = 0x01, 4661 + }, { 4662 + .name = name_svideo, 4663 + .vmux = 6, 4664 + .amux = LINE1, 4665 + .gpio = 0x02, 4666 + } }, 4667 + .radio = { 4668 + .name = name_radio, 4669 + .amux = TV, 4670 + .gpio = 0x00300001, 4671 + }, 4672 + .mute = { 4673 + .name = name_mute, 4674 + .amux = TV, 4675 + .gpio = 0x01, 4643 4676 }, 4644 4677 }, 4645 4678 }; ··· 5733 5702 .subdevice = 0x7128, 5734 5703 .driver_data = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG, 5735 5704 }, { 5705 + .vendor = PCI_VENDOR_ID_PHILIPS, 5706 + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 5707 + .subvendor = 0x1461, /* Avermedia Technologies Inc */ 5708 + .subdevice = 0xf31d, 5709 + .driver_data = SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS, 5710 + 5711 + }, { 5736 5712 /* --- boards without eeprom + subsystem ID --- */ 5737 5713 .vendor = PCI_VENDOR_ID_PHILIPS, 5738 5714 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, ··· 5968 5930 case SAA7134_BOARD_GENIUS_TVGO_A11MCE: 5969 5931 case SAA7134_BOARD_REAL_ANGEL_220: 5970 5932 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG: 5933 + case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: 5971 5934 dev->has_remote = SAA7134_REMOTE_GPIO; 5972 5935 break; 5973 5936 case SAA7134_BOARD_FLYDVBS_LR300: ··· 6064 6025 case SAA7134_BOARD_BEHOLD_M6: 6065 6026 case SAA7134_BOARD_BEHOLD_M63: 6066 6027 case SAA7134_BOARD_BEHOLD_M6_EXTRA: 6028 + case SAA7134_BOARD_BEHOLD_H6: 6067 6029 dev->has_remote = SAA7134_REMOTE_I2C; 6068 6030 break; 6069 6031 case SAA7134_BOARD_AVERMEDIA_A169_B:
+18
drivers/media/video/saa7134/saa7134-dvb.c
··· 49 49 #include "lnbp21.h" 50 50 #include "tuner-simple.h" 51 51 52 + #include "zl10353.h" 53 + 52 54 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); 53 55 MODULE_LICENSE("GPL"); 54 56 ··· 856 854 .request_firmware = philips_tda1004x_request_firmware 857 855 }; 858 856 857 + static struct zl10353_config behold_h6_config = { 858 + .demod_address = 0x1e>>1, 859 + .no_tuner = 1, 860 + .parallel_ts = 1, 861 + }; 862 + 859 863 /* ================================================================== 860 864 * tda10086 based DVB-S cards, helper functions 861 865 */ ··· 1364 1356 if (configure_tda827x_fe(dev, &philips_tiger_config, 1365 1357 &tda827x_cfg_0) < 0) 1366 1358 goto dettach_frontend; 1359 + break; 1360 + case SAA7134_BOARD_BEHOLD_H6: 1361 + fe0->dvb.frontend = dvb_attach(zl10353_attach, 1362 + &behold_h6_config, 1363 + &dev->i2c_adap); 1364 + if (fe0->dvb.frontend) { 1365 + dvb_attach(simple_tuner_attach, fe0->dvb.frontend, 1366 + &dev->i2c_adap, 0x61, 1367 + TUNER_PHILIPS_FMD1216ME_MK3); 1368 + } 1367 1369 break; 1368 1370 default: 1369 1371 wprintk("Huh? unknown DVB card?\n");
+11 -12
drivers/media/video/saa7134/saa7134-empress.c
··· 83 83 84 84 /* ------------------------------------------------------------------ */ 85 85 86 - static int ts_open(struct inode *inode, struct file *file) 86 + static int ts_open(struct file *file) 87 87 { 88 - int minor = iminor(inode); 88 + int minor = video_devdata(file)->minor; 89 89 struct saa7134_dev *dev; 90 90 int err; 91 91 ··· 119 119 return err; 120 120 } 121 121 122 - static int ts_release(struct inode *inode, struct file *file) 122 + static int ts_release(struct file *file) 123 123 { 124 124 struct saa7134_dev *dev = file->private_data; 125 125 ··· 405 405 } 406 406 407 407 static int empress_g_chip_ident(struct file *file, void *fh, 408 - struct v4l2_chip_ident *chip) 408 + struct v4l2_dbg_chip_ident *chip) 409 409 { 410 410 struct saa7134_dev *dev = file->private_data; 411 411 ··· 413 413 chip->revision = 0; 414 414 if (dev->mpeg_i2c_client == NULL) 415 415 return -EINVAL; 416 - if (chip->match_type == V4L2_CHIP_MATCH_I2C_DRIVER && 417 - chip->match_chip == I2C_DRIVERID_SAA6752HS) 418 - return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip); 419 - if (chip->match_type == V4L2_CHIP_MATCH_I2C_ADDR && 420 - chip->match_chip == dev->mpeg_i2c_client->addr) 421 - return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip); 416 + if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER && 417 + !strcmp(chip->match.name, "saa6752hs")) 418 + return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); 419 + if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR && 420 + chip->match.addr == dev->mpeg_i2c_client->addr) 421 + return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); 422 422 return -EINVAL; 423 423 } 424 424 ··· 437 437 return 0; 438 438 } 439 439 440 - static const struct file_operations ts_fops = 440 + static const struct v4l2_file_operations ts_fops = 441 441 { 442 442 .owner = THIS_MODULE, 443 443 .open = ts_open, ··· 446 446 .poll = ts_poll, 447 447 .mmap = ts_mmap, 448 448 .ioctl = video_ioctl2, 449 - .llseek = no_llseek, 450 449 }; 451 450 452 451 static const struct v4l2_ioctl_ops ts_ioctl_ops = {
+1
drivers/media/video/saa7134/saa7134-input.c
··· 449 449 case SAA7134_BOARD_AVERMEDIA_STUDIO_507: 450 450 case SAA7134_BOARD_AVERMEDIA_GO_007_FM: 451 451 case SAA7134_BOARD_AVERMEDIA_M102: 452 + case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: 452 453 ir_codes = ir_codes_avermedia; 453 454 mask_keycode = 0x0007C8; 454 455 mask_keydown = 0x000010;
+10 -13
drivers/media/video/saa7134/saa7134-video.c
··· 1326 1326 return 0; 1327 1327 } 1328 1328 1329 - static int video_open(struct inode *inode, struct file *file) 1329 + static int video_open(struct file *file) 1330 1330 { 1331 - int minor = iminor(inode); 1331 + int minor = video_devdata(file)->minor; 1332 1332 struct saa7134_dev *dev; 1333 1333 struct saa7134_fh *fh; 1334 1334 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ··· 1462 1462 return POLLERR; 1463 1463 } 1464 1464 1465 - static int video_release(struct inode *inode, struct file *file) 1465 + static int video_release(struct file *file) 1466 1466 { 1467 1467 struct saa7134_fh *fh = file->private_data; 1468 1468 struct saa7134_dev *dev = fh->dev; ··· 2247 2247 2248 2248 #ifdef CONFIG_VIDEO_ADV_DEBUG 2249 2249 static int vidioc_g_register (struct file *file, void *priv, 2250 - struct v4l2_register *reg) 2250 + struct v4l2_dbg_register *reg) 2251 2251 { 2252 2252 struct saa7134_fh *fh = priv; 2253 2253 struct saa7134_dev *dev = fh->dev; 2254 2254 2255 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 2255 + if (!v4l2_chip_match_host(&reg->match)) 2256 2256 return -EINVAL; 2257 2257 reg->val = saa_readb(reg->reg); 2258 + reg->size = 1; 2258 2259 return 0; 2259 2260 } 2260 2261 2261 2262 static int vidioc_s_register (struct file *file, void *priv, 2262 - struct v4l2_register *reg) 2263 + struct v4l2_dbg_register *reg) 2263 2264 { 2264 2265 struct saa7134_fh *fh = priv; 2265 2266 struct saa7134_dev *dev = fh->dev; 2266 2267 2267 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 2268 + if (!v4l2_chip_match_host(&reg->match)) 2268 2269 return -EINVAL; 2269 2270 saa_writeb(reg->reg&0xffffff, reg->val); 2270 2271 return 0; ··· 2378 2377 return 0; 2379 2378 } 2380 2379 2381 - static const struct file_operations video_fops = 2380 + static const struct v4l2_file_operations video_fops = 2382 2381 { 2383 2382 .owner = THIS_MODULE, 2384 2383 .open = video_open, ··· 2387 2386 .poll = video_poll, 2388 2387 .mmap = video_mmap, 2389 2388 .ioctl = video_ioctl2, 2390 - .compat_ioctl = v4l_compat_ioctl32, 2391 - .llseek = no_llseek, 2392 2389 }; 2393 2390 2394 2391 static const struct v4l2_ioctl_ops video_ioctl_ops = { ··· 2440 2441 #endif 2441 2442 }; 2442 2443 2443 - static const struct file_operations radio_fops = { 2444 + static const struct v4l2_file_operations radio_fops = { 2444 2445 .owner = THIS_MODULE, 2445 2446 .open = video_open, 2446 2447 .release = video_release, 2447 2448 .ioctl = video_ioctl2, 2448 - .compat_ioctl = v4l_compat_ioctl32, 2449 - .llseek = no_llseek, 2450 2449 }; 2451 2450 2452 2451 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
+1
drivers/media/video/saa7134/saa7134.h
··· 276 276 #define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI 151 277 277 #define SAA7134_BOARD_ASUSTeK_TIGER 152 278 278 #define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG 153 279 + #define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154 279 280 280 281 #define SAA7134_MAXBOARDS 32 281 282 #define SAA7134_INPUT_MAX 8
+5 -4
drivers/media/video/saa717x.c
··· 1171 1171 } 1172 1172 1173 1173 #ifdef CONFIG_VIDEO_ADV_DEBUG 1174 - static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1174 + static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1175 1175 { 1176 1176 struct i2c_client *client = v4l2_get_subdevdata(sd); 1177 1177 1178 - if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) 1178 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1179 1179 return -EINVAL; 1180 1180 if (!capable(CAP_SYS_ADMIN)) 1181 1181 return -EPERM; 1182 1182 reg->val = saa717x_read(sd, reg->reg); 1183 + reg->size = 1; 1183 1184 return 0; 1184 1185 } 1185 1186 1186 - static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 1187 + static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1187 1188 { 1188 1189 struct i2c_client *client = v4l2_get_subdevdata(sd); 1189 1190 u16 addr = reg->reg & 0xffff; 1190 1191 u8 val = reg->val & 0xff; 1191 1192 1192 - if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip)) 1193 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 1193 1194 return -EINVAL; 1194 1195 if (!capable(CAP_SYS_ADMIN)) 1195 1196 return -EPERM;
+5 -9
drivers/media/video/se401.c
··· 932 932 ***************************************************************************/ 933 933 934 934 935 - static int se401_open(struct inode *inode, struct file *file) 935 + static int se401_open(struct file *file) 936 936 { 937 937 struct video_device *dev = video_devdata(file); 938 938 struct usb_se401 *se401 = (struct usb_se401 *)dev; ··· 954 954 return err; 955 955 } 956 956 957 - static int se401_close(struct inode *inode, struct file *file) 957 + static int se401_close(struct file *file) 958 958 { 959 959 struct video_device *dev = file->private_data; 960 960 struct usb_se401 *se401 = (struct usb_se401 *)dev; ··· 975 975 return 0; 976 976 } 977 977 978 - static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg) 978 + static long se401_do_ioctl(struct file *file, unsigned int cmd, void *arg) 979 979 { 980 980 struct video_device *vdev = file->private_data; 981 981 struct usb_se401 *se401 = (struct usb_se401 *)vdev; ··· 1138 1138 return 0; 1139 1139 } 1140 1140 1141 - static int se401_ioctl(struct inode *inode, struct file *file, 1141 + static long se401_ioctl(struct file *file, 1142 1142 unsigned int cmd, unsigned long arg) 1143 1143 { 1144 1144 return video_usercopy(file, cmd, arg, se401_do_ioctl); ··· 1222 1222 return 0; 1223 1223 } 1224 1224 1225 - static const struct file_operations se401_fops = { 1225 + static const struct v4l2_file_operations se401_fops = { 1226 1226 .owner = THIS_MODULE, 1227 1227 .open = se401_open, 1228 1228 .release = se401_close, 1229 1229 .read = se401_read, 1230 1230 .mmap = se401_mmap, 1231 1231 .ioctl = se401_ioctl, 1232 - #ifdef CONFIG_COMPAT 1233 - .compat_ioctl = v4l_compat_ioctl32, 1234 - #endif 1235 - .llseek = no_llseek, 1236 1232 }; 1237 1233 static struct video_device se401_template = { 1238 1234 .name = "se401 USB camera",
+7 -11
drivers/media/video/sn9c102/sn9c102_core.c
··· 1746 1746 } 1747 1747 1748 1748 1749 - static int sn9c102_open(struct inode* inode, struct file* filp) 1749 + static int sn9c102_open(struct file *filp) 1750 1750 { 1751 1751 struct sn9c102_device* cam; 1752 1752 int err = 0; ··· 1857 1857 } 1858 1858 1859 1859 1860 - static int sn9c102_release(struct inode* inode, struct file* filp) 1860 + static int sn9c102_release(struct file *filp) 1861 1861 { 1862 1862 struct sn9c102_device* cam; 1863 1863 ··· 3092 3092 } 3093 3093 3094 3094 3095 - static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, 3096 - unsigned int cmd, void __user * arg) 3095 + static long sn9c102_ioctl_v4l2(struct file *filp, 3096 + unsigned int cmd, void __user *arg) 3097 3097 { 3098 3098 struct sn9c102_device *cam = video_drvdata(filp); 3099 3099 ··· 3196 3196 } 3197 3197 3198 3198 3199 - static int sn9c102_ioctl(struct inode* inode, struct file* filp, 3199 + static long sn9c102_ioctl(struct file *filp, 3200 3200 unsigned int cmd, unsigned long arg) 3201 3201 { 3202 3202 struct sn9c102_device *cam = video_drvdata(filp); ··· 3220 3220 3221 3221 V4LDBG(3, "sn9c102", cmd); 3222 3222 3223 - err = sn9c102_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 3223 + err = sn9c102_ioctl_v4l2(filp, cmd, (void __user *)arg); 3224 3224 3225 3225 mutex_unlock(&cam->fileop_mutex); 3226 3226 ··· 3229 3229 3230 3230 /*****************************************************************************/ 3231 3231 3232 - static const struct file_operations sn9c102_fops = { 3232 + static const struct v4l2_file_operations sn9c102_fops = { 3233 3233 .owner = THIS_MODULE, 3234 3234 .open = sn9c102_open, 3235 3235 .release = sn9c102_release, 3236 3236 .ioctl = sn9c102_ioctl, 3237 - #ifdef CONFIG_COMPAT 3238 - .compat_ioctl = v4l_compat_ioctl32, 3239 - #endif 3240 3237 .read = sn9c102_read, 3241 3238 .poll = sn9c102_poll, 3242 3239 .mmap = sn9c102_mmap, 3243 - .llseek = no_llseek, 3244 3240 }; 3245 3241 3246 3242 /*****************************************************************************/
+6 -7
drivers/media/video/soc_camera.c
··· 256 256 vfree(icd->user_formats); 257 257 } 258 258 259 - static int soc_camera_open(struct inode *inode, struct file *file) 259 + static int soc_camera_open(struct file *file) 260 260 { 261 261 struct video_device *vdev; 262 262 struct soc_camera_device *icd; ··· 330 330 return ret; 331 331 } 332 332 333 - static int soc_camera_close(struct inode *inode, struct file *file) 333 + static int soc_camera_close(struct file *file) 334 334 { 335 335 struct soc_camera_file *icf = file->private_data; 336 336 struct soc_camera_device *icd = icf->icd; ··· 400 400 return ici->ops->poll(file, pt); 401 401 } 402 402 403 - static struct file_operations soc_camera_fops = { 403 + static struct v4l2_file_operations soc_camera_fops = { 404 404 .owner = THIS_MODULE, 405 405 .open = soc_camera_open, 406 406 .release = soc_camera_close, ··· 408 408 .read = soc_camera_read, 409 409 .mmap = soc_camera_mmap, 410 410 .poll = soc_camera_poll, 411 - .llseek = no_llseek, 412 411 }; 413 412 414 413 static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv, ··· 699 700 } 700 701 701 702 static int soc_camera_g_chip_ident(struct file *file, void *fh, 702 - struct v4l2_chip_ident *id) 703 + struct v4l2_dbg_chip_ident *id) 703 704 { 704 705 struct soc_camera_file *icf = file->private_data; 705 706 struct soc_camera_device *icd = icf->icd; ··· 712 713 713 714 #ifdef CONFIG_VIDEO_ADV_DEBUG 714 715 static int soc_camera_g_register(struct file *file, void *fh, 715 - struct v4l2_register *reg) 716 + struct v4l2_dbg_register *reg) 716 717 { 717 718 struct soc_camera_file *icf = file->private_data; 718 719 struct soc_camera_device *icd = icf->icd; ··· 724 725 } 725 726 726 727 static int soc_camera_s_register(struct file *file, void *fh, 727 - struct v4l2_register *reg) 728 + struct v4l2_dbg_register *reg) 728 729 { 729 730 struct soc_camera_file *icf = file->private_data; 730 731 struct soc_camera_device *icd = icf->icd;
+3 -7
drivers/media/video/stk-webcam.c
··· 664 664 665 665 /* v4l file operations */ 666 666 667 - static int v4l_stk_open(struct inode *inode, struct file *fp) 667 + static int v4l_stk_open(struct file *fp) 668 668 { 669 669 struct stk_camera *dev; 670 670 struct video_device *vdev; ··· 684 684 return 0; 685 685 } 686 686 687 - static int v4l_stk_release(struct inode *inode, struct file *fp) 687 + static int v4l_stk_release(struct file *fp) 688 688 { 689 689 struct stk_camera *dev = fp->private_data; 690 690 ··· 1281 1281 } 1282 1282 } 1283 1283 1284 - static struct file_operations v4l_stk_fops = { 1284 + static struct v4l2_file_operations v4l_stk_fops = { 1285 1285 .owner = THIS_MODULE, 1286 1286 .open = v4l_stk_open, 1287 1287 .release = v4l_stk_release, ··· 1289 1289 .poll = v4l_stk_poll, 1290 1290 .mmap = v4l_stk_mmap, 1291 1291 .ioctl = video_ioctl2, 1292 - #ifdef CONFIG_COMPAT 1293 - .compat_ioctl = v4l_compat_ioctl32, 1294 - #endif 1295 - .llseek = no_llseek 1296 1292 }; 1297 1293 1298 1294 static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
+4 -8
drivers/media/video/stradis.c
··· 1275 1275 clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y); 1276 1276 } 1277 1277 1278 - static int saa_ioctl(struct inode *inode, struct file *file, 1278 + static long saa_ioctl(struct file *file, 1279 1279 unsigned int cmd, unsigned long argl) 1280 1280 { 1281 1281 struct saa7146 *saa = file->private_data; ··· 1877 1877 return count; 1878 1878 } 1879 1879 1880 - static int saa_open(struct inode *inode, struct file *file) 1880 + static int saa_open(struct file *file) 1881 1881 { 1882 1882 struct video_device *vdev = video_devdata(file); 1883 1883 struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev); ··· 1895 1895 return 0; 1896 1896 } 1897 1897 1898 - static int saa_release(struct inode *inode, struct file *file) 1898 + static int saa_release(struct file *file) 1899 1899 { 1900 1900 struct saa7146 *saa = file->private_data; 1901 1901 saa->user--; ··· 1906 1906 return 0; 1907 1907 } 1908 1908 1909 - static const struct file_operations saa_fops = { 1909 + static const struct v4l2_file_operations saa_fops = { 1910 1910 .owner = THIS_MODULE, 1911 1911 .open = saa_open, 1912 1912 .release = saa_release, 1913 1913 .ioctl = saa_ioctl, 1914 - #ifdef CONFIG_COMPAT 1915 - .compat_ioctl = v4l_compat_ioctl32, 1916 - #endif 1917 1914 .read = saa_read, 1918 - .llseek = no_llseek, 1919 1915 .write = saa_write, 1920 1916 .mmap = saa_mmap, 1921 1917 };
+5 -9
drivers/media/video/stv680.c
··· 1080 1080 * Video4Linux 1081 1081 *********************************************************************/ 1082 1082 1083 - static int stv_open (struct inode *inode, struct file *file) 1083 + static int stv_open(struct file *file) 1084 1084 { 1085 1085 struct video_device *dev = video_devdata(file); 1086 1086 struct usb_stv *stv680 = video_get_drvdata(dev); ··· 1106 1106 return err; 1107 1107 } 1108 1108 1109 - static int stv_close (struct inode *inode, struct file *file) 1109 + static int stv_close(struct file *file) 1110 1110 { 1111 1111 struct video_device *dev = file->private_data; 1112 1112 struct usb_stv *stv680 = video_get_drvdata(dev); ··· 1132 1132 return 0; 1133 1133 } 1134 1134 1135 - static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1135 + static long stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1136 1136 { 1137 1137 struct video_device *vdev = file->private_data; 1138 1138 struct usb_stv *stv680 = video_get_drvdata(vdev); ··· 1299 1299 return 0; 1300 1300 } 1301 1301 1302 - static int stv680_ioctl(struct inode *inode, struct file *file, 1302 + static long stv680_ioctl(struct file *file, 1303 1303 unsigned int cmd, unsigned long arg) 1304 1304 { 1305 1305 return video_usercopy(file, cmd, arg, stv680_do_ioctl); ··· 1391 1391 return realcount; 1392 1392 } /* stv680_read */ 1393 1393 1394 - static const struct file_operations stv680_fops = { 1394 + static const struct v4l2_file_operations stv680_fops = { 1395 1395 .owner = THIS_MODULE, 1396 1396 .open = stv_open, 1397 1397 .release = stv_close, 1398 1398 .read = stv680_read, 1399 1399 .mmap = stv680_mmap, 1400 1400 .ioctl = stv680_ioctl, 1401 - #ifdef CONFIG_COMPAT 1402 - .compat_ioctl = v4l_compat_ioctl32, 1403 - #endif 1404 - .llseek = no_llseek, 1405 1401 }; 1406 1402 static struct video_device stv680_template = { 1407 1403 .name = "STV0680 USB camera",
+1 -1
drivers/media/video/tda9840.c
··· 137 137 return 0; 138 138 } 139 139 140 - static int tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 140 + static long tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 141 141 { 142 142 int byte; 143 143
+1 -1
drivers/media/video/tea6415c.c
··· 122 122 return ret; 123 123 } 124 124 125 - static int tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 125 + static long tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 126 126 { 127 127 if (cmd == TEA6415C_SWITCH) { 128 128 struct i2c_client *client = v4l2_get_subdevdata(sd);
+1 -1
drivers/media/video/tea6420.c
··· 90 90 return 0; 91 91 } 92 92 93 - static int tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 93 + static long tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg) 94 94 { 95 95 if (cmd == TEA6420_SWITCH) { 96 96 struct i2c_client *client = v4l2_get_subdevdata(sd);
+1 -1
drivers/media/video/tuner-core.c
··· 800 800 } 801 801 802 802 #ifdef CONFIG_VIDEO_ALLOW_V4L1 803 - static int tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 803 + static long tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) 804 804 { 805 805 struct tuner *t = to_tuner(sd); 806 806 struct i2c_client *client = v4l2_get_subdevdata(sd);
+1 -1
drivers/media/video/tvaudio.c
··· 1762 1762 return 0; 1763 1763 } 1764 1764 1765 - static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 1765 + static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 1766 1766 { 1767 1767 struct i2c_client *client = v4l2_get_subdevdata(sd); 1768 1768
+6 -7
drivers/media/video/tvp5150.c
··· 963 963 964 964 965 965 static int tvp5150_g_chip_ident(struct v4l2_subdev *sd, 966 - struct v4l2_chip_ident *chip) 966 + struct v4l2_dbg_chip_ident *chip) 967 967 { 968 968 int rev; 969 969 struct i2c_client *client = v4l2_get_subdevdata(sd); ··· 977 977 978 978 979 979 #ifdef CONFIG_VIDEO_ADV_DEBUG 980 - static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 980 + static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 981 981 { 982 982 struct i2c_client *client = v4l2_get_subdevdata(sd); 983 983 984 - if (!v4l2_chip_match_i2c_client(client, 985 - reg->match_type, reg->match_chip)) 984 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 986 985 return -EINVAL; 987 986 if (!capable(CAP_SYS_ADMIN)) 988 987 return -EPERM; 989 988 reg->val = tvp5150_read(sd, reg->reg & 0xff); 989 + reg->size = 1; 990 990 return 0; 991 991 } 992 992 993 - static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 993 + static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 994 994 { 995 995 struct i2c_client *client = v4l2_get_subdevdata(sd); 996 996 997 - if (!v4l2_chip_match_i2c_client(client, 998 - reg->match_type, reg->match_chip)) 997 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 999 998 return -EINVAL; 1000 999 if (!capable(CAP_SYS_ADMIN)) 1001 1000 return -EPERM;
+3 -3
drivers/media/video/tw9910.c
··· 575 575 } 576 576 577 577 static int tw9910_get_chip_id(struct soc_camera_device *icd, 578 - struct v4l2_chip_ident *id) 578 + struct v4l2_dbg_chip_ident *id) 579 579 { 580 580 id->ident = V4L2_IDENT_TW9910; 581 581 id->revision = 0; ··· 606 606 607 607 #ifdef CONFIG_VIDEO_ADV_DEBUG 608 608 static int tw9910_get_register(struct soc_camera_device *icd, 609 - struct v4l2_register *reg) 609 + struct v4l2_dbg_register *reg) 610 610 { 611 611 struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd); 612 612 int ret; ··· 627 627 } 628 628 629 629 static int tw9910_set_register(struct soc_camera_device *icd, 630 - struct v4l2_register *reg) 630 + struct v4l2_dbg_register *reg) 631 631 { 632 632 struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd); 633 633
+6 -7
drivers/media/video/upd64031a.c
··· 147 147 return upd64031a_s_frequency(sd, NULL); 148 148 } 149 149 150 - static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 150 + static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 151 151 { 152 152 struct i2c_client *client = v4l2_get_subdevdata(sd); 153 153 ··· 162 162 } 163 163 164 164 #ifdef CONFIG_VIDEO_ADV_DEBUG 165 - static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 165 + static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 166 166 { 167 167 struct i2c_client *client = v4l2_get_subdevdata(sd); 168 168 169 - if (!v4l2_chip_match_i2c_client(client, 170 - reg->match_type, reg->match_chip)) 169 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 171 170 return -EINVAL; 172 171 if (!capable(CAP_SYS_ADMIN)) 173 172 return -EPERM; 174 173 reg->val = upd64031a_read(sd, reg->reg & 0xff); 174 + reg->size = 1; 175 175 return 0; 176 176 } 177 177 178 - static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 178 + static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 179 179 { 180 180 struct i2c_client *client = v4l2_get_subdevdata(sd); 181 181 182 - if (!v4l2_chip_match_i2c_client(client, 183 - reg->match_type, reg->match_chip)) 182 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 184 183 return -EINVAL; 185 184 if (!capable(CAP_SYS_ADMIN)) 186 185 return -EPERM;
+6 -7
drivers/media/video/upd64083.c
··· 120 120 } 121 121 122 122 #ifdef CONFIG_VIDEO_ADV_DEBUG 123 - static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 123 + static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 124 124 { 125 125 struct i2c_client *client = v4l2_get_subdevdata(sd); 126 126 127 - if (!v4l2_chip_match_i2c_client(client, 128 - reg->match_type, reg->match_chip)) 127 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 129 128 return -EINVAL; 130 129 if (!capable(CAP_SYS_ADMIN)) 131 130 return -EPERM; 132 131 reg->val = upd64083_read(sd, reg->reg & 0xff); 132 + reg->size = 1; 133 133 return 0; 134 134 } 135 135 136 - static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg) 136 + static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 137 137 { 138 138 struct i2c_client *client = v4l2_get_subdevdata(sd); 139 139 140 - if (!v4l2_chip_match_i2c_client(client, 141 - reg->match_type, reg->match_chip)) 140 + if (!v4l2_chip_match_i2c_client(client, &reg->match)) 142 141 return -EINVAL; 143 142 if (!capable(CAP_SYS_ADMIN)) 144 143 return -EPERM; ··· 146 147 } 147 148 #endif 148 149 149 - static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 150 + static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 150 151 { 151 152 struct i2c_client *client = v4l2_get_subdevdata(sd); 152 153
+8 -12
drivers/media/video/usbvideo/usbvideo.c
··· 41 41 static void usbvideo_Disconnect(struct usb_interface *intf); 42 42 static void usbvideo_CameraRelease(struct uvd *uvd); 43 43 44 - static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, 44 + static long usbvideo_v4l_ioctl(struct file *file, 45 45 unsigned int cmd, unsigned long arg); 46 46 static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma); 47 - static int usbvideo_v4l_open(struct inode *inode, struct file *file); 47 + static int usbvideo_v4l_open(struct file *file); 48 48 static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf, 49 49 size_t count, loff_t *ppos); 50 - static int usbvideo_v4l_close(struct inode *inode, struct file *file); 50 + static int usbvideo_v4l_close(struct file *file); 51 51 52 52 static int usbvideo_StartDataPump(struct uvd *uvd); 53 53 static void usbvideo_StopDataPump(struct uvd *uvd); ··· 942 942 return rv; 943 943 } 944 944 945 - static const struct file_operations usbvideo_fops = { 945 + static const struct v4l2_file_operations usbvideo_fops = { 946 946 .owner = THIS_MODULE, 947 947 .open = usbvideo_v4l_open, 948 948 .release =usbvideo_v4l_close, 949 949 .read = usbvideo_v4l_read, 950 950 .mmap = usbvideo_v4l_mmap, 951 951 .ioctl = usbvideo_v4l_ioctl, 952 - #ifdef CONFIG_COMPAT 953 - .compat_ioctl = v4l_compat_ioctl32, 954 - #endif 955 - .llseek = no_llseek, 956 952 }; 957 953 static const struct video_device usbvideo_template = { 958 954 .fops = &usbvideo_fops, ··· 1109 1113 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. 1110 1114 * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT). 1111 1115 */ 1112 - static int usbvideo_v4l_open(struct inode *inode, struct file *file) 1116 + static int usbvideo_v4l_open(struct file *file) 1113 1117 { 1114 1118 struct video_device *dev = video_devdata(file); 1115 1119 struct uvd *uvd = (struct uvd *) dev; ··· 1229 1233 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. 1230 1234 * 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep. 1231 1235 */ 1232 - static int usbvideo_v4l_close(struct inode *inode, struct file *file) 1236 + static int usbvideo_v4l_close(struct file *file) 1233 1237 { 1234 1238 struct video_device *dev = file->private_data; 1235 1239 struct uvd *uvd = (struct uvd *) dev; ··· 1277 1281 * History: 1278 1282 * 22-Jan-2000 Corrected VIDIOCSPICT to reject unsupported settings. 1279 1283 */ 1280 - static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1284 + static long usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1281 1285 { 1282 1286 struct uvd *uvd = file->private_data; 1283 1287 ··· 1497 1501 return 0; 1498 1502 } 1499 1503 1500 - static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, 1504 + static long usbvideo_v4l_ioctl(struct file *file, 1501 1505 unsigned int cmd, unsigned long arg) 1502 1506 { 1503 1507 return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);
+6 -10
drivers/media/video/usbvideo/vicam.c
··· 229 229 return 0; 230 230 } 231 231 232 - static int 233 - vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long arg) 232 + static long 233 + vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg) 234 234 { 235 235 void __user *user_arg = (void __user *)arg; 236 236 struct vicam_camera *cam = file->private_data; 237 - int retval = 0; 237 + long retval = 0; 238 238 239 239 if (!cam) 240 240 return -ENODEV; ··· 470 470 } 471 471 472 472 static int 473 - vicam_open(struct inode *inode, struct file *file) 473 + vicam_open(struct file *file) 474 474 { 475 475 struct vicam_camera *cam = video_drvdata(file); 476 476 ··· 536 536 } 537 537 538 538 static int 539 - vicam_close(struct inode *inode, struct file *file) 539 + vicam_close(struct file *file) 540 540 { 541 541 struct vicam_camera *cam = file->private_data; 542 542 int open_count; ··· 783 783 return 0; 784 784 } 785 785 786 - static const struct file_operations vicam_fops = { 786 + static const struct v4l2_file_operations vicam_fops = { 787 787 .owner = THIS_MODULE, 788 788 .open = vicam_open, 789 789 .release = vicam_close, 790 790 .read = vicam_read, 791 791 .mmap = vicam_mmap, 792 792 .ioctl = vicam_ioctl, 793 - #ifdef CONFIG_COMPAT 794 - .compat_ioctl = v4l_compat_ioctl32, 795 - #endif 796 - .llseek = no_llseek, 797 793 }; 798 794 799 795 static struct video_device vicam_template = {
+16 -21
drivers/media/video/usbvision/usbvision-video.c
··· 355 355 * then allocates buffers needed for video processing. 356 356 * 357 357 */ 358 - static int usbvision_v4l2_open(struct inode *inode, struct file *file) 358 + static int usbvision_v4l2_open(struct file *file) 359 359 { 360 360 struct usb_usbvision *usbvision = video_drvdata(file); 361 361 int errCode = 0; ··· 432 432 * allocated in usbvision_v4l2_open(). 433 433 * 434 434 */ 435 - static int usbvision_v4l2_close(struct inode *inode, struct file *file) 435 + static int usbvision_v4l2_close(struct file *file) 436 436 { 437 437 struct usb_usbvision *usbvision = video_drvdata(file); 438 438 ··· 477 477 */ 478 478 #ifdef CONFIG_VIDEO_ADV_DEBUG 479 479 static int vidioc_g_register (struct file *file, void *priv, 480 - struct v4l2_register *reg) 480 + struct v4l2_dbg_register *reg) 481 481 { 482 482 struct usb_usbvision *usbvision = video_drvdata(file); 483 483 int errCode; 484 484 485 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 485 + if (!v4l2_chip_match_host(&reg->match)) 486 486 return -EINVAL; 487 487 /* NT100x has a 8-bit register space */ 488 488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff); ··· 492 492 return errCode; 493 493 } 494 494 reg->val = errCode; 495 + reg->size = 1; 495 496 return 0; 496 497 } 497 498 498 499 static int vidioc_s_register (struct file *file, void *priv, 499 - struct v4l2_register *reg) 500 + struct v4l2_dbg_register *reg) 500 501 { 501 502 struct usb_usbvision *usbvision = video_drvdata(file); 502 503 int errCode; 503 504 504 - if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 505 + if (!v4l2_chip_match_host(&reg->match)) 505 506 return -EINVAL; 506 507 /* NT100x has a 8-bit register space */ 507 508 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); ··· 1179 1178 * Here comes the stuff for radio on usbvision based devices 1180 1179 * 1181 1180 */ 1182 - static int usbvision_radio_open(struct inode *inode, struct file *file) 1181 + static int usbvision_radio_open(struct file *file) 1183 1182 { 1184 1183 struct usb_usbvision *usbvision = video_drvdata(file); 1185 1184 int errCode = 0; ··· 1229 1228 } 1230 1229 1231 1230 1232 - static int usbvision_radio_close(struct inode *inode, struct file *file) 1231 + static int usbvision_radio_close(struct file *file) 1233 1232 { 1234 1233 struct usb_usbvision *usbvision = video_drvdata(file); 1235 1234 int errCode = 0; ··· 1267 1266 * Here comes the stuff for vbi on usbvision based devices 1268 1267 * 1269 1268 */ 1270 - static int usbvision_vbi_open(struct inode *inode, struct file *file) 1269 + static int usbvision_vbi_open(struct file *file) 1271 1270 { 1272 1271 /* TODO */ 1273 1272 return -ENODEV; 1274 1273 } 1275 1274 1276 - static int usbvision_vbi_close(struct inode *inode, struct file *file) 1275 + static int usbvision_vbi_close(struct file *file) 1277 1276 { 1278 1277 /* TODO */ 1279 1278 return -ENODEV; 1280 1279 } 1281 1280 1282 - static int usbvision_do_vbi_ioctl(struct file *file, 1281 + static long usbvision_do_vbi_ioctl(struct file *file, 1283 1282 unsigned int cmd, void *arg) 1284 1283 { 1285 1284 /* TODO */ 1286 1285 return -ENOIOCTLCMD; 1287 1286 } 1288 1287 1289 - static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, 1288 + static long usbvision_vbi_ioctl(struct file *file, 1290 1289 unsigned int cmd, unsigned long arg) 1291 1290 { 1292 1291 return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl); ··· 1298 1297 // 1299 1298 1300 1299 // Video template 1301 - static const struct file_operations usbvision_fops = { 1300 + static const struct v4l2_file_operations usbvision_fops = { 1302 1301 .owner = THIS_MODULE, 1303 1302 .open = usbvision_v4l2_open, 1304 1303 .release = usbvision_v4l2_close, 1305 1304 .read = usbvision_v4l2_read, 1306 1305 .mmap = usbvision_v4l2_mmap, 1307 1306 .ioctl = video_ioctl2, 1308 - .llseek = no_llseek, 1309 1307 /* .poll = video_poll, */ 1310 - .compat_ioctl = v4l_compat_ioctl32, 1311 1308 }; 1312 1309 1313 1310 static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { ··· 1354 1355 1355 1356 1356 1357 // Radio template 1357 - static const struct file_operations usbvision_radio_fops = { 1358 + static const struct v4l2_file_operations usbvision_radio_fops = { 1358 1359 .owner = THIS_MODULE, 1359 1360 .open = usbvision_radio_open, 1360 1361 .release = usbvision_radio_close, 1361 1362 .ioctl = video_ioctl2, 1362 - .llseek = no_llseek, 1363 - .compat_ioctl = v4l_compat_ioctl32, 1364 1363 }; 1365 1364 1366 1365 static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { ··· 1389 1392 }; 1390 1393 1391 1394 // vbi template 1392 - static const struct file_operations usbvision_vbi_fops = { 1395 + static const struct v4l2_file_operations usbvision_vbi_fops = { 1393 1396 .owner = THIS_MODULE, 1394 1397 .open = usbvision_vbi_open, 1395 1398 .release = usbvision_vbi_close, 1396 1399 .ioctl = usbvision_vbi_ioctl, 1397 - .llseek = no_llseek, 1398 - .compat_ioctl = v4l_compat_ioctl32, 1399 1400 }; 1400 1401 1401 1402 static struct video_device usbvision_vbi_template=
+6 -8
drivers/media/video/uvc/uvc_v4l2.c
··· 406 406 * V4L2 file operations 407 407 */ 408 408 409 - static int uvc_v4l2_open(struct inode *inode, struct file *file) 409 + static int uvc_v4l2_open(struct file *file) 410 410 { 411 411 struct uvc_video_device *video; 412 412 struct uvc_fh *handle; ··· 444 444 return ret; 445 445 } 446 446 447 - static int uvc_v4l2_release(struct inode *inode, struct file *file) 447 + static int uvc_v4l2_release(struct file *file) 448 448 { 449 449 struct uvc_video_device *video = video_drvdata(file); 450 450 struct uvc_fh *handle = (struct uvc_fh *)file->private_data; ··· 472 472 return 0; 473 473 } 474 474 475 - static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 475 + static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) 476 476 { 477 477 struct video_device *vdev = video_devdata(file); 478 478 struct uvc_video_device *video = video_get_drvdata(vdev); 479 479 struct uvc_fh *handle = (struct uvc_fh *)file->private_data; 480 - int ret = 0; 480 + long ret = 0; 481 481 482 482 switch (cmd) { 483 483 /* Query capabilities */ ··· 996 996 return ret; 997 997 } 998 998 999 - static int uvc_v4l2_ioctl(struct inode *inode, struct file *file, 999 + static long uvc_v4l2_ioctl(struct file *file, 1000 1000 unsigned int cmd, unsigned long arg) 1001 1001 { 1002 1002 if (uvc_trace_param & UVC_TRACE_IOCTL) { ··· 1097 1097 return uvc_queue_poll(&video->queue, file, wait); 1098 1098 } 1099 1099 1100 - struct file_operations uvc_fops = { 1100 + const struct v4l2_file_operations uvc_fops = { 1101 1101 .owner = THIS_MODULE, 1102 1102 .open = uvc_v4l2_open, 1103 1103 .release = uvc_v4l2_release, 1104 1104 .ioctl = uvc_v4l2_ioctl, 1105 - .compat_ioctl = v4l_compat_ioctl32, 1106 - .llseek = no_llseek, 1107 1105 .read = uvc_v4l2_read, 1108 1106 .mmap = uvc_v4l2_mmap, 1109 1107 .poll = uvc_v4l2_poll,
+1 -1
drivers/media/video/uvc/uvcvideo.h
··· 753 753 } 754 754 755 755 /* V4L2 interface */ 756 - extern struct file_operations uvc_fops; 756 + extern const struct v4l2_file_operations uvc_fops; 757 757 758 758 /* Video */ 759 759 extern int uvc_video_init(struct uvc_video_device *video);
+83 -81
drivers/media/video/v4l1-compat.c
··· 267 267 268 268 /* ----------------------------------------------------------------- */ 269 269 270 - static noinline int v4l1_compat_get_capabilities( 270 + static noinline long v4l1_compat_get_capabilities( 271 271 struct video_capability *cap, 272 272 struct file *file, 273 273 v4l2_kioctl drv) 274 274 { 275 - int err; 275 + long err; 276 276 struct v4l2_framebuffer fbuf; 277 277 struct v4l2_capability *cap2; 278 278 ··· 286 286 287 287 err = drv(file, VIDIOC_QUERYCAP, cap2); 288 288 if (err < 0) { 289 - dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); 289 + dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %ld\n", err); 290 290 goto done; 291 291 } 292 292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { 293 293 err = drv(file, VIDIOC_G_FBUF, &fbuf); 294 294 if (err < 0) { 295 - dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); 295 + dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %ld\n", err); 296 296 memset(&fbuf, 0, sizeof(fbuf)); 297 297 } 298 298 err = 0; ··· 324 324 return err; 325 325 } 326 326 327 - static noinline int v4l1_compat_get_frame_buffer( 327 + static noinline long v4l1_compat_get_frame_buffer( 328 328 struct video_buffer *buffer, 329 329 struct file *file, 330 330 v4l2_kioctl drv) 331 331 { 332 - int err; 332 + long err; 333 333 struct v4l2_framebuffer fbuf; 334 334 335 335 memset(buffer, 0, sizeof(*buffer)); ··· 337 337 338 338 err = drv(file, VIDIOC_G_FBUF, &fbuf); 339 339 if (err < 0) { 340 - dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); 340 + dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %ld\n", err); 341 341 goto done; 342 342 } 343 343 buffer->base = fbuf.base; ··· 378 378 return err; 379 379 } 380 380 381 - static noinline int v4l1_compat_set_frame_buffer( 381 + static noinline long v4l1_compat_set_frame_buffer( 382 382 struct video_buffer *buffer, 383 383 struct file *file, 384 384 v4l2_kioctl drv) 385 385 { 386 - int err; 386 + long err; 387 387 struct v4l2_framebuffer fbuf; 388 388 389 389 memset(&fbuf, 0, sizeof(fbuf)); ··· 410 410 fbuf.fmt.bytesperline = buffer->bytesperline; 411 411 err = drv(file, VIDIOC_S_FBUF, &fbuf); 412 412 if (err < 0) 413 - dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); 413 + dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %ld\n", err); 414 414 return err; 415 415 } 416 416 417 - static noinline int v4l1_compat_get_win_cap_dimensions( 417 + static noinline long v4l1_compat_get_win_cap_dimensions( 418 418 struct video_window *win, 419 419 struct file *file, 420 420 v4l2_kioctl drv) 421 421 { 422 - int err; 422 + long err; 423 423 struct v4l2_format *fmt; 424 424 425 425 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); ··· 432 432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; 433 433 err = drv(file, VIDIOC_G_FMT, fmt); 434 434 if (err < 0) 435 - dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); 435 + dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %ld\n", err); 436 436 if (err == 0) { 437 437 win->x = fmt->fmt.win.w.left; 438 438 win->y = fmt->fmt.win.w.top; ··· 447 447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 448 448 err = drv(file, VIDIOC_G_FMT, fmt); 449 449 if (err < 0) { 450 - dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); 450 + dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %ld\n", err); 451 451 goto done; 452 452 } 453 453 win->x = 0; ··· 462 462 return err; 463 463 } 464 464 465 - static noinline int v4l1_compat_set_win_cap_dimensions( 465 + static noinline long v4l1_compat_set_win_cap_dimensions( 466 466 struct video_window *win, 467 467 struct file *file, 468 468 v4l2_kioctl drv) 469 469 { 470 - int err, err1, err2; 470 + long err, err1, err2; 471 471 struct v4l2_format *fmt; 472 472 473 473 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); ··· 479 479 drv(file, VIDIOC_STREAMOFF, &fmt->type); 480 480 err1 = drv(file, VIDIOC_G_FMT, fmt); 481 481 if (err1 < 0) 482 - dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); 482 + dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %ld\n", err1); 483 483 if (err1 == 0) { 484 484 fmt->fmt.pix.width = win->width; 485 485 fmt->fmt.pix.height = win->height; ··· 487 487 fmt->fmt.pix.bytesperline = 0; 488 488 err = drv(file, VIDIOC_S_FMT, fmt); 489 489 if (err < 0) 490 - dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", 490 + dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %ld\n", 491 491 err); 492 492 win->width = fmt->fmt.pix.width; 493 493 win->height = fmt->fmt.pix.height; ··· 504 504 fmt->fmt.win.clipcount = win->clipcount; 505 505 err2 = drv(file, VIDIOC_S_FMT, fmt); 506 506 if (err2 < 0) 507 - dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); 507 + dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %ld\n", err2); 508 508 509 509 if (err1 != 0 && err2 != 0) 510 510 err = err1; ··· 514 514 return err; 515 515 } 516 516 517 - static noinline int v4l1_compat_turn_preview_on_off( 517 + static noinline long v4l1_compat_turn_preview_on_off( 518 518 int *on, 519 519 struct file *file, 520 520 v4l2_kioctl drv) 521 521 { 522 - int err; 522 + long err; 523 523 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 524 524 525 525 if (0 == *on) { ··· 530 530 } 531 531 err = drv(file, VIDIOC_OVERLAY, on); 532 532 if (err < 0) 533 - dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); 533 + dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %ld\n", err); 534 534 return err; 535 535 } 536 536 537 - static noinline int v4l1_compat_get_input_info( 537 + static noinline long v4l1_compat_get_input_info( 538 538 struct video_channel *chan, 539 539 struct file *file, 540 540 v4l2_kioctl drv) 541 541 { 542 - int err; 542 + long err; 543 543 struct v4l2_input input2; 544 544 v4l2_std_id sid; 545 545 ··· 548 548 err = drv(file, VIDIOC_ENUMINPUT, &input2); 549 549 if (err < 0) { 550 550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " 551 - "channel=%d err=%d\n", chan->channel, err); 551 + "channel=%d err=%ld\n", chan->channel, err); 552 552 goto done; 553 553 } 554 554 chan->channel = input2.index; ··· 569 569 chan->norm = 0; 570 570 err = drv(file, VIDIOC_G_STD, &sid); 571 571 if (err < 0) 572 - dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); 572 + dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %ld\n", err); 573 573 if (err == 0) { 574 574 if (sid & V4L2_STD_PAL) 575 575 chan->norm = VIDEO_MODE_PAL; ··· 582 582 return err; 583 583 } 584 584 585 - static noinline int v4l1_compat_set_input( 585 + static noinline long v4l1_compat_set_input( 586 586 struct video_channel *chan, 587 587 struct file *file, 588 588 v4l2_kioctl drv) 589 589 { 590 - int err; 590 + long err; 591 591 v4l2_std_id sid = 0; 592 592 593 593 err = drv(file, VIDIOC_S_INPUT, &chan->channel); 594 594 if (err < 0) 595 - dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); 595 + dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %ld\n", err); 596 596 switch (chan->norm) { 597 597 case VIDEO_MODE_PAL: 598 598 sid = V4L2_STD_PAL; ··· 607 607 if (0 != sid) { 608 608 err = drv(file, VIDIOC_S_STD, &sid); 609 609 if (err < 0) 610 - dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); 610 + dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %ld\n", err); 611 611 } 612 612 return err; 613 613 } 614 614 615 - static noinline int v4l1_compat_get_picture( 615 + static noinline long v4l1_compat_get_picture( 616 616 struct video_picture *pict, 617 617 struct file *file, 618 618 v4l2_kioctl drv) 619 619 { 620 - int err; 620 + long err; 621 621 struct v4l2_format *fmt; 622 622 623 623 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); ··· 640 640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 641 641 err = drv(file, VIDIOC_G_FMT, fmt); 642 642 if (err < 0) { 643 - dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); 643 + dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %ld\n", err); 644 644 goto done; 645 645 } 646 646 ··· 654 654 return err; 655 655 } 656 656 657 - static noinline int v4l1_compat_set_picture( 657 + static noinline long v4l1_compat_set_picture( 658 658 struct video_picture *pict, 659 659 struct file *file, 660 660 v4l2_kioctl drv) 661 661 { 662 - int err; 662 + long err; 663 663 struct v4l2_framebuffer fbuf; 664 664 int mem_err = 0, ovl_err = 0; 665 665 struct v4l2_format *fmt; ··· 694 694 support memory capture. Trying to set the memory capture 695 695 parameters would be pointless. */ 696 696 if (err < 0) { 697 - dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %d\n", err); 697 + dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %ld\n", err); 698 698 mem_err = -1000; /* didn't even try */ 699 699 } else if (fmt->fmt.pix.pixelformat != 700 700 palette_to_pixelformat(pict->palette)) { ··· 711 711 support overlay. Trying to set the overlay parameters 712 712 would be quite pointless. */ 713 713 if (err < 0) { 714 - dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %d\n", err); 714 + dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %ld\n", err); 715 715 ovl_err = -1000; /* didn't even try */ 716 716 } else if (fbuf.fmt.pixelformat != 717 717 palette_to_pixelformat(pict->palette)) { ··· 736 736 return err; 737 737 } 738 738 739 - static noinline int v4l1_compat_get_tuner( 739 + static noinline long v4l1_compat_get_tuner( 740 740 struct video_tuner *tun, 741 741 struct file *file, 742 742 v4l2_kioctl drv) 743 743 { 744 - int err, i; 744 + long err; 745 + int i; 745 746 struct v4l2_tuner tun2; 746 747 struct v4l2_standard std2; 747 748 v4l2_std_id sid; ··· 750 749 memset(&tun2, 0, sizeof(tun2)); 751 750 err = drv(file, VIDIOC_G_TUNER, &tun2); 752 751 if (err < 0) { 753 - dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); 752 + dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %ld\n", err); 754 753 goto done; 755 754 } 756 755 memcpy(tun->name, tun2.name, ··· 776 775 777 776 err = drv(file, VIDIOC_G_STD, &sid); 778 777 if (err < 0) 779 - dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); 778 + dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %ld\n", err); 780 779 if (err == 0) { 781 780 if (sid & V4L2_STD_PAL) 782 781 tun->mode = VIDEO_MODE_PAL; ··· 795 794 return err; 796 795 } 797 796 798 - static noinline int v4l1_compat_select_tuner( 797 + static noinline long v4l1_compat_select_tuner( 799 798 struct video_tuner *tun, 800 799 struct file *file, 801 800 v4l2_kioctl drv) 802 801 { 803 - int err; 802 + long err; 804 803 struct v4l2_tuner t;/*84 bytes on x86_64*/ 805 804 memset(&t, 0, sizeof(t)); 806 805 ··· 808 807 809 808 err = drv(file, VIDIOC_S_INPUT, &t); 810 809 if (err < 0) 811 - dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); 810 + dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err); 812 811 return err; 813 812 } 814 813 815 - static noinline int v4l1_compat_get_frequency( 814 + static noinline long v4l1_compat_get_frequency( 816 815 unsigned long *freq, 817 816 struct file *file, 818 817 v4l2_kioctl drv) 819 818 { 820 - int err; 819 + long err; 821 820 struct v4l2_frequency freq2; 822 821 memset(&freq2, 0, sizeof(freq2)); 823 822 824 823 freq2.tuner = 0; 825 824 err = drv(file, VIDIOC_G_FREQUENCY, &freq2); 826 825 if (err < 0) 827 - dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); 826 + dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %ld\n", err); 828 827 if (0 == err) 829 828 *freq = freq2.frequency; 830 829 return err; 831 830 } 832 831 833 - static noinline int v4l1_compat_set_frequency( 832 + static noinline long v4l1_compat_set_frequency( 834 833 unsigned long *freq, 835 834 struct file *file, 836 835 v4l2_kioctl drv) 837 836 { 838 - int err; 837 + long err; 839 838 struct v4l2_frequency freq2; 840 839 memset(&freq2, 0, sizeof(freq2)); 841 840 ··· 843 842 freq2.frequency = *freq; 844 843 err = drv(file, VIDIOC_S_FREQUENCY, &freq2); 845 844 if (err < 0) 846 - dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); 845 + dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %ld\n", err); 847 846 return err; 848 847 } 849 848 850 - static noinline int v4l1_compat_get_audio( 849 + static noinline long v4l1_compat_get_audio( 851 850 struct video_audio *aud, 852 851 struct file *file, 853 852 v4l2_kioctl drv) 854 853 { 855 - int err, i; 854 + long err; 855 + int i; 856 856 struct v4l2_queryctrl qctrl2; 857 857 struct v4l2_audio aud2; 858 858 struct v4l2_tuner tun2; ··· 861 859 862 860 err = drv(file, VIDIOC_G_AUDIO, &aud2); 863 861 if (err < 0) { 864 - dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); 862 + dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %ld\n", err); 865 863 goto done; 866 864 } 867 865 memcpy(aud->name, aud2.name, ··· 905 903 memset(&tun2, 0, sizeof(tun2)); 906 904 err = drv(file, VIDIOC_G_TUNER, &tun2); 907 905 if (err < 0) { 908 - dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); 906 + dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %ld\n", err); 909 907 err = 0; 910 908 goto done; 911 909 } ··· 920 918 return err; 921 919 } 922 920 923 - static noinline int v4l1_compat_set_audio( 921 + static noinline long v4l1_compat_set_audio( 924 922 struct video_audio *aud, 925 923 struct file *file, 926 924 v4l2_kioctl drv) 927 925 { 928 - int err; 926 + long err; 929 927 struct v4l2_audio aud2; 930 928 struct v4l2_tuner tun2; 931 929 ··· 935 933 aud2.index = aud->audio; 936 934 err = drv(file, VIDIOC_S_AUDIO, &aud2); 937 935 if (err < 0) { 938 - dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); 936 + dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %ld\n", err); 939 937 goto done; 940 938 } 941 939 ··· 952 950 953 951 err = drv(file, VIDIOC_G_TUNER, &tun2); 954 952 if (err < 0) 955 - dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); 953 + dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %ld\n", err); 956 954 if (err == 0) { 957 955 switch (aud->mode) { 958 956 default: ··· 969 967 } 970 968 err = drv(file, VIDIOC_S_TUNER, &tun2); 971 969 if (err < 0) 972 - dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); 970 + dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %ld\n", err); 973 971 } 974 972 err = 0; 975 973 done: 976 974 return err; 977 975 } 978 976 979 - static noinline int v4l1_compat_capture_frame( 977 + static noinline long v4l1_compat_capture_frame( 980 978 struct video_mmap *mm, 981 979 struct file *file, 982 980 v4l2_kioctl drv) 983 981 { 984 - int err; 982 + long err; 985 983 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 986 984 struct v4l2_buffer buf; 987 985 struct v4l2_format *fmt; ··· 996 994 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 997 995 err = drv(file, VIDIOC_G_FMT, fmt); 998 996 if (err < 0) { 999 - dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); 997 + dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %ld\n", err); 1000 998 goto done; 1001 999 } 1002 1000 if (mm->width != fmt->fmt.pix.width || ··· 1012 1010 fmt->fmt.pix.bytesperline = 0; 1013 1011 err = drv(file, VIDIOC_S_FMT, fmt); 1014 1012 if (err < 0) { 1015 - dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); 1013 + dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %ld\n", err); 1016 1014 goto done; 1017 1015 } 1018 1016 } ··· 1020 1018 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1021 1019 err = drv(file, VIDIOC_QUERYBUF, &buf); 1022 1020 if (err < 0) { 1023 - dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); 1021 + dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %ld\n", err); 1024 1022 goto done; 1025 1023 } 1026 1024 err = drv(file, VIDIOC_QBUF, &buf); 1027 1025 if (err < 0) { 1028 - dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); 1026 + dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %ld\n", err); 1029 1027 goto done; 1030 1028 } 1031 1029 err = drv(file, VIDIOC_STREAMON, &captype); 1032 1030 if (err < 0) 1033 - dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); 1031 + dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %ld\n", err); 1034 1032 done: 1035 1033 kfree(fmt); 1036 1034 return err; 1037 1035 } 1038 1036 1039 - static noinline int v4l1_compat_sync( 1037 + static noinline long v4l1_compat_sync( 1040 1038 int *i, 1041 1039 struct file *file, 1042 1040 v4l2_kioctl drv) 1043 1041 { 1044 - int err; 1042 + long err; 1045 1043 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1046 1044 struct v4l2_buffer buf; 1047 1045 struct poll_wqueues *pwq; ··· 1052 1050 err = drv(file, VIDIOC_QUERYBUF, &buf); 1053 1051 if (err < 0) { 1054 1052 /* No such buffer */ 1055 - dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1053 + dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err); 1056 1054 goto done; 1057 1055 } 1058 1056 if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) { ··· 1064 1062 /* make sure capture actually runs so we don't block forever */ 1065 1063 err = drv(file, VIDIOC_STREAMON, &captype); 1066 1064 if (err < 0) { 1067 - dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); 1065 + dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %ld\n", err); 1068 1066 goto done; 1069 1067 } 1070 1068 ··· 1078 1076 break; 1079 1077 err = drv(file, VIDIOC_QUERYBUF, &buf); 1080 1078 if (err < 0) 1081 - dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1079 + dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err); 1082 1080 } 1083 1081 kfree(pwq); 1084 1082 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ ··· 1086 1084 do { 1087 1085 err = drv(file, VIDIOC_DQBUF, &buf); 1088 1086 if (err < 0) 1089 - dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); 1087 + dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %ld\n", err); 1090 1088 } while (err == 0 && buf.index != *i); 1091 1089 done: 1092 1090 return err; 1093 1091 } 1094 1092 1095 - static noinline int v4l1_compat_get_vbi_format( 1093 + static noinline long v4l1_compat_get_vbi_format( 1096 1094 struct vbi_format *fmt, 1097 1095 struct file *file, 1098 1096 v4l2_kioctl drv) 1099 1097 { 1100 - int err; 1098 + long err; 1101 1099 struct v4l2_format *fmt2; 1102 1100 1103 1101 fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL); ··· 1109 1107 1110 1108 err = drv(file, VIDIOC_G_FMT, fmt2); 1111 1109 if (err < 0) { 1112 - dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); 1110 + dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %ld\n", err); 1113 1111 goto done; 1114 1112 } 1115 1113 if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) { ··· 1130 1128 return err; 1131 1129 } 1132 1130 1133 - static noinline int v4l1_compat_set_vbi_format( 1131 + static noinline long v4l1_compat_set_vbi_format( 1134 1132 struct vbi_format *fmt, 1135 1133 struct file *file, 1136 1134 v4l2_kioctl drv) 1137 1135 { 1138 - int err; 1136 + long err; 1139 1137 struct v4l2_format *fmt2 = NULL; 1140 1138 1141 1139 if (VIDEO_PALETTE_RAW != fmt->sample_format) { ··· 1159 1157 fmt2->fmt.vbi.flags = fmt->flags; 1160 1158 err = drv(file, VIDIOC_TRY_FMT, fmt2); 1161 1159 if (err < 0) { 1162 - dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); 1160 + dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %ld\n", err); 1163 1161 goto done; 1164 1162 } 1165 1163 ··· 1176 1174 } 1177 1175 err = drv(file, VIDIOC_S_FMT, fmt2); 1178 1176 if (err < 0) 1179 - dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); 1177 + dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %ld\n", err); 1180 1178 done: 1181 1179 kfree(fmt2); 1182 1180 return err; ··· 1185 1183 /* 1186 1184 * This function is exported. 1187 1185 */ 1188 - int 1186 + long 1189 1187 v4l_compat_translate_ioctl(struct file *file, 1190 1188 int cmd, 1191 1189 void *arg, 1192 1190 v4l2_kioctl drv) 1193 1191 { 1194 - int err; 1192 + long err; 1195 1193 1196 1194 switch (cmd) { 1197 1195 case VIDIOCGCAP: /* capability */
+20 -9
drivers/media/video/v4l2-common.c
··· 797 797 } 798 798 EXPORT_SYMBOL(v4l2_ctrl_next); 799 799 800 - int v4l2_chip_match_host(u32 match_type, u32 match_chip) 800 + int v4l2_chip_match_host(const struct v4l2_dbg_match *match) 801 801 { 802 - switch (match_type) { 802 + switch (match->type) { 803 803 case V4L2_CHIP_MATCH_HOST: 804 - return match_chip == 0; 804 + return match->addr == 0; 805 805 default: 806 806 return 0; 807 807 } ··· 809 809 EXPORT_SYMBOL(v4l2_chip_match_host); 810 810 811 811 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE)) 812 - int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_chip) 812 + int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match) 813 813 { 814 - switch (match_type) { 814 + int len; 815 + 816 + if (c == NULL || match == NULL) 817 + return 0; 818 + 819 + switch (match->type) { 815 820 case V4L2_CHIP_MATCH_I2C_DRIVER: 816 - return (c != NULL && c->driver != NULL && c->driver->id == match_chip); 821 + if (c->driver == NULL || c->driver->driver.name == NULL) 822 + return 0; 823 + len = strlen(c->driver->driver.name); 824 + /* legacy drivers have a ' suffix, don't try to match that */ 825 + if (len && c->driver->driver.name[len - 1] == '\'') 826 + len--; 827 + return len && !strncmp(c->driver->driver.name, match->name, len); 817 828 case V4L2_CHIP_MATCH_I2C_ADDR: 818 - return (c != NULL && c->addr == match_chip); 829 + return c->addr == match->addr; 819 830 default: 820 831 return 0; 821 832 } 822 833 } 823 834 EXPORT_SYMBOL(v4l2_chip_match_i2c_client); 824 835 825 - int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, 836 + int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip, 826 837 u32 ident, u32 revision) 827 838 { 828 - if (!v4l2_chip_match_i2c_client(c, chip->match_type, chip->match_chip)) 839 + if (!v4l2_chip_match_i2c_client(c, &chip->match)) 829 840 return 0; 830 841 if (chip->ident == V4L2_IDENT_NONE) { 831 842 chip->ident = ident;
+12 -15
drivers/media/video/v4l2-compat-ioctl32.c
··· 222 222 223 223 #endif 224 224 225 - static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 225 + static long native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 226 226 { 227 - int ret = -ENOIOCTLCMD; 227 + long ret = -ENOIOCTLCMD; 228 228 229 229 if (file->f_op->unlocked_ioctl) 230 230 ret = file->f_op->unlocked_ioctl(file, cmd, arg); ··· 705 705 #define VIDIOC_G_OUTPUT32 _IOR ('V', 46, s32) 706 706 #define VIDIOC_S_OUTPUT32 _IOWR('V', 47, s32) 707 707 708 - static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 708 + static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 709 709 { 710 710 union { 711 711 #ifdef CONFIG_VIDEO_V4L1_COMPAT ··· 726 726 } karg; 727 727 void __user *up = compat_ptr(arg); 728 728 int compatible_arg = 1; 729 - int err = 0; 729 + long err = 0; 730 730 731 731 /* First, convert the command. */ 732 732 switch (cmd) { ··· 937 937 return err; 938 938 } 939 939 940 - long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) 940 + long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) 941 941 { 942 - int ret = -ENOIOCTLCMD; 942 + long ret = -ENOIOCTLCMD; 943 943 944 944 if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl) 945 945 return ret; ··· 1046 1046 case VIDIOC_TRY_ENCODER_CMD: 1047 1047 case VIDIOC_DBG_S_REGISTER: 1048 1048 case VIDIOC_DBG_G_REGISTER: 1049 - case VIDIOC_G_CHIP_IDENT: 1049 + case VIDIOC_DBG_G_CHIP_IDENT: 1050 + case VIDIOC_G_CHIP_IDENT_OLD: 1050 1051 case VIDIOC_S_HW_FREQ_SEEK: 1051 1052 ret = do_video_ioctl(file, cmd, arg); 1052 1053 break; ··· 1066 1065 break; 1067 1066 #endif 1068 1067 default: 1069 - v4l_print_ioctl("compat_ioctl32", cmd); 1070 - printk(KERN_CONT "\n"); 1068 + printk(KERN_WARNING "compat_ioctl32: " 1069 + "unknown ioctl '%c', dir=%d, #%d (0x%08x)\n", 1070 + _IOC_TYPE(cmd), _IOC_DIR(cmd), _IOC_NR(cmd), cmd); 1071 1071 break; 1072 1072 } 1073 1073 return ret; 1074 1074 } 1075 - #else 1076 - long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) 1077 - { 1078 - return -ENOIOCTLCMD; 1079 - } 1075 + EXPORT_SYMBOL_GPL(v4l2_compat_ioctl32); 1080 1076 #endif 1081 - EXPORT_SYMBOL_GPL(v4l_compat_ioctl32); 1082 1077 1083 1078 MODULE_LICENSE("GPL");
+6 -19
drivers/media/video/v4l2-dev.c
··· 31 31 32 32 #include <media/v4l2-common.h> 33 33 #include <media/v4l2-device.h> 34 + #include <media/v4l2-ioctl.h> 34 35 35 36 #define VIDEO_NUM_DEVICES 256 36 37 #define VIDEO_NAME "video4linux" ··· 183 182 return -ENOTTY; 184 183 /* Allow ioctl to continue even if the device was unregistered. 185 184 Things like dequeueing buffers might still be useful. */ 186 - return vdev->fops->ioctl(inode, filp, cmd, arg); 185 + return vdev->fops->ioctl(filp, cmd, arg); 187 186 } 188 187 189 188 static long v4l2_unlocked_ioctl(struct file *filp, ··· 197 196 Things like dequeueing buffers might still be useful. */ 198 197 return vdev->fops->unlocked_ioctl(filp, cmd, arg); 199 198 } 200 - 201 - #ifdef CONFIG_COMPAT 202 - static long v4l2_compat_ioctl(struct file *filp, 203 - unsigned int cmd, unsigned long arg) 204 - { 205 - struct video_device *vdev = video_devdata(filp); 206 - 207 - if (!vdev->fops->compat_ioctl) 208 - return -ENOIOCTLCMD; 209 - /* Allow ioctl to continue even if the device was unregistered. 210 - Things like dequeueing buffers might still be useful. */ 211 - return vdev->fops->compat_ioctl(filp, cmd, arg); 212 - } 213 - #endif 214 199 215 200 static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) 216 201 { ··· 226 239 /* and increase the device refcount */ 227 240 video_get(vdev); 228 241 mutex_unlock(&videodev_lock); 229 - ret = vdev->fops->open(inode, filp); 242 + ret = vdev->fops->open(filp); 230 243 /* decrease the refcount in case of an error */ 231 244 if (ret) 232 245 video_put(vdev); ··· 237 250 static int v4l2_release(struct inode *inode, struct file *filp) 238 251 { 239 252 struct video_device *vdev = video_devdata(filp); 240 - int ret = vdev->fops->release(inode, filp); 253 + int ret = vdev->fops->release(filp); 241 254 242 255 /* decrease the refcount unconditionally since the release() 243 256 return value is ignored. */ ··· 253 266 .mmap = v4l2_mmap, 254 267 .unlocked_ioctl = v4l2_unlocked_ioctl, 255 268 #ifdef CONFIG_COMPAT 256 - .compat_ioctl = v4l2_compat_ioctl, 269 + .compat_ioctl = v4l2_compat_ioctl32, 257 270 #endif 258 271 .release = v4l2_release, 259 272 .poll = v4l2_poll, ··· 268 281 .mmap = v4l2_mmap, 269 282 .ioctl = v4l2_ioctl, 270 283 #ifdef CONFIG_COMPAT 271 - .compat_ioctl = v4l2_compat_ioctl, 284 + .compat_ioctl = v4l2_compat_ioctl32, 272 285 #endif 273 286 .release = v4l2_release, 274 287 .poll = v4l2_poll,
+17 -19
drivers/media/video/v4l2-ioctl.c
··· 266 266 [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", 267 267 [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", 268 268 269 - [_IOC_NR(VIDIOC_G_CHIP_IDENT)] = "VIDIOC_G_CHIP_IDENT", 269 + [_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT", 270 270 [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK", 271 271 #endif 272 272 }; ··· 392 392 /* 393 393 * Obsolete usercopy function - Should be removed soon 394 394 */ 395 - int 395 + long 396 396 video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, 397 397 v4l2_kioctl func) 398 398 { 399 399 char sbuf[128]; 400 400 void *mbuf = NULL; 401 401 void *parg = NULL; 402 - int err = -EINVAL; 402 + long err = -EINVAL; 403 403 int is_ext_ctrl; 404 404 size_t ctrls_size = 0; 405 405 void __user *user_ptr = NULL; ··· 623 623 return -EINVAL; 624 624 } 625 625 626 - static int __video_do_ioctl(struct file *file, 626 + static long __video_do_ioctl(struct file *file, 627 627 unsigned int cmd, void *arg) 628 628 { 629 629 struct video_device *vfd = video_devdata(file); 630 630 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; 631 631 void *fh = file->private_data; 632 - int ret = -EINVAL; 632 + long ret = -EINVAL; 633 633 634 634 if ((vfd->debug & V4L2_DEBUG_IOCTL) && 635 635 !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { ··· 1720 1720 #ifdef CONFIG_VIDEO_ADV_DEBUG 1721 1721 case VIDIOC_DBG_G_REGISTER: 1722 1722 { 1723 - struct v4l2_register *p = arg; 1723 + struct v4l2_dbg_register *p = arg; 1724 1724 1725 1725 if (!capable(CAP_SYS_ADMIN)) 1726 1726 ret = -EPERM; ··· 1730 1730 } 1731 1731 case VIDIOC_DBG_S_REGISTER: 1732 1732 { 1733 - struct v4l2_register *p = arg; 1733 + struct v4l2_dbg_register *p = arg; 1734 1734 1735 1735 if (!capable(CAP_SYS_ADMIN)) 1736 1736 ret = -EPERM; ··· 1739 1739 break; 1740 1740 } 1741 1741 #endif 1742 - case VIDIOC_G_CHIP_IDENT: 1742 + case VIDIOC_DBG_G_CHIP_IDENT: 1743 1743 { 1744 - struct v4l2_chip_ident *p = arg; 1744 + struct v4l2_dbg_chip_ident *p = arg; 1745 1745 1746 1746 if (!ops->vidioc_g_chip_ident) 1747 1747 break; ··· 1750 1750 dbgarg(cmd, "chip_ident=%u, revision=0x%x\n", p->ident, p->revision); 1751 1751 break; 1752 1752 } 1753 + case VIDIOC_G_CHIP_IDENT_OLD: 1754 + printk(KERN_ERR "VIDIOC_G_CHIP_IDENT has been deprecated and will disappear in 2.6.30.\n"); 1755 + printk(KERN_ERR "It is a debugging ioctl and must not be used in applications!\n"); 1756 + return -EINVAL; 1757 + 1753 1758 case VIDIOC_S_HW_FREQ_SEEK: 1754 1759 { 1755 1760 struct v4l2_hw_freq_seek *p = arg; ··· 1850 1845 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { 1851 1846 if (ret < 0) { 1852 1847 v4l_print_ioctl(vfd->name, cmd); 1853 - printk(KERN_CONT " error %d\n", ret); 1848 + printk(KERN_CONT " error %ld\n", ret); 1854 1849 } 1855 1850 } 1856 1851 1857 1852 return ret; 1858 1853 } 1859 1854 1860 - long __video_ioctl2(struct file *file, 1855 + long video_ioctl2(struct file *file, 1861 1856 unsigned int cmd, unsigned long arg) 1862 1857 { 1863 1858 char sbuf[128]; 1864 1859 void *mbuf = NULL; 1865 1860 void *parg = NULL; 1866 - int err = -EINVAL; 1861 + long err = -EINVAL; 1867 1862 int is_ext_ctrl; 1868 1863 size_t ctrls_size = 0; 1869 1864 void __user *user_ptr = NULL; ··· 1948 1943 out: 1949 1944 kfree(mbuf); 1950 1945 return err; 1951 - } 1952 - EXPORT_SYMBOL(__video_ioctl2); 1953 - 1954 - int video_ioctl2(struct inode *inode, struct file *file, 1955 - unsigned int cmd, unsigned long arg) 1956 - { 1957 - return __video_ioctl2(file, cmd, arg); 1958 1946 } 1959 1947 EXPORT_SYMBOL(video_ioctl2);
+1 -1
drivers/media/video/v4l2-subdev.c
··· 37 37 return v4l2_subdev_call(sd, core, queryctrl, arg); 38 38 case VIDIOC_LOG_STATUS: 39 39 return v4l2_subdev_call(sd, core, log_status); 40 - case VIDIOC_G_CHIP_IDENT: 40 + case VIDIOC_DBG_G_CHIP_IDENT: 41 41 return v4l2_subdev_call(sd, core, g_chip_ident, arg); 42 42 case VIDIOC_INT_S_STANDBY: 43 43 return v4l2_subdev_call(sd, core, s_standby, arg ? (*(u32 *)arg) : 0);
+6 -7
drivers/media/video/vino.c
··· 4019 4019 4020 4020 /* File operations */ 4021 4021 4022 - static int vino_open(struct inode *inode, struct file *file) 4022 + static int vino_open(struct file *file) 4023 4023 { 4024 4024 struct vino_channel_settings *vcs = video_drvdata(file); 4025 4025 int ret = 0; ··· 4050 4050 return ret; 4051 4051 } 4052 4052 4053 - static int vino_close(struct inode *inode, struct file *file) 4053 + static int vino_close(struct file *file) 4054 4054 { 4055 4055 struct vino_channel_settings *vcs = video_drvdata(file); 4056 4056 dprintk("close():\n"); ··· 4237 4237 return ret; 4238 4238 } 4239 4239 4240 - static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg) 4240 + static long vino_do_ioctl(struct file *file, unsigned int cmd, void *arg) 4241 4241 { 4242 4242 struct vino_channel_settings *vcs = video_drvdata(file); 4243 4243 ··· 4343 4343 return 0; 4344 4344 } 4345 4345 4346 - static int vino_ioctl(struct inode *inode, struct file *file, 4346 + static long vino_ioctl(struct file *file, 4347 4347 unsigned int cmd, unsigned long arg) 4348 4348 { 4349 4349 struct vino_channel_settings *vcs = video_drvdata(file); 4350 - int ret; 4350 + long ret; 4351 4351 4352 4352 if (mutex_lock_interruptible(&vcs->mutex)) 4353 4353 return -EINTR; ··· 4364 4364 /* __initdata */ 4365 4365 static int vino_init_stage; 4366 4366 4367 - static const struct file_operations vino_fops = { 4367 + static const struct v4l2_file_operations vino_fops = { 4368 4368 .owner = THIS_MODULE, 4369 4369 .open = vino_open, 4370 4370 .release = vino_close, 4371 4371 .ioctl = vino_ioctl, 4372 4372 .mmap = vino_mmap, 4373 4373 .poll = vino_poll, 4374 - .llseek = no_llseek, 4375 4374 }; 4376 4375 4377 4376 static struct video_device v4l_device_template = {
+5 -7
drivers/media/video/vivi.c
··· 1024 1024 File operations for the device 1025 1025 ------------------------------------------------------------------*/ 1026 1026 1027 - static int vivi_open(struct inode *inode, struct file *file) 1027 + static int vivi_open(struct file *file) 1028 1028 { 1029 - int minor = iminor(inode); 1029 + int minor = video_devdata(file)->minor; 1030 1030 struct vivi_dev *dev; 1031 1031 struct vivi_fh *fh = NULL; 1032 1032 int i; ··· 1127 1127 return videobuf_poll_stream(file, q, wait); 1128 1128 } 1129 1129 1130 - static int vivi_close(struct inode *inode, struct file *file) 1130 + static int vivi_close(struct file *file) 1131 1131 { 1132 1132 struct vivi_fh *fh = file->private_data; 1133 1133 struct vivi_dev *dev = fh->dev; 1134 1134 struct vivi_dmaqueue *vidq = &dev->vidq; 1135 1135 1136 - int minor = iminor(inode); 1136 + int minor = video_devdata(file)->minor; 1137 1137 1138 1138 vivi_stop_thread(vidq); 1139 1139 videobuf_stop(&fh->vb_vidq); ··· 1195 1195 return ret; 1196 1196 } 1197 1197 1198 - static const struct file_operations vivi_fops = { 1198 + static const struct v4l2_file_operations vivi_fops = { 1199 1199 .owner = THIS_MODULE, 1200 1200 .open = vivi_open, 1201 1201 .release = vivi_close, 1202 1202 .read = vivi_read, 1203 1203 .poll = vivi_poll, 1204 1204 .ioctl = video_ioctl2, /* V4L2 ioctl handler */ 1205 - .compat_ioctl = v4l_compat_ioctl32, 1206 1205 .mmap = vivi_mmap, 1207 - .llseek = no_llseek, 1208 1206 }; 1209 1207 1210 1208 static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
+1 -1
drivers/media/video/vp27smpx.c
··· 113 113 return 0; 114 114 } 115 115 116 - static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 116 + static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 117 117 { 118 118 struct i2c_client *client = v4l2_get_subdevdata(sd); 119 119
+6 -10
drivers/media/video/w9966.c
··· 180 180 static int w9966_i2c_rbyte(struct w9966_dev* cam); 181 181 #endif 182 182 183 - static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 183 + static long w9966_v4l_ioctl(struct file *file, 184 184 unsigned int cmd, unsigned long arg); 185 185 static ssize_t w9966_v4l_read(struct file *file, char __user *buf, 186 186 size_t count, loff_t *ppos); 187 187 188 - static int w9966_exclusive_open(struct inode *inode, struct file *file) 188 + static int w9966_exclusive_open(struct file *file) 189 189 { 190 190 struct w9966_dev *cam = video_drvdata(file); 191 191 192 192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; 193 193 } 194 194 195 - static int w9966_exclusive_release(struct inode *inode, struct file *file) 195 + static int w9966_exclusive_release(struct file *file) 196 196 { 197 197 struct w9966_dev *cam = video_drvdata(file); 198 198 ··· 200 200 return 0; 201 201 } 202 202 203 - static const struct file_operations w9966_fops = { 203 + static const struct v4l2_file_operations w9966_fops = { 204 204 .owner = THIS_MODULE, 205 205 .open = w9966_exclusive_open, 206 206 .release = w9966_exclusive_release, 207 207 .ioctl = w9966_v4l_ioctl, 208 - #ifdef CONFIG_COMPAT 209 - .compat_ioctl = v4l_compat_ioctl32, 210 - #endif 211 208 .read = w9966_v4l_read, 212 - .llseek = no_llseek, 213 209 }; 214 210 static struct video_device w9966_template = { 215 211 .name = W9966_DRIVERNAME, ··· 723 727 * Video4linux interfacing 724 728 */ 725 729 726 - static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 730 + static long w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg) 727 731 { 728 732 struct w9966_dev *cam = video_drvdata(file); 729 733 ··· 873 877 return 0; 874 878 } 875 879 876 - static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 880 + static long w9966_v4l_ioctl(struct file *file, 877 881 unsigned int cmd, unsigned long arg) 878 882 { 879 883 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl);
+16 -20
drivers/media/video/w9968cf.c
··· 399 399 ****************************************************************************/ 400 400 401 401 /* Video4linux interface */ 402 - static const struct file_operations w9968cf_fops; 403 - static int w9968cf_open(struct inode*, struct file*); 404 - static int w9968cf_release(struct inode*, struct file*); 405 - static int w9968cf_mmap(struct file*, struct vm_area_struct*); 406 - static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long); 407 - static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*); 408 - static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int, 402 + static const struct v4l2_file_operations w9968cf_fops; 403 + static int w9968cf_open(struct file *); 404 + static int w9968cf_release(struct file *); 405 + static int w9968cf_mmap(struct file *, struct vm_area_struct *); 406 + static long w9968cf_ioctl(struct file *, unsigned, unsigned long); 407 + static ssize_t w9968cf_read(struct file *, char __user *, size_t, loff_t *); 408 + static long w9968cf_v4l_ioctl(struct file *, unsigned int, 409 409 void __user *); 410 410 411 411 /* USB-specific */ ··· 2662 2662 * Video4Linux interface * 2663 2663 ****************************************************************************/ 2664 2664 2665 - static int w9968cf_open(struct inode* inode, struct file* filp) 2665 + static int w9968cf_open(struct file *filp) 2666 2666 { 2667 2667 struct w9968cf_device* cam; 2668 2668 int err; ··· 2748 2748 } 2749 2749 2750 2750 2751 - static int w9968cf_release(struct inode* inode, struct file* filp) 2751 + static int w9968cf_release(struct file *filp) 2752 2752 { 2753 2753 struct w9968cf_device* cam; 2754 2754 ··· 2885 2885 } 2886 2886 2887 2887 2888 - static int 2889 - w9968cf_ioctl(struct inode* inode, struct file* filp, 2888 + static long 2889 + w9968cf_ioctl(struct file *filp, 2890 2890 unsigned int cmd, unsigned long arg) 2891 2891 { 2892 2892 struct w9968cf_device* cam; 2893 - int err; 2893 + long err; 2894 2894 2895 2895 cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp)); 2896 2896 ··· 2909 2909 return -EIO; 2910 2910 } 2911 2911 2912 - err = w9968cf_v4l_ioctl(inode, filp, cmd, (void __user *)arg); 2912 + err = w9968cf_v4l_ioctl(filp, cmd, (void __user *)arg); 2913 2913 2914 2914 mutex_unlock(&cam->fileop_mutex); 2915 2915 return err; 2916 2916 } 2917 2917 2918 2918 2919 - static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp, 2920 - unsigned int cmd, void __user * arg) 2919 + static long w9968cf_v4l_ioctl(struct file *filp, 2920 + unsigned int cmd, void __user *arg) 2921 2921 { 2922 2922 struct w9968cf_device* cam; 2923 2923 const char* v4l1_ioctls[] = { ··· 3456 3456 } 3457 3457 3458 3458 3459 - static const struct file_operations w9968cf_fops = { 3459 + static const struct v4l2_file_operations w9968cf_fops = { 3460 3460 .owner = THIS_MODULE, 3461 3461 .open = w9968cf_open, 3462 3462 .release = w9968cf_release, 3463 3463 .read = w9968cf_read, 3464 3464 .ioctl = w9968cf_ioctl, 3465 - #ifdef CONFIG_COMPAT 3466 - .compat_ioctl = v4l_compat_ioctl32, 3467 - #endif 3468 3465 .mmap = w9968cf_mmap, 3469 - .llseek = no_llseek, 3470 3466 }; 3471 3467 3472 3468
+1 -1
drivers/media/video/wm8739.c
··· 233 233 return -EINVAL; 234 234 } 235 235 236 - static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 236 + static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 237 237 { 238 238 struct i2c_client *client = v4l2_get_subdevdata(sd); 239 239
+1 -1
drivers/media/video/wm8775.c
··· 130 130 return 0; 131 131 } 132 132 133 - static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip) 133 + static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) 134 134 { 135 135 struct i2c_client *client = v4l2_get_subdevdata(sd); 136 136
+7 -11
drivers/media/video/zc0301/zc0301_core.c
··· 649 649 } 650 650 651 651 652 - static int zc0301_open(struct inode* inode, struct file* filp) 652 + static int zc0301_open(struct file *filp) 653 653 { 654 654 struct zc0301_device* cam; 655 655 int err = 0; ··· 733 733 } 734 734 735 735 736 - static int zc0301_release(struct inode* inode, struct file* filp) 736 + static int zc0301_release(struct file *filp) 737 737 { 738 738 struct zc0301_device* cam; 739 739 ··· 1793 1793 } 1794 1794 1795 1795 1796 - static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, 1797 - unsigned int cmd, void __user * arg) 1796 + static long zc0301_ioctl_v4l2(struct file *filp, 1797 + unsigned int cmd, void __user *arg) 1798 1798 { 1799 1799 struct zc0301_device *cam = video_drvdata(filp); 1800 1800 ··· 1888 1888 } 1889 1889 1890 1890 1891 - static int zc0301_ioctl(struct inode* inode, struct file* filp, 1891 + static long zc0301_ioctl(struct file *filp, 1892 1892 unsigned int cmd, unsigned long arg) 1893 1893 { 1894 1894 struct zc0301_device *cam = video_drvdata(filp); ··· 1912 1912 1913 1913 V4LDBG(3, "zc0301", cmd); 1914 1914 1915 - err = zc0301_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 1915 + err = zc0301_ioctl_v4l2(filp, cmd, (void __user *)arg); 1916 1916 1917 1917 mutex_unlock(&cam->fileop_mutex); 1918 1918 ··· 1920 1920 } 1921 1921 1922 1922 1923 - static const struct file_operations zc0301_fops = { 1923 + static const struct v4l2_file_operations zc0301_fops = { 1924 1924 .owner = THIS_MODULE, 1925 1925 .open = zc0301_open, 1926 1926 .release = zc0301_release, 1927 1927 .ioctl = zc0301_ioctl, 1928 - #ifdef CONFIG_COMPAT 1929 - .compat_ioctl = v4l_compat_ioctl32, 1930 - #endif 1931 1928 .read = zc0301_read, 1932 1929 .poll = zc0301_poll, 1933 1930 .mmap = zc0301_mmap, 1934 - .llseek = no_llseek, 1935 1931 }; 1936 1932 1937 1933 /*****************************************************************************/
+9 -16
drivers/media/video/zoran/zoran_driver.c
··· 1197 1197 */ 1198 1198 1199 1199 static int 1200 - zoran_open (struct inode *inode, 1201 - struct file *file) 1200 + zoran_open(struct file *file) 1202 1201 { 1203 - unsigned int minor = iminor(inode); 1202 + unsigned int minor = video_devdata(file)->minor; 1204 1203 struct zoran *zr = NULL; 1205 1204 struct zoran_fh *fh; 1206 1205 int i, res, first_open = 0, have_module_locks = 0; ··· 1339 1340 } 1340 1341 1341 1342 static int 1342 - zoran_close (struct inode *inode, 1343 - struct file *file) 1343 + zoran_close(struct file *file) 1344 1344 { 1345 1345 struct zoran_fh *fh = file->private_data; 1346 1346 struct zoran *zr = fh->zr; ··· 1938 1940 * ioctl routine 1939 1941 */ 1940 1942 1941 - static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1943 + static long zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg) 1942 1944 { 1943 1945 struct zoran_fh *fh = file->private_data; 1944 1946 struct zoran *zr = fh->zr; ··· 4189 4191 } 4190 4192 4191 4193 4192 - static int 4193 - zoran_ioctl (struct inode *inode, 4194 - struct file *file, 4195 - unsigned int cmd, 4196 - unsigned long arg) 4194 + static long 4195 + zoran_ioctl(struct file *file, 4196 + unsigned int cmd, 4197 + unsigned long arg) 4197 4198 { 4198 4199 return video_usercopy(file, cmd, arg, zoran_do_ioctl); 4199 4200 } ··· 4617 4620 return 0; 4618 4621 } 4619 4622 4620 - static const struct file_operations zoran_fops = { 4623 + static const struct v4l2_file_operations zoran_fops = { 4621 4624 .owner = THIS_MODULE, 4622 4625 .open = zoran_open, 4623 4626 .release = zoran_close, 4624 4627 .ioctl = zoran_ioctl, 4625 - #ifdef CONFIG_COMPAT 4626 - .compat_ioctl = v4l_compat_ioctl32, 4627 - #endif 4628 - .llseek = no_llseek, 4629 4628 .read = zoran_read, 4630 4629 .write = zoran_write, 4631 4630 .mmap = zoran_mmap,
+3 -5
drivers/media/video/zr364xx.c
··· 634 634 635 635 636 636 /* open the camera */ 637 - static int zr364xx_open(struct inode *inode, struct file *file) 637 + static int zr364xx_open(struct file *file) 638 638 { 639 639 struct video_device *vdev = video_devdata(file); 640 640 struct zr364xx_camera *cam = video_get_drvdata(vdev); ··· 688 688 689 689 690 690 /* release the camera */ 691 - static int zr364xx_release(struct inode *inode, struct file *file) 691 + static int zr364xx_release(struct file *file) 692 692 { 693 693 struct video_device *vdev = video_devdata(file); 694 694 struct zr364xx_camera *cam; ··· 761 761 } 762 762 763 763 764 - static const struct file_operations zr364xx_fops = { 764 + static const struct v4l2_file_operations zr364xx_fops = { 765 765 .owner = THIS_MODULE, 766 766 .open = zr364xx_open, 767 767 .release = zr364xx_release, 768 768 .read = zr364xx_read, 769 769 .mmap = zr364xx_mmap, 770 770 .ioctl = video_ioctl2, 771 - .llseek = no_llseek, 772 771 }; 773 772 774 773 static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = { ··· 893 894 { 894 895 struct zr364xx_camera *cam = usb_get_intfdata(intf); 895 896 usb_set_intfdata(intf, NULL); 896 - dev_set_drvdata(&intf->dev, NULL); 897 897 dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n"); 898 898 if (cam->vdev) 899 899 video_unregister_device(cam->vdev);
+14 -13
include/linux/dvb/frontend.h
··· 62 62 FE_CAN_HIERARCHY_AUTO = 0x100000, 63 63 FE_CAN_8VSB = 0x200000, 64 64 FE_CAN_16VSB = 0x400000, 65 - FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this. 66 - FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) 67 - FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically 68 - FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output 65 + FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ 66 + FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ 67 + FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ 68 + FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ 69 + FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ 69 70 } fe_caps_t; 70 71 71 72 ··· 122 121 123 122 124 123 typedef enum fe_status { 125 - FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ 126 - FE_HAS_CARRIER = 0x02, /* found a DVB signal */ 127 - FE_HAS_VITERBI = 0x04, /* FEC is stable */ 128 - FE_HAS_SYNC = 0x08, /* found sync bytes */ 129 - FE_HAS_LOCK = 0x10, /* everything's working... */ 130 - FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ 131 - FE_REINIT = 0x40 /* frontend was reinitialized, */ 132 - } fe_status_t; /* application is recommended to reset */ 133 - /* DiSEqC, tone and parameters */ 124 + FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ 125 + FE_HAS_CARRIER = 0x02, /* found a DVB signal */ 126 + FE_HAS_VITERBI = 0x04, /* FEC is stable */ 127 + FE_HAS_SYNC = 0x08, /* found sync bytes */ 128 + FE_HAS_LOCK = 0x10, /* everything's working... */ 129 + FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ 130 + FE_REINIT = 0x40 /* frontend was reinitialized, */ 131 + } fe_status_t; /* application is recommended to reset */ 132 + /* DiSEqC, tone and parameters */ 134 133 135 134 typedef enum fe_spectral_inversion { 136 135 INVERSION_OFF,
+39 -14
include/linux/videodev2.h
··· 1370 1370 /* 1371 1371 * A D V A N C E D D E B U G G I N G 1372 1372 * 1373 - * NOTE: EXPERIMENTAL API 1373 + * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! 1374 + * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY! 1374 1375 */ 1375 1376 1376 1377 /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ 1377 1378 1378 1379 #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ 1379 - #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ 1380 + #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ 1380 1381 #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ 1381 1382 #define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ 1382 1383 1383 - struct v4l2_register { 1384 - __u32 match_type; /* Match type */ 1385 - __u32 match_chip; /* Match this chip, meaning determined by match_type */ 1384 + struct v4l2_dbg_match { 1385 + __u32 type; /* Match type */ 1386 + union { /* Match this chip, meaning determined by type */ 1387 + __u32 addr; 1388 + char name[32]; 1389 + }; 1390 + } __attribute__ ((packed)); 1391 + 1392 + struct v4l2_dbg_register { 1393 + struct v4l2_dbg_match match; 1394 + __u32 size; /* register size in bytes */ 1386 1395 __u64 reg; 1387 1396 __u64 val; 1388 - }; 1397 + } __attribute__ ((packed)); 1389 1398 1390 - /* VIDIOC_G_CHIP_IDENT */ 1391 - struct v4l2_chip_ident { 1399 + /* VIDIOC_DBG_G_CHIP_IDENT */ 1400 + struct v4l2_dbg_chip_ident { 1401 + struct v4l2_dbg_match match; 1402 + __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ 1403 + __u32 revision; /* chip revision, chip specific */ 1404 + } __attribute__ ((packed)); 1405 + 1406 + /* VIDIOC_G_CHIP_IDENT_OLD: Deprecated, do not use */ 1407 + struct v4l2_chip_ident_old { 1392 1408 __u32 match_type; /* Match type */ 1393 1409 __u32 match_chip; /* Match this chip, meaning determined by match_type */ 1394 1410 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ ··· 1476 1460 #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) 1477 1461 #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) 1478 1462 #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) 1479 - 1480 - /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ 1481 - #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) 1482 - #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) 1483 - 1484 - #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) 1485 1463 #endif 1464 + 1465 + #if 1 1466 + /* Experimental, meant for debugging, testing and internal use. 1467 + Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. 1468 + You must be root to use these ioctls. Never use these in applications! */ 1469 + #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) 1470 + #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) 1471 + 1472 + /* Experimental, meant for debugging, testing and internal use. 1473 + Never use this ioctl in applications! */ 1474 + #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) 1475 + /* This is deprecated and will go away in 2.6.30 */ 1476 + #define VIDIOC_G_CHIP_IDENT_OLD _IOWR('V', 81, struct v4l2_chip_ident_old) 1477 + #endif 1478 + 1486 1479 #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) 1487 1480 /* Reminder: when adding new ioctls please add support for them to 1488 1481 drivers/media/video/v4l2-compat-ioctl32.c as well! */
+3 -3
include/media/saa7146_vv.h
··· 177 177 int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); 178 178 179 179 struct saa7146_extension_ioctls *ioctls; 180 - int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); 180 + long (*ioctl)(struct saa7146_fh *, unsigned int cmd, void *arg); 181 181 182 - struct file_operations vbi_fops; 182 + struct v4l2_file_operations vbi_fops; 183 183 }; 184 184 185 185 struct saa7146_use_ops { ··· 216 216 extern struct saa7146_use_ops saa7146_video_uops; 217 217 int saa7146_start_preview(struct saa7146_fh *fh); 218 218 int saa7146_stop_preview(struct saa7146_fh *fh); 219 - int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 219 + long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 220 220 221 221 /* from saa7146_vbi.c */ 222 222 extern struct saa7146_use_ops saa7146_vbi_uops;
+3 -3
include/media/soc_camera.h
··· 164 164 unsigned long (*query_bus_param)(struct soc_camera_device *); 165 165 int (*set_bus_param)(struct soc_camera_device *, unsigned long); 166 166 int (*get_chip_id)(struct soc_camera_device *, 167 - struct v4l2_chip_ident *); 167 + struct v4l2_dbg_chip_ident *); 168 168 int (*set_std)(struct soc_camera_device *, v4l2_std_id *); 169 169 int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); 170 170 #ifdef CONFIG_VIDEO_ADV_DEBUG 171 - int (*get_register)(struct soc_camera_device *, struct v4l2_register *); 172 - int (*set_register)(struct soc_camera_device *, struct v4l2_register *); 171 + int (*get_register)(struct soc_camera_device *, struct v4l2_dbg_register *); 172 + int (*set_register)(struct soc_camera_device *, struct v4l2_dbg_register *); 173 173 #endif 174 174 int (*get_control)(struct soc_camera_device *, struct v4l2_control *); 175 175 int (*set_control)(struct soc_camera_device *, struct v4l2_control *);
+2 -2
include/media/v4l2-chip-ident.h
··· 2 2 v4l2 chip identifiers header 3 3 4 4 This header provides a list of chip identifiers that can be returned 5 - through the VIDIOC_G_CHIP_IDENT ioctl. 5 + through the VIDIOC_DBG_G_CHIP_IDENT ioctl. 6 6 7 7 Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> 8 8 ··· 24 24 #ifndef V4L2_CHIP_IDENT_H_ 25 25 #define V4L2_CHIP_IDENT_H_ 26 26 27 - /* VIDIOC_G_CHIP_IDENT: identifies the actual chip installed on the board */ 27 + /* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */ 28 28 enum { 29 29 /* general idents: reserved range 0-49 */ 30 30 V4L2_IDENT_NONE = 0, /* No chip matched */
+3 -3
include/media/v4l2-common.h
··· 114 114 /* Register/chip ident helper function */ 115 115 116 116 struct i2c_client; /* forward reference */ 117 - int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 id_type, u32 chip_id); 118 - int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, 117 + int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match); 118 + int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip, 119 119 u32 ident, u32 revision); 120 - int v4l2_chip_match_host(u32 id_type, u32 chip_id); 120 + int v4l2_chip_match_host(const struct v4l2_dbg_match *match); 121 121 122 122 /* ------------------------------------------------------------------------- */ 123 123
+14 -1
include/media/v4l2-dev.h
··· 25 25 #define VFL_TYPE_MAX 4 26 26 27 27 struct v4l2_ioctl_callbacks; 28 + struct video_device; 28 29 struct v4l2_device; 29 30 30 31 /* Flag to mark the video_device struct as unregistered. 31 32 Drivers can set this flag if they want to block all future 32 33 device access. It is set by video_unregister_device. */ 33 34 #define V4L2_FL_UNREGISTERED (0) 35 + 36 + struct v4l2_file_operations { 37 + struct module *owner; 38 + ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 39 + ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 40 + unsigned int (*poll) (struct file *, struct poll_table_struct *); 41 + long (*ioctl) (struct file *, unsigned int, unsigned long); 42 + long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 43 + int (*mmap) (struct file *, struct vm_area_struct *); 44 + int (*open) (struct file *); 45 + int (*release) (struct file *); 46 + }; 34 47 35 48 /* 36 49 * Newer version of video_device, handled by videodev2.c ··· 54 41 struct video_device 55 42 { 56 43 /* device ops */ 57 - const struct file_operations *fops; 44 + const struct v4l2_file_operations *fops; 58 45 59 46 /* sysfs */ 60 47 struct device dev; /* v4l device */
+1 -1
include/media/v4l2-device.h
··· 80 80 #define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \ 81 81 ({ \ 82 82 struct v4l2_subdev *sd; \ 83 - int err = 0; \ 83 + long err = 0; \ 84 84 \ 85 85 list_for_each_entry(sd, &(dev)->subdevs, list) { \ 86 86 if ((cond) && sd->ops->o && sd->ops->o->f) \
+1 -1
include/media/v4l2-int-device.h
··· 219 219 vidioc_int_reset_num, 220 220 /* VIDIOC_INT_INIT */ 221 221 vidioc_int_init_num, 222 - /* VIDIOC_INT_G_CHIP_IDENT */ 222 + /* VIDIOC_DBG_G_CHIP_IDENT */ 223 223 vidioc_int_g_chip_ident_num, 224 224 225 225 /*
+11 -20
include/media/v4l2-ioctl.h
··· 225 225 /* Debugging ioctls */ 226 226 #ifdef CONFIG_VIDEO_ADV_DEBUG 227 227 int (*vidioc_g_register) (struct file *file, void *fh, 228 - struct v4l2_register *reg); 228 + struct v4l2_dbg_register *reg); 229 229 int (*vidioc_s_register) (struct file *file, void *fh, 230 - struct v4l2_register *reg); 230 + struct v4l2_dbg_register *reg); 231 231 #endif 232 232 int (*vidioc_g_chip_ident) (struct file *file, void *fh, 233 - struct v4l2_chip_ident *chip); 233 + struct v4l2_dbg_chip_ident *chip); 234 234 235 235 int (*vidioc_enum_framesizes) (struct file *file, void *fh, 236 236 struct v4l2_frmsizeenum *fsize); ··· 239 239 struct v4l2_frmivalenum *fival); 240 240 241 241 /* For other private ioctls */ 242 - int (*vidioc_default) (struct file *file, void *fh, 242 + long (*vidioc_default) (struct file *file, void *fh, 243 243 int cmd, void *arg); 244 244 }; 245 245 ··· 277 277 extern const char *v4l2_type_names[]; 278 278 279 279 /* Compatibility layer interface -- v4l1-compat module */ 280 - typedef int (*v4l2_kioctl)(struct file *file, 280 + typedef long (*v4l2_kioctl)(struct file *file, 281 281 unsigned int cmd, void *arg); 282 282 #ifdef CONFIG_VIDEO_V4L1_COMPAT 283 - int v4l_compat_translate_ioctl(struct file *file, 283 + long v4l_compat_translate_ioctl(struct file *file, 284 284 int cmd, void *arg, v4l2_kioctl driver_ioctl); 285 285 #else 286 286 #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) 287 287 #endif 288 288 289 + #ifdef CONFIG_COMPAT 289 290 /* 32 Bits compatibility layer for 64 bits processors */ 290 - extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 291 + extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, 291 292 unsigned long arg); 293 + #endif 292 294 293 295 /* Include support for obsoleted stuff */ 294 - extern int video_usercopy(struct file *file, unsigned int cmd, 296 + extern long video_usercopy(struct file *file, unsigned int cmd, 295 297 unsigned long arg, v4l2_kioctl func); 296 298 297 299 /* Standard handlers for V4L ioctl's */ 298 - 299 - /* This prototype is used on fops.unlocked_ioctl */ 300 - extern long __video_ioctl2(struct file *file, 301 - unsigned int cmd, unsigned long arg); 302 - 303 - /* This prototype is used on fops.ioctl 304 - * Since fops.ioctl enables Kernel Big Lock, it is preferred 305 - * to use __video_ioctl2 instead. 306 - * It should be noticed that there's no lock code inside 307 - * video_ioctl2(). 308 - */ 309 - extern int video_ioctl2(struct inode *inode, struct file *file, 300 + extern long video_ioctl2(struct file *file, 310 301 unsigned int cmd, unsigned long arg); 311 302 312 303 #endif /* _V4L2_IOCTL_H */
+4 -4
include/media/v4l2-subdev.h
··· 69 69 not yet implemented) since ops provide proper type-checking. 70 70 */ 71 71 struct v4l2_subdev_core_ops { 72 - int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip); 72 + int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 73 73 int (*log_status)(struct v4l2_subdev *sd); 74 74 int (*init)(struct v4l2_subdev *sd, u32 val); 75 75 int (*s_standby)(struct v4l2_subdev *sd, u32 standby); ··· 79 79 int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); 80 80 int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); 81 81 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); 82 - int (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); 82 + long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); 83 83 #ifdef CONFIG_VIDEO_ADV_DEBUG 84 - int (*g_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); 85 - int (*s_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); 84 + int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); 85 + int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); 86 86 #endif 87 87 }; 88 88
+1 -1
include/sound/tea575x-tuner.h
··· 36 36 struct snd_tea575x { 37 37 struct snd_card *card; 38 38 struct video_device vd; /* video device */ 39 - struct file_operations fops; 39 + struct v4l2_file_operations fops; 40 40 int dev_nr; /* requested device number + 1 */ 41 41 int vd_registered; /* video device is registered */ 42 42 int tea5759; /* 5759 chip is present */
+3 -3
sound/i2c/other/tea575x-tuner.c
··· 84 84 * Linux Video interface 85 85 */ 86 86 87 - static int snd_tea575x_ioctl(struct inode *inode, struct file *file, 87 + static long snd_tea575x_ioctl(struct file *file, 88 88 unsigned int cmd, unsigned long data) 89 89 { 90 90 struct snd_tea575x *tea = video_drvdata(file); ··· 174 174 { 175 175 } 176 176 177 - static int snd_tea575x_exclusive_open(struct inode *inode, struct file *file) 177 + static int snd_tea575x_exclusive_open(struct file *file) 178 178 { 179 179 struct snd_tea575x *tea = video_drvdata(file); 180 180 181 181 return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0; 182 182 } 183 183 184 - static int snd_tea575x_exclusive_release(struct inode *inode, struct file *file) 184 + static int snd_tea575x_exclusive_release(struct file *file) 185 185 { 186 186 struct snd_tea575x *tea = video_drvdata(file); 187 187