]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Jan 2009 20:02:18 +0000 (12:02 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Jan 2009 20:02:18 +0000 (12:02 -0800)
* '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
  ...

157 files changed:
Documentation/video4linux/CARDLIST.saa7134
Documentation/video4linux/si470x.txt
Documentation/video4linux/v4l2-framework.txt
drivers/media/common/saa7146_fops.c
drivers/media/common/saa7146_video.c
drivers/media/common/tuners/tuner-simple.c
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/dvb/dvb-usb/gp8psk.c
drivers/media/dvb/frontends/cx24116.c
drivers/media/dvb/frontends/cx24116.h
drivers/media/dvb/frontends/stb0899_drv.c
drivers/media/dvb/frontends/zl10353.c
drivers/media/dvb/siano/sms-cards.c
drivers/media/dvb/ttpci/av7110_v4l.c
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttusb-budget/Kconfig
drivers/media/dvb/ttusb-dec/Kconfig
drivers/media/radio/Kconfig
drivers/media/radio/Makefile
drivers/media/radio/dsbr100.c
drivers/media/radio/radio-aimslab.c
drivers/media/radio/radio-aztech.c
drivers/media/radio/radio-cadet.c
drivers/media/radio/radio-gemtek-pci.c
drivers/media/radio/radio-gemtek.c
drivers/media/radio/radio-maestro.c
drivers/media/radio/radio-maxiradio.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-rtrack2.c
drivers/media/radio/radio-sf16fmi.c
drivers/media/radio/radio-sf16fmr2.c
drivers/media/radio/radio-si470x.c
drivers/media/radio/radio-tea5764.c [new file with mode: 0644]
drivers/media/radio/radio-terratec.c
drivers/media/radio/radio-trust.c
drivers/media/radio/radio-typhoon.c
drivers/media/radio/radio-zoltrix.c
drivers/media/video/Makefile
drivers/media/video/arv.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bw-qcam.c
drivers/media/video/c-qcam.c
drivers/media/video/cafe_ccic.c
drivers/media/video/cpia.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cs5345.c
drivers/media/video/cs53l32a.c
drivers/media/video/cx18/cx18-fileops.c
drivers/media/video/cx18/cx18-fileops.h
drivers/media/video/cx18/cx18-i2c.c
drivers/media/video/cx18/cx18-i2c.h
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/cx18/cx18-ioctl.h
drivers/media/video/cx18/cx18-streams.c
drivers/media/video/cx23885/cx23885-417.c
drivers/media/video/cx23885/cx23885-video.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/cx88/cx88-mpeg.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88.h
drivers/media/video/em28xx/em28xx-audio.c
drivers/media/video/em28xx/em28xx-core.c
drivers/media/video/em28xx/em28xx-reg.h
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/em28xx/em28xx.h
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/gspca/gspca.c
drivers/media/video/hexium_gemini.c
drivers/media/video/hexium_orion.c
drivers/media/video/ivtv/ivtv-driver.c
drivers/media/video/ivtv/ivtv-fileops.c
drivers/media/video/ivtv/ivtv-fileops.h
drivers/media/video/ivtv/ivtv-ioctl.c
drivers/media/video/ivtv/ivtv-streams.c
drivers/media/video/m52790.c
drivers/media/video/meye.c
drivers/media/video/msp3400-driver.c
drivers/media/video/mt9m001.c
drivers/media/video/mt9m111.c
drivers/media/video/mt9t031.c
drivers/media/video/mt9v022.c
drivers/media/video/mxb.c
drivers/media/video/omap24xxcam.c
drivers/media/video/ov511.c
drivers/media/video/ov7670.c
drivers/media/video/ov772x.c
drivers/media/video/pms.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-hdw.h
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pwc/pwc-ctrl.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc-v4l.c
drivers/media/video/pwc/pwc.h
drivers/media/video/s2255drv.c
drivers/media/video/saa5246a.c
drivers/media/video/saa5249.c
drivers/media/video/saa7115.c
drivers/media/video/saa7127.c
drivers/media/video/saa7134/saa6752hs.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/saa717x.c
drivers/media/video/se401.c
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/soc_camera.c
drivers/media/video/stk-webcam.c
drivers/media/video/stradis.c
drivers/media/video/stv680.c
drivers/media/video/tda9840.c
drivers/media/video/tea6415c.c
drivers/media/video/tea6420.c
drivers/media/video/tuner-core.c
drivers/media/video/tvaudio.c
drivers/media/video/tvp5150.c
drivers/media/video/tw9910.c
drivers/media/video/upd64031a.c
drivers/media/video/upd64083.c
drivers/media/video/usbvideo/usbvideo.c
drivers/media/video/usbvideo/vicam.c
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvcvideo.h
drivers/media/video/v4l1-compat.c
drivers/media/video/v4l2-common.c
drivers/media/video/v4l2-compat-ioctl32.c
drivers/media/video/v4l2-dev.c
drivers/media/video/v4l2-ioctl.c
drivers/media/video/v4l2-subdev.c
drivers/media/video/vino.c
drivers/media/video/vivi.c
drivers/media/video/vp27smpx.c
drivers/media/video/w9966.c
drivers/media/video/w9968cf.c
drivers/media/video/wm8739.c
drivers/media/video/wm8775.c
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zoran/zoran_driver.c
drivers/media/video/zr364xx.c
include/linux/dvb/frontend.h
include/linux/videodev2.h
include/media/saa7146_vv.h
include/media/soc_camera.h
include/media/v4l2-chip-ident.h
include/media/v4l2-common.h
include/media/v4l2-dev.h
include/media/v4l2-device.h
include/media/v4l2-int-device.h
include/media/v4l2-ioctl.h
include/media/v4l2-subdev.h
include/sound/tea575x-tuner.h
sound/i2c/other/tea575x-tuner.c

index 335aef4dcaebdaa0acf87477865a0b0cea9be377..b8d470596b0cceadc9b74ed7005d3cb3d144aeed 100644 (file)
 151 -> ADS Tech Instant HDTV                    [1421:0380]
 152 -> Asus Tiger Rev:1.00                      [1043:4857]
 153 -> Kworld Plus TV Analog Lite PCI           [17de:7128]
+154 -> Avermedia AVerTV GO 007 FM Plus          [1461:f31d]
index 11c5fd22a3322e5ac3d568bb354ee62d283489da..49679e6aaa7617daa69d72d7034cf5ebd0e63c20 100644 (file)
@@ -41,6 +41,7 @@ chips are known to work:
 - 10c4:818a: Silicon Labs USB FM Radio Reference Design
 - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
 - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
+- 10c5:819a: DealExtreme USB Radio
 
 
 Software
index eeae76c22a9310229ed46d5092f7db6e29888228..ff124374e9ba3211a078b0ec042a21e6e55ec001 100644 (file)
@@ -184,7 +184,7 @@ may be NULL if the subdev driver does not support anything from that category.
 It looks like this:
 
 struct v4l2_subdev_core_ops {
-       int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip);
+       int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
        int (*log_status)(struct v4l2_subdev *sd);
        int (*init)(struct v4l2_subdev *sd, u32 val);
        ...
@@ -390,16 +390,18 @@ allocated memory.
 
 You should also set these fields:
 
-- parent: set to the parent device (same device as was used to register
-  v4l2_device).
+- v4l2_dev: set to the v4l2_device parent device.
 - name: set to something descriptive and unique.
-- fops: set to the file_operations struct.
+- fops: set to the v4l2_file_operations struct.
 - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
   (highly recommended to use this and it might become compulsory in the
   future!), then set this to your v4l2_ioctl_ops struct.
 
-If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to
-__video_ioctl2 or .ioctl to video_ioctl2 in your file_operations struct.
+If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or
+.ioctl to video_ioctl2 in your v4l2_file_operations struct.
+
+The v4l2_file_operations struct is a subset of file_operations. The main
+difference is that the inode argument is omitted since it is never used.
 
 
 video_device registration
@@ -410,7 +412,7 @@ for you.
 
        err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
        if (err) {
-               video_device_release(vdev); // or kfree(my_vdev);
+               video_device_release(vdev); /* or kfree(my_vdev); */
                return err;
        }
 
@@ -516,5 +518,4 @@ void *video_drvdata(struct file *file);
 
 You can go from a video_device struct to the v4l2_device struct using:
 
-struct v4l2_device *v4l2_dev = dev_get_drvdata(vdev->parent);
-
+struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
index 7d844af883848a46c5eb99b8b25afbef6fbe46c3..cf06f4d10ad4229332d5d0b0146b630c4342fb09 100644 (file)
@@ -192,9 +192,9 @@ void saa7146_buffer_timeout(unsigned long data)
 /********************************************************************************/
 /* file operations */
 
-static int fops_open(struct inode *inode, struct file *file)
+static int fops_open(struct file *file)
 {
-       unsigned int minor = iminor(inode);
+       unsigned int minor = video_devdata(file)->minor;
        struct saa7146_dev *h = NULL, *dev = NULL;
        struct list_head *list;
        struct saa7146_fh *fh = NULL;
@@ -202,7 +202,7 @@ static int fops_open(struct inode *inode, struct file *file)
 
        enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
-       DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor));
+       DEB_EE(("file:%p, minor:%d\n", file, minor));
 
        if (mutex_lock_interruptible(&saa7146_devices_lock))
                return -ERESTARTSYS;
@@ -255,7 +255,7 @@ static int fops_open(struct inode *inode, struct file *file)
                if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
                        result = saa7146_vbi_uops.open(dev,file);
                if (dev->ext_vv_data->vbi_fops.open)
-                       dev->ext_vv_data->vbi_fops.open(inode, file);
+                       dev->ext_vv_data->vbi_fops.open(file);
        } else {
                DEB_S(("initializing video...\n"));
                result = saa7146_video_uops.open(dev,file);
@@ -280,12 +280,12 @@ out:
        return result;
 }
 
-static int fops_release(struct inode *inode, struct file *file)
+static int fops_release(struct file *file)
 {
        struct saa7146_fh  *fh  = file->private_data;
        struct saa7146_dev *dev = fh->dev;
 
-       DEB_EE(("inode:%p, file:%p\n",inode,file));
+       DEB_EE(("file:%p\n", file));
 
        if (mutex_lock_interruptible(&saa7146_devices_lock))
                return -ERESTARTSYS;
@@ -294,7 +294,7 @@ static int fops_release(struct inode *inode, struct file *file)
                if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
                        saa7146_vbi_uops.release(dev,file);
                if (dev->ext_vv_data->vbi_fops.release)
-                       dev->ext_vv_data->vbi_fops.release(inode, file);
+                       dev->ext_vv_data->vbi_fops.release(file);
        } else {
                saa7146_video_uops.release(dev,file);
        }
@@ -308,10 +308,10 @@ static int fops_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int fops_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 /*
-       DEB_EE(("inode:%p, file:%p, cmd:%d, arg:%li\n",inode, file, cmd, arg));
+       DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg));
 */
        return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl);
 }
@@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
        }
 }
 
-static const struct file_operations video_fops =
+static const struct v4l2_file_operations video_fops =
 {
        .owner          = THIS_MODULE,
        .open           = fops_open,
@@ -426,7 +426,6 @@ static const struct file_operations video_fops =
        .poll           = fops_poll,
        .mmap           = fops_mmap,
        .ioctl          = fops_ioctl,
-       .llseek         = no_llseek,
 };
 
 static void vv_callback(struct saa7146_dev *dev, unsigned long status)
index 101b01dbb8eaf11b3c8960ea31e8ec42182e0cad..6098b626811fac4baa0e89f40b0e45e371c9b56f 100644 (file)
@@ -834,13 +834,14 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
  * copying is done already, arg is a kernel pointer.
  */
 
-int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct saa7146_fh *fh  = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_vv *vv = dev->vv_data;
 
-       int err = 0, result = 0, ee = 0;
+       long err = 0;
+       int result = 0, ee = 0;
 
        struct saa7146_use_ops *ops;
        struct videobuf_queue *q;
index fb3f3b3adaba27c9fb2b1244f99914122f7c7364..de7adaf5fa5b1d186c8c05b8c46925bea1c52d65 100644 (file)
@@ -820,6 +820,15 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
        int ret;
        unsigned frequency = params->frequency / 62500;
 
+       if (!tun->stepsize) {
+               /* tuner-core was loaded before the digital tuner was
+                * configured and somehow picked the wrong tuner type */
+               tuner_err("attempt to treat tuner %d (%s) as digital tuner "
+                         "without stepsize defined.\n",
+                         priv->type, priv->tun->name);
+               return 0; /* failure */
+       }
+
        t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL);
        ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb);
        if (ret < 0)
@@ -1059,7 +1068,12 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
        memcpy(&fe->ops.tuner_ops, &simple_tuner_ops,
               sizeof(struct dvb_tuner_ops));
 
-       tuner_info("type set to %d (%s)\n", type, priv->tun->name);
+       if (type != priv->type)
+               tuner_warn("couldn't set type to %d. Using %d (%s) instead\n",
+                           type, priv->type, priv->tun->name);
+       else
+               tuner_info("type set to %d (%s)\n",
+                          priv->type, priv->tun->name);
 
        if ((debug) || ((atv_input[priv->nr] > 0) ||
                        (dtv_input[priv->nr] > 0))) {
index 6c571d9f011c6df050c23230c399390e5c3e7334..65d69665f1fc5b87251c1af795e9cefb4b507eaf 100644 (file)
@@ -436,8 +436,9 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        struct dvb_device *dvbdev = dev_get_drvdata(dev);
 
-       add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id);
        add_uevent_var(env, "DVB_ADAPTER_NUM=%d", dvbdev->adapter->num);
+       add_uevent_var(env, "DVB_DEVICE_TYPE=%s", dnames[dvbdev->type]);
+       add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id);
        return 0;
 }
 
index c1da962cc8863261fa5a833c72451055b79b4c6b..3dd6843864ed8a05f33baedd437af45bff412c86 100644 (file)
@@ -187,7 +187,7 @@ int gp8psk_bcm4500_reload(struct dvb_usb_device *d)
        /* load BCM4500 firmware */
        if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM)
                if (gp8psk_load_bcm4500fw(d))
-                       return EINVAL;
+                       return -EINVAL;
        return 0;
 }
 
index 9b6c89e93f1696570c7bc7194d6deb04a5b21846..4f514d39b98fd8cec5fbeb234e464e7806f454c1 100644 (file)
@@ -1463,6 +1463,7 @@ static struct dvb_frontend_ops cx24116_ops = {
                        FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
                        FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
                        FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
+                       FE_CAN_2G_MODULATION |
                        FE_CAN_QPSK | FE_CAN_RECOVER
        },
 
index 4cb3ddd6c6261f7ce3c15d96550b2c56832ce651..b1b76b47a14cf2c97941a0e5721c85541742c645 100644 (file)
@@ -37,7 +37,8 @@ struct cx24116_config {
        u8 mpg_clk_pos_pol:0x02;
 };
 
-#if defined(CONFIG_DVB_CX24116) || defined(CONFIG_DVB_CX24116_MODULE)
+#if defined(CONFIG_DVB_CX24116) || \
+       (defined(CONFIG_DVB_CX24116_MODULE) && defined(MODULE))
 extern struct dvb_frontend *cx24116_attach(
        const struct cx24116_config *config,
        struct i2c_adapter *i2c);
index 52882017022862e373142b193b416f77a4d4c02d..bee28f77b93f9b3adff2ed7295f37ca9f4754fd7 100644 (file)
@@ -1618,6 +1618,7 @@ static struct dvb_frontend_ops stb0899_ops = {
 
                .caps                   = FE_CAN_INVERSION_AUTO |
                                          FE_CAN_FEC_AUTO       |
+                                         FE_CAN_2G_MODULATION  |
                                          FE_CAN_QPSK
        },
 
index 5506f80e180eeddd8c7bf575b963ea280abd3a94..170720b02815268c54b348d319d4a66d0532e454 100644 (file)
@@ -587,8 +587,15 @@ static int zl10353_init(struct dvb_frontend *fe)
 
 static int zl10353_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
 {
+       struct zl10353_state *state = fe->demodulator_priv;
        u8 val = 0x0a;
 
+       if (state->config.no_tuner) {
+               /* No tuner attached to the internal I2C bus */
+               /* If set enable I2C bridge, the main I2C bus stopped hardly */
+               return 0;
+       }
+
        if (enable)
                val |= 0x10;
 
index fd62e0b856213d15029262c293f05a63cb1a9ee7..4307e4e8aa34d7cddb232643b371756f2583f078 100644 (file)
@@ -120,7 +120,7 @@ static struct sms_board sms_boards[] = {
                .name   = "Hauppauge WinTV MiniCard",
                .type   = SMS_NOVA_B0,
                .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw",
-               .lna_ctrl  = 1,
+               .lna_ctrl  = -1,
        },
 };
 
@@ -131,9 +131,10 @@ struct sms_board *sms_get_board(int id)
        return &sms_boards[id];
 }
 
-static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable)
+static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable)
 {
-       int ret;
+       int lvl, ret;
+       u32 gpio;
        struct smscore_gpio_config gpioconfig = {
                .direction            = SMS_GPIO_DIRECTION_OUTPUT,
                .pullupdown           = SMS_GPIO_PULLUPDOWN_NONE,
@@ -145,12 +146,20 @@ static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable)
        if (pin == 0)
                return -EINVAL;
 
-       ret = smscore_configure_gpio(coredev, pin, &gpioconfig);
+       if (pin < 0) {
+               /* inverted gpio */
+               gpio = pin * -1;
+               lvl = enable ? 0 : 1;
+       } else {
+               gpio = pin;
+               lvl = enable ? 1 : 0;
+       }
 
+       ret = smscore_configure_gpio(coredev, gpio, &gpioconfig);
        if (ret < 0)
                return ret;
 
-       return smscore_set_gpio(coredev, pin, enable);
+       return smscore_set_gpio(coredev, gpio, lvl);
 }
 
 int sms_board_setup(struct smscore_device_t *coredev)
index b4a0cc5dc935ffec2c9310385c7816d1e24f40a4..c5b9c70563dc699eb149ae7c6f7f510228623f77 100644 (file)
@@ -316,7 +316,7 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
        return 0;
 }
 
-static int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static long av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 {
        struct saa7146_dev *dev = fh->dev;
        struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
@@ -567,7 +567,7 @@ static int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int av7110_vbi_reset(struct inode *inode, struct file *file)
+static int av7110_vbi_reset(struct file *file)
 {
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
index f996cef79ec1ff0930060f338aa43135074eeb07..4182121d7e5dcd848ce40d67dc279ffaa076473f 100644 (file)
@@ -1493,7 +1493,7 @@ static struct saa7146_extension_ioctls ioctls[] = {
        {0, 0}
 };
 
-static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static long av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 {
        struct saa7146_dev *dev = fh->dev;
        struct budget_av *budget_av = (struct budget_av *) dev->ext_priv;
index f546bccdb997d80235ac08895c9185034978fbb7..2663ae39b88692f5eada3b73730b68fc756e7db9 100644 (file)
@@ -1,6 +1,6 @@
 config DVB_TTUSB_BUDGET
        tristate "Technotrend/Hauppauge Nova-USB devices"
-       depends on DVB_CORE && USB && I2C
+       depends on DVB_CORE && USB && I2C && PCI
        select DVB_CX22700 if !DVB_FE_CUSTOMISE
        select DVB_TDA1004X if !DVB_FE_CUSTOMISE
        select DVB_VES1820 if !DVB_FE_CUSTOMISE
index d5f48a3102bdf5183d939d6be3002325fa1c8123..290254ab06dbb01edac5ddc362b3d89eebf1662d 100644 (file)
@@ -1,6 +1,6 @@
 config DVB_TTUSB_DEC
        tristate "Technotrend/Hauppauge USB DEC devices"
-       depends on DVB_CORE && USB && INPUT
+       depends on DVB_CORE && USB && INPUT && PCI
        select CRC32
        help
          Support for external USB adapters designed by Technotrend and
index 5189c4eb439f705c98a2a35c7949fb2059ef380c..3315cac875e518996b4f02a1a2cd791fc5e45f6a 100644 (file)
@@ -387,4 +387,23 @@ config USB_MR800
          To compile this driver as a module, choose M here: the
          module will be called radio-mr800.
 
+config RADIO_TEA5764
+       tristate "TEA5764 I2C FM radio support"
+       depends on I2C && VIDEO_V4L2
+       ---help---
+         Say Y here if you want to use the TEA5764 FM chip found in
+         EZX phones. This FM chip is present in EZX phones from Motorola,
+         connected to internal pxa I2C bus.
+
+         To compile this driver as a module, choose M here: the
+         module will be called radio-tea5764.
+
+config RADIO_TEA5764_XTAL
+       bool "TEA5764 crystal reference"
+       depends on RADIO_TEA5764=y
+       default y
+       help
+         Say Y here if TEA5764 have a 32768 Hz crystal in circuit, say N
+         here if TEA5764 reference frequency is connected in FREQIN.
+
 endif # RADIO_ADAPTERS
index 240ec63cdafc490c88612dbc091742cfe714ff32..0f2b35b3e5608a2fdb5a19d6ea78f12f5b3f5791 100644 (file)
@@ -19,5 +19,6 @@ obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
 obj-$(CONFIG_USB_MR800) += radio-mr800.o
+obj-$(CONFIG_RADIO_TEA5764) += radio-tea5764.o
 
 EXTRA_CFLAGS += -Isound
index 5474a22c1b2235ef627163c73ba27fe519d1b471..2014ebc4e984f12cb33f1c1a83f5c9e39b56abda 100644 (file)
@@ -154,8 +154,8 @@ devices, that would be 76 and 91.  */
 static int usb_dsbr100_probe(struct usb_interface *intf,
                             const struct usb_device_id *id);
 static void usb_dsbr100_disconnect(struct usb_interface *intf);
-static int usb_dsbr100_open(struct inode *inode, struct file *file);
-static int usb_dsbr100_close(struct inode *inode, struct file *file);
+static int usb_dsbr100_open(struct file *file);
+static int usb_dsbr100_close(struct file *file);
 static int usb_dsbr100_suspend(struct usb_interface *intf,
                                                pm_message_t message);
 static int usb_dsbr100_resume(struct usb_interface *intf);
@@ -566,7 +566,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
        return 0;
 }
 
-static int usb_dsbr100_open(struct inode *inode, struct file *file)
+static int usb_dsbr100_open(struct file *file)
 {
        struct dsbr100_device *radio = video_drvdata(file);
        int retval;
@@ -593,7 +593,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int usb_dsbr100_close(struct inode *inode, struct file *file)
+static int usb_dsbr100_close(struct file *file)
 {
        struct dsbr100_device *radio = video_drvdata(file);
        int retval;
@@ -653,15 +653,11 @@ static void usb_dsbr100_video_device_release(struct video_device *videodev)
 }
 
 /* File system interface */
-static const struct file_operations usb_dsbr100_fops = {
+static const struct v4l2_file_operations usb_dsbr100_fops = {
        .owner          = THIS_MODULE,
        .open           = usb_dsbr100_open,
        .release        = usb_dsbr100_close,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = {
index dd6d3dfcd7d256bee7f8554175f5ec7b2c7021eb..bfa13b8b3043b33aeb3c0fdeaae3fe947b06b1f0 100644 (file)
@@ -374,26 +374,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct rt_device rtrack_unit;
 
-static int rtrack_exclusive_open(struct inode *inode, struct file *file)
+static int rtrack_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &rtrack_unit.in_use) ? -EBUSY : 0;
 }
 
-static int rtrack_exclusive_release(struct inode *inode, struct file *file)
+static int rtrack_exclusive_release(struct file *file)
 {
        clear_bit(0, &rtrack_unit.in_use);
        return 0;
 }
 
-static const struct file_operations rtrack_fops = {
+static const struct v4l2_file_operations rtrack_fops = {
        .owner          = THIS_MODULE,
        .open           = rtrack_exclusive_open,
        .release        = rtrack_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops rtrack_ioctl_ops = {
index d78489573230c259086711245d35775af57ed94a..5604e881e96c26292badc92c08e8afbb4017bb9a 100644 (file)
@@ -338,26 +338,22 @@ static int vidioc_s_ctrl (struct file *file, void *priv,
 
 static struct az_device aztech_unit;
 
-static int aztech_exclusive_open(struct inode *inode, struct file *file)
+static int aztech_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &aztech_unit.in_use) ? -EBUSY : 0;
 }
 
-static int aztech_exclusive_release(struct inode *inode, struct file *file)
+static int aztech_exclusive_release(struct file *file)
 {
        clear_bit(0, &aztech_unit.in_use);
        return 0;
 }
 
-static const struct file_operations aztech_fops = {
+static const struct v4l2_file_operations aztech_fops = {
        .owner          = THIS_MODULE,
        .open           = aztech_exclusive_open,
        .release        = aztech_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
index bfd37f38b9ab3ad68df8430d16e6807dbf284654..cb3075ac104c211c281af8c77660749735a8f7ad 100644 (file)
@@ -529,7 +529,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
 }
 
 static int
-cadet_open(struct inode *inode, struct file *file)
+cadet_open(struct file *file)
 {
        users++;
        if (1 == users) init_waitqueue_head(&read_queue);
@@ -537,7 +537,7 @@ cadet_open(struct inode *inode, struct file *file)
 }
 
 static int
-cadet_release(struct inode *inode, struct file *file)
+cadet_release(struct file *file)
 {
        users--;
        if (0 == users){
@@ -557,17 +557,13 @@ cadet_poll(struct file *file, struct poll_table_struct *wait)
 }
 
 
-static const struct file_operations cadet_fops = {
+static const struct v4l2_file_operations cadet_fops = {
        .owner          = THIS_MODULE,
        .open           = cadet_open,
        .release        = cadet_release,
        .read           = cadet_read,
        .ioctl          = video_ioctl2,
        .poll           = cadet_poll,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops cadet_ioctl_ops = {
index e15bee6d7cfcb874fedab31a35730af81a75b19b..0c96bf8525b056fbbb17d36c13ea2e1c267ff2c0 100644 (file)
@@ -358,26 +358,22 @@ MODULE_DEVICE_TABLE( pci, gemtek_pci_id );
 
 static int mx = 1;
 
-static int gemtek_pci_exclusive_open(struct inode *inode, struct file *file)
+static int gemtek_pci_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &in_use) ? -EBUSY : 0;
 }
 
-static int gemtek_pci_exclusive_release(struct inode *inode, struct file *file)
+static int gemtek_pci_exclusive_release(struct file *file)
 {
        clear_bit(0, &in_use);
        return 0;
 }
 
-static const struct file_operations gemtek_pci_fops = {
+static const struct v4l2_file_operations gemtek_pci_fops = {
        .owner          = THIS_MODULE,
        .open           = gemtek_pci_exclusive_open,
        .release        = gemtek_pci_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = {
index e13118da307bb313eab757c9cead6046c59aa2ee..2b68be773f1381c443421fdf4ab8f40fe94009d3 100644 (file)
@@ -394,26 +394,22 @@ static struct v4l2_queryctrl radio_qctrl[] = {
        }
 };
 
-static int gemtek_exclusive_open(struct inode *inode, struct file *file)
+static int gemtek_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &in_use) ? -EBUSY : 0;
 }
 
-static int gemtek_exclusive_release(struct inode *inode, struct file *file)
+static int gemtek_exclusive_release(struct file *file)
 {
        clear_bit(0, &in_use);
        return 0;
 }
 
-static const struct file_operations gemtek_fops = {
+static const struct v4l2_file_operations gemtek_fops = {
        .owner          = THIS_MODULE,
        .open           = gemtek_exclusive_open,
        .release        = gemtek_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek
 };
 
 static int vidioc_querycap(struct file *file, void *priv,
index 4bf4d007bcfa2b62db846c29f3c035831c5f0433..ba3a13a90013e4c58e232afe7b50baff892410a8 100644 (file)
@@ -79,12 +79,12 @@ static unsigned long in_use;
 
 static int maestro_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 
-static int maestro_exclusive_open(struct inode *inode, struct file *file)
+static int maestro_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &in_use) ? -EBUSY : 0;
 }
 
-static int maestro_exclusive_release(struct inode *inode, struct file *file)
+static int maestro_exclusive_release(struct file *file)
 {
        clear_bit(0, &in_use);
        return 0;
@@ -110,15 +110,11 @@ static struct pci_driver maestro_r_driver = {
        .remove         = __devexit_p(maestro_remove),
 };
 
-static const struct file_operations maestro_fops = {
+static const struct v4l2_file_operations maestro_fops = {
        .owner          = THIS_MODULE,
        .open           = maestro_exclusive_open,
        .release        = maestro_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 struct radio_device {
index c777a17b00bc21c986b08b756080a995eeeb990e..c5dc00aa9c9f467f2704ca3f13ef531b36248e93 100644 (file)
@@ -100,26 +100,22 @@ static unsigned long in_use;
 #define BITS2FREQ(x)   ((x) * FREQ_STEP - FREQ_IF)
 
 
-static int maxiradio_exclusive_open(struct inode *inode, struct file *file)
+static int maxiradio_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &in_use) ? -EBUSY : 0;
 }
 
-static int maxiradio_exclusive_release(struct inode *inode, struct file *file)
+static int maxiradio_exclusive_release(struct file *file)
 {
        clear_bit(0, &in_use);
        return 0;
 }
 
-static const struct file_operations maxiradio_fops = {
+static const struct v4l2_file_operations maxiradio_fops = {
        .owner          = THIS_MODULE,
        .open           = maxiradio_exclusive_open,
        .release        = maxiradio_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static struct radio_device
index e730eddb2bb5b0077c6c43fb693620262e055f17..0747dc8862b095718e3dba02bd32be898227f829 100644 (file)
@@ -127,8 +127,8 @@ static struct v4l2_queryctrl radio_qctrl[] = {
 static int usb_amradio_probe(struct usb_interface *intf,
                             const struct usb_device_id *id);
 static void usb_amradio_disconnect(struct usb_interface *intf);
-static int usb_amradio_open(struct inode *inode, struct file *file);
-static int usb_amradio_close(struct inode *inode, struct file *file);
+static int usb_amradio_open(struct file *file);
+static int usb_amradio_close(struct file *file);
 static int usb_amradio_suspend(struct usb_interface *intf,
                                pm_message_t message);
 static int usb_amradio_resume(struct usb_interface *intf);
@@ -500,7 +500,7 @@ static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
 }
 
 /* open device - amradio_start() and amradio_setfreq() */
-static int usb_amradio_open(struct inode *inode, struct file *file)
+static int usb_amradio_open(struct file *file)
 {
        struct amradio_device *radio = video_get_drvdata(video_devdata(file));
 
@@ -525,7 +525,7 @@ static int usb_amradio_open(struct inode *inode, struct file *file)
 }
 
 /*close device */
-static int usb_amradio_close(struct inode *inode, struct file *file)
+static int usb_amradio_close(struct file *file)
 {
        struct amradio_device *radio = video_get_drvdata(video_devdata(file));
        int retval;
@@ -572,15 +572,11 @@ static int usb_amradio_resume(struct usb_interface *intf)
 }
 
 /* File system interface */
-static const struct file_operations usb_amradio_fops = {
+static const struct v4l2_file_operations usb_amradio_fops = {
        .owner          = THIS_MODULE,
        .open           = usb_amradio_open,
        .release        = usb_amradio_close,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops usb_amradio_ioctl_ops = {
index 7704f243b6f0cf99c3fb05e4f249de2ed1147ae3..2587227214bf8cfe54f0120f87683006239f2d02 100644 (file)
@@ -280,26 +280,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct rt_device rtrack2_unit;
 
-static int rtrack2_exclusive_open(struct inode *inode, struct file *file)
+static int rtrack2_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &rtrack2_unit.in_use) ? -EBUSY : 0;
 }
 
-static int rtrack2_exclusive_release(struct inode *inode, struct file *file)
+static int rtrack2_exclusive_release(struct file *file)
 {
        clear_bit(0, &rtrack2_unit.in_use);
        return 0;
 }
 
-static const struct file_operations rtrack2_fops = {
+static const struct v4l2_file_operations rtrack2_fops = {
        .owner          = THIS_MODULE,
        .open           = rtrack2_exclusive_open,
        .release        = rtrack2_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = {
index 834d43651c70fc1017ee65fa371ef3e18c86d11f..d358e48c242286d0d9cf45768236e8473d64e8a0 100644 (file)
@@ -280,26 +280,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct fmi_device fmi_unit;
 
-static int fmi_exclusive_open(struct inode *inode, struct file *file)
+static int fmi_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &fmi_unit.in_use) ? -EBUSY : 0;
 }
 
-static int fmi_exclusive_release(struct inode *inode, struct file *file)
+static int fmi_exclusive_release(struct file *file)
 {
        clear_bit(0, &fmi_unit.in_use);
        return 0;
 }
 
-static const struct file_operations fmi_fops = {
+static const struct v4l2_file_operations fmi_fops = {
        .owner          = THIS_MODULE,
        .open           = fmi_exclusive_open,
        .release        = fmi_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops fmi_ioctl_ops = {
index b1f47c322e02637e58b2117a3c7df2e51656dd76..92f17a347fa73baf2fa12fe7524d2cacd9dbd6a7 100644 (file)
@@ -396,26 +396,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct fmr2_device fmr2_unit;
 
-static int fmr2_exclusive_open(struct inode *inode, struct file *file)
+static int fmr2_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &fmr2_unit.in_use) ? -EBUSY : 0;
 }
 
-static int fmr2_exclusive_release(struct inode *inode, struct file *file)
+static int fmr2_exclusive_release(struct file *file)
 {
        clear_bit(0, &fmr2_unit.in_use);
        return 0;
 }
 
-static const struct file_operations fmr2_fops = {
+static const struct v4l2_file_operations fmr2_fops = {
        .owner          = THIS_MODULE,
        .open           = fmr2_exclusive_open,
        .release        = fmr2_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops fmr2_ioctl_ops = {
index 3e1830293de5ebd8c2e1d0a86bc4d6b5d62fe7db..67cbce82cb913a0619f3a72fb8a4e519076cbf96 100644 (file)
@@ -96,6 +96,8 @@
  * 2008-10-20  Alexey Klimov <klimov.linux@gmail.com>
  *             - add support for KWorld USB FM Radio FM700
  *             - blacklisted KWorld radio in hid-core.c and hid-ids.h
+ * 2008-12-03  Mark Lord <mlord@pobox.com>
+ *             - add support for DealExtreme USB Radio
  *
  * ToDo:
  * - add firmware download/update support
@@ -138,6 +140,8 @@ static struct usb_device_id si470x_usb_driver_id_table[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(0x06e1, 0xa155, USB_CLASS_HID, 0, 0) },
        /* KWorld USB FM Radio SnapMusic Mobile 700 (FM700) */
        { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) },
+       /* DealExtreme USB Radio */
+       { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) },
        /* Terminating entry */
        { }
 };
@@ -1075,7 +1079,7 @@ static unsigned int si470x_fops_poll(struct file *file,
 /*
  * si470x_fops_open - file open
  */
-static int si470x_fops_open(struct inode *inode, struct file *file)
+static int si470x_fops_open(struct file *file)
 {
        struct si470x_device *radio = video_drvdata(file);
        int retval;
@@ -1105,7 +1109,7 @@ done:
 /*
  * si470x_fops_release - file release
  */
-static int si470x_fops_release(struct inode *inode, struct file *file)
+static int si470x_fops_release(struct file *file)
 {
        struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
@@ -1147,15 +1151,11 @@ done:
 /*
  * si470x_fops - file operations interface
  */
-static const struct file_operations si470x_fops = {
+static const struct v4l2_file_operations si470x_fops = {
        .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
        .read           = si470x_fops_read,
        .poll           = si470x_fops_poll,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .open           = si470x_fops_open,
        .release        = si470x_fops_release,
 };
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
new file mode 100644 (file)
index 0000000..4d35308
--- /dev/null
@@ -0,0 +1,634 @@
+/*
+ * driver/media/radio/radio-tea5764.c
+ *
+ * Driver for TEA5764 radio chip for linux 2.6.
+ * This driver is for TEA5764 chip from NXP, used in EZX phones from Motorola.
+ * The I2C protocol is used for communicate with chip.
+ *
+ * Based in radio-tea5761.c Copyright (C) 2005 Nokia Corporation
+ *
+ *  Copyright (c) 2008 Fabio Belavenuto <belavenuto@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * History:
+ * 2008-12-06   Fabio Belavenuto <belavenuto@gmail.com>
+ *              initial code
+ *
+ * TODO:
+ *  add platform_data support for IRQs platform dependencies
+ *  add RDS support
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>                        /* Initdata                     */
+#include <linux/videodev2.h>           /* kernel radio structs         */
+#include <linux/i2c.h>                 /* I2C                          */
+#include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
+#include <linux/version.h>             /* for KERNEL_VERSION MACRO     */
+
+#define DRIVER_VERSION "v0.01"
+#define RADIO_VERSION  KERNEL_VERSION(0, 0, 1)
+
+#define DRIVER_AUTHOR  "Fabio Belavenuto <belavenuto@gmail.com>"
+#define DRIVER_DESC    "A driver for the TEA5764 radio chip for EZX Phones."
+
+#define PINFO(format, ...)\
+       printk(KERN_INFO KBUILD_MODNAME ": "\
+               DRIVER_VERSION ": " format "\n", ## __VA_ARGS__)
+#define PWARN(format, ...)\
+       printk(KERN_WARNING KBUILD_MODNAME ": "\
+               DRIVER_VERSION ": " format "\n", ## __VA_ARGS__)
+# define PDEBUG(format, ...)\
+       printk(KERN_DEBUG KBUILD_MODNAME ": "\
+               DRIVER_VERSION ": " format "\n", ## __VA_ARGS__)
+
+/* Frequency limits in MHz -- these are European values.  For Japanese
+devices, that would be 76000 and 91000.  */
+#define FREQ_MIN  87500
+#define FREQ_MAX 108000
+#define FREQ_MUL 16
+
+/* TEA5764 registers */
+#define TEA5764_MANID          0x002b
+#define TEA5764_CHIPID         0x5764
+
+#define TEA5764_INTREG_BLMSK   0x0001
+#define TEA5764_INTREG_FRRMSK  0x0002
+#define TEA5764_INTREG_LEVMSK  0x0008
+#define TEA5764_INTREG_IFMSK   0x0010
+#define TEA5764_INTREG_BLMFLAG 0x0100
+#define TEA5764_INTREG_FRRFLAG 0x0200
+#define TEA5764_INTREG_LEVFLAG 0x0800
+#define TEA5764_INTREG_IFFLAG  0x1000
+
+#define TEA5764_FRQSET_SUD     0x8000
+#define TEA5764_FRQSET_SM      0x4000
+
+#define TEA5764_TNCTRL_PUPD1   0x8000
+#define TEA5764_TNCTRL_PUPD0   0x4000
+#define TEA5764_TNCTRL_BLIM    0x2000
+#define TEA5764_TNCTRL_SWPM    0x1000
+#define TEA5764_TNCTRL_IFCTC   0x0800
+#define TEA5764_TNCTRL_AFM     0x0400
+#define TEA5764_TNCTRL_SMUTE   0x0200
+#define TEA5764_TNCTRL_SNC     0x0100
+#define TEA5764_TNCTRL_MU      0x0080
+#define TEA5764_TNCTRL_SSL1    0x0040
+#define TEA5764_TNCTRL_SSL0    0x0020
+#define TEA5764_TNCTRL_HLSI    0x0010
+#define TEA5764_TNCTRL_MST     0x0008
+#define TEA5764_TNCTRL_SWP     0x0004
+#define TEA5764_TNCTRL_DTC     0x0002
+#define TEA5764_TNCTRL_AHLSI   0x0001
+
+#define TEA5764_TUNCHK_LEVEL(x)        (((x) & 0x00F0) >> 4)
+#define TEA5764_TUNCHK_IFCNT(x) (((x) & 0xFE00) >> 9)
+#define TEA5764_TUNCHK_TUNTO   0x0100
+#define TEA5764_TUNCHK_LD      0x0008
+#define TEA5764_TUNCHK_STEREO  0x0004
+
+#define TEA5764_TESTREG_TRIGFR 0x0800
+
+struct tea5764_regs {
+       u16 intreg;                             /* INTFLAG & INTMSK */
+       u16 frqset;                             /* FRQSETMSB & FRQSETLSB */
+       u16 tnctrl;                             /* TNCTRL1 & TNCTRL2 */
+       u16 frqchk;                             /* FRQCHKMSB & FRQCHKLSB */
+       u16 tunchk;                             /* IFCHK & LEVCHK */
+       u16 testreg;                            /* TESTBITS & TESTMODE */
+       u16 rdsstat;                            /* RDSSTAT1 & RDSSTAT2 */
+       u16 rdslb;                              /* RDSLBMSB & RDSLBLSB */
+       u16 rdspb;                              /* RDSPBMSB & RDSPBLSB */
+       u16 rdsbc;                              /* RDSBBC & RDSGBC */
+       u16 rdsctrl;                            /* RDSCTRL1 & RDSCTRL2 */
+       u16 rdsbbl;                             /* PAUSEDET & RDSBBL */
+       u16 manid;                              /* MANID1 & MANID2 */
+       u16 chipid;                             /* CHIPID1 & CHIPID2 */
+} __attribute__ ((packed));
+
+struct tea5764_write_regs {
+       u8 intreg;                              /* INTMSK */
+       u16 frqset;                             /* FRQSETMSB & FRQSETLSB */
+       u16 tnctrl;                             /* TNCTRL1 & TNCTRL2 */
+       u16 testreg;                            /* TESTBITS & TESTMODE */
+       u16 rdsctrl;                            /* RDSCTRL1 & RDSCTRL2 */
+       u16 rdsbbl;                             /* PAUSEDET & RDSBBL */
+} __attribute__ ((packed));
+
+#ifndef RADIO_TEA5764_XTAL
+#define RADIO_TEA5764_XTAL 1
+#endif
+
+static int radio_nr = -1;
+static int use_xtal = RADIO_TEA5764_XTAL;
+
+struct tea5764_device {
+       struct i2c_client               *i2c_client;
+       struct video_device             *videodev;
+       struct tea5764_regs             regs;
+       struct mutex                    mutex;
+       int                             users;
+};
+
+/* I2C code related */
+int tea5764_i2c_read(struct tea5764_device *radio)
+{
+       int i;
+       u16 *p = (u16 *) &radio->regs;
+
+       struct i2c_msg msgs[1] = {
+               { radio->i2c_client->addr, I2C_M_RD, sizeof(radio->regs),
+                       (void *)&radio->regs },
+       };
+       if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1)
+               return -EIO;
+       for (i = 0; i < sizeof(struct tea5764_regs) / sizeof(u16); i++)
+               p[i] = __be16_to_cpu(p[i]);
+
+       return 0;
+}
+
+int tea5764_i2c_write(struct tea5764_device *radio)
+{
+       struct tea5764_write_regs wr;
+       struct tea5764_regs *r = &radio->regs;
+       struct i2c_msg msgs[1] = {
+               { radio->i2c_client->addr, 0, sizeof(wr), (void *) &wr },
+       };
+       wr.intreg  = r->intreg & 0xff;
+       wr.frqset  = __cpu_to_be16(r->frqset);
+       wr.tnctrl  = __cpu_to_be16(r->tnctrl);
+       wr.testreg = __cpu_to_be16(r->testreg);
+       wr.rdsctrl = __cpu_to_be16(r->rdsctrl);
+       wr.rdsbbl  = __cpu_to_be16(r->rdsbbl);
+       if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1)
+               return -EIO;
+       return 0;
+}
+
+/* V4L2 code related */
+static struct v4l2_queryctrl radio_qctrl[] = {
+       {
+               .id            = V4L2_CID_AUDIO_MUTE,
+               .name          = "Mute",
+               .minimum       = 0,
+               .maximum       = 1,
+               .default_value = 1,
+               .type          = V4L2_CTRL_TYPE_BOOLEAN,
+       }
+};
+
+static void tea5764_power_up(struct tea5764_device *radio)
+{
+       struct tea5764_regs *r = &radio->regs;
+
+       if (!(r->tnctrl & TEA5764_TNCTRL_PUPD0)) {
+               r->tnctrl &= ~(TEA5764_TNCTRL_AFM | TEA5764_TNCTRL_MU |
+                              TEA5764_TNCTRL_HLSI);
+               if (!use_xtal)
+                       r->testreg |= TEA5764_TESTREG_TRIGFR;
+               else
+                       r->testreg &= ~TEA5764_TESTREG_TRIGFR;
+
+               r->tnctrl |= TEA5764_TNCTRL_PUPD0;
+               tea5764_i2c_write(radio);
+       }
+}
+
+static void tea5764_power_down(struct tea5764_device *radio)
+{
+       struct tea5764_regs *r = &radio->regs;
+
+       if (r->tnctrl & TEA5764_TNCTRL_PUPD0) {
+               r->tnctrl &= ~TEA5764_TNCTRL_PUPD0;
+               tea5764_i2c_write(radio);
+       }
+}
+
+static void tea5764_set_freq(struct tea5764_device *radio, int freq)
+{
+       struct tea5764_regs *r = &radio->regs;
+
+       /* formula: (freq [+ or -] 225000) / 8192 */
+       if (r->tnctrl & TEA5764_TNCTRL_HLSI)
+               r->frqset = (freq + 225000) / 8192;
+       else
+               r->frqset = (freq - 225000) / 8192;
+}
+
+static int tea5764_get_freq(struct tea5764_device *radio)
+{
+       struct tea5764_regs *r = &radio->regs;
+
+       if (r->tnctrl & TEA5764_TNCTRL_HLSI)
+               return (r->frqchk * 8192) - 225000;
+       else
+               return (r->frqchk * 8192) + 225000;
+}
+
+/* tune an frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
+static void tea5764_tune(struct tea5764_device *radio, int freq)
+{
+       tea5764_set_freq(radio, freq);
+       if (tea5764_i2c_write(radio))
+               PWARN("Could not set frequency!");
+}
+
+static void tea5764_set_audout_mode(struct tea5764_device *radio, int audmode)
+{
+       struct tea5764_regs *r = &radio->regs;
+       int tnctrl = r->tnctrl;
+
+       if (audmode == V4L2_TUNER_MODE_MONO)
+               r->tnctrl |= TEA5764_TNCTRL_MST;
+       else
+               r->tnctrl &= ~TEA5764_TNCTRL_MST;
+       if (tnctrl != r->tnctrl)
+               tea5764_i2c_write(radio);
+}
+
+static int tea5764_get_audout_mode(struct tea5764_device *radio)
+{
+       struct tea5764_regs *r = &radio->regs;
+
+       if (r->tnctrl & TEA5764_TNCTRL_MST)
+               return V4L2_TUNER_MODE_MONO;
+       else
+               return V4L2_TUNER_MODE_STEREO;
+}
+
+static void tea5764_mute(struct tea5764_device *radio, int on)
+{
+       struct tea5764_regs *r = &radio->regs;
+       int tnctrl = r->tnctrl;
+
+       if (on)
+               r->tnctrl |= TEA5764_TNCTRL_MU;
+       else
+               r->tnctrl &= ~TEA5764_TNCTRL_MU;
+       if (tnctrl != r->tnctrl)
+               tea5764_i2c_write(radio);
+}
+
+static int tea5764_is_muted(struct tea5764_device *radio)
+{
+       return radio->regs.tnctrl & TEA5764_TNCTRL_MU;
+}
+
+/* V4L2 vidioc */
+static int vidioc_querycap(struct file *file, void  *priv,
+                                       struct v4l2_capability *v)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+       struct video_device *dev = radio->videodev;
+
+       strlcpy(v->driver, dev->dev.driver->name, sizeof(v->driver));
+       strlcpy(v->card, dev->name, sizeof(v->card));
+       snprintf(v->bus_info, sizeof(v->bus_info), "I2C:%s", dev->dev.bus_id);
+       v->version = RADIO_VERSION;
+       v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
+       return 0;
+}
+
+static int vidioc_g_tuner(struct file *file, void *priv,
+                               struct v4l2_tuner *v)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+       struct tea5764_regs *r = &radio->regs;
+
+       if (v->index > 0)
+               return -EINVAL;
+
+       memset(v, 0, sizeof(v));
+       strcpy(v->name, "FM");
+       v->type = V4L2_TUNER_RADIO;
+       tea5764_i2c_read(radio);
+       v->rangelow   = FREQ_MIN * FREQ_MUL;
+       v->rangehigh  = FREQ_MAX * FREQ_MUL;
+       v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
+       if (r->tunchk & TEA5764_TUNCHK_STEREO)
+                       v->rxsubchans = V4L2_TUNER_SUB_STEREO;
+       v->audmode = tea5764_get_audout_mode(radio);
+       v->signal = TEA5764_TUNCHK_LEVEL(r->tunchk) * 0xffff / 0xf;
+       v->afc = TEA5764_TUNCHK_IFCNT(r->tunchk);
+
+       return 0;
+}
+
+static int vidioc_s_tuner(struct file *file, void *priv,
+                               struct v4l2_tuner *v)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+
+       if (v->index > 0)
+               return -EINVAL;
+
+       tea5764_set_audout_mode(radio, v->audmode);
+       return 0;
+}
+
+static int vidioc_s_frequency(struct file *file, void *priv,
+                               struct v4l2_frequency *f)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+
+       if (f->tuner != 0)
+               return -EINVAL;
+       if (f->frequency == 0) {
+               /* We special case this as a power down control. */
+               tea5764_power_down(radio);
+       }
+       if (f->frequency < (FREQ_MIN * FREQ_MUL))
+               return -EINVAL;
+       if (f->frequency > (FREQ_MAX * FREQ_MUL))
+               return -EINVAL;
+       tea5764_power_up(radio);
+       tea5764_tune(radio, (f->frequency * 125) / 2);
+       return 0;
+}
+
+static int vidioc_g_frequency(struct file *file, void *priv,
+                               struct v4l2_frequency *f)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+       struct tea5764_regs *r = &radio->regs;
+
+       tea5764_i2c_read(radio);
+       memset(f, 0, sizeof(f));
+       f->type = V4L2_TUNER_RADIO;
+       if (r->tnctrl & TEA5764_TNCTRL_PUPD0)
+               f->frequency = (tea5764_get_freq(radio) * 2) / 125;
+       else
+               f->frequency = 0;
+
+       return 0;
+}
+
+static int vidioc_queryctrl(struct file *file, void *priv,
+                           struct v4l2_queryctrl *qc)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
+               if (qc->id && qc->id == radio_qctrl[i].id) {
+                       memcpy(qc, &(radio_qctrl[i]), sizeof(*qc));
+                       return 0;
+               }
+       }
+       return -EINVAL;
+}
+
+static int vidioc_g_ctrl(struct file *file, void *priv,
+                           struct v4l2_control *ctrl)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+
+       switch (ctrl->id) {
+       case V4L2_CID_AUDIO_MUTE:
+               tea5764_i2c_read(radio);
+               ctrl->value = tea5764_is_muted(radio) ? 1 : 0;
+               return 0;
+       }
+       return -EINVAL;
+}
+
+static int vidioc_s_ctrl(struct file *file, void *priv,
+                           struct v4l2_control *ctrl)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+
+       switch (ctrl->id) {
+       case V4L2_CID_AUDIO_MUTE:
+               tea5764_mute(radio, ctrl->value);
+               return 0;
+       }
+       return -EINVAL;
+}
+
+static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
+{
+       *i = 0;
+       return 0;
+}
+
+static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
+{
+       if (i != 0)
+               return -EINVAL;
+       return 0;
+}
+
+static int vidioc_g_audio(struct file *file, void *priv,
+                          struct v4l2_audio *a)
+{
+       if (a->index > 1)
+               return -EINVAL;
+
+       strcpy(a->name, "Radio");
+       a->capability = V4L2_AUDCAP_STEREO;
+       return 0;
+}
+
+static int vidioc_s_audio(struct file *file, void *priv,
+                          struct v4l2_audio *a)
+{
+       if (a->index != 0)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int tea5764_open(struct file *file)
+{
+       /* Currently we support only one device */
+       int minor = video_devdata(file)->minor;
+       struct tea5764_device *radio = video_drvdata(file);
+
+       if (radio->videodev->minor != minor)
+               return -ENODEV;
+
+       mutex_lock(&radio->mutex);
+       /* Only exclusive access */
+       if (radio->users) {
+               mutex_unlock(&radio->mutex);
+               return -EBUSY;
+       }
+       radio->users++;
+       mutex_unlock(&radio->mutex);
+       file->private_data = radio;
+       return 0;
+}
+
+static int tea5764_close(struct file *file)
+{
+       struct tea5764_device *radio = video_drvdata(file);
+
+       if (!radio)
+               return -ENODEV;
+       mutex_lock(&radio->mutex);
+       radio->users--;
+       mutex_unlock(&radio->mutex);
+       return 0;
+}
+
+/* File system interface */
+static const struct v4l2_file_operations tea5764_fops = {
+       .owner          = THIS_MODULE,
+       .open           = tea5764_open,
+       .release        = tea5764_close,
+       .ioctl          = video_ioctl2,
+};
+
+static const struct v4l2_ioctl_ops tea5764_ioctl_ops = {
+       .vidioc_querycap    = vidioc_querycap,
+       .vidioc_g_tuner     = vidioc_g_tuner,
+       .vidioc_s_tuner     = vidioc_s_tuner,
+       .vidioc_g_audio     = vidioc_g_audio,
+       .vidioc_s_audio     = vidioc_s_audio,
+       .vidioc_g_input     = vidioc_g_input,
+       .vidioc_s_input     = vidioc_s_input,
+       .vidioc_g_frequency = vidioc_g_frequency,
+       .vidioc_s_frequency = vidioc_s_frequency,
+       .vidioc_queryctrl   = vidioc_queryctrl,
+       .vidioc_g_ctrl      = vidioc_g_ctrl,
+       .vidioc_s_ctrl      = vidioc_s_ctrl,
+};
+
+/* V4L2 interface */
+static struct video_device tea5764_radio_template = {
+       .name           = "TEA5764 FM-Radio",
+       .fops           = &tea5764_fops,
+       .ioctl_ops      = &tea5764_ioctl_ops,
+       .release        = video_device_release,
+};
+
+/* I2C probe: check if the device exists and register with v4l if it is */
+static int __devinit tea5764_i2c_probe(struct i2c_client *client,
+                                       const struct i2c_device_id *id)
+{
+       struct tea5764_device *radio;
+       struct tea5764_regs *r;
+       int ret;
+
+       PDEBUG("probe");
+       radio = kmalloc(sizeof(struct tea5764_device), GFP_KERNEL);
+       if (!radio)
+               return -ENOMEM;
+
+       mutex_init(&radio->mutex);
+       radio->i2c_client = client;
+       ret = tea5764_i2c_read(radio);
+       if (ret)
+               goto errfr;
+       r = &radio->regs;
+       PDEBUG("chipid = %04X, manid = %04X", r->chipid, r->manid);
+       if (r->chipid != TEA5764_CHIPID ||
+               (r->manid & 0x0fff) != TEA5764_MANID) {
+               PWARN("This chip is not a TEA5764!");
+               ret = -EINVAL;
+               goto errfr;
+       }
+
+       radio->videodev = video_device_alloc();
+       if (!(radio->videodev)) {
+               ret = -ENOMEM;
+               goto errfr;
+       }
+       memcpy(radio->videodev, &tea5764_radio_template,
+               sizeof(tea5764_radio_template));
+
+       i2c_set_clientdata(client, radio);
+       video_set_drvdata(radio->videodev, radio);
+
+       ret = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr);
+       if (ret < 0) {
+               PWARN("Could not register video device!");
+               goto errrel;
+       }
+
+       /* initialize and power off the chip */
+       tea5764_i2c_read(radio);
+       tea5764_set_audout_mode(radio, V4L2_TUNER_MODE_STEREO);
+       tea5764_mute(radio, 1);
+       tea5764_power_down(radio);
+
+       PINFO("registered.");
+       return 0;
+errrel:
+       video_device_release(radio->videodev);
+errfr:
+       kfree(radio);
+       return ret;
+}
+
+static int __devexit tea5764_i2c_remove(struct i2c_client *client)
+{
+       struct tea5764_device *radio = i2c_get_clientdata(client);
+
+       PDEBUG("remove");
+       if (radio) {
+               tea5764_power_down(radio);
+               video_unregister_device(radio->videodev);
+               kfree(radio);
+       }
+       return 0;
+}
+
+/* I2C subsystem interface */
+static const struct i2c_device_id tea5764_id[] = {
+       { "radio-tea5764", 0 },
+       { }                                     /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(i2c, tea5764_id);
+
+static struct i2c_driver tea5764_i2c_driver = {
+       .driver = {
+               .name = "radio-tea5764",
+               .owner = THIS_MODULE,
+       },
+       .probe = tea5764_i2c_probe,
+       .remove = __devexit_p(tea5764_i2c_remove),
+       .id_table = tea5764_id,
+};
+
+/* init the driver */
+static int __init tea5764_init(void)
+{
+       int ret = i2c_add_driver(&tea5764_i2c_driver);
+
+       printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ": "
+               DRIVER_DESC "\n");
+       return ret;
+}
+
+/* cleanup the driver */
+static void __exit tea5764_exit(void)
+{
+       i2c_del_driver(&tea5764_i2c_driver);
+}
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+
+module_param(use_xtal, int, 1);
+MODULE_PARM_DESC(use_xtal, "Chip have a xtal connected in board");
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr, "video4linux device number to use");
+
+module_init(tea5764_init);
+module_exit(tea5764_exit);
index 0abb186a9473e5661dd1a117e83acdc9fe034a98..0798d71abd005d67f5a44c924da99a2da06c0330 100644 (file)
@@ -352,26 +352,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct tt_device terratec_unit;
 
-static int terratec_exclusive_open(struct inode *inode, struct file *file)
+static int terratec_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &terratec_unit.in_use) ? -EBUSY : 0;
 }
 
-static int terratec_exclusive_release(struct inode *inode, struct file *file)
+static int terratec_exclusive_release(struct file *file)
 {
        clear_bit(0, &terratec_unit.in_use);
        return 0;
 }
 
-static const struct file_operations terratec_fops = {
+static const struct v4l2_file_operations terratec_fops = {
        .owner          = THIS_MODULE,
        .open           = terratec_exclusive_open,
        .release        = terratec_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops terratec_ioctl_ops = {
index e7b111fcd105b6fc79a3a11c922d6edf2a0542e1..bdf9cb6a75f47c7634d99a615cabbf925cbdf740 100644 (file)
@@ -337,26 +337,22 @@ static int vidioc_s_audio(struct file *file, void *priv,
        return 0;
 }
 
-static int trust_exclusive_open(struct inode *inode, struct file *file)
+static int trust_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &in_use) ? -EBUSY : 0;
 }
 
-static int trust_exclusive_release(struct inode *inode, struct file *file)
+static int trust_exclusive_release(struct file *file)
 {
        clear_bit(0, &in_use);
        return 0;
 }
 
-static const struct file_operations trust_fops = {
+static const struct v4l2_file_operations trust_fops = {
        .owner          = THIS_MODULE,
        .open           = trust_exclusive_open,
        .release        = trust_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops trust_ioctl_ops = {
index 952ec35a8415129100ae56564ee2e956facbccd7..5c3b319dab37cadaadc64c576bc18482e943d444 100644 (file)
@@ -330,26 +330,22 @@ static struct typhoon_device typhoon_unit =
        .mutefreq       = CONFIG_RADIO_TYPHOON_MUTEFREQ,
 };
 
-static int typhoon_exclusive_open(struct inode *inode, struct file *file)
+static int typhoon_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &typhoon_unit.in_use) ? -EBUSY : 0;
 }
 
-static int typhoon_exclusive_release(struct inode *inode, struct file *file)
+static int typhoon_exclusive_release(struct file *file)
 {
        clear_bit(0, &typhoon_unit.in_use);
        return 0;
 }
 
-static const struct file_operations typhoon_fops = {
+static const struct v4l2_file_operations typhoon_fops = {
        .owner          = THIS_MODULE,
        .open           = typhoon_exclusive_open,
        .release        = typhoon_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops typhoon_ioctl_ops = {
index 15b10bad679660efa22b59bc3d70f161841c07f0..d2ac17eeec5ffeb30c77a3c528cea291af6ec134 100644 (file)
@@ -401,27 +401,23 @@ static int vidioc_s_audio(struct file *file, void *priv,
 
 static struct zol_device zoltrix_unit;
 
-static int zoltrix_exclusive_open(struct inode *inode, struct file *file)
+static int zoltrix_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &zoltrix_unit.in_use) ? -EBUSY : 0;
 }
 
-static int zoltrix_exclusive_release(struct inode *inode, struct file *file)
+static int zoltrix_exclusive_release(struct file *file)
 {
        clear_bit(0, &zoltrix_unit.in_use);
        return 0;
 }
 
-static const struct file_operations zoltrix_fops =
+static const struct v4l2_file_operations zoltrix_fops =
 {
        .owner          = THIS_MODULE,
        .open           = zoltrix_exclusive_open,
        .release        = zoltrix_exclusive_release,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = {
index 1611c33b1aee3593d9a15515a35c971179101d5b..72f6d03d2d8f472600d60208b75d8e9d30d2f691 100644 (file)
@@ -12,7 +12,10 @@ omap2cam-objs        :=      omap24xxcam.o omap24xxcam-dma.o
 
 videodev-objs  :=      v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-subdev.o
 
-obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-compat-ioctl32.o v4l2-int-device.o
+obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-int-device.o
+ifeq ($(CONFIG_COMPAT),y)
+  obj-$(CONFIG_VIDEO_DEV) += v4l2-compat-ioctl32.o
+endif
 
 obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o
 
index 2ba6abd92b6f2932f4dd4c0e9ff3317ca224971c..d137bac84511eb9c3dfdb7c61aef5140a163ec5a 100644 (file)
@@ -396,7 +396,7 @@ out_up:
        return ret;
 }
 
-static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *dev = video_devdata(file);
        struct ar_device *ar = video_get_drvdata(dev);
@@ -539,7 +539,7 @@ static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int ar_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+static long ar_ioctl(struct file *file, unsigned int cmd,
                    unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, ar_do_ioctl);
@@ -744,27 +744,23 @@ void ar_release(struct video_device *vfd)
  ****************************************************************************/
 static struct ar_device ardev;
 
-static int ar_exclusive_open(struct inode *inode, struct file *file)
+static int ar_exclusive_open(struct file *file)
 {
        return test_and_set_bit(0, &ardev.in_use) ? -EBUSY : 0;
 }
 
-static int ar_exclusive_release(struct inode *inode, struct file *file)
+static int ar_exclusive_release(struct file *file)
 {
        clear_bit(0, &ardev.in_use);
        return 0;
 }
 
-static const struct file_operations ar_fops = {
+static const struct v4l2_file_operations ar_fops = {
        .owner          = THIS_MODULE,
        .open           = ar_exclusive_open,
        .release        = ar_exclusive_release,
        .read           = ar_read,
        .ioctl          = ar_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static struct video_device ar_template = {
index 9ec4cec2e52dada612a8857a1033325f6cb5415a..c71f394fc0ead807e04b166b2a300c4bf2978326 100644 (file)
@@ -2039,7 +2039,7 @@ static int bttv_log_status(struct file *file, void *f)
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int bttv_g_register(struct file *file, void *f,
-                                       struct v4l2_register *reg)
+                                       struct v4l2_dbg_register *reg)
 {
        struct bttv_fh *fh = f;
        struct bttv *btv = fh->btv;
@@ -2047,18 +2047,19 @@ static int bttv_g_register(struct file *file, void *f,
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
 
        /* bt848 has a 12-bit register space */
        reg->reg &= 0xfff;
        reg->val = btread(reg->reg);
+       reg->size = 1;
 
        return 0;
 }
 
 static int bttv_s_register(struct file *file, void *f,
-                                       struct v4l2_register *reg)
+                                       struct v4l2_dbg_register *reg)
 {
        struct bttv_fh *fh = f;
        struct bttv *btv = fh->btv;
@@ -2066,7 +2067,7 @@ static int bttv_s_register(struct file *file, void *f,
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
 
        /* bt848 has a 12-bit register space */
@@ -3208,9 +3209,9 @@ err:
        return POLLERR;
 }
 
-static int bttv_open(struct inode *inode, struct file *file)
+static int bttv_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct bttv *btv = NULL;
        struct bttv_fh *fh;
        enum v4l2_buf_type type = 0;
@@ -3291,7 +3292,7 @@ static int bttv_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int bttv_release(struct inode *inode, struct file *file)
+static int bttv_release(struct file *file)
 {
        struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
@@ -3346,14 +3347,12 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
        return videobuf_mmap_mapper(bttv_queue(fh),vma);
 }
 
-static const struct file_operations bttv_fops =
+static const struct v4l2_file_operations bttv_fops =
 {
        .owner    = THIS_MODULE,
        .open     = bttv_open,
        .release  = bttv_release,
        .ioctl    = video_ioctl2,
-       .compat_ioctl   = v4l_compat_ioctl32,
-       .llseek   = no_llseek,
        .read     = bttv_read,
        .mmap     = bttv_mmap,
        .poll     = bttv_poll,
@@ -3422,9 +3421,9 @@ static struct video_device bttv_video_template = {
 /* ----------------------------------------------------------------------- */
 /* radio interface                                                         */
 
-static int radio_open(struct inode *inode, struct file *file)
+static int radio_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct bttv *btv = NULL;
        struct bttv_fh *fh;
        unsigned int i;
@@ -3467,12 +3466,13 @@ static int radio_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int radio_release(struct inode *inode, struct file *file)
+static int radio_release(struct file *file)
 {
        struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
        struct rds_command cmd;
 
+       v4l2_prio_close(&btv->prio,&fh->prio);
        file->private_data = NULL;
        kfree(fh);
 
@@ -3633,15 +3633,13 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
        return cmd.result;
 }
 
-static const struct file_operations radio_fops =
+static const struct v4l2_file_operations radio_fops =
 {
        .owner    = THIS_MODULE,
        .open     = radio_open,
        .read     = radio_read,
        .release  = radio_release,
-       .compat_ioctl   = v4l_compat_ioctl32,
        .ioctl    = video_ioctl2,
-       .llseek   = no_llseek,
        .poll     = radio_poll,
 };
 
index 17f80d03f38e4e2f6780fa1d10e63aa2b40e9126..10dbd4a11b30f8e4aaf7e0ac2fad97f69bb56dbb 100644 (file)
@@ -706,7 +706,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
  *     Video4linux interfacing
  */
 
-static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -863,7 +863,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int qcam_ioctl(struct inode *inode, struct file *file,
+static long qcam_ioctl(struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, qcam_do_ioctl);
@@ -893,7 +893,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
        return len;
 }
 
-static int qcam_exclusive_open(struct inode *inode, struct file *file)
+static int qcam_exclusive_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -901,7 +901,7 @@ static int qcam_exclusive_open(struct inode *inode, struct file *file)
        return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0;
 }
 
-static int qcam_exclusive_release(struct inode *inode, struct file *file)
+static int qcam_exclusive_release(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -910,16 +910,12 @@ static int qcam_exclusive_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations qcam_fops = {
+static const struct v4l2_file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = qcam_exclusive_open,
        .release        = qcam_exclusive_release,
        .ioctl          = qcam_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .read           = qcam_read,
-       .llseek         = no_llseek,
 };
 static struct video_device qcam_template=
 {
index 21c71eb085db53ba232d17fb73c4ba868f936e19..85cf1778827adee718ba6ad930bfec12d37be25d 100644 (file)
@@ -500,7 +500,7 @@ static long qc_capture(struct qcam_device *q, char __user *buf, unsigned long le
  *     Video4linux interfacing
  */
 
-static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -665,7 +665,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int qcam_ioctl(struct inode *inode, struct file *file,
+static long qcam_ioctl(struct file *file,
                      unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, qcam_do_ioctl);
@@ -687,7 +687,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
        return len;
 }
 
-static int qcam_exclusive_open(struct inode *inode, struct file *file)
+static int qcam_exclusive_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -695,7 +695,7 @@ static int qcam_exclusive_open(struct inode *inode, struct file *file)
        return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0;
 }
 
-static int qcam_exclusive_release(struct inode *inode, struct file *file)
+static int qcam_exclusive_release(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -705,16 +705,12 @@ static int qcam_exclusive_release(struct inode *inode, struct file *file)
 }
 
 /* video device template */
-static const struct file_operations qcam_fops = {
+static const struct v4l2_file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = qcam_exclusive_open,
        .release        = qcam_exclusive_release,
        .ioctl          = qcam_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .read           = qcam_read,
-       .llseek         = no_llseek,
 };
 
 static struct video_device qcam_template=
index 1740b9ebdcefef613c0c2287a854798380c9a4e0..34a39d2e4703843bc7a0dfd2dc9431f5de149907 100644 (file)
@@ -859,7 +859,7 @@ static int __cafe_cam_reset(struct cafe_camera *cam)
  */
 static int cafe_cam_init(struct cafe_camera *cam)
 {
-       struct v4l2_chip_ident chip = { V4L2_CHIP_MATCH_I2C_ADDR, 0, 0, 0 };
+       struct v4l2_dbg_chip_ident chip;
        int ret;
 
        mutex_lock(&cam->s_mutex);
@@ -869,8 +869,9 @@ static int cafe_cam_init(struct cafe_camera *cam)
        ret = __cafe_cam_reset(cam);
        if (ret)
                goto out;
-       chip.match_chip = cam->sensor->addr;
-       ret = __cafe_cam_cmd(cam, VIDIOC_G_CHIP_IDENT, &chip);
+       chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR;
+       chip.match.addr = cam->sensor->addr;
+       ret = __cafe_cam_cmd(cam, VIDIOC_DBG_G_CHIP_IDENT, &chip);
        if (ret)
                goto out;
        cam->sensor_type = chip.ident;
@@ -1472,11 +1473,11 @@ static int cafe_v4l_mmap(struct file *filp, struct vm_area_struct *vma)
 
 
 
-static int cafe_v4l_open(struct inode *inode, struct file *filp)
+static int cafe_v4l_open(struct file *filp)
 {
        struct cafe_camera *cam;
 
-       cam = cafe_find_dev(iminor(inode));
+       cam = cafe_find_dev(video_devdata(filp)->minor);
        if (cam == NULL)
                return -ENODEV;
        filp->private_data = cam;
@@ -1494,7 +1495,7 @@ static int cafe_v4l_open(struct inode *inode, struct file *filp)
 }
 
 
-static int cafe_v4l_release(struct inode *inode, struct file *filp)
+static int cafe_v4l_release(struct file *filp)
 {
        struct cafe_camera *cam = filp->private_data;
 
@@ -1759,7 +1760,7 @@ static void cafe_v4l_dev_release(struct video_device *vd)
  * clone it for specific real devices.
  */
 
-static const struct file_operations cafe_v4l_fops = {
+static const struct v4l2_file_operations cafe_v4l_fops = {
        .owner = THIS_MODULE,
        .open = cafe_v4l_open,
        .release = cafe_v4l_release,
@@ -1767,7 +1768,6 @@ static const struct file_operations cafe_v4l_fops = {
        .poll = cafe_v4l_poll,
        .mmap = cafe_v4l_mmap,
        .ioctl = video_ioctl2,
-       .llseek = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = {
index 028a400d2453b64f4658091cfa0c86eb71b833db..c3b0c8c63c7642601a2b14feceb5a1f55ff86a78 100644 (file)
@@ -3148,7 +3148,7 @@ static void put_cam(struct cpia_camera_ops* ops)
 }
 
 /* ------------------------- V4L interface --------------------- */
-static int cpia_open(struct inode *inode, struct file *file)
+static int cpia_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct cam_data *cam = video_get_drvdata(dev);
@@ -3225,7 +3225,7 @@ static int cpia_open(struct inode *inode, struct file *file)
        return err;
 }
 
-static int cpia_close(struct inode *inode, struct file *file)
+static int cpia_close(struct file *file)
 {
        struct  video_device *dev = file->private_data;
        struct cam_data *cam = video_get_drvdata(dev);
@@ -3333,7 +3333,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf,
        return cam->decompressed_frame.count;
 }
 
-static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *dev = file->private_data;
        struct cam_data *cam = video_get_drvdata(dev);
@@ -3720,7 +3720,7 @@ static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return retval;
 }
 
-static int cpia_ioctl(struct inode *inode, struct file *file,
+static long cpia_ioctl(struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, cpia_do_ioctl);
@@ -3780,17 +3780,13 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations cpia_fops = {
+static const struct v4l2_file_operations cpia_fops = {
        .owner          = THIS_MODULE,
        .open           = cpia_open,
        .release        = cpia_close,
        .read           = cpia_read,
        .mmap           = cpia_mmap,
        .ioctl          = cpia_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static struct video_device cpia_template = {
index 3c2d7eac119713d5704075e054ed5b21fa52f040..9c25894fdd8e7b19050ae7c3e58d67d45c5b11d7 100644 (file)
@@ -239,7 +239,7 @@ static struct v4l2_queryctrl controls[] = {
  *  cpia2_open
  *
  *****************************************************************************/
-static int cpia2_open(struct inode *inode, struct file *file)
+static int cpia2_open(struct file *file)
 {
        struct camera_data *cam = video_drvdata(file);
        int retval = 0;
@@ -302,7 +302,7 @@ err_return:
  *  cpia2_close
  *
  *****************************************************************************/
-static int cpia2_close(struct inode *inode, struct file *file)
+static int cpia2_close(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct camera_data *cam = video_get_drvdata(dev);
@@ -1572,10 +1572,10 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file)
  *  cpia2_ioctl
  *
  *****************************************************************************/
-static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct camera_data *cam = video_drvdata(file);
-       int retval = 0;
+       long retval = 0;
 
        if (!cam)
                return -ENOTTY;
@@ -1841,7 +1841,7 @@ static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return retval;
 }
 
-static int cpia2_ioctl(struct inode *inode, struct file *file,
+static long cpia2_ioctl(struct file *file,
                       unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, cpia2_do_ioctl);
@@ -1912,17 +1912,13 @@ static void reset_camera_struct_v4l(struct camera_data *cam)
 /***
  * The v4l video device structure initialized for this device
  ***/
-static const struct file_operations fops_template = {
+static const struct v4l2_file_operations fops_template = {
        .owner          = THIS_MODULE,
        .open           = cpia2_open,
        .release        = cpia2_close,
        .read           = cpia2_v4l_read,
        .poll           = cpia2_v4l_poll,
        .ioctl          = cpia2_ioctl,
-       .llseek         = no_llseek,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .mmap           = cpia2_mmap,
 };
 
index 70fcd0d5de13bf50b968d14ba522d545a1e813ff..14bebf8a116ffe2b4afc6546bc80eb66ef2b110d 100644 (file)
@@ -95,25 +95,24 @@ static int cs5345_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
+       reg->size = 1;
        reg->val = cs5345_read(sd, reg->reg & 0x1f);
        return 0;
 }
 
-static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -122,7 +121,7 @@ static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
 }
 #endif
 
-static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int cs5345_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index cb65d519cf78e463c0fa71b806521334c17ede3f..7292a6316e63baa8cf278411b61591ff6f39a237 100644 (file)
@@ -102,7 +102,7 @@ static int cs53l32a_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
        return 0;
 }
 
-static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int cs53l32a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 425271a29517e91534e6762163ced38f61a0cbe7..055f6e004b2dccd8d6daf7e877b23b07733bed2d 100644 (file)
@@ -552,7 +552,7 @@ void cx18_stop_capture(struct cx18_open_id *id, int gop_end)
        }
 }
 
-int cx18_v4l2_close(struct inode *inode, struct file *filp)
+int cx18_v4l2_close(struct file *filp)
 {
        struct cx18_open_id *id = filp->private_data;
        struct cx18 *cx = id->cx;
@@ -650,12 +650,12 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
        return 0;
 }
 
-int cx18_v4l2_open(struct inode *inode, struct file *filp)
+int cx18_v4l2_open(struct file *filp)
 {
        int res, x, y = 0;
        struct cx18 *cx = NULL;
        struct cx18_stream *s = NULL;
-       int minor = iminor(inode);
+       int minor = video_devdata(filp)->minor;
 
        /* Find which card this open was on */
        spin_lock(&cx18_cards_lock);
index 46da0282fc7d71bf9b1c324226989e29229c665e..92e2d5dab936e15897b1652e1ab6737b368dd21d 100644 (file)
  */
 
 /* Testing/Debugging */
-int cx18_v4l2_open(struct inode *inode, struct file *filp);
+int cx18_v4l2_open(struct file *filp);
 ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
                      loff_t *pos);
 ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count,
                       loff_t *pos);
-int cx18_v4l2_close(struct inode *inode, struct file *filp);
+int cx18_v4l2_close(struct file *filp);
 unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait);
 int cx18_start_capture(struct cx18_open_id *id);
 void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
index 8941f58bed7f042ce5cce8a97bbfeb33ef20bd79..83e1c6333126eabf84da60d05d0a45fc6274a6cf 100644 (file)
@@ -242,7 +242,7 @@ int cx18_call_i2c_client(struct cx18 *cx, int addr, unsigned cmd, void *arg)
                        return retval;
                }
        }
-       if (cmd != VIDIOC_G_CHIP_IDENT)
+       if (cmd != VIDIOC_DBG_G_CHIP_IDENT)
                CX18_ERR("i2c addr 0x%02x not found for cmd 0x%x!\n",
                               addr, cmd);
        return -ENODEV;
@@ -268,17 +268,6 @@ static int cx18_i2c_id_addr(struct cx18 *cx, u32 id)
        return retval;
 }
 
-/* Find the i2c device name matching the DRIVERID */
-static const char *cx18_i2c_id_name(u32 id)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
-               if (hw_driverids[i] == id)
-                       return hw_devicenames[i];
-       return "unknown device";
-}
-
 /* Find the i2c device name matching the CX18_HW_ flag */
 static const char *cx18_i2c_hw_name(u32 hw)
 {
@@ -326,21 +315,6 @@ int cx18_i2c_hw(struct cx18 *cx, u32 hw, unsigned int cmd, void *arg)
        return cx18_call_i2c_client(cx, addr, cmd, arg);
 }
 
-/* Calls i2c device based on I2C driver ID. */
-int cx18_i2c_id(struct cx18 *cx, u32 id, unsigned int cmd, void *arg)
-{
-       int addr;
-
-       addr = cx18_i2c_id_addr(cx, id);
-       if (addr < 0) {
-               if (cmd != VIDIOC_G_CHIP_IDENT)
-                       CX18_ERR("i2c ID 0x%08x (%s) not found for cmd 0x%x!\n",
-                               id, cx18_i2c_id_name(id), cmd);
-               return addr;
-       }
-       return cx18_call_i2c_client(cx, addr, cmd, arg);
-}
-
 /* broadcast cmd for all I2C clients and for the gpio subsystem */
 void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg)
 {
index 113c3f9a2cc0781ad6dc3d4c7c3000c32d645401..4869739013bdf3fbd68f37696f890256f89961d6 100644 (file)
@@ -23,7 +23,6 @@
 
 int cx18_i2c_hw_addr(struct cx18 *cx, u32 hw);
 int cx18_i2c_hw(struct cx18 *cx, u32 hw, unsigned int cmd, void *arg);
-int cx18_i2c_id(struct cx18 *cx, u32 id, unsigned int cmd, void *arg);
 int cx18_call_i2c_client(struct cx18 *cx, int addr, unsigned cmd, void *arg);
 void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg);
 int cx18_i2c_register(struct cx18 *cx, unsigned idx);
index e6087486f889d77b997c9eafd62ae01d69f0fbfa..7086aaba77d677ed5cc9f8d697b0206be56d4f17 100644 (file)
@@ -254,30 +254,24 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
 }
 
 static int cx18_g_chip_ident(struct file *file, void *fh,
-                               struct v4l2_chip_ident *chip)
+                               struct v4l2_dbg_chip_ident *chip)
 {
        struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
 
        chip->ident = V4L2_IDENT_NONE;
        chip->revision = 0;
-       if (chip->match_type == V4L2_CHIP_MATCH_HOST) {
-               if (v4l2_chip_match_host(chip->match_type, chip->match_chip))
-                       chip->ident = V4L2_IDENT_CX23418;
+       if (v4l2_chip_match_host(&chip->match)) {
+               chip->ident = V4L2_IDENT_CX23418;
                return 0;
        }
-       if (chip->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
-               return cx18_i2c_id(cx, chip->match_chip, VIDIOC_G_CHIP_IDENT,
-                                       chip);
-       if (chip->match_type == V4L2_CHIP_MATCH_I2C_ADDR)
-               return cx18_call_i2c_client(cx, chip->match_chip,
-                                               VIDIOC_G_CHIP_IDENT, chip);
-       return -EINVAL;
+       cx18_call_i2c_clients(cx, VIDIOC_DBG_G_CHIP_IDENT, chip);
+       return 0;
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
 {
-       struct v4l2_register *regs = arg;
+       struct v4l2_dbg_register *regs = arg;
        unsigned long flags;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -286,6 +280,7 @@ static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
                return -EINVAL;
 
        spin_lock_irqsave(&cx18_cards_lock, flags);
+       regs->size = 4;
        if (cmd == VIDIOC_DBG_G_REGISTER)
                regs->val = cx18_read_enc(cx, regs->reg);
        else
@@ -295,31 +290,25 @@ static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
 }
 
 static int cx18_g_register(struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
 
-       if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (v4l2_chip_match_host(&reg->match))
                return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
-       if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
-               return cx18_i2c_id(cx, reg->match_chip, VIDIOC_DBG_G_REGISTER,
-                                       reg);
-       return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_G_REGISTER,
-                                       reg);
+       cx18_call_i2c_clients(cx, VIDIOC_DBG_G_REGISTER, reg);
+       return 0;
 }
 
 static int cx18_s_register(struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
 
-       if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (v4l2_chip_match_host(&reg->match))
                return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
-       if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
-               return cx18_i2c_id(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER,
-                                       reg);
-       return cx18_call_i2c_client(cx, reg->match_chip, VIDIOC_DBG_S_REGISTER,
-                                       reg);
+       cx18_call_i2c_clients(cx, VIDIOC_DBG_S_REGISTER, reg);
+       return 0;
 }
 #endif
 
@@ -755,7 +744,7 @@ static int cx18_log_status(struct file *file, void *fh)
        return 0;
 }
 
-static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
+static long cx18_default(struct file *file, void *fh, int cmd, void *arg)
 {
        struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
 
@@ -783,19 +772,19 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
        return 0;
 }
 
-int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
                    unsigned long arg)
 {
        struct video_device *vfd = video_devdata(filp);
        struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
        struct cx18 *cx = id->cx;
-       int res;
+       long res;
 
        mutex_lock(&cx->serialize_lock);
 
        if (cx18_debug & CX18_DBGFLG_IOCTL)
                vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-       res = video_ioctl2(inode, filp, cmd, arg);
+       res = video_ioctl2(filp, cmd, arg);
        vfd->debug = 0;
        mutex_unlock(&cx->serialize_lock);
        return res;
index 08fe24e9510e816926b54714bd964271134ca28c..e2ca0d1521165fd210a14e8f535724e0a38d249f 100644 (file)
@@ -29,5 +29,5 @@ void cx18_set_funcs(struct video_device *vdev);
 int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
 int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
 int cx18_s_input(struct file *file, void *fh, unsigned int inp);
-int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
                    unsigned long arg);
index 63c336c95ff5005e9220361b55c6347fdb7ec401..89c1ec94f33593b590ae0039b09597e72d29b5fa 100644 (file)
 
 #define CX18_DSP0_INTERRUPT_MASK       0xd0004C
 
-static struct file_operations cx18_v4l2_enc_fops = {
+static struct v4l2_file_operations cx18_v4l2_enc_fops = {
        .owner = THIS_MODULE,
        .read = cx18_v4l2_read,
        .open = cx18_v4l2_open,
        /* FIXME change to video_ioctl2 if serialization lock can be removed */
        .ioctl = cx18_v4l2_ioctl,
-       .compat_ioctl = v4l_compat_ioctl32,
        .release = cx18_v4l2_close,
        .poll = cx18_v4l2_enc_poll,
 };
@@ -61,49 +60,41 @@ static struct {
        int num_offset;
        int dma;
        enum v4l2_buf_type buf_type;
-       struct file_operations *fops;
 } cx18_stream_info[] = {
        {       /* CX18_ENC_STREAM_TYPE_MPG */
                "encoder MPEG",
                VFL_TYPE_GRABBER, 0,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_TS */
                "TS",
                VFL_TYPE_GRABBER, -1,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_YUV */
                "encoder YUV",
                VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_VBI */
                "encoder VBI",
                VFL_TYPE_VBI, 0,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VBI_CAPTURE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_PCM */
                "encoder PCM audio",
                VFL_TYPE_GRABBER, CX18_V4L2_ENC_PCM_OFFSET,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_PRIVATE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_IDX */
                "encoder IDX",
                VFL_TYPE_GRABBER, -1,
                PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
-               &cx18_v4l2_enc_fops
        },
        {       /* CX18_ENC_STREAM_TYPE_RAD */
                "encoder radio",
                VFL_TYPE_RADIO, 0,
                PCI_DMA_NONE, V4L2_BUF_TYPE_PRIVATE,
-               &cx18_v4l2_enc_fops
        },
 };
 
@@ -184,7 +175,7 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
 
        s->v4l2dev->num = num;
        s->v4l2dev->parent = &cx->dev->dev;
-       s->v4l2dev->fops = cx18_stream_info[type].fops;
+       s->v4l2dev->fops = &cx18_v4l2_enc_fops;
        s->v4l2dev->release = video_device_release;
        s->v4l2dev->tvnorms = V4L2_STD_ALL;
        cx18_set_funcs(s->v4l2dev);
index 798d240243536a2f79fcf218a2616ccd154ad629..8f1db57bd1dd8cefc4fcd7b55865429ec04491bd 100644 (file)
@@ -1027,12 +1027,13 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev)
                        printk(KERN_ERR "%s() f/w load failed\n", __func__);
                        return retval;
                }
-               dev->cx23417_mailbox = cx23885_find_mailbox(dev);
-               if (dev->cx23417_mailbox < 0) {
+               retval = cx23885_find_mailbox(dev);
+               if (retval < 0) {
                        printk(KERN_ERR "%s() mailbox < 0, error\n",
                                __func__);
                        return -1;
                }
+               dev->cx23417_mailbox = retval;
                retval = cx23885_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0);
                if (retval < 0) {
                        printk(KERN_ERR
@@ -1573,9 +1574,9 @@ static int vidioc_queryctrl(struct file *file, void *priv,
        return cx23885_queryctrl(dev, c);
 }
 
-static int mpeg_open(struct inode *inode, struct file *file)
+static int mpeg_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct cx23885_dev *h, *dev = NULL;
        struct list_head *list;
        struct cx23885_fh *fh;
@@ -1617,7 +1618,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int mpeg_release(struct inode *inode, struct file *file)
+static int mpeg_release(struct file *file)
 {
        struct cx23885_fh  *fh  = file->private_data;
        struct cx23885_dev *dev = fh->dev;
@@ -1694,15 +1695,13 @@ static int mpeg_mmap(struct file *file, struct vm_area_struct *vma)
        return videobuf_mmap_mapper(&fh->mpegq, vma);
 }
 
-static struct file_operations mpeg_fops = {
+static struct v4l2_file_operations mpeg_fops = {
        .owner         = THIS_MODULE,
        .open          = mpeg_open,
        .release       = mpeg_release,
        .read          = mpeg_read,
        .poll          = mpeg_poll,
        .mmap          = mpeg_mmap,
-       .ioctl         = video_ioctl2,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
index c742a10be5cb2f9a94972b5f20d9eeb5ad355063..2d81c4d043403297b504a2b77b5a17560cde31c7 100644 (file)
@@ -718,9 +718,9 @@ static int get_resource(struct cx23885_fh *fh)
        }
 }
 
-static int video_open(struct inode *inode, struct file *file)
+static int video_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct cx23885_dev *h, *dev = NULL;
        struct cx23885_fh *fh;
        struct list_head *list;
@@ -834,7 +834,7 @@ static unsigned int video_poll(struct file *file,
        return 0;
 }
 
-static int video_release(struct inode *inode, struct file *file)
+static int video_release(struct file *file)
 {
        struct cx23885_fh *fh = file->private_data;
        struct cx23885_dev *dev = fh->dev;
@@ -1326,11 +1326,11 @@ static int vidioc_s_frequency(struct file *file, void *priv,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int vidioc_g_register(struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
 
        cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_G_REGISTER, reg);
@@ -1339,11 +1339,11 @@ static int vidioc_g_register(struct file *file, void *fh,
 }
 
 static int vidioc_s_register(struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
 
        cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg);
@@ -1422,7 +1422,7 @@ int cx23885_video_irq(struct cx23885_dev *dev, u32 status)
 /* ----------------------------------------------------------- */
 /* exported stuff                                              */
 
-static const struct file_operations video_fops = {
+static const struct v4l2_file_operations video_fops = {
        .owner         = THIS_MODULE,
        .open          = video_open,
        .release       = video_release,
@@ -1430,8 +1430,6 @@ static const struct file_operations video_fops = {
        .poll          = video_poll,
        .mmap          = video_mmap,
        .ioctl         = video_ioctl2,
-       .compat_ioctl  = v4l_compat_ioctl32,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1479,13 +1477,11 @@ static struct video_device cx23885_video_template = {
        .current_norm         = V4L2_STD_NTSC_M,
 };
 
-static const struct file_operations radio_fops = {
+static const struct v4l2_file_operations radio_fops = {
        .owner         = THIS_MODULE,
        .open          = video_open,
        .release       = video_release,
        .ioctl         = video_ioctl2,
-       .compat_ioctl  = v4l_compat_ioctl32,
-       .llseek        = no_llseek,
 };
 
 
index 2ad277189da820fd83478fb5d0369959f1de3ae6..88f2fd32bfe357617f82f011df18a9c31ddf7997 100644 (file)
@@ -1120,25 +1120,24 @@ static int cx25840_init(struct v4l2_subdev *sd, u32 val)
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
+       reg->size = 1;
        reg->val = cx25840_read(client, reg->reg & 0x0fff);
        return 0;
 }
 
-static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -1362,7 +1361,7 @@ static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
        return 0;
 }
 
-static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int cx25840_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct cx25840_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index e162a70748c5fa6458655daf8591f94b2d3fff63..7f5b8bfd08ac74aa01ec0657c0641ccc25348000 100644 (file)
@@ -1049,16 +1049,16 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
 
 /* FIXME: cx88_ioctl_hook not implemented */
 
-static int mpeg_open(struct inode *inode, struct file *file)
+static int mpeg_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct cx8802_dev *dev = NULL;
        struct cx8802_fh *fh;
        struct cx8802_driver *drv = NULL;
        int err;
 
        lock_kernel();
-       dev = cx8802_get_device(inode);
+       dev = cx8802_get_device(minor);
 
        dprintk( 1, "%s\n", __func__);
 
@@ -1114,7 +1114,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int mpeg_release(struct inode *inode, struct file *file)
+static int mpeg_release(struct file *file)
 {
        struct cx8802_fh  *fh  = file->private_data;
        struct cx8802_dev *dev = fh->dev;
@@ -1132,7 +1132,7 @@ static int mpeg_release(struct inode *inode, struct file *file)
        kfree(fh);
 
        /* Make sure we release the hardware */
-       dev = cx8802_get_device(inode);
+       dev = cx8802_get_device(video_devdata(file)->minor);
        if (dev == NULL)
                return -ENODEV;
 
@@ -1178,7 +1178,7 @@ mpeg_mmap(struct file *file, struct vm_area_struct * vma)
        return videobuf_mmap_mapper(&fh->mpegq, vma);
 }
 
-static const struct file_operations mpeg_fops =
+static const struct v4l2_file_operations mpeg_fops =
 {
        .owner         = THIS_MODULE,
        .open          = mpeg_open,
@@ -1187,7 +1187,6 @@ static const struct file_operations mpeg_fops =
        .poll          = mpeg_poll,
        .mmap          = mpeg_mmap,
        .ioctl         = video_ioctl2,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
index a04fee235db6c487c162434e75d20a05b4e9b463..59164fc94f5f09581d26cf96d25a7ff83d1ae6d6 100644 (file)
@@ -578,9 +578,8 @@ static int cx8802_resume_common(struct pci_dev *pci_dev)
 
 #if defined(CONFIG_VIDEO_CX88_BLACKBIRD) || \
     defined(CONFIG_VIDEO_CX88_BLACKBIRD_MODULE)
-struct cx8802_dev * cx8802_get_device(struct inode *inode)
+struct cx8802_dev *cx8802_get_device(int minor)
 {
-       int minor = iminor(inode);
        struct cx8802_dev *dev;
 
        list_for_each_entry(dev, &cx8802_devlist, devlist)
index b96ce991d968cca4b2995f99918affb7696b5cd2..791e69d804f97d89ae37f42520fc34536675072c 100644 (file)
@@ -757,9 +757,9 @@ static int get_ressource(struct cx8800_fh *fh)
        }
 }
 
-static int video_open(struct inode *inode, struct file *file)
+static int video_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct cx8800_dev *h,*dev = NULL;
        struct cx88_core *core;
        struct cx8800_fh *fh;
@@ -904,7 +904,7 @@ video_poll(struct file *file, struct poll_table_struct *wait)
        return 0;
 }
 
-static int video_release(struct inode *inode, struct file *file)
+static int video_release(struct file *file)
 {
        struct cx8800_fh  *fh  = file->private_data;
        struct cx8800_dev *dev = fh->dev;
@@ -1447,25 +1447,26 @@ static int vidioc_s_frequency (struct file *file, void *priv,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int vidioc_g_register (struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
        /* cx2388x has a 24-bit register space */
-       reg->val = cx_read(reg->reg&0xffffff);
+       reg->val = cx_read(reg->reg & 0xffffff);
+       reg->size = 4;
        return 0;
 }
 
 static int vidioc_s_register (struct file *file, void *fh,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
-       cx_write(reg->reg&0xffffff, reg->val);
+       cx_write(reg->reg & 0xffffff, reg->val);
        return 0;
 }
 #endif
@@ -1693,7 +1694,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id)
 /* ----------------------------------------------------------- */
 /* exported stuff                                              */
 
-static const struct file_operations video_fops =
+static const struct v4l2_file_operations video_fops =
 {
        .owner         = THIS_MODULE,
        .open          = video_open,
@@ -1702,8 +1703,6 @@ static const struct file_operations video_fops =
        .poll          = video_poll,
        .mmap          = video_mmap,
        .ioctl         = video_ioctl2,
-       .compat_ioctl  = v4l_compat_ioctl32,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1752,14 +1751,12 @@ static struct video_device cx8800_video_template = {
        .current_norm         = V4L2_STD_NTSC_M,
 };
 
-static const struct file_operations radio_fops =
+static const struct v4l2_file_operations radio_fops =
 {
        .owner         = THIS_MODULE,
        .open          = video_open,
        .release       = video_release,
        .ioctl         = video_ioctl2,
-       .compat_ioctl  = v4l_compat_ioctl32,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
index 20649b25f7baf522a95a659d65da13ba7369805f..eb9ce30dc5e696a0e0e33605deec485630199cc2 100644 (file)
@@ -643,7 +643,7 @@ int cx88_audio_thread(void *data);
 
 int cx8802_register_driver(struct cx8802_driver *drv);
 int cx8802_unregister_driver(struct cx8802_driver *drv);
-struct cx8802_dev * cx8802_get_device(struct inode *inode);
+struct cx8802_dev *cx8802_get_device(int minor);
 struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype);
 
 /* ----------------------------------------------------------- */
index 15c03f0e69ad63fe1a5c2015a8210e31698b21cd..94378ccb7505845d157920e4f81d9154eee6f35f 100644 (file)
@@ -62,9 +62,9 @@ static int em28xx_isoc_audio_deinit(struct em28xx *dev)
 
        dprintk("Stopping isoc\n");
        for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
-               usb_unlink_urb(dev->adev->urb[i]);
-               usb_free_urb(dev->adev->urb[i]);
-               dev->adev->urb[i] = NULL;
+               usb_unlink_urb(dev->adev.urb[i]);
+               usb_free_urb(dev->adev.urb[i]);
+               dev->adev.urb[i] = NULL;
        }
 
        return 0;
@@ -81,8 +81,8 @@ static void em28xx_audio_isocirq(struct urb *urb)
        unsigned int             stride;
        struct snd_pcm_substream *substream;
        struct snd_pcm_runtime   *runtime;
-       if (dev->adev->capture_pcm_substream) {
-               substream = dev->adev->capture_pcm_substream;
+       if (dev->adev.capture_pcm_substream) {
+               substream = dev->adev.capture_pcm_substream;
                runtime = substream->runtime;
                stride = runtime->frame_bits >> 3;
 
@@ -95,7 +95,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
                        if (!length)
                                continue;
 
-                       oldptr = dev->adev->hwptr_done_capture;
+                       oldptr = dev->adev.hwptr_done_capture;
                        if (oldptr + length >= runtime->buffer_size) {
                                unsigned int cnt =
                                    runtime->buffer_size - oldptr;
@@ -110,16 +110,16 @@ static void em28xx_audio_isocirq(struct urb *urb)
 
                        snd_pcm_stream_lock(substream);
 
-                       dev->adev->hwptr_done_capture += length;
-                       if (dev->adev->hwptr_done_capture >=
+                       dev->adev.hwptr_done_capture += length;
+                       if (dev->adev.hwptr_done_capture >=
                            runtime->buffer_size)
-                               dev->adev->hwptr_done_capture -=
+                               dev->adev.hwptr_done_capture -=
                                    runtime->buffer_size;
 
-                       dev->adev->capture_transfer_done += length;
-                       if (dev->adev->capture_transfer_done >=
+                       dev->adev.capture_transfer_done += length;
+                       if (dev->adev.capture_transfer_done >=
                            runtime->period_size) {
-                               dev->adev->capture_transfer_done -=
+                               dev->adev.capture_transfer_done -=
                                    runtime->period_size;
                                period_elapsed = 1;
                        }
@@ -131,7 +131,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
        }
        urb->status = 0;
 
-       if (dev->adev->shutdown)
+       if (dev->adev.shutdown)
                return;
 
        status = usb_submit_urb(urb, GFP_ATOMIC);
@@ -154,17 +154,17 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
                struct urb *urb;
                int j, k;
 
-               dev->adev->transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
-               if (!dev->adev->transfer_buffer[i])
+               dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
+               if (!dev->adev.transfer_buffer[i])
                        return -ENOMEM;
 
-               memset(dev->adev->transfer_buffer[i], 0x80, sb_size);
+               memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
                urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
                if (!urb) {
                        em28xx_errdev("usb_alloc_urb failed!\n");
                        for (j = 0; j < i; j++) {
-                               usb_free_urb(dev->adev->urb[j]);
-                               kfree(dev->adev->transfer_buffer[j]);
+                               usb_free_urb(dev->adev.urb[j]);
+                               kfree(dev->adev.transfer_buffer[j]);
                        }
                        return -ENOMEM;
                }
@@ -173,7 +173,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
                urb->context = dev;
                urb->pipe = usb_rcvisocpipe(dev->udev, 0x83);
                urb->transfer_flags = URB_ISO_ASAP;
-               urb->transfer_buffer = dev->adev->transfer_buffer[i];
+               urb->transfer_buffer = dev->adev.transfer_buffer[i];
                urb->interval = 1;
                urb->complete = em28xx_audio_isocirq;
                urb->number_of_packets = EM28XX_NUM_AUDIO_PACKETS;
@@ -185,11 +185,11 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
                        urb->iso_frame_desc[j].length =
                            EM28XX_AUDIO_MAX_PACKET_SIZE;
                }
-               dev->adev->urb[i] = urb;
+               dev->adev.urb[i] = urb;
        }
 
        for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
-               errCode = usb_submit_urb(dev->adev->urb[i], GFP_ATOMIC);
+               errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
                if (errCode) {
                        em28xx_isoc_audio_deinit(dev);
 
@@ -202,16 +202,16 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
 
 static int em28xx_cmd(struct em28xx *dev, int cmd, int arg)
 {
-       dprintk("%s transfer\n", (dev->adev->capture_stream == STREAM_ON)?
+       dprintk("%s transfer\n", (dev->adev.capture_stream == STREAM_ON) ?
                                 "stop" : "start");
 
        switch (cmd) {
        case EM28XX_CAPTURE_STREAM_EN:
-               if (dev->adev->capture_stream == STREAM_OFF && arg == 1) {
-                       dev->adev->capture_stream = STREAM_ON;
+               if (dev->adev.capture_stream == STREAM_OFF && arg == 1) {
+                       dev->adev.capture_stream = STREAM_ON;
                        em28xx_init_audio_isoc(dev);
-               } else if (dev->adev->capture_stream == STREAM_ON && arg == 0) {
-                       dev->adev->capture_stream = STREAM_OFF;
+               } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) {
+                       dev->adev.capture_stream = STREAM_OFF;
                        em28xx_isoc_audio_deinit(dev);
                } else {
                        printk(KERN_ERR "An underrun very likely occurred. "
@@ -289,17 +289,17 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
                goto err;
 
        runtime->hw = snd_em28xx_hw_capture;
-       if (dev->alt == 0 && dev->adev->users == 0) {
+       if (dev->alt == 0 && dev->adev.users == 0) {
                int errCode;
                dev->alt = 7;
                errCode = usb_set_interface(dev->udev, 0, 7);
                dprintk("changing alternate number to 7\n");
        }
 
-       dev->adev->users++;
+       dev->adev.users++;
 
        snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
-       dev->adev->capture_pcm_substream = substream;
+       dev->adev.capture_pcm_substream = substream;
        runtime->private_data = dev;
 
        return 0;
@@ -311,7 +311,7 @@ err:
 static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream)
 {
        struct em28xx *dev = snd_pcm_substream_chip(substream);
-       dev->adev->users--;
+       dev->adev.users--;
 
        dprintk("closing device\n");
 
@@ -320,10 +320,10 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream)
        em28xx_audio_analog_set(dev);
        mutex_unlock(&dev->lock);
 
-       if (dev->adev->users == 0 && dev->adev->shutdown == 1) {
-               dprintk("audio users: %d\n", dev->adev->users);
+       if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
+               dprintk("audio users: %d\n", dev->adev.users);
                dprintk("disabling audio stream!\n");
-               dev->adev->shutdown = 0;
+               dev->adev.shutdown = 0;
                dprintk("released lock\n");
                em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
        }
@@ -356,7 +356,7 @@ static int snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream)
 
        dprintk("Stop capture, if needed\n");
 
-       if (dev->adev->capture_stream == STREAM_ON)
+       if (dev->adev.capture_stream == STREAM_ON)
                em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
 
        return 0;
@@ -379,7 +379,7 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
                em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1);
                return 0;
        case SNDRV_PCM_TRIGGER_STOP:
-               dev->adev->shutdown = 1;
+               dev->adev.shutdown = 1;
                return 0;
        default:
                return -EINVAL;
@@ -393,7 +393,7 @@ static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream
 
        snd_pcm_uframes_t hwptr_done;
        dev = snd_pcm_substream_chip(substream);
-       hwptr_done = dev->adev->hwptr_done_capture;
+       hwptr_done = dev->adev.hwptr_done_capture;
 
        return hwptr_done;
 }
@@ -420,7 +420,7 @@ static struct snd_pcm_ops snd_em28xx_pcm_capture = {
 
 static int em28xx_audio_init(struct em28xx *dev)
 {
-       struct em28xx_audio *adev;
+       struct em28xx_audio *adev = &dev->adev;
        struct snd_pcm      *pcm;
        struct snd_card     *card;
        static int          devnr;
@@ -438,16 +438,9 @@ static int em28xx_audio_init(struct em28xx *dev)
        printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus "
                         "Rechberger\n");
 
-       adev = kzalloc(sizeof(*adev), GFP_KERNEL);
-       if (!adev) {
-               printk(KERN_ERR "em28xx-audio.c: out of memory\n");
-               return -1;
-       }
        card = snd_card_new(index[devnr], "Em28xx Audio", THIS_MODULE, 0);
-       if (card == NULL) {
-               kfree(adev);
+       if (card == NULL)
                return -ENOMEM;
-       }
 
        spin_lock_init(&adev->slock);
        err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
@@ -471,7 +464,6 @@ static int em28xx_audio_init(struct em28xx *dev)
        }
        adev->sndcard = card;
        adev->udev = dev->udev;
-       dev->adev = adev;
 
        return 0;
 }
@@ -488,10 +480,9 @@ static int em28xx_audio_fini(struct em28xx *dev)
                return 0;
        }
 
-       if (dev->adev) {
-               snd_card_free(dev->adev->sndcard);
-               kfree(dev->adev);
-               dev->adev = NULL;
+       if (dev->adev.sndcard) {
+               snd_card_free(dev->adev.sndcard);
+               dev->adev.sndcard = NULL;
        }
 
        return 0;
index f8504518586abadc2fb27208b331c2010327596b..819cceaa6ef41fa709fc152c172dc87d20580ef2 100644 (file)
@@ -1000,12 +1000,11 @@ void em28xx_wake_i2c(struct em28xx *dev)
 static LIST_HEAD(em28xx_devlist);
 static DEFINE_MUTEX(em28xx_devlist_mutex);
 
-struct em28xx *em28xx_get_device(struct inode *inode,
+struct em28xx *em28xx_get_device(int minor,
                                 enum v4l2_buf_type *fh_type,
                                 int *has_radio)
 {
        struct em28xx *h, *dev = NULL;
-       int minor = iminor(inode);
 
        *fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        *has_radio = 0;
index 65dcb91bdcc2046baa7d3070224e5c71245a5f04..24e39c56811e98713f8497cca6f46fbd48409209 100644 (file)
 
 /* FIXME: Need to be populated with the other chip ID's */
 enum em28xx_chip_id {
-       CHIP_ID_EM2820 = 18,
+       CHIP_ID_EM2820 = 18,    /* Also used by em2710 */
        CHIP_ID_EM2840 = 20,
        CHIP_ID_EM2750 = 33,
        CHIP_ID_EM2860 = 34,
index 53527536481e6946b1432b2b08b4590ac0620596..416b691c33c1eafd382420fbc7dbb1af79ff64f3 100644 (file)
@@ -1154,7 +1154,7 @@ static int em28xx_reg_len(int reg)
 }
 
 static int vidioc_g_chip_ident(struct file *file, void *priv,
-              struct v4l2_chip_ident *chip)
+              struct v4l2_dbg_chip_ident *chip)
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
@@ -1162,20 +1162,20 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
        chip->ident = V4L2_IDENT_NONE;
        chip->revision = 0;
 
-       em28xx_i2c_call_clients(dev, VIDIOC_G_CHIP_IDENT, chip);
+       em28xx_i2c_call_clients(dev, VIDIOC_DBG_G_CHIP_IDENT, chip);
 
        return 0;
 }
 
 
 static int vidioc_g_register(struct file *file, void *priv,
-                            struct v4l2_register *reg)
+                            struct v4l2_dbg_register *reg)
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
        int ret;
 
-       switch (reg->match_type) {
+       switch (reg->match.type) {
        case V4L2_CHIP_MATCH_AC97:
                mutex_lock(&dev->lock);
                ret = em28xx_read_ac97(dev, reg->reg);
@@ -1184,6 +1184,7 @@ static int vidioc_g_register(struct file *file, void *priv,
                        return ret;
 
                reg->val = ret;
+               reg->size = 1;
                return 0;
        case V4L2_CHIP_MATCH_I2C_DRIVER:
                em28xx_i2c_call_clients(dev, VIDIOC_DBG_G_REGISTER, reg);
@@ -1192,12 +1193,13 @@ static int vidioc_g_register(struct file *file, void *priv,
                /* Not supported yet */
                return -EINVAL;
        default:
-               if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+               if (!v4l2_chip_match_host(&reg->match))
                        return -EINVAL;
        }
 
        /* Match host */
-       if (em28xx_reg_len(reg->reg) == 1) {
+       reg->size = em28xx_reg_len(reg->reg);
+       if (reg->size == 1) {
                mutex_lock(&dev->lock);
                ret = em28xx_read_reg(dev, reg->reg);
                mutex_unlock(&dev->lock);
@@ -1207,7 +1209,7 @@ static int vidioc_g_register(struct file *file, void *priv,
 
                reg->val = ret;
        } else {
-               __le64 val = 0;
+               __le16 val = 0;
                mutex_lock(&dev->lock);
                ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS,
                                                   reg->reg, (char *)&val, 2);
@@ -1215,21 +1217,21 @@ static int vidioc_g_register(struct file *file, void *priv,
                if (ret < 0)
                        return ret;
 
-               reg->val = le64_to_cpu(val);
+               reg->val = le16_to_cpu(val);
        }
 
        return 0;
 }
 
 static int vidioc_s_register(struct file *file, void *priv,
-                            struct v4l2_register *reg)
+                            struct v4l2_dbg_register *reg)
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
-       __le64 buf;
+       __le16 buf;
        int    rc;
 
-       switch (reg->match_type) {
+       switch (reg->match.type) {
        case V4L2_CHIP_MATCH_AC97:
                mutex_lock(&dev->lock);
                rc = em28xx_write_ac97(dev, reg->reg, reg->val);
@@ -1243,12 +1245,12 @@ static int vidioc_s_register(struct file *file, void *priv,
                /* Not supported yet */
                return -EINVAL;
        default:
-               if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+               if (!v4l2_chip_match_host(&reg->match))
                        return -EINVAL;
        }
 
        /* Match host */
-       buf = cpu_to_le64(reg->val);
+       buf = cpu_to_le16(reg->val);
 
        mutex_lock(&dev->lock);
        rc = em28xx_write_regs(dev, reg->reg, (char *)&buf,
@@ -1582,15 +1584,15 @@ static int radio_queryctrl(struct file *file, void *priv,
  * em28xx_v4l2_open()
  * inits the device and starts isoc transfer
  */
-static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
+static int em28xx_v4l2_open(struct file *filp)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(filp)->minor;
        int errCode = 0, radio;
        struct em28xx *dev;
        enum v4l2_buf_type fh_type;
        struct em28xx_fh *fh;
 
-       dev = em28xx_get_device(inode, &fh_type, &radio);
+       dev = em28xx_get_device(minor, &fh_type, &radio);
 
        if (NULL == dev)
                return -ENODEV;
@@ -1686,7 +1688,7 @@ void em28xx_release_analog_resources(struct em28xx *dev)
  * stops streaming and deallocates all resources allocated by the v4l2
  * calls and ioctls
  */
-static int em28xx_v4l2_close(struct inode *inode, struct file *filp)
+static int em28xx_v4l2_close(struct file *filp)
 {
        struct em28xx_fh *fh  = filp->private_data;
        struct em28xx    *dev = fh->dev;
@@ -1826,7 +1828,7 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma)
        return rc;
 }
 
-static const struct file_operations em28xx_v4l_fops = {
+static const struct v4l2_file_operations em28xx_v4l_fops = {
        .owner         = THIS_MODULE,
        .open          = em28xx_v4l2_open,
        .release       = em28xx_v4l2_close,
@@ -1834,8 +1836,6 @@ static const struct file_operations em28xx_v4l_fops = {
        .poll          = em28xx_v4l2_poll,
        .mmap          = em28xx_v4l2_mmap,
        .ioctl         = video_ioctl2,
-       .llseek        = no_llseek,
-       .compat_ioctl  = v4l_compat_ioctl32,
 };
 
 static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1890,13 +1890,11 @@ static const struct video_device em28xx_video_template = {
        .current_norm               = V4L2_STD_PAL,
 };
 
-static const struct file_operations radio_fops = {
+static const struct v4l2_file_operations radio_fops = {
        .owner         = THIS_MODULE,
        .open          = em28xx_v4l2_open,
        .release       = em28xx_v4l2_close,
        .ioctl         = video_ioctl2,
-       .compat_ioctl  = v4l_compat_ioctl32,
-       .llseek        = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
index b5eddc26388e476d4174149b824185482f1c7281..6c6b94aa05b2ca2377d0672c3149095cd38661e1 100644 (file)
@@ -473,7 +473,7 @@ struct em28xx {
        unsigned long i2c_hash; /* i2c devicelist hash -
                                   for boards with generic ID */
 
-       struct em28xx_audio *adev;
+       struct em28xx_audio adev;
 
        /* states */
        enum em28xx_dev_state state;
@@ -583,7 +583,7 @@ int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio);
 void em28xx_wake_i2c(struct em28xx *dev);
 void em28xx_remove_from_devlist(struct em28xx *dev);
 void em28xx_add_into_devlist(struct em28xx *dev);
-struct em28xx *em28xx_get_device(struct inode *inode,
+struct em28xx *em28xx_get_device(int minor,
                                 enum v4l2_buf_type *fh_type,
                                 int *has_radio);
 int em28xx_register_extension(struct em28xx_ops *dev);
index 83c07112c59d64c4fb6832b01a5d1cedc174c07c..d1c1e457f0b95a937a135920d07b1b474317dc3f 100644 (file)
@@ -1206,7 +1206,7 @@ static void et61x251_release_resources(struct kref *kref)
 }
 
 
-static int et61x251_open(struct inode* inode, struct file* filp)
+static int et61x251_open(struct file *filp)
 {
        struct et61x251_device* cam;
        int err = 0;
@@ -1291,7 +1291,7 @@ out:
 }
 
 
-static int et61x251_release(struct inode* inode, struct file* filp)
+static int et61x251_release(struct file *filp)
 {
        struct et61x251_device* cam;
 
@@ -2392,8 +2392,8 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
 }
 
 
-static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
-                              unsigned int cmd, void __user * arg)
+static long et61x251_ioctl_v4l2(struct file *filp,
+                              unsigned int cmd, void __user *arg)
 {
        struct et61x251_device *cam = video_drvdata(filp);
 
@@ -2487,11 +2487,11 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
 }
 
 
-static int et61x251_ioctl(struct inode* inode, struct file* filp,
+static long et61x251_ioctl(struct file *filp,
                         unsigned int cmd, unsigned long arg)
 {
        struct et61x251_device *cam = video_drvdata(filp);
-       int err = 0;
+       long err = 0;
 
        if (mutex_lock_interruptible(&cam->fileop_mutex))
                return -ERESTARTSYS;
@@ -2511,7 +2511,7 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp,
 
        V4LDBG(3, "et61x251", cmd);
 
-       err = et61x251_ioctl_v4l2(inode, filp, cmd, (void __user *)arg);
+       err = et61x251_ioctl_v4l2(filp, cmd, (void __user *)arg);
 
        mutex_unlock(&cam->fileop_mutex);
 
@@ -2519,18 +2519,14 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp,
 }
 
 
-static const struct file_operations et61x251_fops = {
+static const struct v4l2_file_operations et61x251_fops = {
        .owner = THIS_MODULE,
        .open =    et61x251_open,
        .release = et61x251_release,
        .ioctl =   et61x251_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
        .read =    et61x251_read,
        .poll =    et61x251_poll,
        .mmap =    et61x251_mmap,
-       .llseek =  no_llseek,
 };
 
 /*****************************************************************************/
index 8b9f3bde5740dd7edcf60270b7c5b5be3a0230fc..5e36b9a4ae3ea289ee016af8041230ef622ef0bf 100644 (file)
@@ -875,7 +875,7 @@ static void gspca_release(struct video_device *vfd)
        kfree(gspca_dev);
 }
 
-static int dev_open(struct inode *inode, struct file *file)
+static int dev_open(struct file *file)
 {
        struct gspca_dev *gspca_dev;
        int ret;
@@ -922,7 +922,7 @@ out:
        return ret;
 }
 
-static int dev_close(struct inode *inode, struct file *file)
+static int dev_close(struct file *file)
 {
        struct gspca_dev *gspca_dev = file->private_data;
 
@@ -1802,17 +1802,13 @@ out:
        return ret;
 }
 
-static struct file_operations dev_fops = {
+static struct v4l2_file_operations dev_fops = {
        .owner = THIS_MODULE,
        .open = dev_open,
        .release = dev_close,
        .read = dev_read,
        .mmap = dev_mmap,
-       .unlocked_ioctl = __video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek = no_llseek,
+       .unlocked_ioctl = video_ioctl2,
        .poll   = dev_poll,
 };
 
index 352f84d440fb64272e6818fc2439122fa0c43230..79393d1772e40163a7e4bcfa1f971ef88faaacd8 100644 (file)
@@ -306,7 +306,7 @@ static int hexium_detach(struct saa7146_dev *dev)
        return 0;
 }
 
-static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 {
        struct saa7146_dev *dev = fh->dev;
        struct hexium *hexium = (struct hexium *) dev->ext_priv;
index 8d3c1482e7ea376b5ae9919f7107b7eded09e185..074bec711fe0a621b1894f50c35246195b7bc3bf 100644 (file)
@@ -370,7 +370,7 @@ static int hexium_detach(struct saa7146_dev *dev)
        return 0;
 }
 
-static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static long hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 {
        struct saa7146_dev *dev = fh->dev;
        struct hexium *hexium = (struct hexium *) dev->ext_priv;
index 08b762951759eab53949ea35c13b40f77f2eca95..e8e5921cdc346dd8b26efa1ad93cc01f1791acdb 100644 (file)
@@ -902,18 +902,19 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
        }
 
        if (hw & IVTV_HW_SAA711X) {
-               struct v4l2_chip_ident v = { V4L2_CHIP_MATCH_I2C_DRIVER, I2C_DRIVERID_SAA711X };
+               struct v4l2_dbg_chip_ident v;
 
                /* determine the exact saa711x model */
                itv->hw_flags &= ~IVTV_HW_SAA711X;
 
+               v.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
+               strlcpy(v.match.name, "saa7115", sizeof(v.match.name));
                ivtv_call_hw(itv, IVTV_HW_SAA711X, core, g_chip_ident, &v);
                if (v.ident == V4L2_IDENT_SAA7114) {
                        itv->hw_flags |= IVTV_HW_SAA7114;
                        /* VBI is not yet supported by the saa7114 driver. */
                        itv->v4l2_cap &= ~(V4L2_CAP_SLICED_VBI_CAPTURE|V4L2_CAP_VBI_CAPTURE);
-               }
-               else {
+               } else {
                        itv->hw_flags |= IVTV_HW_SAA7115;
                }
                itv->vbi.raw_decoder_line_size = 1443;
index 5eb587592e9dbdfc27a6c2d0e18c0a4e082f85b1..d594bc29f07f48a4293f0e1b7e753719e30e9f2a 100644 (file)
@@ -831,7 +831,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
        ivtv_release_stream(s);
 }
 
-int ivtv_v4l2_close(struct inode *inode, struct file *filp)
+int ivtv_v4l2_close(struct file *filp)
 {
        struct ivtv_open_id *id = filp->private_data;
        struct ivtv *itv = id->itv;
@@ -978,7 +978,7 @@ static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp)
        return 0;
 }
 
-int ivtv_v4l2_open(struct inode *inode, struct file *filp)
+int ivtv_v4l2_open(struct file *filp)
 {
        int res;
        struct ivtv *itv = NULL;
index df81e790147f71a9e839d5efda508a614778ef77..049a2923965d9259713230f5612f150d69773f79 100644 (file)
 #define IVTV_FILEOPS_H
 
 /* Testing/Debugging */
-int ivtv_v4l2_open(struct inode *inode, struct file *filp);
+int ivtv_v4l2_open(struct file *filp);
 ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count,
                      loff_t * pos);
 ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count,
                       loff_t * pos);
-int ivtv_v4l2_close(struct inode *inode, struct file *filp);
+int ivtv_v4l2_close(struct file *filp);
 unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait);
 unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait);
 int ivtv_start_capture(struct ivtv_open_id *id);
index cd990a4b81a9e338ba97219f824113cd6c833169..f6b3ef6e691be8465ab82b397b7c796bd27b0cf4 100644 (file)
@@ -674,19 +674,19 @@ static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_f
        return ret;
 }
 
-static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident *chip)
+static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident *chip)
 {
        struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
 
        chip->ident = V4L2_IDENT_NONE;
        chip->revision = 0;
-       if (chip->match_type == V4L2_CHIP_MATCH_HOST) {
-               if (v4l2_chip_match_host(chip->match_type, chip->match_chip))
+       if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
+               if (v4l2_chip_match_host(&chip->match))
                        chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416;
                return 0;
        }
-       if (chip->match_type != V4L2_CHIP_MATCH_I2C_DRIVER &&
-           chip->match_type != V4L2_CHIP_MATCH_I2C_ADDR)
+       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
+           chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
                return -EINVAL;
        /* TODO: is this correct? */
        return ivtv_call_all_err(itv, core, g_chip_ident, chip);
@@ -695,7 +695,7 @@ static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_chip_ident
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
 {
-       struct v4l2_register *regs = arg;
+       struct v4l2_dbg_register *regs = arg;
        volatile u8 __iomem *reg_start;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -710,6 +710,7 @@ static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
        else
                return -EINVAL;
 
+       regs->size = 4;
        if (cmd == VIDIOC_DBG_G_REGISTER)
                regs->val = readl(regs->reg + reg_start);
        else
@@ -717,11 +718,11 @@ static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *reg)
+static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
 {
        struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
 
-       if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (v4l2_chip_match_host(&reg->match))
                return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
        /* TODO: subdev errors should not be ignored, this should become a
           subdev helper function. */
@@ -729,11 +730,11 @@ static int ivtv_g_register(struct file *file, void *fh, struct v4l2_register *re
        return 0;
 }
 
-static int ivtv_s_register(struct file *file, void *fh, struct v4l2_register *reg)
+static int ivtv_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
 {
        struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
 
-       if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (v4l2_chip_match_host(&reg->match))
                return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
        /* TODO: subdev errors should not be ignored, this should become a
           subdev helper function. */
@@ -1725,7 +1726,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int ivtv_default(struct file *file, void *fh, int cmd, void *arg)
+static long ivtv_default(struct file *file, void *fh, int cmd, void *arg)
 {
        struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
 
@@ -1827,7 +1828,7 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
 
        if (ivtv_debug & IVTV_DBGFLG_IOCTL)
                vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-       ret = __video_ioctl2(filp, cmd, arg);
+       ret = video_ioctl2(filp, cmd, arg);
        vfd->debug = 0;
        return ret;
 }
index f77d764707b2a1f81b7bef2953de5c920918e3d7..854a950af78c757ae95ff9f8a39a6a7a6f1d3ede 100644 (file)
 #include "ivtv-cards.h"
 #include "ivtv-streams.h"
 
-static const struct file_operations ivtv_v4l2_enc_fops = {
+static const struct v4l2_file_operations ivtv_v4l2_enc_fops = {
        .owner = THIS_MODULE,
        .read = ivtv_v4l2_read,
        .write = ivtv_v4l2_write,
        .open = ivtv_v4l2_open,
        .unlocked_ioctl = ivtv_v4l2_ioctl,
-       .compat_ioctl = v4l_compat_ioctl32,
        .release = ivtv_v4l2_close,
        .poll = ivtv_v4l2_enc_poll,
 };
 
-static const struct file_operations ivtv_v4l2_dec_fops = {
+static const struct v4l2_file_operations ivtv_v4l2_dec_fops = {
        .owner = THIS_MODULE,
        .read = ivtv_v4l2_read,
        .write = ivtv_v4l2_write,
        .open = ivtv_v4l2_open,
        .unlocked_ioctl = ivtv_v4l2_ioctl,
-       .compat_ioctl = v4l_compat_ioctl32,
        .release = ivtv_v4l2_close,
        .poll = ivtv_v4l2_dec_poll,
 };
@@ -78,7 +76,7 @@ static struct {
        int num_offset;
        int dma, pio;
        enum v4l2_buf_type buf_type;
-       const struct file_operations *fops;
+       const struct v4l2_file_operations *fops;
 } ivtv_stream_info[] = {
        {       /* IVTV_ENC_STREAM_TYPE_MPG */
                "encoder MPG",
index 07be14a9fe7b7cd49b4fe95a21d9fd2cf3b7942b..de397ef57b44d7aefa843a2e5f6fbd761e24a6ac 100644 (file)
@@ -80,29 +80,28 @@ static int m52790_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct m52790_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        if (reg->reg != 0)
                return -EINVAL;
+       reg->size = 1;
        reg->val = state->input | state->output;
        return 0;
 }
 
-static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct m52790_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -115,7 +114,7 @@ static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
 }
 #endif
 
-static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int m52790_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 6418f4a78f2a86afc716ff9e6e4d377ceceb434d..b76e33d5c867bad4430035ac952765497fc128ee 100644 (file)
@@ -841,7 +841,7 @@ again:
 /* video4linux integration                                                  */
 /****************************************************************************/
 
-static int meye_open(struct inode *inode, struct file *file)
+static int meye_open(struct file *file)
 {
        int i;
 
@@ -863,7 +863,7 @@ static int meye_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int meye_release(struct inode *inode, struct file *file)
+static int meye_release(struct file *file)
 {
        mchip_hic_stop();
        mchip_dma_free();
@@ -1577,7 +1577,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
        return 0;
 }
 
-static int vidioc_default(struct file *file, void *fh, int cmd, void *arg)
+static long vidioc_default(struct file *file, void *fh, int cmd, void *arg)
 {
        switch (cmd) {
        case MEYEIOC_G_PARAMS:
@@ -1684,17 +1684,13 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations meye_fops = {
+static const struct v4l2_file_operations meye_fops = {
        .owner          = THIS_MODULE,
        .open           = meye_open,
        .release        = meye_release,
        .mmap           = meye_mmap,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .poll           = meye_poll,
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops meye_ioctl_ops = {
index a622dbb72ed89e166fec1566f40abcc825e27c23..4d7a91852117920b6dfe38b5d9ed7f1f9278f5c6 100644 (file)
@@ -483,7 +483,7 @@ static int msp_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 }
 
 #ifdef CONFIG_VIDEO_ALLOW_V4L1
-static int msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
+static long msp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 {
        struct msp_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -733,7 +733,7 @@ static int msp_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
        return 0;
 }
 
-static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int msp_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct msp_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index 1a1a12453672984b903e1bb96461d48aa881242c..c1bf75ef2741389576f167c65ccbda8254fa4c40 100644 (file)
@@ -343,14 +343,14 @@ static int mt9m001_try_fmt(struct soc_camera_device *icd,
 }
 
 static int mt9m001_get_chip_id(struct soc_camera_device *icd,
-                              struct v4l2_chip_ident *id)
+                              struct v4l2_dbg_chip_ident *id)
 {
        struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd);
 
-       if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR)
+       if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
                return -EINVAL;
 
-       if (id->match_chip != mt9m001->client->addr)
+       if (id->match.addr != mt9m001->client->addr)
                return -ENODEV;
 
        id->ident       = mt9m001->model;
@@ -361,16 +361,17 @@ static int mt9m001_get_chip_id(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9m001_get_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9m001->client->addr)
+       if (reg->match.addr != mt9m001->client->addr)
                return -ENODEV;
 
+       reg->size = 2;
        reg->val = reg_read(icd, reg->reg);
 
        if (reg->val > 0xffff)
@@ -380,14 +381,14 @@ static int mt9m001_get_register(struct soc_camera_device *icd,
 }
 
 static int mt9m001_set_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9m001->client->addr)
+       if (reg->match.addr != mt9m001->client->addr)
                return -ENODEV;
 
        if (reg_write(icd, reg->reg, reg->val) < 0)
index c89ea41fe25948d216535ac34ed5d1604c7a76e1..5b8e20979cceeb94288a328b8cde1c3ee6a27a4c 100644 (file)
@@ -514,14 +514,14 @@ static int mt9m111_try_fmt(struct soc_camera_device *icd,
 }
 
 static int mt9m111_get_chip_id(struct soc_camera_device *icd,
-                              struct v4l2_chip_ident *id)
+                              struct v4l2_dbg_chip_ident *id)
 {
        struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd);
 
-       if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR)
+       if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
                return -EINVAL;
 
-       if (id->match_chip != mt9m111->client->addr)
+       if (id->match.addr != mt9m111->client->addr)
                return -ENODEV;
 
        id->ident       = mt9m111->model;
@@ -532,18 +532,19 @@ static int mt9m111_get_chip_id(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9m111_get_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        int val;
 
        struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff)
                return -EINVAL;
-       if (reg->match_chip != mt9m111->client->addr)
+       if (reg->match.addr != mt9m111->client->addr)
                return -ENODEV;
 
        val = mt9m111_reg_read(icd, reg->reg);
+       reg->size = 2;
        reg->val = (u64)val;
 
        if (reg->val > 0xffff)
@@ -553,14 +554,14 @@ static int mt9m111_get_register(struct soc_camera_device *icd,
 }
 
 static int mt9m111_set_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0x2ff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9m111->client->addr)
+       if (reg->match.addr != mt9m111->client->addr)
                return -ENODEV;
 
        if (mt9m111_reg_write(icd, reg->reg, reg->val) < 0)
index 1a9d53966d06cf251816488c780f3a347fed3d84..349d8e36553087886354ff8771cf4b1cab12c4c5 100644 (file)
@@ -326,14 +326,14 @@ static int mt9t031_try_fmt(struct soc_camera_device *icd,
 }
 
 static int mt9t031_get_chip_id(struct soc_camera_device *icd,
-                              struct v4l2_chip_ident *id)
+                              struct v4l2_dbg_chip_ident *id)
 {
        struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
 
-       if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR)
+       if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
                return -EINVAL;
 
-       if (id->match_chip != mt9t031->client->addr)
+       if (id->match.addr != mt9t031->client->addr)
                return -ENODEV;
 
        id->ident       = mt9t031->model;
@@ -344,14 +344,14 @@ static int mt9t031_get_chip_id(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9t031_get_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9t031->client->addr)
+       if (reg->match.addr != mt9t031->client->addr)
                return -ENODEV;
 
        reg->val = reg_read(icd, reg->reg);
@@ -363,14 +363,14 @@ static int mt9t031_get_register(struct soc_camera_device *icd,
 }
 
 static int mt9t031_set_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9t031 *mt9t031 = container_of(icd, struct mt9t031, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9t031->client->addr)
+       if (reg->match.addr != mt9t031->client->addr)
                return -ENODEV;
 
        if (reg_write(icd, reg->reg, reg->val) < 0)
index 14a5f9c21ffa22d76cd10e76f52825fe5d9f9a33..b04c8cb1644d1193cf3d59ef7b6df597fb7b6933 100644 (file)
@@ -422,14 +422,14 @@ static int mt9v022_try_fmt(struct soc_camera_device *icd,
 }
 
 static int mt9v022_get_chip_id(struct soc_camera_device *icd,
-                              struct v4l2_chip_ident *id)
+                              struct v4l2_dbg_chip_ident *id)
 {
        struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd);
 
-       if (id->match_type != V4L2_CHIP_MATCH_I2C_ADDR)
+       if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
                return -EINVAL;
 
-       if (id->match_chip != mt9v022->client->addr)
+       if (id->match.addr != mt9v022->client->addr)
                return -ENODEV;
 
        id->ident       = mt9v022->model;
@@ -440,16 +440,17 @@ static int mt9v022_get_chip_id(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9v022_get_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9v022->client->addr)
+       if (reg->match.addr != mt9v022->client->addr)
                return -ENODEV;
 
+       reg->size = 2;
        reg->val = reg_read(icd, reg->reg);
 
        if (reg->val > 0xffff)
@@ -459,14 +460,14 @@ static int mt9v022_get_register(struct soc_camera_device *icd,
 }
 
 static int mt9v022_set_register(struct soc_camera_device *icd,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd);
 
-       if (reg->match_type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
+       if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
                return -EINVAL;
 
-       if (reg->match_chip != mt9v022->client->addr)
+       if (reg->match.addr != mt9v022->client->addr)
                return -ENODEV;
 
        if (reg_write(icd, reg->reg, reg->val) < 0)
index 7f130284b5c730a0573bcc0c10c9cd925cb5dfec..e3cbe14c349a788288987200be077322e7ecf3d1 100644 (file)
@@ -489,7 +489,7 @@ static int mxb_detach(struct saa7146_dev *dev)
        return 0;
 }
 
-static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
+static long mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 {
        struct saa7146_dev *dev = fh->dev;
        struct mxb *mxb = (struct mxb *)dev->ext_priv;
index 85c3c7c92af1902ccd7b51768882245950a66e9e..73eb656acfe356b0ca965fffee948fbd75436397 100644 (file)
@@ -1454,9 +1454,9 @@ static int omap24xxcam_mmap(struct file *file, struct vm_area_struct *vma)
        return rval;
 }
 
-static int omap24xxcam_open(struct inode *inode, struct file *file)
+static int omap24xxcam_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct omap24xxcam_device *cam = omap24xxcam.priv;
        struct omap24xxcam_fh *fh;
        struct v4l2_format format;
@@ -1511,7 +1511,7 @@ out_try_module_get:
        return -ENODEV;
 }
 
-static int omap24xxcam_release(struct inode *inode, struct file *file)
+static int omap24xxcam_release(struct file *file)
 {
        struct omap24xxcam_fh *fh = file->private_data;
        struct omap24xxcam_device *cam = fh->cam;
@@ -1559,8 +1559,7 @@ static int omap24xxcam_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations omap24xxcam_fops = {
-       .llseek  = no_llseek,
+static struct v4l2_file_operations omap24xxcam_fops = {
        .ioctl   = video_ioctl2,
        .poll    = omap24xxcam_poll,
        .mmap    = omap24xxcam_mmap,
index 6ee9b69cc4a90585c7daa10b27bcc0136f43bfa8..9af5532db1423eb1d7971e5a00396a49c03f1959 100644 (file)
@@ -3915,7 +3915,7 @@ ov51x_dealloc(struct usb_ov511 *ov)
  ***************************************************************************/
 
 static int
-ov51x_v4l1_open(struct inode *inode, struct file *file)
+ov51x_v4l1_open(struct file *file)
 {
        struct video_device *vdev = video_devdata(file);
        struct usb_ov511 *ov = video_get_drvdata(vdev);
@@ -3972,7 +3972,7 @@ out:
 }
 
 static int
-ov51x_v4l1_close(struct inode *inode, struct file *file)
+ov51x_v4l1_close(struct file *file)
 {
        struct video_device *vdev = file->private_data;
        struct usb_ov511 *ov = video_get_drvdata(vdev);
@@ -4010,7 +4010,7 @@ ov51x_v4l1_close(struct inode *inode, struct file *file)
 }
 
 /* Do not call this function directly! */
-static int
+static long
 ov51x_v4l1_ioctl_internal(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
@@ -4449,8 +4449,8 @@ redo:
        return 0;
 }
 
-static int
-ov51x_v4l1_ioctl(struct inode *inode, struct file *file,
+static long
+ov51x_v4l1_ioctl(struct file *file,
                 unsigned int cmd, unsigned long arg)
 {
        struct video_device *vdev = file->private_data;
@@ -4661,17 +4661,13 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations ov511_fops = {
+static const struct v4l2_file_operations ov511_fops = {
        .owner =        THIS_MODULE,
        .open =         ov51x_v4l1_open,
        .release =      ov51x_v4l1_close,
        .read =         ov51x_v4l1_read,
        .mmap =         ov51x_v4l1_mmap,
        .ioctl =        ov51x_v4l1_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek =       no_llseek,
 };
 
 static struct video_device vdev_template = {
index ea032f5f2f412ff2fae9eb6fa1535ad045e94ede..ca26b0c50cf2ab94095e0856f1183974fba3a918 100644 (file)
@@ -1310,7 +1310,7 @@ static int ov7670_command(struct i2c_client *client, unsigned int cmd,
                void *arg)
 {
        switch (cmd) {
-       case VIDIOC_G_CHIP_IDENT:
+       case VIDIOC_DBG_G_CHIP_IDENT:
                return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_OV7670, 0);
 
        case VIDIOC_INT_RESET:
index 54b736fcc07a4786bce26f89184f59a00ddf062d..3c9e0ba974e9ec57bb819b234f18cb05c53ecc4d 100644 (file)
@@ -724,7 +724,7 @@ static unsigned long ov772x_query_bus_param(struct soc_camera_device *icd)
 }
 
 static int ov772x_get_chip_id(struct soc_camera_device *icd,
-                             struct v4l2_chip_ident   *id)
+                             struct v4l2_dbg_chip_ident   *id)
 {
        struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd);
 
@@ -736,11 +736,12 @@ static int ov772x_get_chip_id(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int ov772x_get_register(struct soc_camera_device *icd,
-                              struct v4l2_register *reg)
+                              struct v4l2_dbg_register *reg)
 {
        struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd);
        int                 ret;
 
+       reg->size = 1;
        if (reg->reg > 0xff)
                return -EINVAL;
 
@@ -754,7 +755,7 @@ static int ov772x_get_register(struct soc_camera_device *icd,
 }
 
 static int ov772x_set_register(struct soc_camera_device *icd,
-                              struct v4l2_register *reg)
+                              struct v4l2_dbg_register *reg)
 {
        struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd);
 
index 45730fac1570b0be08e3313700e525be3d710790..a1ad38fc49c18154f67b27dea1fba2b3888c97a1 100644 (file)
@@ -680,7 +680,7 @@ static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
  *     Video4linux interfacing
  */
 
-static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *dev = video_devdata(file);
        struct pms_device *pd=(struct pms_device *)dev;
@@ -862,7 +862,7 @@ static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int pms_ioctl(struct inode *inode, struct file *file,
+static long pms_ioctl(struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, pms_do_ioctl);
@@ -881,7 +881,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
        return len;
 }
 
-static int pms_exclusive_open(struct inode *inode, struct file *file)
+static int pms_exclusive_open(struct file *file)
 {
        struct video_device *v = video_devdata(file);
        struct pms_device *pd = (struct pms_device *)v;
@@ -889,7 +889,7 @@ static int pms_exclusive_open(struct inode *inode, struct file *file)
        return test_and_set_bit(0, &pd->in_use) ? -EBUSY : 0;
 }
 
-static int pms_exclusive_release(struct inode *inode, struct file *file)
+static int pms_exclusive_release(struct file *file)
 {
        struct video_device *v = video_devdata(file);
        struct pms_device *pd = (struct pms_device *)v;
@@ -898,16 +898,12 @@ static int pms_exclusive_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations pms_fops = {
+static const struct v4l2_file_operations pms_fops = {
        .owner          = THIS_MODULE,
        .open           = pms_exclusive_open,
        .release        = pms_exclusive_release,
        .ioctl          = pms_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .read           = pms_read,
-       .llseek         = no_llseek,
 };
 
 static struct video_device pms_template=
index 4358079f1966f4efa4a60eaded89e9c75e1866fd..8fb92ac78c7b9ab4cd217a79efe6f60ca2c03085 100644 (file)
@@ -4732,26 +4732,25 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
 
 
 int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
-                            u32 match_type, u32 match_chip, u64 reg_id,
-                            int setFl,u64 *val_ptr)
+                            struct v4l2_dbg_match *match, u64 reg_id,
+                            int setFl, u64 *val_ptr)
 {
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        struct pvr2_i2c_client *cp;
-       struct v4l2_register req;
+       struct v4l2_dbg_register req;
        int stat = 0;
        int okFl = 0;
 
        if (!capable(CAP_SYS_ADMIN)) return -EPERM;
 
-       req.match_type = match_type;
-       req.match_chip = match_chip;
+       req.match = *match;
        req.reg = reg_id;
        if (setFl) req.val = *val_ptr;
        mutex_lock(&hdw->i2c_list_lock); do {
                list_for_each_entry(cp, &hdw->i2c_clients, list) {
                        if (!v4l2_chip_match_i2c_client(
                                    cp->client,
-                                   req.match_type, req.match_chip)) {
+                                   &req.match)) {
                                continue;
                        }
                        stat = pvr2_i2c_client_cmd(
index 49482d1f2b28d71b87ccd3318e3b0b45afeda2e1..1b4fec337c6b2f694b2aa6a53d8a7f7afb60fe3d 100644 (file)
@@ -242,8 +242,8 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,
    setFl   - true to set the register, false to read it
    val_ptr - storage location for source / result. */
 int pvr2_hdw_register_access(struct pvr2_hdw *,
-                            u32 match_type, u32 match_chip,u64 reg_id,
-                            int setFl,u64 *val_ptr);
+                            struct v4l2_dbg_match *match, u64 reg_id,
+                            int setFl, u64 *val_ptr);
 
 /* The following entry points are all lower level things you normally don't
    want to worry about. */
index 52af1c4359655dbcd6159434e37ab02eb915b56b..878fd52a73b3a330df8cae9af1a0b5b9deae7bbc 100644 (file)
@@ -168,13 +168,13 @@ static const char *get_v4l_name(int v4l_type)
  * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
  *
  */
-static int pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct pvr2_v4l2_fh *fh = file->private_data;
        struct pvr2_v4l2 *vp = fh->vhead;
        struct pvr2_v4l2_dev *dev_info = fh->dev_info;
        struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
-       int ret = -EINVAL;
+       long ret = -EINVAL;
 
        if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
                v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),cmd);
@@ -851,11 +851,11 @@ static int pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        case VIDIOC_DBG_G_REGISTER:
        {
                u64 val;
-               struct v4l2_register *req = (struct v4l2_register *)arg;
+               struct v4l2_dbg_register *req = (struct v4l2_dbg_register *)arg;
                if (cmd == VIDIOC_DBG_S_REGISTER) val = req->val;
                ret = pvr2_hdw_register_access(
-                       hdw,req->match_type,req->match_chip,req->reg,
-                       cmd == VIDIOC_DBG_S_REGISTER,&val);
+                       hdw, &req->match, req->reg,
+                       cmd == VIDIOC_DBG_S_REGISTER, &val);
                if (cmd == VIDIOC_DBG_G_REGISTER) req->val = val;
                break;
        }
@@ -871,20 +871,20 @@ static int pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        if (ret < 0) {
                if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
                        pvr2_trace(PVR2_TRACE_V4LIOCTL,
-                                  "pvr2_v4l2_do_ioctl failure, ret=%d",ret);
+                                  "pvr2_v4l2_do_ioctl failure, ret=%ld", ret);
                } else {
                        if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
                                pvr2_trace(PVR2_TRACE_V4LIOCTL,
-                                          "pvr2_v4l2_do_ioctl failure, ret=%d"
-                                          " command was:",ret);
+                                          "pvr2_v4l2_do_ioctl failure, ret=%ld"
+                                          " command was:", ret);
                                v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),
                                                cmd);
                        }
                }
        } else {
                pvr2_trace(PVR2_TRACE_V4LIOCTL,
-                          "pvr2_v4l2_do_ioctl complete, ret=%d (0x%x)",
-                          ret,ret);
+                          "pvr2_v4l2_do_ioctl complete, ret=%ld (0x%lx)",
+                          ret, ret);
        }
        return ret;
 }
@@ -948,7 +948,7 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
 }
 
 
-static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
+static long pvr2_v4l2_ioctl(struct file *file,
                           unsigned int cmd, unsigned long arg)
 {
 
@@ -960,7 +960,7 @@ static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
 }
 
 
-static int pvr2_v4l2_release(struct inode *inode, struct file *file)
+static int pvr2_v4l2_release(struct file *file)
 {
        struct pvr2_v4l2_fh *fhp = file->private_data;
        struct pvr2_v4l2 *vp = fhp->vhead;
@@ -1008,7 +1008,7 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file)
 }
 
 
-static int pvr2_v4l2_open(struct inode *inode, struct file *file)
+static int pvr2_v4l2_open(struct file *file)
 {
        struct pvr2_v4l2_dev *dip; /* Our own context pointer */
        struct pvr2_v4l2_fh *fhp;
@@ -1235,13 +1235,12 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait)
 }
 
 
-static const struct file_operations vdev_fops = {
+static const struct v4l2_file_operations vdev_fops = {
        .owner      = THIS_MODULE,
        .open       = pvr2_v4l2_open,
        .release    = pvr2_v4l2_release,
        .read       = pvr2_v4l2_read,
        .ioctl      = pvr2_v4l2_ioctl,
-       .llseek     = no_llseek,
        .poll       = pvr2_v4l2_poll,
 };
 
index c6653021019224c697053b869d62a656333a89d5..f9fbe02e0f6950d44d8f2cab2fa5bb549ca0445a 100644 (file)
@@ -1266,9 +1266,9 @@ int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
 /* copy local variable to arg */
 #define ARG_OUT(ARG_name) /* nothing */
 
-int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
+long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
 {
-       int ret = 0;
+       long ret = 0;
 
        switch(cmd) {
        case VIDIOCPWCRUSER:
index 1ce9da167b7e5e8de2b4f73064386eab3eda8f99..39fbc970f43de09da5d45fd6951b82af337a2775 100644 (file)
@@ -142,16 +142,16 @@ static struct {
 
 /***/
 
-static int pwc_video_open(struct inode *inode, struct file *file);
-static int pwc_video_close(struct inode *inode, struct file *file);
+static int pwc_video_open(struct file *file);
+static int pwc_video_close(struct file *file);
 static ssize_t pwc_video_read(struct file *file, char __user *buf,
                          size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
-static int  pwc_video_ioctl(struct inode *inode, struct file *file,
+static long  pwc_video_ioctl(struct file *file,
                            unsigned int ioctlnr, unsigned long arg);
 static int  pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
 
-static const struct file_operations pwc_fops = {
+static const struct v4l2_file_operations pwc_fops = {
        .owner =        THIS_MODULE,
        .open =         pwc_video_open,
        .release =      pwc_video_close,
@@ -159,10 +159,6 @@ static const struct file_operations pwc_fops = {
        .poll =         pwc_video_poll,
        .mmap =         pwc_video_mmap,
        .ioctl =        pwc_video_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek =       no_llseek,
 };
 static struct video_device pwc_template = {
        .name =         "Philips Webcam",       /* Filled in later */
@@ -1104,7 +1100,7 @@ static const char *pwc_sensor_type_to_string(unsigned int sensor_type)
 /***************************************************************************/
 /* Video4Linux functions */
 
-static int pwc_video_open(struct inode *inode, struct file *file)
+static int pwc_video_open(struct file *file)
 {
        int i, ret;
        struct video_device *vdev = video_devdata(file);
@@ -1224,7 +1220,7 @@ static void pwc_cleanup(struct pwc_device *pdev)
 }
 
 /* Note that all cleanup is done in the reverse order as in _open */
-static int pwc_video_close(struct inode *inode, struct file *file)
+static int pwc_video_close(struct file *file)
 {
        struct video_device *vdev = file->private_data;
        struct pwc_device *pdev;
@@ -1399,12 +1395,12 @@ static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
        return 0;
 }
 
-static int pwc_video_ioctl(struct inode *inode, struct file *file,
+static long pwc_video_ioctl(struct file *file,
                           unsigned int cmd, unsigned long arg)
 {
        struct video_device *vdev = file->private_data;
        struct pwc_device *pdev;
-       int r = -ENODEV;
+       long r = -ENODEV;
 
        if (!vdev)
                goto out;
index d7c147328e35268b6d68138cb499df52bdebe38c..bc0a464295c59d511128b8526c445419c808e7b3 100644 (file)
@@ -337,7 +337,7 @@ static int pwc_vidioc_set_fmt(struct pwc_device *pdev, struct v4l2_format *f)
 
 }
 
-int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *vdev = video_devdata(file);
        struct pwc_device *pdev;
index c046a253566880c115e437946ee2e38129aa89b8..01411fb2337ae9d0e392d2d0cd611889b1e8b2b7 100644 (file)
@@ -337,10 +337,10 @@ extern int pwc_get_dynamic_noise(struct pwc_device *pdev, int *noise);
 extern int pwc_camera_power(struct pwc_device *pdev, int power);
 
 /* Private ioctl()s; see pwc-ioctl.h */
-extern int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg);
+extern long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg);
 
 /** Functions in pwc-v4l.c */
-extern int pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
+extern long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
 
 /** pwc-uncompress.c */
 /* Expand frame to image, possibly including decompression. Uses read_frame and fill_image */
index 3c3f8cf73108a55280fb27bd33118fbe8f4c98e6..13f85ad363cd3b7b81e5eae85675846b0452a966 100644 (file)
@@ -1502,9 +1502,9 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
        dprintk(2, "setting jpeg quality %d\n", jc->quality);
        return 0;
 }
-static int s2255_open(struct inode *inode, struct file *file)
+static int s2255_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct s2255_dev *h, *dev = NULL;
        struct s2255_fh *fh;
        struct list_head *list;
@@ -1711,11 +1711,11 @@ static void s2255_destroy(struct kref *kref)
        mutex_unlock(&dev->open_lock);
 }
 
-static int s2255_close(struct inode *inode, struct file *file)
+static int s2255_close(struct file *file)
 {
        struct s2255_fh *fh = file->private_data;
        struct s2255_dev *dev = fh->dev;
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        if (!dev)
                return -ENODEV;
 
@@ -1759,15 +1759,13 @@ static int s2255_mmap_v4l(struct file *file, struct vm_area_struct *vma)
        return ret;
 }
 
-static const struct file_operations s2255_fops_v4l = {
+static const struct v4l2_file_operations s2255_fops_v4l = {
        .owner = THIS_MODULE,
        .open = s2255_open,
        .release = s2255_close,
        .poll = s2255_poll,
        .ioctl = video_ioctl2,  /* V4L2 ioctl handler */
-       .compat_ioctl = v4l_compat_ioctl32,
        .mmap = s2255_mmap_v4l,
-       .llseek = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops s2255_ioctl_ops = {
index f159441e937527afbab13e49e824214613e3da6d..e637e440b6d589eaba402bebff53e4e05f756467 100644 (file)
@@ -804,7 +804,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
  *
  *  Returns 0 if successful
  */
-static int do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long do_saa5246a_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct saa5246a_device *t = video_drvdata(file);
 
@@ -944,11 +944,11 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
 /*
  *     Handle the locking
  */
-static int saa5246a_ioctl(struct inode *inode, struct file *file,
+static long saa5246a_ioctl(struct file *file,
                         unsigned int cmd, unsigned long arg)
 {
        struct saa5246a_device *t = video_drvdata(file);
-       int err;
+       long err;
 
        cmd = vtx_fix_command(cmd);
        mutex_lock(&t->lock);
@@ -957,7 +957,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
        return err;
 }
 
-static int saa5246a_open(struct inode *inode, struct file *file)
+static int saa5246a_open(struct file *file)
 {
        struct saa5246a_device *t = video_drvdata(file);
 
@@ -999,7 +999,7 @@ static int saa5246a_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int saa5246a_release(struct inode *inode, struct file *file)
+static int saa5246a_release(struct file *file)
 {
        struct saa5246a_device *t = video_drvdata(file);
 
@@ -1018,12 +1018,11 @@ static int saa5246a_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations saa_fops = {
+static const struct v4l2_file_operations saa_fops = {
        .owner   = THIS_MODULE,
        .open    = saa5246a_open,
        .release = saa5246a_release,
        .ioctl   = saa5246a_ioctl,
-       .llseek  = no_llseek,
 };
 
 static struct video_device saa_template =
index 6ef3affb97f163d165c227a178c199ea5913d7bc..e297651924697ad8114977253ee509a5c3bfbefe 100644 (file)
@@ -190,7 +190,7 @@ static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
  *     Standard character-device-driver functions
  */
 
-static int do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long do_saa5249_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        static int virtual_mode = false;
        struct saa5249_device *t = video_drvdata(file);
@@ -479,11 +479,11 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
  *     Handle the locking
  */
 
-static int saa5249_ioctl(struct inode *inode, struct file *file,
+static long saa5249_ioctl(struct file *file,
                         unsigned int cmd, unsigned long arg)
 {
        struct saa5249_device *t = video_drvdata(file);
-       int err;
+       long err;
 
        cmd = vtx_fix_command(cmd);
        mutex_lock(&t->lock);
@@ -492,7 +492,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
        return err;
 }
 
-static int saa5249_open(struct inode *inode, struct file *file)
+static int saa5249_open(struct file *file)
 {
        struct saa5249_device *t = video_drvdata(file);
        int pgbuf;
@@ -529,7 +529,7 @@ static int saa5249_open(struct inode *inode, struct file *file)
 
 
 
-static int saa5249_release(struct inode *inode, struct file *file)
+static int saa5249_release(struct file *file)
 {
        struct saa5249_device *t = video_drvdata(file);
 
@@ -539,15 +539,11 @@ static int saa5249_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations saa_fops = {
+static const struct v4l2_file_operations saa_fops = {
        .owner          = THIS_MODULE,
        .open           = saa5249_open,
        .release        = saa5249_release,
        .ioctl          = saa5249_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static struct video_device saa_template =
index 22708ecdf1bbaad27f1d8e81ef30054102d0977c..46c796c3fec887010d1da38810fdeac0d1ef2158 100644 (file)
@@ -1371,25 +1371,24 @@ static int saa711x_g_vbi_data(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_dat
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = saa711x_read(sd, reg->reg & 0xff);
+       reg->size = 1;
        return 0;
 }
 
-static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -1398,7 +1397,7 @@ static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
 }
 #endif
 
-static int saa711x_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int saa711x_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct saa711x_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index bfc85654795e089189a1e676ac9d63b9651f0fcd..d6848f7a503b5874e58259696f69f8033f89b407 100644 (file)
@@ -623,25 +623,24 @@ static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_v
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = saa7127_read(sd, reg->reg & 0xff);
+       reg->size = 1;
        return 0;
 }
 
-static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -650,7 +649,7 @@ static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
 }
 #endif
 
-static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int saa7127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct saa7127_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index 1fb6eccdade32ac5f22a1c6493914e6ce041bc8c..1fee6e84a512c77ac4e8dffaadca0d994a6fb9bf 100644 (file)
@@ -838,7 +838,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
                h->standard = *((v4l2_std_id *) arg);
                break;
 
-       case VIDIOC_G_CHIP_IDENT:
+       case VIDIOC_DBG_G_CHIP_IDENT:
                return v4l2_chip_ident_i2c_client(client,
                                arg, h->chip, h->revision);
 
index a2e3f6729c5b1ad709fc9749d17054a93c3188e4..e2febcd6e529f45245bbd02c6c7e684ca9e14fe5 100644 (file)
@@ -4462,6 +4462,7 @@ struct saa7134_board saa7134_boards[] = {
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .tda9887_conf   = TDA9887_PRESENT,
+               .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
                        .name = name_tv,
                        .vmux = 3,
@@ -4480,8 +4481,6 @@ struct saa7134_board saa7134_boards[] = {
                        .name = name_radio,
                        .amux = LINE2,
                },
-               /* no DVB support for now */
-               /* .mpeg           = SAA7134_MPEG_DVB, */
        },
        [SAA7134_BOARD_ASUSTeK_TIGER_3IN1] = {
                .name           = "Asus Tiger 3in1",
@@ -4643,6 +4642,38 @@ struct saa7134_board saa7134_boards[] = {
                        .amux = 2,
                },
        },
+       [SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS] = {
+               .name           = "Avermedia AVerTV GO 007 FM Plus",
+               .audio_clock    = 0x00187de7,
+               .tuner_type     = TUNER_PHILIPS_TDA8290,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .gpiomask       = 0x00300003,
+               /* .gpiomask       = 0x8c240003, */
+               .inputs         = { {
+                       .name = name_tv,
+                       .vmux = 1,
+                       .amux = TV,
+                       .tv   = 1,
+                       .gpio = 0x01,
+               }, {
+                       .name = name_svideo,
+                       .vmux = 6,
+                       .amux = LINE1,
+                       .gpio = 0x02,
+               } },
+               .radio = {
+                       .name = name_radio,
+                       .amux = TV,
+                       .gpio = 0x00300001,
+               },
+               .mute = {
+                       .name = name_mute,
+                       .amux = TV,
+                       .gpio = 0x01,
+               },
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -5701,6 +5732,13 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subvendor    = 0x17de,
                .subdevice    = 0x7128,
                .driver_data  = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG,
+       }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x1461, /* Avermedia Technologies Inc */
+               .subdevice    = 0xf31d,
+               .driver_data  = SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS,
+
        }, {
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -5930,6 +5968,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_GENIUS_TVGO_A11MCE:
        case SAA7134_BOARD_REAL_ANGEL_220:
        case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
+       case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS:
                dev->has_remote = SAA7134_REMOTE_GPIO;
                break;
        case SAA7134_BOARD_FLYDVBS_LR300:
@@ -6025,6 +6064,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_BEHOLD_M6:
        case SAA7134_BOARD_BEHOLD_M63:
        case SAA7134_BOARD_BEHOLD_M6_EXTRA:
+       case SAA7134_BOARD_BEHOLD_H6:
                dev->has_remote = SAA7134_REMOTE_I2C;
                break;
        case SAA7134_BOARD_AVERMEDIA_A169_B:
index d9a5652595b525d16827da87af1bf9de56a88a57..0776ecf56d2702505dc227292fddb3113da9dc5e 100644 (file)
@@ -49,6 +49,8 @@
 #include "lnbp21.h"
 #include "tuner-simple.h"
 
+#include "zl10353.h"
+
 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
 MODULE_LICENSE("GPL");
 
@@ -854,6 +856,12 @@ static struct tda1004x_config ads_tech_duo_config = {
        .request_firmware = philips_tda1004x_request_firmware
 };
 
+static struct zl10353_config behold_h6_config = {
+       .demod_address = 0x1e>>1,
+       .no_tuner      = 1,
+       .parallel_ts   = 1,
+};
+
 /* ==================================================================
  * tda10086 based DVB-S cards, helper functions
  */
@@ -1357,6 +1365,16 @@ static int dvb_init(struct saa7134_dev *dev)
                                         &tda827x_cfg_0) < 0)
                        goto dettach_frontend;
                break;
+       case SAA7134_BOARD_BEHOLD_H6:
+               fe0->dvb.frontend = dvb_attach(zl10353_attach,
+                                               &behold_h6_config,
+                                               &dev->i2c_adap);
+               if (fe0->dvb.frontend) {
+                       dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
+                                  &dev->i2c_adap, 0x61,
+                                  TUNER_PHILIPS_FMD1216ME_MK3);
+               }
+               break;
        default:
                wprintk("Huh? unknown DVB card?\n");
                break;
index 7f40511bcc04b9493423d2fc9826d57e2473af98..c9d8beb87a608114c30ce64577a440afb788847c 100644 (file)
@@ -83,9 +83,9 @@ static int ts_init_encoder(struct saa7134_dev* dev)
 
 /* ------------------------------------------------------------------ */
 
-static int ts_open(struct inode *inode, struct file *file)
+static int ts_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct saa7134_dev *dev;
        int err;
 
@@ -119,7 +119,7 @@ done:
        return err;
 }
 
-static int ts_release(struct inode *inode, struct file *file)
+static int ts_release(struct file *file)
 {
        struct saa7134_dev *dev = file->private_data;
 
@@ -405,7 +405,7 @@ static int empress_querymenu(struct file *file, void *priv,
 }
 
 static int empress_g_chip_ident(struct file *file, void *fh,
-              struct v4l2_chip_ident *chip)
+              struct v4l2_dbg_chip_ident *chip)
 {
        struct saa7134_dev *dev = file->private_data;
 
@@ -413,12 +413,12 @@ static int empress_g_chip_ident(struct file *file, void *fh,
        chip->revision = 0;
        if (dev->mpeg_i2c_client == NULL)
                return -EINVAL;
-       if (chip->match_type == V4L2_CHIP_MATCH_I2C_DRIVER &&
-           chip->match_chip == I2C_DRIVERID_SAA6752HS)
-               return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip);
-       if (chip->match_type == V4L2_CHIP_MATCH_I2C_ADDR &&
-           chip->match_chip == dev->mpeg_i2c_client->addr)
-               return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip);
+       if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER &&
+           !strcmp(chip->match.name, "saa6752hs"))
+               return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip);
+       if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR &&
+           chip->match.addr == dev->mpeg_i2c_client->addr)
+               return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip);
        return -EINVAL;
 }
 
@@ -437,7 +437,7 @@ static int empress_g_std(struct file *file, void *priv, v4l2_std_id *id)
        return 0;
 }
 
-static const struct file_operations ts_fops =
+static const struct v4l2_file_operations ts_fops =
 {
        .owner    = THIS_MODULE,
        .open     = ts_open,
@@ -446,7 +446,6 @@ static const struct file_operations ts_fops =
        .poll     = ts_poll,
        .mmap     = ts_mmap,
        .ioctl    = video_ioctl2,
-       .llseek   = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops ts_ioctl_ops = {
index d2124f64e4e2339a6d140e0bc83a72b011c0c766..8a106d36e7232c4bce0c38aef1071526cdf93ae1 100644 (file)
@@ -449,6 +449,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_AVERMEDIA_STUDIO_507:
        case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
        case SAA7134_BOARD_AVERMEDIA_M102:
+       case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS:
                ir_codes     = ir_codes_avermedia;
                mask_keycode = 0x0007C8;
                mask_keydown = 0x000010;
index 02bb6747a39c846fa7c19c288e9703054c1c40d5..a1f7e351f57234480719c0b297c38ccbf7583cb1 100644 (file)
@@ -1326,9 +1326,9 @@ static int saa7134_resource(struct saa7134_fh *fh)
        return 0;
 }
 
-static int video_open(struct inode *inode, struct file *file)
+static int video_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct saa7134_dev *dev;
        struct saa7134_fh *fh;
        enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -1462,7 +1462,7 @@ err:
        return POLLERR;
 }
 
-static int video_release(struct inode *inode, struct file *file)
+static int video_release(struct file *file)
 {
        struct saa7134_fh  *fh  = file->private_data;
        struct saa7134_dev *dev = fh->dev;
@@ -2247,24 +2247,25 @@ static int saa7134_g_parm(struct file *file, void *fh,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int vidioc_g_register (struct file *file, void *priv,
-                             struct v4l2_register *reg)
+                             struct v4l2_dbg_register *reg)
 {
        struct saa7134_fh *fh = priv;
        struct saa7134_dev *dev = fh->dev;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
        reg->val = saa_readb(reg->reg);
+       reg->size = 1;
        return 0;
 }
 
 static int vidioc_s_register (struct file *file, void *priv,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct saa7134_fh *fh = priv;
        struct saa7134_dev *dev = fh->dev;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
        saa_writeb(reg->reg&0xffffff, reg->val);
        return 0;
@@ -2377,7 +2378,7 @@ static int radio_queryctrl(struct file *file, void *priv,
        return 0;
 }
 
-static const struct file_operations video_fops =
+static const struct v4l2_file_operations video_fops =
 {
        .owner    = THIS_MODULE,
        .open     = video_open,
@@ -2386,8 +2387,6 @@ static const struct file_operations video_fops =
        .poll     = video_poll,
        .mmap     = video_mmap,
        .ioctl    = video_ioctl2,
-       .compat_ioctl   = v4l_compat_ioctl32,
-       .llseek   = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -2441,13 +2440,11 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
 #endif
 };
 
-static const struct file_operations radio_fops = {
+static const struct v4l2_file_operations radio_fops = {
        .owner    = THIS_MODULE,
        .open     = video_open,
        .release  = video_release,
        .ioctl    = video_ioctl2,
-       .compat_ioctl   = v4l_compat_ioctl32,
-       .llseek   = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
index f6c1fcc720701cc04c74fe6029a0b0f3acfff942..14ee265f33747b3f9583f8e51d78b917189dfd97 100644 (file)
@@ -276,6 +276,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI  151
 #define SAA7134_BOARD_ASUSTeK_TIGER         152
 #define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG 153
+#define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
index 9befca65905e0e6dee10882f240fac2d361b1b99..454ad1dd7507a5f523b8513ef10988cd06d6b81f 100644 (file)
@@ -1171,25 +1171,26 @@ static int saa717x_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = saa717x_read(sd, reg->reg);
+       reg->size = 1;
        return 0;
 }
 
-static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        u16 addr = reg->reg & 0xffff;
        u8 val = reg->val & 0xff;
 
-       if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
index d652f25eef0edc9b5aef4a23c0928246588116b6..5990ab38a1249146a8ebdff9b2b1c8be02b58a8e 100644 (file)
@@ -932,7 +932,7 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401)
  ***************************************************************************/
 
 
-static int se401_open(struct inode *inode, struct file *file)
+static int se401_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct usb_se401 *se401 = (struct usb_se401 *)dev;
@@ -954,7 +954,7 @@ static int se401_open(struct inode *inode, struct file *file)
        return err;
 }
 
-static int se401_close(struct inode *inode, struct file *file)
+static int se401_close(struct file *file)
 {
        struct video_device *dev = file->private_data;
        struct usb_se401 *se401 = (struct usb_se401 *)dev;
@@ -975,7 +975,7 @@ static int se401_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
        struct usb_se401 *se401 = (struct usb_se401 *)vdev;
@@ -1138,7 +1138,7 @@ static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int se401_ioctl(struct inode *inode, struct file *file,
+static long se401_ioctl(struct file *file,
                       unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, se401_do_ioctl);
@@ -1222,17 +1222,13 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations se401_fops = {
+static const struct v4l2_file_operations se401_fops = {
        .owner =        THIS_MODULE,
        .open =         se401_open,
        .release =      se401_close,
        .read =         se401_read,
        .mmap =         se401_mmap,
        .ioctl =        se401_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek =       no_llseek,
 };
 static struct video_device se401_template = {
        .name =         "se401 USB camera",
index 01a8efb8deb156f274ad54e514be0082783df6f2..23edfdc4d4bcafb8230e5924d0773381eea01dc3 100644 (file)
@@ -1746,7 +1746,7 @@ static void sn9c102_release_resources(struct kref *kref)
 }
 
 
-static int sn9c102_open(struct inode* inode, struct file* filp)
+static int sn9c102_open(struct file *filp)
 {
        struct sn9c102_device* cam;
        int err = 0;
@@ -1857,7 +1857,7 @@ out:
 }
 
 
-static int sn9c102_release(struct inode* inode, struct file* filp)
+static int sn9c102_release(struct file *filp)
 {
        struct sn9c102_device* cam;
 
@@ -3092,8 +3092,8 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg)
 }
 
 
-static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
-                             unsigned int cmd, void __user * arg)
+static long sn9c102_ioctl_v4l2(struct file *filp,
+                             unsigned int cmd, void __user *arg)
 {
        struct sn9c102_device *cam = video_drvdata(filp);
 
@@ -3196,7 +3196,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
 }
 
 
-static int sn9c102_ioctl(struct inode* inode, struct file* filp,
+static long sn9c102_ioctl(struct file *filp,
                         unsigned int cmd, unsigned long arg)
 {
        struct sn9c102_device *cam = video_drvdata(filp);
@@ -3220,7 +3220,7 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp,
 
        V4LDBG(3, "sn9c102", cmd);
 
-       err = sn9c102_ioctl_v4l2(inode, filp, cmd, (void __user *)arg);
+       err = sn9c102_ioctl_v4l2(filp, cmd, (void __user *)arg);
 
        mutex_unlock(&cam->fileop_mutex);
 
@@ -3229,18 +3229,14 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp,
 
 /*****************************************************************************/
 
-static const struct file_operations sn9c102_fops = {
+static const struct v4l2_file_operations sn9c102_fops = {
        .owner = THIS_MODULE,
        .open = sn9c102_open,
        .release = sn9c102_release,
        .ioctl = sn9c102_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
        .read = sn9c102_read,
        .poll = sn9c102_poll,
        .mmap = sn9c102_mmap,
-       .llseek = no_llseek,
 };
 
 /*****************************************************************************/
index 90077cb4fe667fed105771fbb379ac3024dac480..fcb05f06de8ffb7d73e564820110ca78100a7a07 100644 (file)
@@ -256,7 +256,7 @@ static void soc_camera_free_user_formats(struct soc_camera_device *icd)
        vfree(icd->user_formats);
 }
 
-static int soc_camera_open(struct inode *inode, struct file *file)
+static int soc_camera_open(struct file *file)
 {
        struct video_device *vdev;
        struct soc_camera_device *icd;
@@ -330,7 +330,7 @@ emgd:
        return ret;
 }
 
-static int soc_camera_close(struct inode *inode, struct file *file)
+static int soc_camera_close(struct file *file)
 {
        struct soc_camera_file *icf = file->private_data;
        struct soc_camera_device *icd = icf->icd;
@@ -400,7 +400,7 @@ static unsigned int soc_camera_poll(struct file *file, poll_table *pt)
        return ici->ops->poll(file, pt);
 }
 
-static struct file_operations soc_camera_fops = {
+static struct v4l2_file_operations soc_camera_fops = {
        .owner          = THIS_MODULE,
        .open           = soc_camera_open,
        .release        = soc_camera_close,
@@ -408,7 +408,6 @@ static struct file_operations soc_camera_fops = {
        .read           = soc_camera_read,
        .mmap           = soc_camera_mmap,
        .poll           = soc_camera_poll,
-       .llseek         = no_llseek,
 };
 
 static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv,
@@ -700,7 +699,7 @@ static int soc_camera_s_crop(struct file *file, void *fh,
 }
 
 static int soc_camera_g_chip_ident(struct file *file, void *fh,
-                                  struct v4l2_chip_ident *id)
+                                  struct v4l2_dbg_chip_ident *id)
 {
        struct soc_camera_file *icf = file->private_data;
        struct soc_camera_device *icd = icf->icd;
@@ -713,7 +712,7 @@ static int soc_camera_g_chip_ident(struct file *file, void *fh,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int soc_camera_g_register(struct file *file, void *fh,
-                                struct v4l2_register *reg)
+                                struct v4l2_dbg_register *reg)
 {
        struct soc_camera_file *icf = file->private_data;
        struct soc_camera_device *icd = icf->icd;
@@ -725,7 +724,7 @@ static int soc_camera_g_register(struct file *file, void *fh,
 }
 
 static int soc_camera_s_register(struct file *file, void *fh,
-                                struct v4l2_register *reg)
+                                struct v4l2_dbg_register *reg)
 {
        struct soc_camera_file *icf = file->private_data;
        struct soc_camera_device *icd = icf->icd;
index f9516d0f3c1121ee2122cb01ef51b9e6465434f3..26378cf390fc483542dce73a1e0ad5ccb6f3a698 100644 (file)
@@ -664,7 +664,7 @@ static void stk_free_buffers(struct stk_camera *dev)
 
 /* v4l file operations */
 
-static int v4l_stk_open(struct inode *inode, struct file *fp)
+static int v4l_stk_open(struct file *fp)
 {
        struct stk_camera *dev;
        struct video_device *vdev;
@@ -684,7 +684,7 @@ static int v4l_stk_open(struct inode *inode, struct file *fp)
        return 0;
 }
 
-static int v4l_stk_release(struct inode *inode, struct file *fp)
+static int v4l_stk_release(struct file *fp)
 {
        struct stk_camera *dev = fp->private_data;
 
@@ -1281,7 +1281,7 @@ static int stk_vidioc_enum_framesizes(struct file *filp,
        }
 }
 
-static struct file_operations v4l_stk_fops = {
+static struct v4l2_file_operations v4l_stk_fops = {
        .owner = THIS_MODULE,
        .open = v4l_stk_open,
        .release = v4l_stk_release,
@@ -1289,10 +1289,6 @@ static struct file_operations v4l_stk_fops = {
        .poll = v4l_stk_poll,
        .mmap = v4l_stk_mmap,
        .ioctl = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek = no_llseek
 };
 
 static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
index bbad54f85c83c83a92d8d4d41cdedf70af3b1803..0eb313082c973e78fcfe6e2e935ec1c5751ce5c6 100644 (file)
@@ -1275,7 +1275,7 @@ static void make_clip_tab(struct saa7146 *saa, struct video_clip *cr, int ncr)
                clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y);
 }
 
-static int saa_ioctl(struct inode *inode, struct file *file,
+static long saa_ioctl(struct file *file,
                     unsigned int cmd, unsigned long argl)
 {
        struct saa7146 *saa = file->private_data;
@@ -1877,7 +1877,7 @@ static ssize_t saa_write(struct file *file, const char __user * buf,
        return count;
 }
 
-static int saa_open(struct inode *inode, struct file *file)
+static int saa_open(struct file *file)
 {
        struct video_device *vdev = video_devdata(file);
        struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev);
@@ -1895,7 +1895,7 @@ static int saa_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int saa_release(struct inode *inode, struct file *file)
+static int saa_release(struct file *file)
 {
        struct saa7146 *saa = file->private_data;
        saa->user--;
@@ -1906,16 +1906,12 @@ static int saa_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations saa_fops = {
+static const struct v4l2_file_operations saa_fops = {
        .owner = THIS_MODULE,
        .open = saa_open,
        .release = saa_release,
        .ioctl = saa_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
        .read = saa_read,
-       .llseek = no_llseek,
        .write = saa_write,
        .mmap = saa_mmap,
 };
index 42acc92c182da708c3cdf0ed315996a11a74ea16..75f286f7a2e9939cfc9d24f25a06d6b50c8cab91 100644 (file)
@@ -1080,7 +1080,7 @@ static int stv680_newframe (struct usb_stv *stv680, int framenr)
  * Video4Linux
  *********************************************************************/
 
-static int stv_open (struct inode *inode, struct file *file)
+static int stv_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct usb_stv *stv680 = video_get_drvdata(dev);
@@ -1106,7 +1106,7 @@ static int stv_open (struct inode *inode, struct file *file)
        return err;
 }
 
-static int stv_close (struct inode *inode, struct file *file)
+static int stv_close(struct file *file)
 {
        struct video_device *dev = file->private_data;
        struct usb_stv *stv680 = video_get_drvdata(dev);
@@ -1132,7 +1132,7 @@ static int stv_close (struct inode *inode, struct file *file)
        return 0;
 }
 
-static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
        struct usb_stv *stv680 = video_get_drvdata(vdev);
@@ -1299,7 +1299,7 @@ static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int stv680_ioctl(struct inode *inode, struct file *file,
+static long stv680_ioctl(struct file *file,
                        unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, stv680_do_ioctl);
@@ -1391,17 +1391,13 @@ static ssize_t stv680_read (struct file *file, char __user *buf,
        return realcount;
 }                              /* stv680_read */
 
-static const struct file_operations stv680_fops = {
+static const struct v4l2_file_operations stv680_fops = {
        .owner =        THIS_MODULE,
        .open =         stv_open,
        .release =      stv_close,
        .read =         stv680_read,
        .mmap =         stv680_mmap,
        .ioctl =        stv680_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek =       no_llseek,
 };
 static struct video_device stv680_template = {
        .name =         "STV0680 USB camera",
index 2644e0dc925139dab0e8a7f4881257c3cf44ef05..6afb7059502d00df6aa75dbdd24568bb11a2d5f1 100644 (file)
@@ -137,7 +137,7 @@ static int tda9840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t)
        return 0;
 }
 
-static int tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
+static long tda9840_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
 {
        int byte;
 
index 31dde86f2df4f6f187fe97eea6c8358efef22f1a..7519fd1f57efbd14418b7c9993d34a0528e6ab34 100644 (file)
@@ -122,7 +122,7 @@ static int switch_matrix(struct i2c_client *client, int i, int o)
        return ret;
 }
 
-static int tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
+static long tea6415c_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
 {
        if (cmd == TEA6415C_SWITCH) {
                struct i2c_client *client = v4l2_get_subdevdata(sd);
index 38e519f04bdeac9241ca12e7d70a3da598d7321d..081e74fa3b2eb2360dc68c1a0cdac0564548a0d2 100644 (file)
@@ -90,7 +90,7 @@ static int tea6420_switch(struct i2c_client *client, int i, int o, int g)
        return 0;
 }
 
-static int tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
+static long tea6420_ioctl(struct v4l2_subdev *sd, unsigned cmd, void *arg)
 {
        if (cmd == TEA6420_SWITCH) {
                struct i2c_client *client = v4l2_get_subdevdata(sd);
index 97d7509d212f67602526b21a5656794be0656d90..30640fbfd0f921ad0734eb939a533bfea1e7fc0e 100644 (file)
@@ -800,7 +800,7 @@ static int tuner_s_standby(struct v4l2_subdev *sd, u32 standby)
 }
 
 #ifdef CONFIG_VIDEO_ALLOW_V4L1
-static int tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
+static long tuner_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 {
        struct tuner *t = to_tuner(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
index d0c794da735b413eb8b83006e732c4e89117adda..5aeccb301cea147370c89af12de35cc3306f4c9d 100644 (file)
@@ -1762,7 +1762,7 @@ static int tvaudio_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr
        return 0;
 }
 
-static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index a388a9f0cb187d380f5286bef7838875b801beb9..2cd64ef27b95ee6b8f37a982cc233bb690d02017 100644 (file)
@@ -963,7 +963,7 @@ static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
 
 
 static int tvp5150_g_chip_ident(struct v4l2_subdev *sd,
-                               struct v4l2_chip_ident *chip)
+                               struct v4l2_dbg_chip_ident *chip)
 {
        int rev;
        struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -977,25 +977,24 @@ static int tvp5150_g_chip_ident(struct v4l2_subdev *sd,
 
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = tvp5150_read(sd, reg->reg & 0xff);
+       reg->size = 1;
        return 0;
 }
 
-static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
index d5cdc4be1a354e41d89e6c2de2b21648b0f0cfce..52c0357faa5d0fb2e270e41dc05fd44ec56bdd7a 100644 (file)
@@ -575,7 +575,7 @@ static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd)
 }
 
 static int tw9910_get_chip_id(struct soc_camera_device *icd,
-                             struct v4l2_chip_ident *id)
+                             struct v4l2_dbg_chip_ident *id)
 {
        id->ident = V4L2_IDENT_TW9910;
        id->revision = 0;
@@ -606,7 +606,7 @@ static int tw9910_enum_input(struct soc_camera_device *icd,
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int tw9910_get_register(struct soc_camera_device *icd,
-                              struct v4l2_register *reg)
+                              struct v4l2_dbg_register *reg)
 {
        struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd);
        int ret;
@@ -627,7 +627,7 @@ static int tw9910_get_register(struct soc_camera_device *icd,
 }
 
 static int tw9910_set_register(struct soc_camera_device *icd,
-                              struct v4l2_register *reg)
+                              struct v4l2_dbg_register *reg)
 {
        struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd);
 
index 7a609a3a6dbe2e3be83b06afa6669c86c365e03a..4f16effb530fd61f33328e57028f67ec8c39faf4 100644 (file)
@@ -147,7 +147,7 @@ static int upd64031a_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing
        return upd64031a_s_frequency(sd, NULL);
 }
 
-static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int upd64031a_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
@@ -162,25 +162,24 @@ static int upd64031a_log_status(struct v4l2_subdev *sd)
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = upd64031a_read(sd, reg->reg & 0xff);
+       reg->size = 1;
        return 0;
 }
 
-static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
index 58412cb9c01a0d058ec01f3f5113b75e6b757e0b..4b712f69d1b715c1fddce33e9cadb7f531ccf62d 100644 (file)
@@ -120,25 +120,24 @@ static int upd64083_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing
 }
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
        reg->val = upd64083_read(sd, reg->reg & 0xff);
+       reg->size = 1;
        return 0;
 }
 
-static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg)
+static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (!v4l2_chip_match_i2c_client(client,
-                               reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_i2c_client(client, &reg->match))
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -147,7 +146,7 @@ static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_register *reg
 }
 #endif
 
-static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int upd64083_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 148a1f98c70f714e46f0af650a49268f5d07ae59..dea8b321fb4a5b983f35da9f56fa6a83a22c1895 100644 (file)
@@ -41,13 +41,13 @@ module_param(video_nr, int, 0);
 static void usbvideo_Disconnect(struct usb_interface *intf);
 static void usbvideo_CameraRelease(struct uvd *uvd);
 
-static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
+static long usbvideo_v4l_ioctl(struct file *file,
                              unsigned int cmd, unsigned long arg);
 static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
-static int usbvideo_v4l_open(struct inode *inode, struct file *file);
+static int usbvideo_v4l_open(struct file *file);
 static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf,
                             size_t count, loff_t *ppos);
-static int usbvideo_v4l_close(struct inode *inode, struct file *file);
+static int usbvideo_v4l_close(struct file *file);
 
 static int usbvideo_StartDataPump(struct uvd *uvd);
 static void usbvideo_StopDataPump(struct uvd *uvd);
@@ -942,17 +942,13 @@ static int usbvideo_find_struct(struct usbvideo *cams)
        return rv;
 }
 
-static const struct file_operations usbvideo_fops = {
+static const struct v4l2_file_operations usbvideo_fops = {
        .owner =  THIS_MODULE,
        .open =   usbvideo_v4l_open,
        .release =usbvideo_v4l_close,
        .read =   usbvideo_v4l_read,
        .mmap =   usbvideo_v4l_mmap,
        .ioctl =  usbvideo_v4l_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
-       .llseek = no_llseek,
 };
 static const struct video_device usbvideo_template = {
        .fops =       &usbvideo_fops,
@@ -1113,7 +1109,7 @@ static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
  * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
  * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT).
  */
-static int usbvideo_v4l_open(struct inode *inode, struct file *file)
+static int usbvideo_v4l_open(struct file *file)
 {
        struct video_device *dev = video_devdata(file);
        struct uvd *uvd = (struct uvd *) dev;
@@ -1233,7 +1229,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
  * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
  * 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep.
  */
-static int usbvideo_v4l_close(struct inode *inode, struct file *file)
+static int usbvideo_v4l_close(struct file *file)
 {
        struct video_device *dev = file->private_data;
        struct uvd *uvd = (struct uvd *) dev;
@@ -1281,7 +1277,7 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file)
  * History:
  * 22-Jan-2000 Corrected VIDIOCSPICT to reject unsupported settings.
  */
-static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct uvd *uvd = file->private_data;
 
@@ -1501,7 +1497,7 @@ static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
+static long usbvideo_v4l_ioctl(struct file *file,
                       unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);
index 4602597ed8d1af301b198dfb7dfe8f97994f5614..2f1106338c085d7881940e54951d10b8ac93c44b 100644 (file)
@@ -229,12 +229,12 @@ set_camera_power(struct vicam_camera *cam, int state)
        return 0;
 }
 
-static int
-vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long arg)
+static long
+vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg)
 {
        void __user *user_arg = (void __user *)arg;
        struct vicam_camera *cam = file->private_data;
-       int retval = 0;
+       long retval = 0;
 
        if (!cam)
                return -ENODEV;
@@ -470,7 +470,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 }
 
 static int
-vicam_open(struct inode *inode, struct file *file)
+vicam_open(struct file *file)
 {
        struct vicam_camera *cam = video_drvdata(file);
 
@@ -536,7 +536,7 @@ vicam_open(struct inode *inode, struct file *file)
 }
 
 static int
-vicam_close(struct inode *inode, struct file *file)
+vicam_close(struct file *file)
 {
        struct vicam_camera *cam = file->private_data;
        int open_count;
@@ -783,17 +783,13 @@ vicam_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations vicam_fops = {
+static const struct v4l2_file_operations vicam_fops = {
        .owner          = THIS_MODULE,
        .open           = vicam_open,
        .release        = vicam_close,
        .read           = vicam_read,
        .mmap           = vicam_mmap,
        .ioctl          = vicam_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek         = no_llseek,
 };
 
 static struct video_device vicam_template = {
index 85661b1848fe5cb52111c50b65b56c93372070b8..2be5e47ed081949b8f50b2f6528d9929d47c45d8 100644 (file)
@@ -355,7 +355,7 @@ static void usbvision_remove_sysfs(struct video_device *vdev)
  * then allocates buffers needed for video processing.
  *
  */
-static int usbvision_v4l2_open(struct inode *inode, struct file *file)
+static int usbvision_v4l2_open(struct file *file)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
@@ -432,7 +432,7 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
  * allocated in usbvision_v4l2_open().
  *
  */
-static int usbvision_v4l2_close(struct inode *inode, struct file *file)
+static int usbvision_v4l2_close(struct file *file)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
 
@@ -477,12 +477,12 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file)
  */
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int vidioc_g_register (struct file *file, void *priv,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
        /* NT100x has a 8-bit register space */
        errCode = usbvision_read_reg(usbvision, reg->reg&0xff);
@@ -492,16 +492,17 @@ static int vidioc_g_register (struct file *file, void *priv,
                return errCode;
        }
        reg->val = errCode;
+       reg->size = 1;
        return 0;
 }
 
 static int vidioc_s_register (struct file *file, void *priv,
-                               struct v4l2_register *reg)
+                               struct v4l2_dbg_register *reg)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode;
 
-       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+       if (!v4l2_chip_match_host(&reg->match))
                return -EINVAL;
        /* NT100x has a 8-bit register space */
        errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
@@ -1178,7 +1179,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
  * Here comes the stuff for radio on usbvision based devices
  *
  */
-static int usbvision_radio_open(struct inode *inode, struct file *file)
+static int usbvision_radio_open(struct file *file)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
@@ -1228,7 +1229,7 @@ out:
 }
 
 
-static int usbvision_radio_close(struct inode *inode, struct file *file)
+static int usbvision_radio_close(struct file *file)
 {
        struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
@@ -1266,26 +1267,26 @@ static int usbvision_radio_close(struct inode *inode, struct file *file)
  * Here comes the stuff for vbi on usbvision based devices
  *
  */
-static int usbvision_vbi_open(struct inode *inode, struct file *file)
+static int usbvision_vbi_open(struct file *file)
 {
        /* TODO */
        return -ENODEV;
 }
 
-static int usbvision_vbi_close(struct inode *inode, struct file *file)
+static int usbvision_vbi_close(struct file *file)
 {
        /* TODO */
        return -ENODEV;
 }
 
-static int usbvision_do_vbi_ioctl(struct file *file,
+static long usbvision_do_vbi_ioctl(struct file *file,
                                 unsigned int cmd, void *arg)
 {
        /* TODO */
        return -ENOIOCTLCMD;
 }
 
-static int usbvision_vbi_ioctl(struct inode *inode, struct file *file,
+static long usbvision_vbi_ioctl(struct file *file,
                       unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl);
@@ -1297,16 +1298,14 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file,
 //
 
 // Video template
-static const struct file_operations usbvision_fops = {
+static const struct v4l2_file_operations usbvision_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_v4l2_open,
        .release        = usbvision_v4l2_close,
        .read           = usbvision_v4l2_read,
        .mmap           = usbvision_v4l2_mmap,
        .ioctl          = video_ioctl2,
-       .llseek         = no_llseek,
 /*     .poll          = video_poll, */
-       .compat_ioctl  = v4l_compat_ioctl32,
 };
 
 static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
@@ -1355,13 +1354,11 @@ static struct video_device usbvision_video_template = {
 
 
 // Radio template
-static const struct file_operations usbvision_radio_fops = {
+static const struct v4l2_file_operations usbvision_radio_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_radio_open,
        .release        = usbvision_radio_close,
        .ioctl          = video_ioctl2,
-       .llseek         = no_llseek,
-       .compat_ioctl  = v4l_compat_ioctl32,
 };
 
 static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = {
@@ -1392,13 +1389,11 @@ static struct video_device usbvision_radio_template = {
 };
 
 // vbi template
-static const struct file_operations usbvision_vbi_fops = {
+static const struct v4l2_file_operations usbvision_vbi_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_vbi_open,
        .release        = usbvision_vbi_close,
        .ioctl          = usbvision_vbi_ioctl,
-       .llseek         = no_llseek,
-       .compat_ioctl  = v4l_compat_ioctl32,
 };
 
 static struct video_device usbvision_vbi_template=
index afcc6934559e6f7c5f819fd74efb6b0f2c488e63..fa150fff2c10964e0ea8c2b9deb0ac22a98a96a3 100644 (file)
@@ -406,7 +406,7 @@ static int uvc_has_privileges(struct uvc_fh *handle)
  * V4L2 file operations
  */
 
-static int uvc_v4l2_open(struct inode *inode, struct file *file)
+static int uvc_v4l2_open(struct file *file)
 {
        struct uvc_video_device *video;
        struct uvc_fh *handle;
@@ -444,7 +444,7 @@ done:
        return ret;
 }
 
-static int uvc_v4l2_release(struct inode *inode, struct file *file)
+static int uvc_v4l2_release(struct file *file)
 {
        struct uvc_video_device *video = video_drvdata(file);
        struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
@@ -472,12 +472,12 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct video_device *vdev = video_devdata(file);
        struct uvc_video_device *video = video_get_drvdata(vdev);
        struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
-       int ret = 0;
+       long ret = 0;
 
        switch (cmd) {
        /* Query capabilities */
@@ -996,7 +996,7 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return ret;
 }
 
-static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
+static long uvc_v4l2_ioctl(struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
        if (uvc_trace_param & UVC_TRACE_IOCTL) {
@@ -1097,13 +1097,11 @@ static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
        return uvc_queue_poll(&video->queue, file, wait);
 }
 
-struct file_operations uvc_fops = {
+const struct v4l2_file_operations uvc_fops = {
        .owner          = THIS_MODULE,
        .open           = uvc_v4l2_open,
        .release        = uvc_v4l2_release,
        .ioctl          = uvc_v4l2_ioctl,
-       .compat_ioctl   = v4l_compat_ioctl32,
-       .llseek         = no_llseek,
        .read           = uvc_v4l2_read,
        .mmap           = uvc_v4l2_mmap,
        .poll           = uvc_v4l2_poll,
index 896b791ece159565553804e8e2efb7db942820bc..bcf4361dc1bc8ffd543e5f1533d0b85d413da076 100644 (file)
@@ -753,7 +753,7 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
 }
 
 /* V4L2 interface */
-extern struct file_operations uvc_fops;
+extern const struct v4l2_file_operations uvc_fops;
 
 /* Video */
 extern int uvc_video_init(struct uvc_video_device *video);
index f13c0a9d684fe997dcbe0ab593f04d1c49557c21..d450cab20be4d09f8e92e259ba424b235ba36139 100644 (file)
@@ -267,12 +267,12 @@ done:
 
 /* ----------------------------------------------------------------- */
 
-static noinline int v4l1_compat_get_capabilities(
+static noinline long v4l1_compat_get_capabilities(
                                        struct video_capability *cap,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_framebuffer fbuf;
        struct v4l2_capability *cap2;
 
@@ -286,13 +286,13 @@ static noinline int v4l1_compat_get_capabilities(
 
        err = drv(file, VIDIOC_QUERYCAP, cap2);
        if (err < 0) {
-               dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
+               dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %ld\n", err);
                goto done;
        }
        if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
                err = drv(file, VIDIOC_G_FBUF, &fbuf);
                if (err < 0) {
-                       dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
+                       dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %ld\n", err);
                        memset(&fbuf, 0, sizeof(fbuf));
                }
                err = 0;
@@ -324,12 +324,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_get_frame_buffer(
+static noinline long v4l1_compat_get_frame_buffer(
                                        struct video_buffer *buffer,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_framebuffer fbuf;
 
        memset(buffer, 0, sizeof(*buffer));
@@ -337,7 +337,7 @@ static noinline int v4l1_compat_get_frame_buffer(
 
        err = drv(file, VIDIOC_G_FBUF, &fbuf);
        if (err < 0) {
-               dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
+               dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %ld\n", err);
                goto done;
        }
        buffer->base   = fbuf.base;
@@ -378,12 +378,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_frame_buffer(
+static noinline long v4l1_compat_set_frame_buffer(
                                        struct video_buffer *buffer,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_framebuffer fbuf;
 
        memset(&fbuf, 0, sizeof(fbuf));
@@ -410,16 +410,16 @@ static noinline int v4l1_compat_set_frame_buffer(
        fbuf.fmt.bytesperline = buffer->bytesperline;
        err = drv(file, VIDIOC_S_FBUF, &fbuf);
        if (err < 0)
-               dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
+               dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %ld\n", err);
        return err;
 }
 
-static noinline int v4l1_compat_get_win_cap_dimensions(
+static noinline long v4l1_compat_get_win_cap_dimensions(
                                        struct video_window *win,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_format *fmt;
 
        fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -432,7 +432,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
        fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
        err = drv(file, VIDIOC_G_FMT, fmt);
        if (err < 0)
-               dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
+               dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %ld\n", err);
        if (err == 0) {
                win->x         = fmt->fmt.win.w.left;
                win->y         = fmt->fmt.win.w.top;
@@ -447,7 +447,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
        fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        err = drv(file, VIDIOC_G_FMT, fmt);
        if (err < 0) {
-               dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
+               dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %ld\n", err);
                goto done;
        }
        win->x         = 0;
@@ -462,12 +462,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_win_cap_dimensions(
+static noinline long v4l1_compat_set_win_cap_dimensions(
                                        struct video_window *win,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err, err1, err2;
+       long err, err1, err2;
        struct v4l2_format *fmt;
 
        fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -479,7 +479,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
        drv(file, VIDIOC_STREAMOFF, &fmt->type);
        err1 = drv(file, VIDIOC_G_FMT, fmt);
        if (err1 < 0)
-               dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
+               dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %ld\n", err1);
        if (err1 == 0) {
                fmt->fmt.pix.width  = win->width;
                fmt->fmt.pix.height = win->height;
@@ -487,7 +487,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
                fmt->fmt.pix.bytesperline = 0;
                err = drv(file, VIDIOC_S_FMT, fmt);
                if (err < 0)
-                       dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
+                       dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %ld\n",
                                err);
                win->width  = fmt->fmt.pix.width;
                win->height = fmt->fmt.pix.height;
@@ -504,7 +504,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
        fmt->fmt.win.clipcount = win->clipcount;
        err2 = drv(file, VIDIOC_S_FMT, fmt);
        if (err2 < 0)
-               dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
+               dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %ld\n", err2);
 
        if (err1 != 0 && err2 != 0)
                err = err1;
@@ -514,12 +514,12 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
        return err;
 }
 
-static noinline int v4l1_compat_turn_preview_on_off(
+static noinline long v4l1_compat_turn_preview_on_off(
                                        int *on,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
        if (0 == *on) {
@@ -530,16 +530,16 @@ static noinline int v4l1_compat_turn_preview_on_off(
        }
        err = drv(file, VIDIOC_OVERLAY, on);
        if (err < 0)
-               dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
+               dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %ld\n", err);
        return err;
 }
 
-static noinline int v4l1_compat_get_input_info(
+static noinline long v4l1_compat_get_input_info(
                                        struct video_channel *chan,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_input       input2;
        v4l2_std_id             sid;
 
@@ -548,7 +548,7 @@ static noinline int v4l1_compat_get_input_info(
        err = drv(file, VIDIOC_ENUMINPUT, &input2);
        if (err < 0) {
                dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
-                       "channel=%d err=%d\n", chan->channel, err);
+                       "channel=%d err=%ld\n", chan->channel, err);
                goto done;
        }
        chan->channel = input2.index;
@@ -569,7 +569,7 @@ static noinline int v4l1_compat_get_input_info(
        chan->norm = 0;
        err = drv(file, VIDIOC_G_STD, &sid);
        if (err < 0)
-               dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
+               dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %ld\n", err);
        if (err == 0) {
                if (sid & V4L2_STD_PAL)
                        chan->norm = VIDEO_MODE_PAL;
@@ -582,17 +582,17 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_input(
+static noinline long v4l1_compat_set_input(
                                        struct video_channel *chan,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        v4l2_std_id sid = 0;
 
        err = drv(file, VIDIOC_S_INPUT, &chan->channel);
        if (err < 0)
-               dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
+               dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %ld\n", err);
        switch (chan->norm) {
        case VIDEO_MODE_PAL:
                sid = V4L2_STD_PAL;
@@ -607,17 +607,17 @@ static noinline int v4l1_compat_set_input(
        if (0 != sid) {
                err = drv(file, VIDIOC_S_STD, &sid);
                if (err < 0)
-                       dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
+                       dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %ld\n", err);
        }
        return err;
 }
 
-static noinline int v4l1_compat_get_picture(
+static noinline long v4l1_compat_get_picture(
                                        struct video_picture *pict,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_format *fmt;
 
        fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -640,7 +640,7 @@ static noinline int v4l1_compat_get_picture(
        fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        err = drv(file, VIDIOC_G_FMT, fmt);
        if (err < 0) {
-               dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
+               dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %ld\n", err);
                goto done;
        }
 
@@ -654,12 +654,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_picture(
+static noinline long v4l1_compat_set_picture(
                                        struct video_picture *pict,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_framebuffer fbuf;
        int mem_err = 0, ovl_err = 0;
        struct v4l2_format *fmt;
@@ -694,7 +694,7 @@ static noinline int v4l1_compat_set_picture(
           support memory capture.  Trying to set the memory capture
           parameters would be pointless.  */
        if (err < 0) {
-               dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %d\n", err);
+               dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %ld\n", err);
                mem_err = -1000;  /* didn't even try */
        } else if (fmt->fmt.pix.pixelformat !=
                 palette_to_pixelformat(pict->palette)) {
@@ -711,7 +711,7 @@ static noinline int v4l1_compat_set_picture(
           support overlay.  Trying to set the overlay parameters
           would be quite pointless.  */
        if (err < 0) {
-               dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %d\n", err);
+               dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %ld\n", err);
                ovl_err = -1000;  /* didn't even try */
        } else if (fbuf.fmt.pixelformat !=
                 palette_to_pixelformat(pict->palette)) {
@@ -736,12 +736,13 @@ static noinline int v4l1_compat_set_picture(
        return err;
 }
 
-static noinline int v4l1_compat_get_tuner(
+static noinline long v4l1_compat_get_tuner(
                                        struct video_tuner *tun,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err, i;
+       long err;
+       int i;
        struct v4l2_tuner       tun2;
        struct v4l2_standard    std2;
        v4l2_std_id             sid;
@@ -749,7 +750,7 @@ static noinline int v4l1_compat_get_tuner(
        memset(&tun2, 0, sizeof(tun2));
        err = drv(file, VIDIOC_G_TUNER, &tun2);
        if (err < 0) {
-               dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
+               dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %ld\n", err);
                goto done;
        }
        memcpy(tun->name, tun2.name,
@@ -775,7 +776,7 @@ static noinline int v4l1_compat_get_tuner(
 
        err = drv(file, VIDIOC_G_STD, &sid);
        if (err < 0)
-               dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
+               dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %ld\n", err);
        if (err == 0) {
                if (sid & V4L2_STD_PAL)
                        tun->mode = VIDEO_MODE_PAL;
@@ -794,12 +795,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_select_tuner(
+static noinline long v4l1_compat_select_tuner(
                                        struct video_tuner *tun,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_tuner       t;/*84 bytes on x86_64*/
        memset(&t, 0, sizeof(t));
 
@@ -807,34 +808,34 @@ static noinline int v4l1_compat_select_tuner(
 
        err = drv(file, VIDIOC_S_INPUT, &t);
        if (err < 0)
-               dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
+               dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err);
        return err;
 }
 
-static noinline int v4l1_compat_get_frequency(
+static noinline long v4l1_compat_get_frequency(
                                        unsigned long *freq,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_frequency   freq2;
        memset(&freq2, 0, sizeof(freq2));
 
        freq2.tuner = 0;
        err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
        if (err < 0)
-               dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
+               dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %ld\n", err);
        if (0 == err)
                *freq = freq2.frequency;
        return err;
 }
 
-static noinline int v4l1_compat_set_frequency(
+static noinline long v4l1_compat_set_frequency(
                                        unsigned long *freq,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_frequency   freq2;
        memset(&freq2, 0, sizeof(freq2));
 
@@ -842,16 +843,17 @@ static noinline int v4l1_compat_set_frequency(
        freq2.frequency = *freq;
        err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
        if (err < 0)
-               dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
+               dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %ld\n", err);
        return err;
 }
 
-static noinline int v4l1_compat_get_audio(
+static noinline long v4l1_compat_get_audio(
                                        struct video_audio *aud,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err, i;
+       long err;
+       int i;
        struct v4l2_queryctrl   qctrl2;
        struct v4l2_audio       aud2;
        struct v4l2_tuner       tun2;
@@ -859,7 +861,7 @@ static noinline int v4l1_compat_get_audio(
 
        err = drv(file, VIDIOC_G_AUDIO, &aud2);
        if (err < 0) {
-               dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
+               dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %ld\n", err);
                goto done;
        }
        memcpy(aud->name, aud2.name,
@@ -903,7 +905,7 @@ static noinline int v4l1_compat_get_audio(
        memset(&tun2, 0, sizeof(tun2));
        err = drv(file, VIDIOC_G_TUNER, &tun2);
        if (err < 0) {
-               dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
+               dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %ld\n", err);
                err = 0;
                goto done;
        }
@@ -918,12 +920,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_audio(
+static noinline long v4l1_compat_set_audio(
                                        struct video_audio *aud,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_audio       aud2;
        struct v4l2_tuner       tun2;
 
@@ -933,7 +935,7 @@ static noinline int v4l1_compat_set_audio(
        aud2.index = aud->audio;
        err = drv(file, VIDIOC_S_AUDIO, &aud2);
        if (err < 0) {
-               dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
+               dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %ld\n", err);
                goto done;
        }
 
@@ -950,7 +952,7 @@ static noinline int v4l1_compat_set_audio(
 
        err = drv(file, VIDIOC_G_TUNER, &tun2);
        if (err < 0)
-               dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
+               dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %ld\n", err);
        if (err == 0) {
                switch (aud->mode) {
                default:
@@ -967,19 +969,19 @@ static noinline int v4l1_compat_set_audio(
                }
                err = drv(file, VIDIOC_S_TUNER, &tun2);
                if (err < 0)
-                       dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
+                       dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %ld\n", err);
        }
        err = 0;
 done:
        return err;
 }
 
-static noinline int v4l1_compat_capture_frame(
+static noinline long v4l1_compat_capture_frame(
                                        struct video_mmap *mm,
                                        struct file *file,
                                        v4l2_kioctl drv)
 {
-       int err;
+       long err;
        enum v4l2_buf_type      captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        struct v4l2_buffer      buf;
        struct v4l2_format      *fmt;
@@ -994,7 +996,7 @@ static noinline int v4l1_compat_capture_frame(
        fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        err = drv(file, VIDIOC_G_FMT, fmt);
        if (err < 0) {
-               dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
+               dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %ld\n", err);
                goto done;
        }
        if (mm->width   != fmt->fmt.pix.width  ||
@@ -1010,7 +1012,7 @@ static noinline int v4l1_compat_capture_frame(
                fmt->fmt.pix.bytesperline = 0;
                err = drv(file, VIDIOC_S_FMT, fmt);
                if (err < 0) {
-                       dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
+                       dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %ld\n", err);
                        goto done;
                }
        }
@@ -1018,28 +1020,28 @@ static noinline int v4l1_compat_capture_frame(
        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        err = drv(file, VIDIOC_QUERYBUF, &buf);
        if (err < 0) {
-               dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
+               dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %ld\n", err);
                goto done;
        }
        err = drv(file, VIDIOC_QBUF, &buf);
        if (err < 0) {
-               dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
+               dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %ld\n", err);
                goto done;
        }
        err = drv(file, VIDIOC_STREAMON, &captype);
        if (err < 0)
-               dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
+               dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %ld\n", err);
 done:
        kfree(fmt);
        return err;
 }
 
-static noinline int v4l1_compat_sync(
+static noinline long v4l1_compat_sync(
                                int *i,
                                struct file *file,
                                v4l2_kioctl drv)
 {
-       int err;
+       long err;
        enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        struct v4l2_buffer buf;
        struct poll_wqueues *pwq;
@@ -1050,7 +1052,7 @@ static noinline int v4l1_compat_sync(
        err = drv(file, VIDIOC_QUERYBUF, &buf);
        if (err < 0) {
                /*  No such buffer */
-               dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
+               dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
                goto done;
        }
        if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) {
@@ -1062,7 +1064,7 @@ static noinline int v4l1_compat_sync(
        /* make sure capture actually runs so we don't block forever */
        err = drv(file, VIDIOC_STREAMON, &captype);
        if (err < 0) {
-               dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
+               dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %ld\n", err);
                goto done;
        }
 
@@ -1076,7 +1078,7 @@ static noinline int v4l1_compat_sync(
                        break;
                err = drv(file, VIDIOC_QUERYBUF, &buf);
                if (err < 0)
-                       dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
+                       dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
        }
        kfree(pwq);
        if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
@@ -1084,18 +1086,18 @@ static noinline int v4l1_compat_sync(
        do {
                err = drv(file, VIDIOC_DQBUF, &buf);
                if (err < 0)
-                       dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
+                       dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %ld\n", err);
        } while (err == 0 && buf.index != *i);
 done:
        return err;
 }
 
-static noinline int v4l1_compat_get_vbi_format(
+static noinline long v4l1_compat_get_vbi_format(
                                struct vbi_format *fmt,
                                struct file *file,
                                v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_format *fmt2;
 
        fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
@@ -1107,7 +1109,7 @@ static noinline int v4l1_compat_get_vbi_format(
 
        err = drv(file, VIDIOC_G_FMT, fmt2);
        if (err < 0) {
-               dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
+               dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %ld\n", err);
                goto done;
        }
        if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) {
@@ -1128,12 +1130,12 @@ done:
        return err;
 }
 
-static noinline int v4l1_compat_set_vbi_format(
+static noinline long v4l1_compat_set_vbi_format(
                                struct vbi_format *fmt,
                                struct file *file,
                                v4l2_kioctl drv)
 {
-       int err;
+       long err;
        struct v4l2_format      *fmt2 = NULL;
 
        if (VIDEO_PALETTE_RAW != fmt->sample_format) {
@@ -1157,7 +1159,7 @@ static noinline int v4l1_compat_set_vbi_format(
        fmt2->fmt.vbi.flags            = fmt->flags;
        err = drv(file, VIDIOC_TRY_FMT, fmt2);
        if (err < 0) {
-               dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
+               dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %ld\n", err);
                goto done;
        }
 
@@ -1174,7 +1176,7 @@ static noinline int v4l1_compat_set_vbi_format(
        }
        err = drv(file, VIDIOC_S_FMT, fmt2);
        if (err < 0)
-               dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
+               dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %ld\n", err);
 done:
        kfree(fmt2);
        return err;
@@ -1183,13 +1185,13 @@ done:
 /*
  *     This function is exported.
  */
-int
+long
 v4l_compat_translate_ioctl(struct file         *file,
                           int                  cmd,
                           void                 *arg,
                           v4l2_kioctl          drv)
 {
-       int err;
+       long err;
 
        switch (cmd) {
        case VIDIOCGCAP:        /* capability */
index c676b0b0f708340f7644f69d3b6ceaab29fd8eea..b8f2be8d5c0ee3702bad5f880180797e711082f9 100644 (file)
@@ -797,11 +797,11 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 id)
 }
 EXPORT_SYMBOL(v4l2_ctrl_next);
 
-int v4l2_chip_match_host(u32 match_type, u32 match_chip)
+int v4l2_chip_match_host(const struct v4l2_dbg_match *match)
 {
-       switch (match_type) {
+       switch (match->type) {
        case V4L2_CHIP_MATCH_HOST:
-               return match_chip == 0;
+               return match->addr == 0;
        default:
                return 0;
        }
@@ -809,23 +809,34 @@ int v4l2_chip_match_host(u32 match_type, u32 match_chip)
 EXPORT_SYMBOL(v4l2_chip_match_host);
 
 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
-int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_chip)
+int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match)
 {
-       switch (match_type) {
+       int len;
+
+       if (c == NULL || match == NULL)
+               return 0;
+
+       switch (match->type) {
        case V4L2_CHIP_MATCH_I2C_DRIVER:
-               return (c != NULL && c->driver != NULL && c->driver->id == match_chip);
+               if (c->driver == NULL || c->driver->driver.name == NULL)
+                       return 0;
+               len = strlen(c->driver->driver.name);
+               /* legacy drivers have a ' suffix, don't try to match that */
+               if (len && c->driver->driver.name[len - 1] == '\'')
+                       len--;
+               return len && !strncmp(c->driver->driver.name, match->name, len);
        case V4L2_CHIP_MATCH_I2C_ADDR:
-               return (c != NULL && c->addr == match_chip);
+               return c->addr == match->addr;
        default:
                return 0;
        }
 }
 EXPORT_SYMBOL(v4l2_chip_match_i2c_client);
 
-int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip,
+int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip,
                u32 ident, u32 revision)
 {
-       if (!v4l2_chip_match_i2c_client(c, chip->match_type, chip->match_chip))
+       if (!v4l2_chip_match_i2c_client(c, &chip->match))
                return 0;
        if (chip->ident == V4L2_IDENT_NONE) {
                chip->ident = ident;
index d0e1bd3ace6aec3a8f2aeab76a79509e783f762f..110376be5d2b247921d390f5ea1e503d3c82331d 100644 (file)
@@ -222,9 +222,9 @@ static int get_microcode32(struct video_code *kp, struct video_code32 __user *up
 
 #endif
 
-static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       int ret = -ENOIOCTLCMD;
+       long ret = -ENOIOCTLCMD;
 
        if (file->f_op->unlocked_ioctl)
                ret = file->f_op->unlocked_ioctl(file, cmd, arg);
@@ -705,7 +705,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
 #define VIDIOC_G_OUTPUT32      _IOR ('V', 46, s32)
 #define VIDIOC_S_OUTPUT32      _IOWR('V', 47, s32)
 
-static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        union {
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
@@ -726,7 +726,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        } karg;
        void __user *up = compat_ptr(arg);
        int compatible_arg = 1;
-       int err = 0;
+       long err = 0;
 
        /* First, convert the command. */
        switch (cmd) {
@@ -937,9 +937,9 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        return err;
 }
 
-long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
+long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       int ret = -ENOIOCTLCMD;
+       long ret = -ENOIOCTLCMD;
 
        if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl)
                return ret;
@@ -1046,7 +1046,8 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
        case VIDIOC_TRY_ENCODER_CMD:
        case VIDIOC_DBG_S_REGISTER:
        case VIDIOC_DBG_G_REGISTER:
-       case VIDIOC_G_CHIP_IDENT:
+       case VIDIOC_DBG_G_CHIP_IDENT:
+       case VIDIOC_G_CHIP_IDENT_OLD:
        case VIDIOC_S_HW_FREQ_SEEK:
                ret = do_video_ioctl(file, cmd, arg);
                break;
@@ -1065,18 +1066,14 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
                break;
 #endif
        default:
-               v4l_print_ioctl("compat_ioctl32", cmd);
-               printk(KERN_CONT "\n");
+               printk(KERN_WARNING "compat_ioctl32: "
+                       "unknown ioctl '%c', dir=%d, #%d (0x%08x)\n",
+                       _IOC_TYPE(cmd), _IOC_DIR(cmd), _IOC_NR(cmd), cmd);
                break;
        }
        return ret;
 }
-#else
-long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
-{
-       return -ENOIOCTLCMD;
-}
+EXPORT_SYMBOL_GPL(v4l2_compat_ioctl32);
 #endif
-EXPORT_SYMBOL_GPL(v4l_compat_ioctl32);
 
 MODULE_LICENSE("GPL");
index 7ad6711ee32776452f2493f022b9b4dc059de8a9..13f87c22e78dce1721bb10c464409786df685c2c 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-ioctl.h>
 
 #define VIDEO_NUM_DEVICES      256
 #define VIDEO_NAME              "video4linux"
@@ -182,7 +183,7 @@ static int v4l2_ioctl(struct inode *inode, struct file *filp,
                return -ENOTTY;
        /* Allow ioctl to continue even if the device was unregistered.
           Things like dequeueing buffers might still be useful. */
-       return vdev->fops->ioctl(inode, filp, cmd, arg);
+       return vdev->fops->ioctl(filp, cmd, arg);
 }
 
 static long v4l2_unlocked_ioctl(struct file *filp,
@@ -197,20 +198,6 @@ static long v4l2_unlocked_ioctl(struct file *filp,
        return vdev->fops->unlocked_ioctl(filp, cmd, arg);
 }
 
-#ifdef CONFIG_COMPAT
-static long v4l2_compat_ioctl(struct file *filp,
-               unsigned int cmd, unsigned long arg)
-{
-       struct video_device *vdev = video_devdata(filp);
-
-       if (!vdev->fops->compat_ioctl)
-               return -ENOIOCTLCMD;
-       /* Allow ioctl to continue even if the device was unregistered.
-          Things like dequeueing buffers might still be useful. */
-       return vdev->fops->compat_ioctl(filp, cmd, arg);
-}
-#endif
-
 static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm)
 {
        struct video_device *vdev = video_devdata(filp);
@@ -239,7 +226,7 @@ static int v4l2_open(struct inode *inode, struct file *filp)
        /* and increase the device refcount */
        video_get(vdev);
        mutex_unlock(&videodev_lock);
-       ret = vdev->fops->open(inode, filp);
+       ret = vdev->fops->open(filp);
        /* decrease the refcount in case of an error */
        if (ret)
                video_put(vdev);
@@ -250,7 +237,7 @@ static int v4l2_open(struct inode *inode, struct file *filp)
 static int v4l2_release(struct inode *inode, struct file *filp)
 {
        struct video_device *vdev = video_devdata(filp);
-       int ret = vdev->fops->release(inode, filp);
+       int ret = vdev->fops->release(filp);
 
        /* decrease the refcount unconditionally since the release()
           return value is ignored. */
@@ -266,7 +253,7 @@ static const struct file_operations v4l2_unlocked_fops = {
        .mmap = v4l2_mmap,
        .unlocked_ioctl = v4l2_unlocked_ioctl,
 #ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l2_compat_ioctl,
+       .compat_ioctl = v4l2_compat_ioctl32,
 #endif
        .release = v4l2_release,
        .poll = v4l2_poll,
@@ -281,7 +268,7 @@ static const struct file_operations v4l2_fops = {
        .mmap = v4l2_mmap,
        .ioctl = v4l2_ioctl,
 #ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l2_compat_ioctl,
+       .compat_ioctl = v4l2_compat_ioctl32,
 #endif
        .release = v4l2_release,
        .poll = v4l2_poll,
index b063381f4b3b99af4e75ae4e96c7ebd26b38d9d7..52d687b165e0c6589cc3bab0e29f953b6625b295 100644 (file)
@@ -266,7 +266,7 @@ static const char *v4l2_ioctls[] = {
        [_IOC_NR(VIDIOC_DBG_S_REGISTER)]   = "VIDIOC_DBG_S_REGISTER",
        [_IOC_NR(VIDIOC_DBG_G_REGISTER)]   = "VIDIOC_DBG_G_REGISTER",
 
-       [_IOC_NR(VIDIOC_G_CHIP_IDENT)]     = "VIDIOC_G_CHIP_IDENT",
+       [_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT",
        [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)]   = "VIDIOC_S_HW_FREQ_SEEK",
 #endif
 };
@@ -392,14 +392,14 @@ video_fix_command(unsigned int cmd)
 /*
  * Obsolete usercopy function - Should be removed soon
  */
-int
+long
 video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
                v4l2_kioctl func)
 {
        char    sbuf[128];
        void    *mbuf = NULL;
        void    *parg = NULL;
-       int     err  = -EINVAL;
+       long    err  = -EINVAL;
        int     is_ext_ctrl;
        size_t  ctrls_size = 0;
        void __user *user_ptr = NULL;
@@ -623,13 +623,13 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)
        return -EINVAL;
 }
 
-static int __video_do_ioctl(struct file *file,
+static long __video_do_ioctl(struct file *file,
                unsigned int cmd, void *arg)
 {
        struct video_device *vfd = video_devdata(file);
        const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
        void *fh = file->private_data;
-       int ret = -EINVAL;
+       long ret = -EINVAL;
 
        if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
                                !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
@@ -1720,7 +1720,7 @@ static int __video_do_ioctl(struct file *file,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        case VIDIOC_DBG_G_REGISTER:
        {
-               struct v4l2_register *p = arg;
+               struct v4l2_dbg_register *p = arg;
 
                if (!capable(CAP_SYS_ADMIN))
                        ret = -EPERM;
@@ -1730,7 +1730,7 @@ static int __video_do_ioctl(struct file *file,
        }
        case VIDIOC_DBG_S_REGISTER:
        {
-               struct v4l2_register *p = arg;
+               struct v4l2_dbg_register *p = arg;
 
                if (!capable(CAP_SYS_ADMIN))
                        ret = -EPERM;
@@ -1739,9 +1739,9 @@ static int __video_do_ioctl(struct file *file,
                break;
        }
 #endif
-       case VIDIOC_G_CHIP_IDENT:
+       case VIDIOC_DBG_G_CHIP_IDENT:
        {
-               struct v4l2_chip_ident *p = arg;
+               struct v4l2_dbg_chip_ident *p = arg;
 
                if (!ops->vidioc_g_chip_ident)
                        break;
@@ -1750,6 +1750,11 @@ static int __video_do_ioctl(struct file *file,
                        dbgarg(cmd, "chip_ident=%u, revision=0x%x\n", p->ident, p->revision);
                break;
        }
+       case VIDIOC_G_CHIP_IDENT_OLD:
+               printk(KERN_ERR "VIDIOC_G_CHIP_IDENT has been deprecated and will disappear in 2.6.30.\n");
+               printk(KERN_ERR "It is a debugging ioctl and must not be used in applications!\n");
+               return -EINVAL;
+
        case VIDIOC_S_HW_FREQ_SEEK:
        {
                struct v4l2_hw_freq_seek *p = arg;
@@ -1845,20 +1850,20 @@ static int __video_do_ioctl(struct file *file,
        if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {
                if (ret < 0) {
                        v4l_print_ioctl(vfd->name, cmd);
-                       printk(KERN_CONT " error %d\n", ret);
+                       printk(KERN_CONT " error %ld\n", ret);
                }
        }
 
        return ret;
 }
 
-long __video_ioctl2(struct file *file,
+long video_ioctl2(struct file *file,
               unsigned int cmd, unsigned long arg)
 {
        char    sbuf[128];
        void    *mbuf = NULL;
        void    *parg = NULL;
-       int     err  = -EINVAL;
+       long    err  = -EINVAL;
        int     is_ext_ctrl;
        size_t  ctrls_size = 0;
        void __user *user_ptr = NULL;
@@ -1944,11 +1949,4 @@ out:
        kfree(mbuf);
        return err;
 }
-EXPORT_SYMBOL(__video_ioctl2);
-
-int video_ioctl2(struct inode *inode, struct file *file,
-              unsigned int cmd, unsigned long arg)
-{
-       return __video_ioctl2(file, cmd, arg);
-}
 EXPORT_SYMBOL(video_ioctl2);
index e3612f29d0df762f4f4805cef4ec3f7cd9f23ad8..fbe9cc0d433a29cf16a33d89a55a001596ad0c5e 100644 (file)
@@ -37,7 +37,7 @@ int v4l2_subdev_command(struct v4l2_subdev *sd, unsigned cmd, void *arg)
                return v4l2_subdev_call(sd, core, queryctrl, arg);
        case VIDIOC_LOG_STATUS:
                return v4l2_subdev_call(sd, core, log_status);
-       case VIDIOC_G_CHIP_IDENT:
+       case VIDIOC_DBG_G_CHIP_IDENT:
                return v4l2_subdev_call(sd, core, g_chip_ident, arg);
        case VIDIOC_INT_S_STANDBY:
                return v4l2_subdev_call(sd, core, s_standby, arg ? (*(u32 *)arg) : 0);
index a72a361daade1b33b92a5f6911d998e6bfe13685..88bf845a3d567cbe754dbd89dfe2fc3952ba0ecd 100644 (file)
@@ -4019,7 +4019,7 @@ out:
 
 /* File operations */
 
-static int vino_open(struct inode *inode, struct file *file)
+static int vino_open(struct file *file)
 {
        struct vino_channel_settings *vcs = video_drvdata(file);
        int ret = 0;
@@ -4050,7 +4050,7 @@ static int vino_open(struct inode *inode, struct file *file)
        return ret;
 }
 
-static int vino_close(struct inode *inode, struct file *file)
+static int vino_close(struct file *file)
 {
        struct vino_channel_settings *vcs = video_drvdata(file);
        dprintk("close():\n");
@@ -4237,7 +4237,7 @@ error:
        return ret;
 }
 
-static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct vino_channel_settings *vcs = video_drvdata(file);
 
@@ -4343,11 +4343,11 @@ static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int vino_ioctl(struct inode *inode, struct file *file,
+static long vino_ioctl(struct file *file,
                      unsigned int cmd, unsigned long arg)
 {
        struct vino_channel_settings *vcs = video_drvdata(file);
-       int ret;
+       long ret;
 
        if (mutex_lock_interruptible(&vcs->mutex))
                return -EINTR;
@@ -4364,14 +4364,13 @@ static int vino_ioctl(struct inode *inode, struct file *file,
 /* __initdata */
 static int vino_init_stage;
 
-static const struct file_operations vino_fops = {
+static const struct v4l2_file_operations vino_fops = {
        .owner          = THIS_MODULE,
        .open           = vino_open,
        .release        = vino_close,
        .ioctl          = vino_ioctl,
        .mmap           = vino_mmap,
        .poll           = vino_poll,
-       .llseek         = no_llseek,
 };
 
 static struct video_device v4l_device_template = {
index e15e48f04be7511e788b5022f413952d10d93bc7..81d5aa5cf3317c336ecbaf7c666e75d793514dab 100644 (file)
@@ -1024,9 +1024,9 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
        File operations for the device
    ------------------------------------------------------------------*/
 
-static int vivi_open(struct inode *inode, struct file *file)
+static int vivi_open(struct file *file)
 {
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
        struct vivi_dev *dev;
        struct vivi_fh *fh = NULL;
        int i;
@@ -1127,13 +1127,13 @@ vivi_poll(struct file *file, struct poll_table_struct *wait)
        return videobuf_poll_stream(file, q, wait);
 }
 
-static int vivi_close(struct inode *inode, struct file *file)
+static int vivi_close(struct file *file)
 {
        struct vivi_fh         *fh = file->private_data;
        struct vivi_dev *dev       = fh->dev;
        struct vivi_dmaqueue *vidq = &dev->vidq;
 
-       int minor = iminor(inode);
+       int minor = video_devdata(file)->minor;
 
        vivi_stop_thread(vidq);
        videobuf_stop(&fh->vb_vidq);
@@ -1195,16 +1195,14 @@ static int vivi_mmap(struct file *file, struct vm_area_struct *vma)
        return ret;
 }
 
-static const struct file_operations vivi_fops = {
+static const struct v4l2_file_operations vivi_fops = {
        .owner          = THIS_MODULE,
        .open           = vivi_open,
        .release        = vivi_close,
        .read           = vivi_read,
        .poll           = vivi_poll,
        .ioctl          = video_ioctl2, /* V4L2 ioctl handler */
-       .compat_ioctl   = v4l_compat_ioctl32,
        .mmap           = vivi_mmap,
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
index f72b859486ada73f1725641f9a7cedcd4b272767..5d73f66d9f551efb65f541a2fab1c27970a7f667 100644 (file)
@@ -113,7 +113,7 @@ static int vp27smpx_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
        return 0;
 }
 
-static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int vp27smpx_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 56c570c267ea1f6f110678867809d606642c3e7f..038ff32b01b85943fdc572fb6266becb9c4f4ada 100644 (file)
@@ -180,19 +180,19 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
 static int w9966_i2c_rbyte(struct w9966_dev* cam);
 #endif
 
-static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
+static long w9966_v4l_ioctl(struct file *file,
                           unsigned int cmd, unsigned long arg);
 static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
                              size_t count, loff_t *ppos);
 
-static int w9966_exclusive_open(struct inode *inode, struct file *file)
+static int w9966_exclusive_open(struct file *file)
 {
        struct w9966_dev *cam = video_drvdata(file);
 
        return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
 }
 
-static int w9966_exclusive_release(struct inode *inode, struct file *file)
+static int w9966_exclusive_release(struct file *file)
 {
        struct w9966_dev *cam = video_drvdata(file);
 
@@ -200,16 +200,12 @@ static int w9966_exclusive_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations w9966_fops = {
+static const struct v4l2_file_operations w9966_fops = {
        .owner          = THIS_MODULE,
        .open           = w9966_exclusive_open,
        .release        = w9966_exclusive_release,
        .ioctl          = w9966_v4l_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .read           = w9966_v4l_read,
-       .llseek         = no_llseek,
 };
 static struct video_device w9966_template = {
        .name           = W9966_DRIVERNAME,
@@ -727,7 +723,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data)
  *     Video4linux interfacing
  */
 
-static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct w9966_dev *cam = video_drvdata(file);
 
@@ -877,7 +873,7 @@ static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
+static long w9966_v4l_ioctl(struct file *file,
                           unsigned int cmd, unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl);
index 4dfb43bd1846b977edfe277d6f8e2d06898bb837..a3997b7d4366049d9ce20e446e67fb47f0bececf 100644 (file)
@@ -399,13 +399,13 @@ MODULE_PARM_DESC(specific_debug,
  ****************************************************************************/
 
 /* Video4linux interface */
-static const struct file_operations w9968cf_fops;
-static int w9968cf_open(struct inode*, struct file*);
-static int w9968cf_release(struct inode*, struct file*);
-static int w9968cf_mmap(struct file*, struct vm_area_struct*);
-static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long);
-static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*);
-static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int,
+static const struct v4l2_file_operations w9968cf_fops;
+static int w9968cf_open(struct file *);
+static int w9968cf_release(struct file *);
+static int w9968cf_mmap(struct file *, struct vm_area_struct *);
+static long w9968cf_ioctl(struct file *, unsigned, unsigned long);
+static ssize_t w9968cf_read(struct file *, char __user *, size_t, loff_t *);
+static long w9968cf_v4l_ioctl(struct file *, unsigned int,
                             void __user *);
 
 /* USB-specific */
@@ -2662,7 +2662,7 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
  * Video4Linux interface                                                    *
  ****************************************************************************/
 
-static int w9968cf_open(struct inode* inode, struct file* filp)
+static int w9968cf_open(struct file *filp)
 {
        struct w9968cf_device* cam;
        int err;
@@ -2748,7 +2748,7 @@ deallocate_memory:
 }
 
 
-static int w9968cf_release(struct inode* inode, struct file* filp)
+static int w9968cf_release(struct file *filp)
 {
        struct w9968cf_device* cam;
 
@@ -2885,12 +2885,12 @@ static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
 }
 
 
-static int
-w9968cf_ioctl(struct inode* inode, struct file* filp,
+static long
+w9968cf_ioctl(struct file *filp,
              unsigned int cmd, unsigned long arg)
 {
        struct w9968cf_device* cam;
-       int err;
+       long err;
 
        cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
 
@@ -2909,15 +2909,15 @@ w9968cf_ioctl(struct inode* inode, struct file* filp,
                return -EIO;
        }
 
-       err = w9968cf_v4l_ioctl(inode, filp, cmd, (void __user *)arg);
+       err = w9968cf_v4l_ioctl(filp, cmd, (void __user *)arg);
 
        mutex_unlock(&cam->fileop_mutex);
        return err;
 }
 
 
-static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
-                            unsigned int cmd, void __user * arg)
+static long w9968cf_v4l_ioctl(struct file *filp,
+                            unsigned int cmd, void __user *arg)
 {
        struct w9968cf_device* cam;
        const char* v4l1_ioctls[] = {
@@ -3456,17 +3456,13 @@ ioctl_fail:
 }
 
 
-static const struct file_operations w9968cf_fops = {
+static const struct v4l2_file_operations w9968cf_fops = {
        .owner =   THIS_MODULE,
        .open =    w9968cf_open,
        .release = w9968cf_release,
        .read =    w9968cf_read,
        .ioctl =   w9968cf_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
        .mmap =    w9968cf_mmap,
-       .llseek =  no_llseek,
 };
 
 
index 12a31e7a5f6de31fbebce5fe93aa8ebfe0797f16..f2864d5cd1800c5662e6985bf5be2fdeafcb8c71 100644 (file)
@@ -233,7 +233,7 @@ static int wm8739_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
        return -EINVAL;
 }
 
-static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index d0220b0ec0bcf331320ad89d67b398f617609773..53fcd42843e0eae0ef6c998002db002f8d37e355 100644 (file)
@@ -130,7 +130,7 @@ static int wm8775_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
        return 0;
 }
 
-static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip)
+static int wm8775_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
index 9d00e6056491b1a9baeb6fc305e48ee87bdd9f31..96971044fc78cb767815179b556fe30c4c20a4e8 100644 (file)
@@ -649,7 +649,7 @@ static void zc0301_release_resources(struct kref *kref)
 }
 
 
-static int zc0301_open(struct inode* inode, struct file* filp)
+static int zc0301_open(struct file *filp)
 {
        struct zc0301_device* cam;
        int err = 0;
@@ -733,7 +733,7 @@ out:
 }
 
 
-static int zc0301_release(struct inode* inode, struct file* filp)
+static int zc0301_release(struct file *filp)
 {
        struct zc0301_device* cam;
 
@@ -1793,8 +1793,8 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
 }
 
 
-static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
-                            unsigned int cmd, void __user * arg)
+static long zc0301_ioctl_v4l2(struct file *filp,
+                            unsigned int cmd, void __user *arg)
 {
        struct zc0301_device *cam = video_drvdata(filp);
 
@@ -1888,7 +1888,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
 }
 
 
-static int zc0301_ioctl(struct inode* inode, struct file* filp,
+static long zc0301_ioctl(struct file *filp,
                        unsigned int cmd, unsigned long arg)
 {
        struct zc0301_device *cam = video_drvdata(filp);
@@ -1912,7 +1912,7 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp,
 
        V4LDBG(3, "zc0301", cmd);
 
-       err = zc0301_ioctl_v4l2(inode, filp, cmd, (void __user *)arg);
+       err = zc0301_ioctl_v4l2(filp, cmd, (void __user *)arg);
 
        mutex_unlock(&cam->fileop_mutex);
 
@@ -1920,18 +1920,14 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp,
 }
 
 
-static const struct file_operations zc0301_fops = {
+static const struct v4l2_file_operations zc0301_fops = {
        .owner =   THIS_MODULE,
        .open =    zc0301_open,
        .release = zc0301_release,
        .ioctl =   zc0301_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = v4l_compat_ioctl32,
-#endif
        .read =    zc0301_read,
        .poll =    zc0301_poll,
        .mmap =    zc0301_mmap,
-       .llseek =  no_llseek,
 };
 
 /*****************************************************************************/
index 00b97d97aeaa612275e7cab190a7823fbcf1a1da..b58b9dda715ccedb80cb4c67a42d8c0b9816a903 100644 (file)
@@ -1197,10 +1197,9 @@ zoran_close_end_session (struct file *file)
  */
 
 static int
-zoran_open (struct inode *inode,
-           struct file  *file)
+zoran_open(struct file  *file)
 {
-       unsigned int minor = iminor(inode);
+       unsigned int minor = video_devdata(file)->minor;
        struct zoran *zr = NULL;
        struct zoran_fh *fh;
        int i, res, first_open = 0, have_module_locks = 0;
@@ -1340,8 +1339,7 @@ open_unlock_and_return:
 }
 
 static int
-zoran_close (struct inode *inode,
-            struct file  *file)
+zoran_close(struct file  *file)
 {
        struct zoran_fh *fh = file->private_data;
        struct zoran *zr = fh->zr;
@@ -1940,7 +1938,7 @@ zoran_set_input (struct zoran *zr,
  *   ioctl routine
  */
 
-static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
+static long zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
        struct zoran_fh *fh = file->private_data;
        struct zoran *zr = fh->zr;
@@ -4191,11 +4189,10 @@ static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 }
 
 
-static int
-zoran_ioctl (struct inode *inode,
-            struct file  *file,
-            unsigned int  cmd,
-            unsigned long arg)
+static long
+zoran_ioctl(struct file  *file,
+           unsigned int  cmd,
+           unsigned long arg)
 {
        return video_usercopy(file, cmd, arg, zoran_do_ioctl);
 }
@@ -4620,15 +4617,11 @@ zoran_mmap (struct file           *file,
        return 0;
 }
 
-static const struct file_operations zoran_fops = {
+static const struct v4l2_file_operations zoran_fops = {
        .owner = THIS_MODULE,
        .open = zoran_open,
        .release = zoran_close,
        .ioctl = zoran_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
-       .llseek = no_llseek,
        .read = zoran_read,
        .write = zoran_write,
        .mmap = zoran_mmap,
index a1d81ed44c7c965451ae5acb00727dc079305c5f..93023560f3242550f0ed2e026954cfcac9c0794c 100644 (file)
@@ -634,7 +634,7 @@ static int zr364xx_vidioc_streamoff(struct file *file, void *priv,
 
 
 /* open the camera */
-static int zr364xx_open(struct inode *inode, struct file *file)
+static int zr364xx_open(struct file *file)
 {
        struct video_device *vdev = video_devdata(file);
        struct zr364xx_camera *cam = video_get_drvdata(vdev);
@@ -688,7 +688,7 @@ out:
 
 
 /* release the camera */
-static int zr364xx_release(struct inode *inode, struct file *file)
+static int zr364xx_release(struct file *file)
 {
        struct video_device *vdev = video_devdata(file);
        struct zr364xx_camera *cam;
@@ -761,14 +761,13 @@ static int zr364xx_mmap(struct file *file, struct vm_area_struct *vma)
 }
 
 
-static const struct file_operations zr364xx_fops = {
+static const struct v4l2_file_operations zr364xx_fops = {
        .owner = THIS_MODULE,
        .open = zr364xx_open,
        .release = zr364xx_release,
        .read = zr364xx_read,
        .mmap = zr364xx_mmap,
        .ioctl = video_ioctl2,
-       .llseek = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = {
@@ -894,7 +893,6 @@ static void zr364xx_disconnect(struct usb_interface *intf)
 {
        struct zr364xx_camera *cam = usb_get_intfdata(intf);
        usb_set_intfdata(intf, NULL);
-       dev_set_drvdata(&intf->dev, NULL);
        dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n");
        if (cam->vdev)
                video_unregister_device(cam->vdev);
index 79a8ed8e6a7d6c02517c7407019b0302806035c1..55026b1a40bd8ee17fdfca344311d28f2bae3a6a 100644 (file)
@@ -62,10 +62,11 @@ typedef enum fe_caps {
        FE_CAN_HIERARCHY_AUTO           = 0x100000,
        FE_CAN_8VSB                     = 0x200000,
        FE_CAN_16VSB                    = 0x400000,
-       FE_HAS_EXTENDED_CAPS            = 0x800000,   // We need more bitspace for newer APIs, indicate this.
-       FE_NEEDS_BENDING                = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
-       FE_CAN_RECOVER                  = 0x40000000, // frontend can recover from a cable unplug automatically
-       FE_CAN_MUTE_TS                  = 0x80000000  // frontend can stop spurious TS data output
+       FE_HAS_EXTENDED_CAPS            = 0x800000,   /* We need more bitspace for newer APIs, indicate this. */
+       FE_CAN_2G_MODULATION            = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
+       FE_NEEDS_BENDING                = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
+       FE_CAN_RECOVER                  = 0x40000000, /* frontend can recover from a cable unplug automatically */
+       FE_CAN_MUTE_TS                  = 0x80000000  /* frontend can stop spurious TS data output */
 } fe_caps_t;
 
 
@@ -121,15 +122,15 @@ typedef enum fe_sec_mini_cmd {
 
 
 typedef enum fe_status {
-       FE_HAS_SIGNAL   = 0x01,   /*  found something above the noise level */
-       FE_HAS_CARRIER  = 0x02,   /*  found a DVB signal  */
-       FE_HAS_VITERBI  = 0x04,   /*  FEC is stable  */
-       FE_HAS_SYNC     = 0x08,   /*  found sync bytes  */
-       FE_HAS_LOCK     = 0x10,   /*  everything's working... */
-       FE_TIMEDOUT     = 0x20,   /*  no lock within the last ~2 seconds */
-       FE_REINIT       = 0x40    /*  frontend was reinitialized,  */
-} fe_status_t;                   /*  application is recommended to reset */
-                                 /*  DiSEqC, tone and parameters */
+       FE_HAS_SIGNAL   = 0x01,   /* found something above the noise level */
+       FE_HAS_CARRIER  = 0x02,   /* found a DVB signal  */
+       FE_HAS_VITERBI  = 0x04,   /* FEC is stable  */
+       FE_HAS_SYNC     = 0x08,   /* found sync bytes  */
+       FE_HAS_LOCK     = 0x10,   /* everything's working... */
+       FE_TIMEDOUT     = 0x20,   /* no lock within the last ~2 seconds */
+       FE_REINIT       = 0x40    /* frontend was reinitialized,  */
+} fe_status_t;                   /* application is recommended to reset */
+                                 /* DiSEqC, tone and parameters */
 
 typedef enum fe_spectral_inversion {
        INVERSION_OFF,
index 1f126e30766cbb42d41557bf2a4aed6192f354ba..5571dbe1c0addb74d48809925f2b09ff7bd144f3 100644 (file)
@@ -1370,25 +1370,41 @@ struct v4l2_streamparm {
 /*
  *     A D V A N C E D   D E B U G G I N G
  *
- *     NOTE: EXPERIMENTAL API
+ *     NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
+ *     FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
  */
 
 /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
 
 #define V4L2_CHIP_MATCH_HOST       0  /* Match against chip ID on host (0 for the host) */
-#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver ID */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver name */
 #define V4L2_CHIP_MATCH_I2C_ADDR   2  /* Match against I2C 7-bit address */
 #define V4L2_CHIP_MATCH_AC97       3  /* Match against anciliary AC97 chip */
 
-struct v4l2_register {
-       __u32 match_type; /* Match type */
-       __u32 match_chip; /* Match this chip, meaning determined by match_type */
+struct v4l2_dbg_match {
+       __u32 type; /* Match type */
+       union {     /* Match this chip, meaning determined by type */
+               __u32 addr;
+               char name[32];
+       };
+} __attribute__ ((packed));
+
+struct v4l2_dbg_register {
+       struct v4l2_dbg_match match;
+       __u32 size;     /* register size in bytes */
        __u64 reg;
        __u64 val;
-};
+} __attribute__ ((packed));
+
+/* VIDIOC_DBG_G_CHIP_IDENT */
+struct v4l2_dbg_chip_ident {
+       struct v4l2_dbg_match match;
+       __u32 ident;       /* chip identifier as specified in <media/v4l2-chip-ident.h> */
+       __u32 revision;    /* chip revision, chip specific */
+} __attribute__ ((packed));
 
-/* VIDIOC_G_CHIP_IDENT */
-struct v4l2_chip_ident {
+/* VIDIOC_G_CHIP_IDENT_OLD: Deprecated, do not use */
+struct v4l2_chip_ident_old {
        __u32 match_type;  /* Match type */
        __u32 match_chip;  /* Match this chip, meaning determined by match_type */
        __u32 ident;       /* chip identifier as specified in <media/v4l2-chip-ident.h> */
@@ -1460,13 +1476,22 @@ struct v4l2_chip_ident {
 #define VIDIOC_G_ENC_INDEX       _IOR('V', 76, struct v4l2_enc_idx)
 #define VIDIOC_ENCODER_CMD      _IOWR('V', 77, struct v4l2_encoder_cmd)
 #define VIDIOC_TRY_ENCODER_CMD  _IOWR('V', 78, struct v4l2_encoder_cmd)
+#endif
 
-/* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
-#define        VIDIOC_DBG_S_REGISTER    _IOW('V', 79, struct v4l2_register)
-#define        VIDIOC_DBG_G_REGISTER   _IOWR('V', 80, struct v4l2_register)
-
-#define VIDIOC_G_CHIP_IDENT     _IOWR('V', 81, struct v4l2_chip_ident)
+#if 1
+/* Experimental, meant for debugging, testing and internal use.
+   Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
+   You must be root to use these ioctls. Never use these in applications! */
+#define        VIDIOC_DBG_S_REGISTER    _IOW('V', 79, struct v4l2_dbg_register)
+#define        VIDIOC_DBG_G_REGISTER   _IOWR('V', 80, struct v4l2_dbg_register)
+
+/* Experimental, meant for debugging, testing and internal use.
+   Never use this ioctl in applications! */
+#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
+/* This is deprecated and will go away in 2.6.30 */
+#define VIDIOC_G_CHIP_IDENT_OLD _IOWR('V', 81, struct v4l2_chip_ident_old)
 #endif
+
 #define VIDIOC_S_HW_FREQ_SEEK   _IOW('V', 82, struct v4l2_hw_freq_seek)
 /* Reminder: when adding new ioctls please add support for them to
    drivers/media/video/v4l2-compat-ioctl32.c as well! */
index 6bbb0d93bb5f39b34a368a450b73caae2eeccd66..c8d0b23fde295542d02c86421cdfc6e305383bd2 100644 (file)
@@ -177,9 +177,9 @@ struct saa7146_ext_vv
        int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *);
 
        struct saa7146_extension_ioctls *ioctls;
-       int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg);
+       long (*ioctl)(struct saa7146_fh *, unsigned int cmd, void *arg);
 
-       struct file_operations vbi_fops;
+       struct v4l2_file_operations vbi_fops;
 };
 
 struct saa7146_use_ops  {
@@ -216,7 +216,7 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data);
 extern struct saa7146_use_ops saa7146_video_uops;
 int saa7146_start_preview(struct saa7146_fh *fh);
 int saa7146_stop_preview(struct saa7146_fh *fh);
-int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
+long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
 
 /* from saa7146_vbi.c */
 extern struct saa7146_use_ops saa7146_vbi_uops;
index 425b6a98c95c220e703cb98a5b2eb32a04bb2f08..7440d9250665489f2699fc1557bc1a7ae655b337 100644 (file)
@@ -164,12 +164,12 @@ struct soc_camera_ops {
        unsigned long (*query_bus_param)(struct soc_camera_device *);
        int (*set_bus_param)(struct soc_camera_device *, unsigned long);
        int (*get_chip_id)(struct soc_camera_device *,
-                          struct v4l2_chip_ident *);
+                          struct v4l2_dbg_chip_ident *);
        int (*set_std)(struct soc_camera_device *, v4l2_std_id *);
        int (*enum_input)(struct soc_camera_device *, struct v4l2_input *);
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       int (*get_register)(struct soc_camera_device *, struct v4l2_register *);
-       int (*set_register)(struct soc_camera_device *, struct v4l2_register *);
+       int (*get_register)(struct soc_camera_device *, struct v4l2_dbg_register *);
+       int (*set_register)(struct soc_camera_device *, struct v4l2_dbg_register *);
 #endif
        int (*get_control)(struct soc_camera_device *, struct v4l2_control *);
        int (*set_control)(struct soc_camera_device *, struct v4l2_control *);
index 43dbb659f1f57533f6cba2bd8df37ff5d47591c5..9aaf652b20ef7a3ff638e171906f60231de68161 100644 (file)
@@ -2,7 +2,7 @@
     v4l2 chip identifiers header
 
     This header provides a list of chip identifiers that can be returned
-    through the VIDIOC_G_CHIP_IDENT ioctl.
+    through the VIDIOC_DBG_G_CHIP_IDENT ioctl.
 
     Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
 
@@ -24,7 +24,7 @@
 #ifndef V4L2_CHIP_IDENT_H_
 #define V4L2_CHIP_IDENT_H_
 
-/* VIDIOC_G_CHIP_IDENT: identifies the actual chip installed on the board */
+/* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */
 enum {
        /* general idents: reserved range 0-49 */
        V4L2_IDENT_NONE      = 0,       /* No chip matched */
index f99c866d8c37f0cd4506e8f28b6d2911bb7a71ab..95e74f1874e1cc53b24b6ac11af0d47149e99b9c 100644 (file)
@@ -114,10 +114,10 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
 /* Register/chip ident helper function */
 
 struct i2c_client; /* forward reference */
-int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 id_type, u32 chip_id);
-int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip,
+int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match);
+int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip,
                u32 ident, u32 revision);
-int v4l2_chip_match_host(u32 id_type, u32 chip_id);
+int v4l2_chip_match_host(const struct v4l2_dbg_match *match);
 
 /* ------------------------------------------------------------------------- */
 
index 0a88d1d17d30accc82ec89aff84313dc04d81821..e36faab8459b873f7ec07147abbcb834a12861cf 100644 (file)
@@ -25,6 +25,7 @@
 #define VFL_TYPE_MAX           4
 
 struct v4l2_ioctl_callbacks;
+struct video_device;
 struct v4l2_device;
 
 /* Flag to mark the video_device struct as unregistered.
@@ -32,6 +33,18 @@ struct v4l2_device;
    device access. It is set by video_unregister_device. */
 #define V4L2_FL_UNREGISTERED   (0)
 
+struct v4l2_file_operations {
+       struct module *owner;
+       ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
+       ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
+       unsigned int (*poll) (struct file *, struct poll_table_struct *);
+       long (*ioctl) (struct file *, unsigned int, unsigned long);
+       long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
+       int (*mmap) (struct file *, struct vm_area_struct *);
+       int (*open) (struct file *);
+       int (*release) (struct file *);
+};
+
 /*
  * Newer version of video_device, handled by videodev2.c
  *     This version moves redundant code from video device code to
@@ -41,7 +54,7 @@ struct v4l2_device;
 struct video_device
 {
        /* device ops */
-       const struct file_operations *fops;
+       const struct v4l2_file_operations *fops;
 
        /* sysfs */
        struct device dev;              /* v4l device */
index 97b283a0428903dcf093952bc0fcd9ca9449e828..9bf4ccc93dbf9ff591df4eecc6f4358d527d14fe 100644 (file)
@@ -80,7 +80,7 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
 #define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...)  \
 ({                                                                     \
        struct v4l2_subdev *sd;                                         \
-       int err = 0;                                                    \
+       long err = 0;                                                   \
                                                                        \
        list_for_each_entry(sd, &(dev)->subdevs, list) {                \
                if ((cond) && sd->ops->o && sd->ops->o->f)              \
index ecda3c72583705cc2dda3422c83b8deba7031b28..fbf585561570bc7fbc43859fd9aa70a4bfdc68f6 100644 (file)
@@ -219,7 +219,7 @@ enum v4l2_int_ioctl_num {
        vidioc_int_reset_num,
        /* VIDIOC_INT_INIT */
        vidioc_int_init_num,
-       /* VIDIOC_INT_G_CHIP_IDENT */
+       /* VIDIOC_DBG_G_CHIP_IDENT */
        vidioc_int_g_chip_ident_num,
 
        /*
index fcdb58c4ce07b6872a3cbe57d72abdbb6e080a35..b01c044868d060e8c33fff3bf59d226b94ff33eb 100644 (file)
@@ -225,12 +225,12 @@ struct v4l2_ioctl_ops {
        /* Debugging ioctls */
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        int (*vidioc_g_register)       (struct file *file, void *fh,
-                                       struct v4l2_register *reg);
+                                       struct v4l2_dbg_register *reg);
        int (*vidioc_s_register)       (struct file *file, void *fh,
-                                       struct v4l2_register *reg);
+                                       struct v4l2_dbg_register *reg);
 #endif
        int (*vidioc_g_chip_ident)     (struct file *file, void *fh,
-                                       struct v4l2_chip_ident *chip);
+                                       struct v4l2_dbg_chip_ident *chip);
 
        int (*vidioc_enum_framesizes)   (struct file *file, void *fh,
                                         struct v4l2_frmsizeenum *fsize);
@@ -239,7 +239,7 @@ struct v4l2_ioctl_ops {
                                           struct v4l2_frmivalenum *fival);
 
        /* For other private ioctls */
-       int (*vidioc_default)          (struct file *file, void *fh,
+       long (*vidioc_default)         (struct file *file, void *fh,
                                        int cmd, void *arg);
 };
 
@@ -277,36 +277,27 @@ extern const char *v4l2_field_names[];
 extern const char *v4l2_type_names[];
 
 /*  Compatibility layer interface  --  v4l1-compat module */
-typedef int (*v4l2_kioctl)(struct file *file,
+typedef long (*v4l2_kioctl)(struct file *file,
                           unsigned int cmd, void *arg);
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
-int v4l_compat_translate_ioctl(struct file *file,
+long v4l_compat_translate_ioctl(struct file *file,
                               int cmd, void *arg, v4l2_kioctl driver_ioctl);
 #else
 #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
 #endif
 
+#ifdef CONFIG_COMPAT
 /* 32 Bits compatibility layer for 64 bits processors */
-extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
+extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
                                unsigned long arg);
+#endif
 
 /* Include support for obsoleted stuff */
-extern int video_usercopy(struct file *file, unsigned int cmd,
+extern long video_usercopy(struct file *file, unsigned int cmd,
                                unsigned long arg, v4l2_kioctl func);
 
 /* Standard handlers for V4L ioctl's */
-
-/* This prototype is used on fops.unlocked_ioctl */
-extern long __video_ioctl2(struct file *file,
-                       unsigned int cmd, unsigned long arg);
-
-/* This prototype is used on fops.ioctl
- * Since fops.ioctl enables Kernel Big Lock, it is preferred
- * to use __video_ioctl2 instead.
- * It should be noticed that there's no lock code inside
- * video_ioctl2().
- */
-extern int video_ioctl2(struct inode *inode, struct file *file,
+extern long video_ioctl2(struct file *file,
                        unsigned int cmd, unsigned long arg);
 
 #endif /* _V4L2_IOCTL_H */
index ceef016bb0b7a24ef7ef6397d5b893bbf355e3f3..37b09e56e943ecf0938c175c3a9e83df8b171a7f 100644 (file)
@@ -69,7 +69,7 @@ struct tuner_setup;
    not yet implemented) since ops provide proper type-checking.
  */
 struct v4l2_subdev_core_ops {
-       int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip);
+       int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
        int (*log_status)(struct v4l2_subdev *sd);
        int (*init)(struct v4l2_subdev *sd, u32 val);
        int (*s_standby)(struct v4l2_subdev *sd, u32 standby);
@@ -79,10 +79,10 @@ struct v4l2_subdev_core_ops {
        int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
        int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
        int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
-       int (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
+       long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       int (*g_register)(struct v4l2_subdev *sd, struct v4l2_register *reg);
-       int (*s_register)(struct v4l2_subdev *sd, struct v4l2_register *reg);
+       int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
+       int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
 #endif
 };
 
index b6870cbaf2b38812e6bc77c24ce7a7e416eadd3f..426899e529c55313ee2aa35374e01f6c4fd74de5 100644 (file)
@@ -36,7 +36,7 @@ struct snd_tea575x_ops {
 struct snd_tea575x {
        struct snd_card *card;
        struct video_device vd;         /* video device */
-       struct file_operations fops;
+       struct v4l2_file_operations fops;
        int dev_nr;                     /* requested device number + 1 */
        int vd_registered;              /* video device is registered */
        int tea5759;                    /* 5759 chip is present */
index 549b4eba14963d3b624acac71fad8fc8ce491957..9d98a6658ac9d757c004f7c130a7c143109dfe51 100644 (file)
@@ -84,7 +84,7 @@ static void snd_tea575x_set_freq(struct snd_tea575x *tea)
  * Linux Video interface
  */
 
-static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
+static long snd_tea575x_ioctl(struct file *file,
                             unsigned int cmd, unsigned long data)
 {
        struct snd_tea575x *tea = video_drvdata(file);
@@ -174,14 +174,14 @@ static void snd_tea575x_release(struct video_device *vfd)
 {
 }
 
-static int snd_tea575x_exclusive_open(struct inode *inode, struct file *file)
+static int snd_tea575x_exclusive_open(struct file *file)
 {
        struct snd_tea575x *tea = video_drvdata(file);
 
        return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0;
 }
 
-static int snd_tea575x_exclusive_release(struct inode *inode, struct file *file)
+static int snd_tea575x_exclusive_release(struct file *file)
 {
        struct snd_tea575x *tea = video_drvdata(file);