V4L/DVB (3599b): Whitespace cleanups under drivers/media
Mauro Carvalho Chehab [Sat, 25 Mar 2006 12:19:53 +0000 (09:19 -0300)]
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

102 files changed:
drivers/media/video/Kconfig
drivers/media/video/adv7170.c
drivers/media/video/adv7175.c
drivers/media/video/arv.c
drivers/media/video/bt819.c
drivers/media/video/bt856.c
drivers/media/video/bw-qcam.c
drivers/media/video/c-qcam.c
drivers/media/video/cpia.c
drivers/media/video/cpia.h
drivers/media/video/cpia_pp.c
drivers/media/video/cpia_usb.c
drivers/media/video/cs8420.h
drivers/media/video/dabusb.c
drivers/media/video/dabusb.h
drivers/media/video/dsbr100.c
drivers/media/video/et61x251/et61x251.h
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/et61x251/et61x251_sensor.h
drivers/media/video/et61x251/et61x251_tas5130d1b.c
drivers/media/video/ov511.c
drivers/media/video/ov511.h
drivers/media/video/ovcamchip/Makefile
drivers/media/video/ovcamchip/ovcamchip_core.c
drivers/media/video/ovcamchip/ovcamchip_priv.h
drivers/media/video/planb.c
drivers/media/video/planb.h
drivers/media/video/pms.c
drivers/media/video/pwc/Makefile
drivers/media/video/pwc/philips.txt
drivers/media/video/pwc/pwc-ctrl.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc-ioctl.h
drivers/media/video/pwc/pwc-kiara.c
drivers/media/video/pwc/pwc-misc.c
drivers/media/video/pwc/pwc-nala.h
drivers/media/video/pwc/pwc-timon.c
drivers/media/video/pwc/pwc-uncompress.c
drivers/media/video/pwc/pwc-uncompress.h
drivers/media/video/pwc/pwc.h
drivers/media/video/saa5249.c
drivers/media/video/saa7110.c
drivers/media/video/saa7111.c
drivers/media/video/saa7114.c
drivers/media/video/saa7121.h
drivers/media/video/saa7146.h
drivers/media/video/saa7146reg.h
drivers/media/video/saa7185.c
drivers/media/video/saa7196.h
drivers/media/video/se401.c
drivers/media/video/se401.h
drivers/media/video/sn9c102/Makefile
drivers/media/video/sn9c102/sn9c102.h
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/sn9c102/sn9c102_hv7131d.c
drivers/media/video/sn9c102/sn9c102_mi0343.c
drivers/media/video/sn9c102/sn9c102_ov7630.c
drivers/media/video/sn9c102/sn9c102_pas106b.c
drivers/media/video/sn9c102/sn9c102_pas202bca.c
drivers/media/video/sn9c102/sn9c102_pas202bcb.c
drivers/media/video/sn9c102/sn9c102_sensor.h
drivers/media/video/sn9c102/sn9c102_tas5110c1b.c
drivers/media/video/sn9c102/sn9c102_tas5130d1b.c
drivers/media/video/stradis.c
drivers/media/video/stv680.c
drivers/media/video/stv680.h
drivers/media/video/tda9840.c
drivers/media/video/tea6415c.c
drivers/media/video/tea6420.c
drivers/media/video/tuner-3036.c
drivers/media/video/usbvideo/ibmcam.c
drivers/media/video/usbvideo/konicawc.c
drivers/media/video/usbvideo/ultracam.c
drivers/media/video/usbvideo/usbvideo.c
drivers/media/video/usbvideo/usbvideo.h
drivers/media/video/usbvideo/vicam.c
drivers/media/video/videocodec.h
drivers/media/video/vino.c
drivers/media/video/vpx3220.c
drivers/media/video/w9966.c
drivers/media/video/w9968cf.c
drivers/media/video/w9968cf.h
drivers/media/video/w9968cf_decoder.h
drivers/media/video/w9968cf_vpp.h
drivers/media/video/zc0301/zc0301.h
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zc0301/zc0301_pas202bcb.c
drivers/media/video/zc0301/zc0301_sensor.h
drivers/media/video/zoran.h
drivers/media/video/zoran_card.c
drivers/media/video/zoran_card.h
drivers/media/video/zoran_device.c
drivers/media/video/zoran_device.h
drivers/media/video/zoran_driver.c
drivers/media/video/zoran_procfs.c
drivers/media/video/zoran_procfs.h
drivers/media/video/zr36016.c
drivers/media/video/zr36050.c
drivers/media/video/zr36057.h
drivers/media/video/zr36060.c
drivers/media/video/zr36120.c
drivers/media/video/zr36120.h

index 1f8a46b..f31a198 100644 (file)
@@ -370,7 +370,7 @@ config VIDEO_SAA7127
 #
 
 menu "V4L USB devices"
-        depends on USB && VIDEO_DEV
+       depends on USB && VIDEO_DEV
 
 source "drivers/media/video/em28xx/Kconfig"
 
@@ -528,17 +528,17 @@ config USB_W9968CF
        ---help---
          Say Y here if you want support for cameras based on OV681 or
          Winbond W9967CF/W9968CF JPEG USB Dual Mode Camera Chips.
-       
+
          This driver has an optional plugin, which is distributed as a
-         separate module only (released under GPL). It allows to use higher 
-         resolutions and framerates, but cannot be included in the official 
+         separate module only (released under GPL). It allows to use higher
+         resolutions and framerates, but cannot be included in the official
          Linux kernel for performance purposes.
 
          See <file:Documentation/usb/w9968cf.txt> for more informations.
 
          This driver uses the Video For Linux and the I2C APIs. It needs the
          OmniVision Camera Chip support as well. You must say Y or M to
-         "Video For Linux", "I2C Support" and "OmniVision Camera Chip 
+         "Video For Linux", "I2C Support" and "OmniVision Camera Chip
          support" to use this driver.
 
          To compile this driver as a module, choose M here: the
@@ -564,20 +564,20 @@ config USB_PWC
        depends on USB && VIDEO_DEV
        ---help---
          Say Y or M here if you want to use one of these Philips & OEM
-          webcams:
-           * Philips PCA645, PCA646
-           * Philips PCVC675, PCVC680, PCVC690
-           * Philips PCVC720/40, PCVC730, PCVC740, PCVC750
+         webcams:
+          * Philips PCA645, PCA646
+          * Philips PCVC675, PCVC680, PCVC690
+          * Philips PCVC720/40, PCVC730, PCVC740, PCVC750
           * Askey VC010
-          * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 
-             and 'Orbit'/'Sphere'
-           * Samsung MPC-C10, MPC-C30
+          * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro'
+            and 'Orbit'/'Sphere'
+          * Samsung MPC-C10, MPC-C30
           * Creative Webcam 5, Pro Ex
           * SOTEC Afina Eye
           * Visionite VCS-UC300, VCS-UM100
-          
+
          The PCA635, PCVC665 and PCVC720/20 are not supported by this driver
-         and never will be, but the 665 and 720/20 are supported by other 
+         and never will be, but the 665 and 720/20 are supported by other
          drivers.
 
          See <file:Documentation/usb/philips.txt> for more information and
index 671e36d..4870958 100644 (file)
@@ -1,9 +1,9 @@
-/* 
+/*
  * adv7170 - adv7170, adv7171 video encoder driver version 0.0.1
  *
  * Copyright (C) 2002 Maxim Yevtyushkin <max@linuxmedialabs.com>
  *
- * Based on adv7176 driver by:    
+ * Based on adv7176 driver by:
  *
  * Copyright (C) 1998 Dave Perks <dperks@ibm.net>
  * Copyright (C) 1999 Wolfgang Scherr <scherr@net4you.net>
@@ -173,7 +173,7 @@ adv7170_write_block (struct i2c_client *client,
 static const unsigned char init_NTSC[] = {
        0x00, 0x10,             // MR0
        0x01, 0x20,             // MR1
-       0x02, 0x0e,             // MR2 RTC control: bits 2 and 1 
+       0x02, 0x0e,             // MR2 RTC control: bits 2 and 1
        0x03, 0x80,             // MR3
        0x04, 0x30,             // MR4
        0x05, 0x00,             // Reserved
@@ -196,7 +196,7 @@ static const unsigned char init_NTSC[] = {
        0x16, 0x00,             // CGMS_WSS_0
        0x17, 0x00,             // CGMS_WSS_1
        0x18, 0x00,             // CGMS_WSS_2
-       0x19, 0x00,             // Teletext Ctl 
+       0x19, 0x00,             // Teletext Ctl
 };
 
 static const unsigned char init_PAL[] = {
@@ -381,7 +381,7 @@ static unsigned short normal_i2c[] =
 };
 
 static unsigned short ignore = I2C_CLIENT_END;
-                                                                                
+
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
        .probe                  = &ignore,
index 085e886..68e7d7a 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  *  adv7175 - adv7175a video encoder driver version 0.0.3
  *
  * Copyright (C) 1998 Dave Perks <dperks@ibm.net>
@@ -233,7 +233,7 @@ adv7175_command (struct i2c_client *client,
                                    sizeof(init_common));
                adv7175_write(client, 0x07, TR0MODE | TR0RST);
                adv7175_write(client, 0x07, TR0MODE);
-               break;
+               break;
 
        case ENCODER_GET_CAPABILITIES:
        {
@@ -399,7 +399,7 @@ static unsigned short normal_i2c[] =
 };
 
 static unsigned short ignore = I2C_CLIENT_END;
-                                                                                
+
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
        .probe                  = &ignore,
index c586f64..dbe0251 100644 (file)
@@ -161,39 +161,39 @@ void iic(int n, unsigned long addr, unsigned long data1, unsigned long data2,
 {
        int i;
 
-       /* Slave Address */
-       ar_outl(addr, PLDI2CDATA);
+       /* Slave Address */
+       ar_outl(addr, PLDI2CDATA);
        wait_for_vsync();
 
-       /* Start */
-       ar_outl(1, PLDI2CCND);
+       /* Start */
+       ar_outl(1, PLDI2CCND);
        wait_acknowledge();
 
        /* Transfer data 1 */
-       ar_outl(data1, PLDI2CDATA);
+       ar_outl(data1, PLDI2CDATA);
        wait_for_vsync();
-       ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
+       ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
        wait_acknowledge();
 
        /* Transfer data 2 */
-       ar_outl(data2, PLDI2CDATA);
+       ar_outl(data2, PLDI2CDATA);
        wait_for_vsync();
-       ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
+       ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
        wait_acknowledge();
 
        if (n == 3) {
                /* Transfer data 3 */
-               ar_outl(data3, PLDI2CDATA);
+               ar_outl(data3, PLDI2CDATA);
                wait_for_vsync();
-               ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
+               ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN);
                wait_acknowledge();
-       }
+       }
 
-       /* Stop */
+       /* Stop */
        for (i = 0; i < 100; i++)
                cpu_relax();
-       ar_outl(2, PLDI2CCND);
-       ar_outl(2, PLDI2CCND);
+       ar_outl(2, PLDI2CCND);
+       ar_outl(2, PLDI2CCND);
 
        while (ar_inl(PLDI2CSTS) & PLDI2CSTS_BB)
                cpu_relax();
@@ -204,24 +204,24 @@ void init_iic(void)
 {
        DEBUG(1, "init_iic:\n");
 
-       /*
+       /*
         * ICU Setting (iic)
         */
-       /* I2C Setting */
-       ar_outl(0x0, PLDI2CCR);         /* I2CCR Disable                   */
-       ar_outl(0x0300, PLDI2CMOD);     /* I2CMOD ACK/8b-data/7b-addr/auto */
-       ar_outl(0x1, PLDI2CACK);        /* I2CACK ACK                      */
+       /* I2C Setting */
+       ar_outl(0x0, PLDI2CCR);         /* I2CCR Disable                   */
+       ar_outl(0x0300, PLDI2CMOD);     /* I2CMOD ACK/8b-data/7b-addr/auto */
+       ar_outl(0x1, PLDI2CACK);        /* I2CACK ACK                      */
 
        /* I2C CLK */
-       /* 50MH-100k */
+       /* 50MH-100k */
        if (freq == 75) {
-               ar_outl(369, PLDI2CFREQ);       /* BCLK = 75MHz */
+               ar_outl(369, PLDI2CFREQ);       /* BCLK = 75MHz */
        } else if (freq == 50) {
                ar_outl(244, PLDI2CFREQ);       /* BCLK = 50MHz */
        } else {
                ar_outl(244, PLDI2CFREQ);       /* default: BCLK = 50MHz */
        }
-       ar_outl(0x1, PLDI2CCR);         /* I2CCR Enable */
+       ar_outl(0x1, PLDI2CCR);         /* I2CCR Enable */
 }
 
 /**************************************************************************
@@ -253,7 +253,7 @@ static inline void wait_for_vertical_sync(int exp_line)
 
        /*
         * check HCOUNT because we cannot check vertical sync.
-        */
+        */
        for (; tmout >= 0; tmout--) {
                l = ar_inl(ARVHCOUNT);
                if (l == exp_line)
@@ -562,8 +562,8 @@ static void ar_interrupt(int irq, void *dev, struct pt_regs *regs)
                /* operations for interlace mode */
                if ( line_count < (AR_HEIGHT_VGA/2) )   /* even line */
                        line_number = (line_count << 1);
-               else                                    /* odd line */
-                       line_number =
+               else                                    /* odd line */
+                       line_number =
                        (((line_count - (AR_HEIGHT_VGA/2)) << 1) + 1);
        } else {
                line_number = line_count;
@@ -651,7 +651,7 @@ static int ar_initialize(struct video_device *dev)
                cr |= ARVCR1_NORMAL;
        ar_outl(cr, ARVCR1);
 
-       /*
+       /*
         * Initialize IIC so that CPU can communicate with AR LSI,
         * and send boot commands to AR LSI.
         */
@@ -846,7 +846,7 @@ static int __init ar_init(void)
         * so register video device as a frame grabber type.
         * device is named "video[0-64]".
         * video_register_device() initializes h/w using ar_initialize().
-        */
+        */
        if (video_register_device(ar->vdev, VFL_TYPE_GRABBER, video_nr) != 0) {
                /* return -1, -ENFILE(full) or others */
                printk("arv: register video (Colour AR) failed.\n");
index d8a18a6..e7b38fd 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  *  bt819 - BT819A VideoStream Decoder (Rockwell Part)
  *
  * Copyright (C) 1999 Mike Bernson <mike@mlb.org>
@@ -6,7 +6,7 @@
  *
  * Modifications for LML33/DC10plus unified driver
  * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx>
- *  
+ *
  * Changes by Ronald Bultje <rbultje@ronald.bitfreak.net>
  *    - moved over to linux>=2.4.x i2c protocol (9/9/2002)
  *
@@ -206,9 +206,9 @@ bt819_init (struct i2c_client *client)
                                           Bug in the bt819 stepping on my board?
                                        */
                0x14, 0x00,     /* 0x14 Vertial Scaling lsb */
-               0x16, 0x07,     /* 0x16 Video Timing Polarity 
+               0x16, 0x07,     /* 0x16 Video Timing Polarity
                                           ACTIVE=active low
-                                          FIELD: high=odd, 
+                                          FIELD: high=odd,
                                           vreset=active high,
                                           hreset=active high */
                0x18, 0x68,     /* 0x18 AGC Delay */
@@ -497,7 +497,7 @@ static unsigned short normal_i2c[] = {
 };
 
 static unsigned short ignore = I2C_CLIENT_END;
-                                                                                
+
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
        .probe                  = &ignore,
index 4d47a0a..af3b61d 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * bt856 - BT856A Digital Video Encoder (Rockwell Part)
  *
  * Copyright (C) 1999 Mike Bernson <mike@mlb.org>
@@ -285,7 +285,7 @@ bt856_command (struct i2c_client *client,
 static unsigned short normal_i2c[] = { I2C_BT856 >> 1, I2C_CLIENT_END };
 
 static unsigned short ignore = I2C_CLIENT_END;
-                                                                                
+
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
        .probe                  = &ignore,
index d97b7d8..cf61c59 100644 (file)
@@ -150,7 +150,7 @@ static int qc_calibrate(struct qcam_device *q)
 static struct qcam_device *qcam_init(struct parport *port)
 {
        struct qcam_device *q;
-       
+
        q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL);
        if(q==NULL)
                return NULL;
@@ -158,16 +158,16 @@ static struct qcam_device *qcam_init(struct parport *port)
        q->pport = port;
        q->pdev = parport_register_device(port, "bw-qcam", NULL, NULL,
                                          NULL, 0, NULL);
-       if (q->pdev == NULL) 
+       if (q->pdev == NULL)
        {
                printk(KERN_ERR "bw-qcam: couldn't register for %s.\n",
                       port->name);
                kfree(q);
                return NULL;
        }
-       
+
        memcpy(&q->vdev, &qcam_template, sizeof(qcam_template));
-       
+
        mutex_init(&q->lock);
 
        q->port_mode = (QC_ANY | QC_NOTSET);
@@ -236,12 +236,12 @@ static int qc_waithand(struct qcam_device *q, int val)
                while (!((status = read_lpstatus(q)) & 8))
                {
                        /* 1000 is enough spins on the I/O for all normal
-                          cases, at that point we start to poll slowly 
+                          cases, at that point we start to poll slowly
                           until the camera wakes up. However, we are
                           busy blocked until the camera responds, so
                           setting it lower is much better for interactive
                           response. */
-                          
+
                        if(runs++>maxpoll)
                        {
                                msleep_interruptible(5);
@@ -255,12 +255,12 @@ static int qc_waithand(struct qcam_device *q, int val)
                while (((status = read_lpstatus(q)) & 8))
                {
                        /* 1000 is enough spins on the I/O for all normal
-                          cases, at that point we start to poll slowly 
+                          cases, at that point we start to poll slowly
                           until the camera wakes up. However, we are
                           busy blocked until the camera responds, so
                           setting it lower is much better for interactive
                           response. */
-                          
+
                        if(runs++>maxpoll)
                        {
                                msleep_interruptible(5);
@@ -282,17 +282,17 @@ static unsigned int qc_waithand2(struct qcam_device *q, int val)
 {
        unsigned int status;
        int runs=0;
-       
-       do 
+
+       do
        {
                status = read_lpdata(q);
                /* 1000 is enough spins on the I/O for all normal
-                  cases, at that point we start to poll slowly 
+                  cases, at that point we start to poll slowly
                   until the camera wakes up. However, we are
                   busy blocked until the camera responds, so
                   setting it lower is much better for interactive
                   response. */
-                  
+
                if(runs++>maxpoll)
                {
                        msleep_interruptible(5);
@@ -321,7 +321,7 @@ static int qc_detect(struct qcam_device *q)
 
        lastreg = reg = read_lpstatus(q) & 0xf0;
 
-       for (i = 0; i < 500; i++) 
+       for (i = 0; i < 500; i++)
        {
                reg = read_lpstatus(q) & 0xf0;
                if (reg != lastreg)
@@ -357,7 +357,7 @@ static int qc_detect(struct qcam_device *q)
 
 static void qc_reset(struct qcam_device *q)
 {
-       switch (q->port_mode & QC_FORCE_MASK) 
+       switch (q->port_mode & QC_FORCE_MASK)
        {
                case QC_FORCE_UNIDIR:
                        q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_UNIDIR;
@@ -370,7 +370,7 @@ static void qc_reset(struct qcam_device *q)
                case QC_ANY:
                        write_lpcontrol(q, 0x20);
                        write_lpdata(q, 0x75);
-       
+
                        if (read_lpdata(q) != 0x75) {
                                q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_BIDIR;
                        } else {
@@ -398,8 +398,8 @@ static void qc_reset(struct qcam_device *q)
 static int qc_setscanmode(struct qcam_device *q)
 {
        int old_mode = q->mode;
-       
-       switch (q->transfer_scale) 
+
+       switch (q->transfer_scale)
        {
                case 1:
                        q->mode = 0;
@@ -412,7 +412,7 @@ static int qc_setscanmode(struct qcam_device *q)
                        break;
        }
 
-       switch (q->bpp) 
+       switch (q->bpp)
        {
                case 4:
                        break;
@@ -421,7 +421,7 @@ static int qc_setscanmode(struct qcam_device *q)
                        break;
        }
 
-       switch (q->port_mode & QC_MODE_MASK) 
+       switch (q->port_mode & QC_MODE_MASK)
        {
                case QC_BIDIR:
                        q->mode += 1;
@@ -430,10 +430,10 @@ static int qc_setscanmode(struct qcam_device *q)
                case QC_UNIDIR:
                        break;
        }
-       
+
        if (q->mode != old_mode)
                q->status |= QC_PARAM_CHANGE;
-       
+
        return 0;
 }
 
@@ -451,7 +451,7 @@ static void qc_set(struct qcam_device *q)
        /* Set the brightness.  Yes, this is repetitive, but it works.
         * Shorter versions seem to fail subtly.  Feel free to try :-). */
        /* I think the problem was in qc_command, not here -- bls */
-       
+
        qc_command(q, 0xb);
        qc_command(q, q->brightness);
 
@@ -502,13 +502,13 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[])
        unsigned int hi2, lo2;
        static int state = 0;
 
-       if (buffer == NULL) 
+       if (buffer == NULL)
        {
                state = 0;
                return 0;
        }
-       
-       switch (q->port_mode & QC_MODE_MASK) 
+
+       switch (q->port_mode & QC_MODE_MASK)
        {
                case QC_BIDIR:          /* Bi-directional Port */
                        write_lpcontrol(q, 0x26);
@@ -517,7 +517,7 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[])
                        write_lpcontrol(q, 0x2e);
                        lo2 = (qc_waithand2(q, 0) >> 1);
                        hi2 = (read_lpstatus(q) >> 3) & 0x1f;
-                       switch (q->bpp) 
+                       switch (q->bpp)
                        {
                                case 4:
                                        buffer[0] = lo & 0xf;
@@ -544,7 +544,7 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[])
                        write_lpcontrol(q, 0xe);
                        hi = (qc_waithand(q, 0) & 0xf0) >> 4;
 
-                       switch (q->bpp) 
+                       switch (q->bpp)
                        {
                                case 4:
                                        buffer[0] = lo;
@@ -552,7 +552,7 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[])
                                        ret = 2;
                                        break;
                                case 6:
-                                       switch (state) 
+                                       switch (state)
                                        {
                                                case 0:
                                                        buffer[0] = (lo << 2) | ((hi & 0xc) >> 2);
@@ -604,13 +604,13 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
        int  shift=8-q->bpp;
        char invert;
 
-       if (q->mode == -1) 
+       if (q->mode == -1)
                return -ENXIO;
 
        qc_command(q, 0x7);
        qc_command(q, q->mode);
 
-       if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 
+       if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR)
        {
                write_lpcontrol(q, 0x2e);       /* turn port around */
                write_lpcontrol(q, 0x26);
@@ -618,7 +618,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
                write_lpcontrol(q, 0x2e);
                (void) qc_waithand(q, 0);
        }
-       
+
        /* strange -- should be 15:63 below, but 4bpp is odd */
        invert = (q->bpp == 4) ? 16 : 63;
 
@@ -629,15 +629,15 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
            q->transfer_scale;
        transperline = (transperline + divisor - 1) / divisor;
 
-       for (i = 0, yield = yieldlines; i < linestotrans; i++) 
+       for (i = 0, yield = yieldlines; i < linestotrans; i++)
        {
-               for (pixels_read = j = 0; j < transperline; j++) 
+               for (pixels_read = j = 0; j < transperline; j++)
                {
                        bytes = qc_readbytes(q, buffer);
-                       for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++) 
+                       for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++)
                        {
                                int o;
-                               if (buffer[k] == 0 && invert == 16) 
+                               if (buffer[k] == 0 && invert == 16)
                                {
                                        /* 4bpp is odd (again) -- inverter is 16, not 15, but output
                                           must be 0-15 -- bls */
@@ -653,7 +653,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
                        pixels_read += bytes;
                }
                (void) qc_readbytes(q, NULL);   /* reset state machine */
-               
+
                /* Grabbing an entire frame from the quickcam is a lengthy
                   process. We don't (usually) want to busy-block the
                   processor for the entire frame. yieldlines is a module
@@ -666,7 +666,7 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l
                }
        }
 
-       if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 
+       if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR)
        {
                write_lpcontrol(q, 2);
                write_lpcontrol(q, 6);
@@ -687,7 +687,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam=(struct qcam_device *)dev;
-       
+
        switch(cmd)
        {
                case VIDIOCGCAP:
@@ -762,7 +762,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                                return -EINVAL;
                        if(p->depth!=4 && p->depth!=6)
                                return -EINVAL;
-                       
+
                        /*
                         *      Now load the camera.
                         */
@@ -790,11 +790,11 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                                return -EINVAL;
                        if(vw->width<80||vw->width>320)
                                return -EINVAL;
-                               
+
                        qcam->width = 320;
                        qcam->height = 240;
                        qcam->transfer_scale = 4;
-                       
+
                        if(vw->width>=160 && vw->height>=120)
                        {
                                qcam->transfer_scale = 2;
@@ -808,11 +808,11 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                        mutex_lock(&qcam->lock);
                        qc_setscanmode(qcam);
                        mutex_unlock(&qcam->lock);
-                       
+
                        /* We must update the camera before we grab. We could
                           just have changed the grab size */
                        qcam->status |= QC_PARAM_CHANGE;
-                       
+
                        /* Ok we figured out what to use from our wide choice */
                        return 0;
                }
@@ -853,9 +853,9 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
        struct qcam_device *qcam=(struct qcam_device *)v;
        int len;
        parport_claim_or_block(qcam->pdev);
-       
+
        mutex_lock(&qcam->lock);
-       
+
        qc_reset(qcam);
 
        /* Update the camera parameters if we need to */
@@ -863,13 +863,13 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
                qc_set(qcam);
 
        len=qc_capture(qcam, buf,count);
-       
+
        mutex_unlock(&qcam->lock);
-       
+
        parport_release(qcam->pdev);
        return len;
 }
+
 static struct file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
@@ -905,11 +905,11 @@ static int init_bwqcam(struct parport *port)
        qcam=qcam_init(port);
        if(qcam==NULL)
                return -ENODEV;
-               
+
        parport_claim_or_block(qcam->pdev);
 
        qc_reset(qcam);
-       
+
        if(qc_detect(qcam)==0)
        {
                parport_release(qcam->pdev);
@@ -920,9 +920,9 @@ static int init_bwqcam(struct parport *port)
        qc_calibrate(qcam);
 
        parport_release(qcam->pdev);
-       
+
        printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name);
-       
+
        if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
        {
                parport_unregister_device(qcam->pdev);
@@ -1013,7 +1013,7 @@ static int __init init_bw_qcams(void)
                printk("Connectix Quickcam max-poll was above 5000. Using 5000.\n");
                maxpoll = 5000;
        }
-       
+
        if (yieldlines < 1) {
                printk("Connectix Quickcam yieldlines was less than 1. Using 1.\n");
                yieldlines = 1;
index 8211fd8..22a7386 100644 (file)
@@ -16,7 +16,7 @@
  *
  * The parport parameter controls which parports will be scanned.
  * Scanning all parports causes some printers to print a garbage page.
- *       -- March 14, 1999  Billy Donahue <billy@escape.com> 
+ *       -- March 14, 1999  Billy Donahue <billy@escape.com>
  *
  * Fixed data format to BGR, added force_rgb parameter. Added missing
  * parport_unregister_driver() on module removal.
@@ -88,7 +88,7 @@ static inline unsigned int qcam_ready2(struct qcam_device *qcam)
        return (parport_read_data(qcam->pport) & 0x1)?1:0;
 }
 
-static unsigned int qcam_await_ready1(struct qcam_device *qcam, 
+static unsigned int qcam_await_ready1(struct qcam_device *qcam,
                                             int value)
 {
        unsigned long oldjiffies = jiffies;
@@ -98,7 +98,7 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam,
                if (qcam_ready1(qcam) == value)
                        return 0;
 
-       /* If the camera didn't respond within 1/25 second, poll slowly 
+       /* If the camera didn't respond within 1/25 second, poll slowly
           for a while. */
        for (i = 0; i < 50; i++)
        {
@@ -123,7 +123,7 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value)
                if (qcam_ready2(qcam) == value)
                        return 0;
 
-       /* If the camera didn't respond within 1/25 second, poll slowly 
+       /* If the camera didn't respond within 1/25 second, poll slowly
           for a while. */
        for (i = 0; i < 50; i++)
        {
@@ -157,12 +157,12 @@ static int qcam_write_data(struct qcam_device *qcam, unsigned int data)
        unsigned int idata;
        parport_write_data(qcam->pport, data);
        idata = qcam_read_data(qcam);
-       if (data != idata) 
+       if (data != idata)
        {
-               printk(KERN_WARNING "cqcam: sent %x but received %x\n", data, 
+               printk(KERN_WARNING "cqcam: sent %x but received %x\n", data,
                       idata);
                return 1;
-       } 
+       }
        return 0;
 }
 
@@ -193,12 +193,12 @@ static int qc_detect(struct qcam_device *qcam)
           no device was found".  Fix this one day. */
        if (qcam->pport->probe_info[0].class == PARPORT_CLASS_MEDIA
            && qcam->pport->probe_info[0].model
-           && !strcmp(qcam->pdev->port->probe_info[0].model, 
+           && !strcmp(qcam->pdev->port->probe_info[0].model,
                       "Color QuickCam 2.0")) {
                printk(KERN_DEBUG "QuickCam: Found by IEEE1284 probe.\n");
                return 1;
        }
-       
+
        if (probe < 2)
                return 0;
 
@@ -206,11 +206,11 @@ static int qc_detect(struct qcam_device *qcam)
 
        /* look for a heartbeat */
        ostat = stat = parport_read_status(qcam->pport);
-       for (i=0; i<250; i++) 
+       for (i=0; i<250; i++)
        {
                mdelay(1);
                stat = parport_read_status(qcam->pport);
-               if (ostat != stat) 
+               if (ostat != stat)
                {
                        if (++count >= 3) return 1;
                        ostat = stat;
@@ -226,11 +226,11 @@ static int qc_detect(struct qcam_device *qcam)
        count = 0;
 
        ostat = stat = parport_read_status(qcam->pport);
-       for (i=0; i<250; i++) 
+       for (i=0; i<250; i++)
        {
                mdelay(1);
                stat = parport_read_status(qcam->pport);
-               if (ostat != stat) 
+               if (ostat != stat)
                {
                        if (++count >= 3) return 1;
                        ostat = stat;
@@ -247,7 +247,7 @@ static void qc_reset(struct qcam_device *qcam)
        parport_write_control(qcam->pport, 0x8);
        mdelay(1);
        parport_write_control(qcam->pport, 0xc);
-       mdelay(1);          
+       mdelay(1);
 }
 
 /* Reset the QuickCam and program for brightness, contrast,
@@ -258,7 +258,7 @@ static void qc_setup(struct qcam_device *q)
        qc_reset(q);
 
        /* Set the brightness.  */
-               qcam_set(q, 11, q->brightness);
+       qcam_set(q, 11, q->brightness);
 
        /* Set the height and width.  These refer to the actual
           CCD area *before* applying the selected decimation.  */
@@ -272,12 +272,12 @@ static void qc_setup(struct qcam_device *q)
        /* Set contrast and white balance.  */
        qcam_set(q, 0x19, q->contrast);
        qcam_set(q, 0x1f, q->whitebal);
-       
+
        /* Set the speed.  */
        qcam_set(q, 45, 2);
 }
 
-/* Read some bytes from the camera and put them in the buffer. 
+/* Read some bytes from the camera and put them in the buffer.
    nbytes should be a multiple of 3, because bidirectional mode gives
    us three bytes at a time.  */
 
@@ -383,7 +383,7 @@ static long qc_capture(struct qcam_device *q, char __user *buf, unsigned long le
 
        if (qcam_set(q, 7, (q->mode | (is_bi_dir?1:0)) + 1))
                return -EIO;
-       
+
        lines = q->height;
        pixelsperline = q->width;
        bitsperxfer = (is_bi_dir) ? 24 : 8;
@@ -499,7 +499,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
 {
        struct video_device *dev = video_devdata(file);
        struct qcam_device *qcam=(struct qcam_device *)dev;
-       
+
        switch(cmd)
        {
                case VIDIOCGCAP:
@@ -574,7 +574,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                         */
                        if (p->depth != 24 || p->palette != VIDEO_PALETTE_RGB24)
                                return -EINVAL;
-                       
+
                        /*
                         *      Now load the camera.
                         */
@@ -584,7 +584,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
 
                        mutex_lock(&qcam->lock);
                        parport_claim_or_block(qcam->pdev);
-                       qc_setup(qcam); 
+                       qc_setup(qcam);
                        parport_release(qcam->pdev);
                        mutex_unlock(&qcam->lock);
                        return 0;
@@ -601,11 +601,11 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                                return -EINVAL;
                        if(vw->width<80||vw->width>320)
                                return -EINVAL;
-                               
+
                        qcam->width = 80;
                        qcam->height = 60;
                        qcam->mode = QC_DECIMATION_4;
-                       
+
                        if(vw->width>=160 && vw->height>=120)
                        {
                                qcam->width = 160;
@@ -627,7 +627,7 @@ static int qcam_do_ioctl(struct inode *inode, struct file *file,
                                qcam->mode = QC_BILLIONS | QC_DECIMATION_1;
                        }
 #endif
-                       /* Ok we figured out what to use from our 
+                       /* Ok we figured out what to use from our
                           wide choice */
                        mutex_lock(&qcam->lock);
                        parport_claim_or_block(qcam->pdev);
@@ -676,7 +676,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
        mutex_lock(&qcam->lock);
        parport_claim_or_block(qcam->pdev);
        /* Probably should have a semaphore against multiple users */
-       len = qc_capture(qcam, buf,count); 
+       len = qc_capture(qcam, buf,count);
        parport_release(qcam->pdev);
        mutex_unlock(&qcam->lock);
        return len;
@@ -707,7 +707,7 @@ static struct video_device qcam_template=
 static struct qcam_device *qcam_init(struct parport *port)
 {
        struct qcam_device *q;
-       
+
        q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL);
        if(q==NULL)
                return NULL;
@@ -718,14 +718,14 @@ static struct qcam_device *qcam_init(struct parport *port)
 
        q->bidirectional = (q->pport->modes & PARPORT_MODE_TRISTATE)?1:0;
 
-       if (q->pdev == NULL) 
+       if (q->pdev == NULL)
        {
                printk(KERN_ERR "c-qcam: couldn't register for %s.\n",
                       port->name);
                kfree(q);
                return NULL;
        }
-       
+
        memcpy(&q->vdev, &qcam_template, sizeof(qcam_template));
 
        mutex_init(&q->lock);
@@ -766,11 +766,11 @@ static int init_cqcam(struct parport *port)
        qcam = qcam_init(port);
        if (qcam==NULL)
                return -ENODEV;
-               
+
        parport_claim_or_block(qcam->pdev);
 
        qc_reset(qcam);
-       
+
        if (probe && qc_detect(qcam)==0)
        {
                parport_release(qcam->pdev);
@@ -782,7 +782,7 @@ static int init_cqcam(struct parport *port)
        qc_setup(qcam);
 
        parport_release(qcam->pdev);
-       
+
        if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
        {
                printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
@@ -792,9 +792,9 @@ static int init_cqcam(struct parport *port)
                return -ENODEV;
        }
 
-       printk(KERN_INFO "video%d: Colour QuickCam found on %s\n", 
+       printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
               qcam->vdev.minor, qcam->pport->name);
-       
+
        qcams[num_cams++] = qcam;
 
        return 0;
index 3cebfa9..2227c56 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
-/* #define _CPIA_DEBUG_  1 */  
+/* #define _CPIA_DEBUG_  1 */
 
 #include <linux/config.h>
 
@@ -67,11 +67,11 @@ MODULE_SUPPORTED_DEVICE("video");
 static unsigned short colorspace_conv = 0;
 module_param(colorspace_conv, ushort, 0444);
 MODULE_PARM_DESC(colorspace_conv,
-                 "\n<n> Colorspace conversion:"
-                 "\n0 = disable"
-                 "\n1 = enable"
-                 "\nDefault value is 0"
-                 "\n");
+                "\n<n> Colorspace conversion:"
+                "\n0 = disable"
+                "\n1 = enable"
+                "\nDefault value is 0"
+                "\n");
 
 #define ABOUT "V4L-Driver for Vision CPiA based cameras"
 
@@ -189,8 +189,8 @@ enum {
 #define TC             94
 #define        EXP_ACC_DARK   50
 #define        EXP_ACC_LIGHT  90
-#define HIGH_COMP_102 160              
-#define MAX_COMP      239              
+#define HIGH_COMP_102 160
+#define MAX_COMP      239
 #define DARK_TIME       3
 #define LIGHT_TIME      3
 
@@ -208,7 +208,7 @@ static u8 flicker_jumps[2][2][4] =
 static void reset_camera_struct(struct cam_data *cam);
 static int find_over_exposure(int brightness);
 static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
-                        int on);
+                       int on);
 
 
 /**********************************************************************
@@ -262,7 +262,7 @@ static void rvfree(void *mem, unsigned long size)
 static struct proc_dir_entry *cpia_proc_root=NULL;
 
 static int cpia_read_proc(char *page, char **start, off_t off,
-                          int count, int *eof, void *data)
+                         int count, int *eof, void *data)
 {
        char *out = page;
        int len, tmp;
@@ -276,58 +276,58 @@ static int cpia_read_proc(char *page, char **start, off_t off,
        out += sprintf(out, "V4L Driver version:       %d.%d.%d\n",
                       CPIA_MAJ_VER, CPIA_MIN_VER, CPIA_PATCH_VER);
        out += sprintf(out, "CPIA Version:             %d.%02d (%d.%d)\n",
-                      cam->params.version.firmwareVersion,
-                      cam->params.version.firmwareRevision,
-                      cam->params.version.vcVersion,
-                      cam->params.version.vcRevision);
+                      cam->params.version.firmwareVersion,
+                      cam->params.version.firmwareRevision,
+                      cam->params.version.vcVersion,
+                      cam->params.version.vcRevision);
        out += sprintf(out, "CPIA PnP-ID:              %04x:%04x:%04x\n",
-                      cam->params.pnpID.vendor, cam->params.pnpID.product,
-                      cam->params.pnpID.deviceRevision);
+                      cam->params.pnpID.vendor, cam->params.pnpID.product,
+                      cam->params.pnpID.deviceRevision);
        out += sprintf(out, "VP-Version:               %d.%d %04x\n",
-                      cam->params.vpVersion.vpVersion,
-                      cam->params.vpVersion.vpRevision,
-                      cam->params.vpVersion.cameraHeadID);
-       
+                      cam->params.vpVersion.vpVersion,
+                      cam->params.vpVersion.vpRevision,
+                      cam->params.vpVersion.cameraHeadID);
+
        out += sprintf(out, "system_state:             %#04x\n",
-                      cam->params.status.systemState);
+                      cam->params.status.systemState);
        out += sprintf(out, "grab_state:               %#04x\n",
-                      cam->params.status.grabState);
+                      cam->params.status.grabState);
        out += sprintf(out, "stream_state:             %#04x\n",
-                      cam->params.status.streamState);
+                      cam->params.status.streamState);
        out += sprintf(out, "fatal_error:              %#04x\n",
-                      cam->params.status.fatalError);
+                      cam->params.status.fatalError);
        out += sprintf(out, "cmd_error:                %#04x\n",
-                      cam->params.status.cmdError);
+                      cam->params.status.cmdError);
        out += sprintf(out, "debug_flags:              %#04x\n",
-                      cam->params.status.debugFlags);
+                      cam->params.status.debugFlags);
        out += sprintf(out, "vp_status:                %#04x\n",
-                      cam->params.status.vpStatus);
+                      cam->params.status.vpStatus);
        out += sprintf(out, "error_code:               %#04x\n",
-                      cam->params.status.errorCode);
+                      cam->params.status.errorCode);
        /* QX3 specific entries */
        if (cam->params.qx3.qx3_detected) {
                out += sprintf(out, "button:                   %4d\n",
-                              cam->params.qx3.button);
+                              cam->params.qx3.button);
                out += sprintf(out, "cradled:                  %4d\n",
-                              cam->params.qx3.cradled);
+                              cam->params.qx3.cradled);
        }
        out += sprintf(out, "video_size:               %s\n",
-                      cam->params.format.videoSize == VIDEOSIZE_CIF ?
+                      cam->params.format.videoSize == VIDEOSIZE_CIF ?
                       "CIF " : "QCIF");
        out += sprintf(out, "roi:                      (%3d, %3d) to (%3d, %3d)\n",
-                      cam->params.roi.colStart*8,
-                      cam->params.roi.rowStart*4,
-                      cam->params.roi.colEnd*8,
-                      cam->params.roi.rowEnd*4);
+                      cam->params.roi.colStart*8,
+                      cam->params.roi.rowStart*4,
+                      cam->params.roi.colEnd*8,
+                      cam->params.roi.rowEnd*4);
        out += sprintf(out, "actual_fps:               %3d\n", cam->fps);
        out += sprintf(out, "transfer_rate:            %4dkB/s\n",
-                      cam->transfer_rate);
-       
+                      cam->transfer_rate);
+
        out += sprintf(out, "\nread-write\n");
        out += sprintf(out, "-----------------------  current       min"
-                      "       max   default  comment\n");
+                      "       max   default  comment\n");
        out += sprintf(out, "brightness:             %8d  %8d  %8d  %8d\n",
-                      cam->params.colourParams.brightness, 0, 100, 50);
+                      cam->params.colourParams.brightness, 0, 100, 50);
        if (cam->params.version.firmwareVersion == 1 &&
           cam->params.version.firmwareRevision == 2)
                /* 1-02 firmware limits contrast to 80 */
@@ -336,26 +336,26 @@ static int cpia_read_proc(char *page, char **start, off_t off,
                tmp = 96;
 
        out += sprintf(out, "contrast:               %8d  %8d  %8d  %8d"
-                      "  steps of 8\n",
-                      cam->params.colourParams.contrast, 0, tmp, 48);
+                      "  steps of 8\n",
+                      cam->params.colourParams.contrast, 0, tmp, 48);
        out += sprintf(out, "saturation:             %8d  %8d  %8d  %8d\n",
-                      cam->params.colourParams.saturation, 0, 100, 50);
+                      cam->params.colourParams.saturation, 0, 100, 50);
        tmp = (25000+5000*cam->params.sensorFps.baserate)/
              (1<<cam->params.sensorFps.divisor);
        out += sprintf(out, "sensor_fps:             %4d.%03d  %8d  %8d  %8d\n",
-                      tmp/1000, tmp%1000, 3, 30, 15);
+                      tmp/1000, tmp%1000, 3, 30, 15);
        out += sprintf(out, "stream_start_line:      %8d  %8d  %8d  %8d\n",
-                      2*cam->params.streamStartLine, 0,
+                      2*cam->params.streamStartLine, 0,
                       cam->params.format.videoSize == VIDEOSIZE_CIF ? 288:144,
                       cam->params.format.videoSize == VIDEOSIZE_CIF ? 240:120);
        out += sprintf(out, "sub_sample:             %8s  %8s  %8s  %8s\n",
-                      cam->params.format.subSample == SUBSAMPLE_420 ?
+                      cam->params.format.subSample == SUBSAMPLE_420 ?
                       "420" : "422", "420", "422", "422");
        out += sprintf(out, "yuv_order:              %8s  %8s  %8s  %8s\n",
-                      cam->params.format.yuvOrder == YUVORDER_YUYV ?
+                      cam->params.format.yuvOrder == YUVORDER_YUYV ?
                       "YUYV" : "UYVY", "YUYV" , "UYVY", "YUYV");
        out += sprintf(out, "ecp_timing:             %8s  %8s  %8s  %8s\n",
-                      cam->params.ecpTiming ? "slow" : "normal", "slow",
+                      cam->params.ecpTiming ? "slow" : "normal", "slow",
                       "normal", "normal");
 
        if (cam->params.colourBalance.balanceMode == 2) {
@@ -366,11 +366,11 @@ static int cpia_read_proc(char *page, char **start, off_t off,
        out += sprintf(out, "color_balance_mode:     %8s  %8s  %8s"
                       "  %8s\n",  tmpstr, "manual", "auto", "auto");
        out += sprintf(out, "red_gain:               %8d  %8d  %8d  %8d\n",
-                      cam->params.colourBalance.redGain, 0, 212, 32);
+                      cam->params.colourBalance.redGain, 0, 212, 32);
        out += sprintf(out, "green_gain:             %8d  %8d  %8d  %8d\n",
-                      cam->params.colourBalance.greenGain, 0, 212, 6);
+                      cam->params.colourBalance.greenGain, 0, 212, 6);
        out += sprintf(out, "blue_gain:              %8d  %8d  %8d  %8d\n",
-                      cam->params.colourBalance.blueGain, 0, 212, 92);
+                      cam->params.colourBalance.blueGain, 0, 212, 92);
 
        if (cam->params.version.firmwareVersion == 1 &&
           cam->params.version.firmwareRevision == 2)
@@ -381,11 +381,11 @@ static int cpia_read_proc(char *page, char **start, off_t off,
 
        if (cam->params.exposure.gainMode == 0)
                out += sprintf(out, "max_gain:                unknown  %28s"
-                              "  powers of 2\n", tmpstr); 
+                              "  powers of 2\n", tmpstr);
        else
                out += sprintf(out, "max_gain:               %8d  %28s"
                               "  1,2,4 or 8 \n",
-                              1<<(cam->params.exposure.gainMode-1), tmpstr);
+                              1<<(cam->params.exposure.gainMode-1), tmpstr);
 
        switch(cam->params.exposure.expMode) {
        case 1:
@@ -402,10 +402,10 @@ static int cpia_read_proc(char *page, char **start, off_t off,
        out += sprintf(out, "exposure_mode:          %8s  %8s  %8s"
                       "  %8s\n",  tmpstr, "manual", "auto", "auto");
        out += sprintf(out, "centre_weight:          %8s  %8s  %8s  %8s\n",
-                      (2-cam->params.exposure.centreWeight) ? "on" : "off",
-                      "off", "on", "on");
+                      (2-cam->params.exposure.centreWeight) ? "on" : "off",
+                      "off", "on", "on");
        out += sprintf(out, "gain:                   %8d  %8d  max_gain  %8d  1,2,4,8 possible\n",
-                      1<<cam->params.exposure.gain, 1, 1);
+                      1<<cam->params.exposure.gain, 1, 1);
        if (cam->params.version.firmwareVersion == 1 &&
           cam->params.version.firmwareRevision == 2)
                /* 1-02 firmware limits fineExp/2 to 127 */
@@ -414,7 +414,7 @@ static int cpia_read_proc(char *page, char **start, off_t off,
                tmp = 510;
 
        out += sprintf(out, "fine_exp:               %8d  %8d  %8d  %8d\n",
-                      cam->params.exposure.fineExp*2, 0, tmp, 0);
+                      cam->params.exposure.fineExp*2, 0, tmp, 0);
        if (cam->params.version.firmwareVersion == 1 &&
           cam->params.version.firmwareRevision == 2)
                /* 1-02 firmware limits coarseExpHi to 0 */
@@ -426,46 +426,46 @@ static int cpia_read_proc(char *page, char **start, off_t off,
                       "  %8d\n", cam->params.exposure.coarseExpLo+
                       256*cam->params.exposure.coarseExpHi, 0, tmp, 185);
        out += sprintf(out, "red_comp:               %8d  %8d  %8d  %8d\n",
-                      cam->params.exposure.redComp, COMP_RED, 255, COMP_RED);
+                      cam->params.exposure.redComp, COMP_RED, 255, COMP_RED);
        out += sprintf(out, "green1_comp:            %8d  %8d  %8d  %8d\n",
-                      cam->params.exposure.green1Comp, COMP_GREEN1, 255,
+                      cam->params.exposure.green1Comp, COMP_GREEN1, 255,
                       COMP_GREEN1);
        out += sprintf(out, "green2_comp:            %8d  %8d  %8d  %8d\n",
-                      cam->params.exposure.green2Comp, COMP_GREEN2, 255,
+                      cam->params.exposure.green2Comp, COMP_GREEN2, 255,
                       COMP_GREEN2);
        out += sprintf(out, "blue_comp:              %8d  %8d  %8d  %8d\n",
-                      cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE);
-       
+                      cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE);
+
        out += sprintf(out, "apcor_gain1:            %#8x  %#8x  %#8x  %#8x\n",
-                      cam->params.apcor.gain1, 0, 0xff, 0x1c);
+                      cam->params.apcor.gain1, 0, 0xff, 0x1c);
        out += sprintf(out, "apcor_gain2:            %#8x  %#8x  %#8x  %#8x\n",
-                      cam->params.apcor.gain2, 0, 0xff, 0x1a);
+                      cam->params.apcor.gain2, 0, 0xff, 0x1a);
        out += sprintf(out, "apcor_gain4:            %#8x  %#8x  %#8x  %#8x\n",
-                      cam->params.apcor.gain4, 0, 0xff, 0x2d);
+                      cam->params.apcor.gain4, 0, 0xff, 0x2d);
        out += sprintf(out, "apcor_gain8:            %#8x  %#8x  %#8x  %#8x\n",
-                      cam->params.apcor.gain8, 0, 0xff, 0x2a);
+                      cam->params.apcor.gain8, 0, 0xff, 0x2a);
        out += sprintf(out, "vl_offset_gain1:        %8d  %8d  %8d  %8d\n",
-                      cam->params.vlOffset.gain1, 0, 255, 24);
+                      cam->params.vlOffset.gain1, 0, 255, 24);
        out += sprintf(out, "vl_offset_gain2:        %8d  %8d  %8d  %8d\n",
-                      cam->params.vlOffset.gain2, 0, 255, 28);
+                      cam->params.vlOffset.gain2, 0, 255, 28);
        out += sprintf(out, "vl_offset_gain4:        %8d  %8d  %8d  %8d\n",
-                      cam->params.vlOffset.gain4, 0, 255, 30);
+                      cam->params.vlOffset.gain4, 0, 255, 30);
        out += sprintf(out, "vl_offset_gain8:        %8d  %8d  %8d  %8d\n",
-                      cam->params.vlOffset.gain8, 0, 255, 30);
+                      cam->params.vlOffset.gain8, 0, 255, 30);
        out += sprintf(out, "flicker_control:        %8s  %8s  %8s  %8s\n",
-                      cam->params.flickerControl.flickerMode ? "on" : "off",
+                      cam->params.flickerControl.flickerMode ? "on" : "off",
                       "off", "on", "off");
        out += sprintf(out, "mains_frequency:        %8d  %8d  %8d  %8d"
-                      " only 50/60\n",
-                      cam->mainsFreq ? 60 : 50, 50, 60, 50);
+                      " only 50/60\n",
+                      cam->mainsFreq ? 60 : 50, 50, 60, 50);
        if(cam->params.flickerControl.allowableOverExposure < 0)
                out += sprintf(out, "allowable_overexposure: %4dauto      auto  %8d      auto\n",
-                              -cam->params.flickerControl.allowableOverExposure,
-                              255);
+                              -cam->params.flickerControl.allowableOverExposure,
+                              255);
        else
                out += sprintf(out, "allowable_overexposure: %8d      auto  %8d      auto\n",
-                              cam->params.flickerControl.allowableOverExposure,
-                              255);
+                              cam->params.flickerControl.allowableOverExposure,
+                              255);
        out += sprintf(out, "compression_mode:       ");
        switch(cam->params.compression.mode) {
        case CPIA_COMPRESSION_NONE:
@@ -483,52 +483,52 @@ static int cpia_read_proc(char *page, char **start, off_t off,
        }
        out += sprintf(out, "    none,auto,manual      auto\n");
        out += sprintf(out, "decimation_enable:      %8s  %8s  %8s  %8s\n",
-                      cam->params.compression.decimation ==
-                      DECIMATION_ENAB ? "on":"off", "off", "on", 
+                      cam->params.compression.decimation ==
+                      DECIMATION_ENAB ? "on":"off", "off", "on",
                       "off");
        out += sprintf(out, "compression_target:    %9s %9s %9s %9s\n",
-                      cam->params.compressionTarget.frTargeting  == 
+                      cam->params.compressionTarget.frTargeting  ==
                       CPIA_COMPRESSION_TARGET_FRAMERATE ?
                       "framerate":"quality",
                       "framerate", "quality", "quality");
        out += sprintf(out, "target_framerate:       %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionTarget.targetFR, 1, 30, 15);
+                      cam->params.compressionTarget.targetFR, 1, 30, 15);
        out += sprintf(out, "target_quality:         %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionTarget.targetQ, 1, 64, 5);
+                      cam->params.compressionTarget.targetQ, 1, 64, 5);
        out += sprintf(out, "y_threshold:            %8d  %8d  %8d  %8d\n",
-                      cam->params.yuvThreshold.yThreshold, 0, 31, 6);
+                      cam->params.yuvThreshold.yThreshold, 0, 31, 6);
        out += sprintf(out, "uv_threshold:           %8d  %8d  %8d  %8d\n",
-                      cam->params.yuvThreshold.uvThreshold, 0, 31, 6);
+                      cam->params.yuvThreshold.uvThreshold, 0, 31, 6);
        out += sprintf(out, "hysteresis:             %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.hysteresis, 0, 255, 3);
+                      cam->params.compressionParams.hysteresis, 0, 255, 3);
        out += sprintf(out, "threshold_max:          %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.threshMax, 0, 255, 11);
+                      cam->params.compressionParams.threshMax, 0, 255, 11);
        out += sprintf(out, "small_step:             %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.smallStep, 0, 255, 1);
+                      cam->params.compressionParams.smallStep, 0, 255, 1);
        out += sprintf(out, "large_step:             %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.largeStep, 0, 255, 3);
+                      cam->params.compressionParams.largeStep, 0, 255, 3);
        out += sprintf(out, "decimation_hysteresis:  %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.decimationHysteresis,
+                      cam->params.compressionParams.decimationHysteresis,
                       0, 255, 2);
        out += sprintf(out, "fr_diff_step_thresh:    %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.frDiffStepThresh,
+                      cam->params.compressionParams.frDiffStepThresh,
                       0, 255, 5);
        out += sprintf(out, "q_diff_step_thresh:     %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.qDiffStepThresh,
+                      cam->params.compressionParams.qDiffStepThresh,
                       0, 255, 3);
        out += sprintf(out, "decimation_thresh_mod:  %8d  %8d  %8d  %8d\n",
-                      cam->params.compressionParams.decimationThreshMod,
+                      cam->params.compressionParams.decimationThreshMod,
                       0, 255, 2);
        /* QX3 specific entries */
        if (cam->params.qx3.qx3_detected) {
-               out += sprintf(out, "toplight:               %8s  %8s  %8s  %8s\n", 
-                              cam->params.qx3.toplight ? "on" : "off",
+               out += sprintf(out, "toplight:               %8s  %8s  %8s  %8s\n",
+                              cam->params.qx3.toplight ? "on" : "off",
                               "off", "on", "off");
-               out += sprintf(out, "bottomlight:            %8s  %8s  %8s  %8s\n", 
-                              cam->params.qx3.bottomlight ? "on" : "off",
+               out += sprintf(out, "bottomlight:            %8s  %8s  %8s  %8s\n",
+                              cam->params.qx3.bottomlight ? "on" : "off",
                               "off", "on", "off");
        }
-       
+
        len = out - page;
        len -= off;
        if (len < count) {
@@ -543,7 +543,7 @@ static int cpia_read_proc(char *page, char **start, off_t off,
 
 
 static int match(char *checkstr, char **buffer, unsigned long *count,
-                 int *find_colon, int *err)
+                int *find_colon, int *err)
 {
        int ret, colon_found = 1;
        int len = strlen(checkstr);
@@ -583,7 +583,7 @@ static unsigned long int value(char **buffer, unsigned long *count, int *err)
 }
 
 static int cpia_write_proc(struct file *file, const char __user *buf,
-                           unsigned long count, void *data)
+                          unsigned long count, void *data)
 {
        struct cam_data *cam = data;
        struct cam_params new_params;
@@ -619,12 +619,12 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                retval = -EINVAL;
                goto out;
        }
-       
+
        buffer = page;
-       
+
        if (mutex_lock_interruptible(&cam->param_lock))
                return -ERESTARTSYS;
-       
+
        /*
         * Skip over leading whitespace
         */
@@ -632,15 +632,15 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                --count;
                ++buffer;
        }
-       
+
        memcpy(&new_params, &cam->params, sizeof(struct cam_params));
        new_mains = cam->mainsFreq;
-       
+
 #define MATCH(x) (match(x, &buffer, &count, &find_colon, &retval))
 #define VALUE (value(&buffer,&count, &retval))
 #define FIRMWARE_VERSION(x,y) (new_params.version.firmwareVersion == (x) && \
-                               new_params.version.firmwareRevision == (y))
-       
+                              new_params.version.firmwareRevision == (y))
+
        retval = 0;
        while (count && !retval) {
                find_colon = 1;
@@ -656,7 +656,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                        }
                        command_flags |= COMMAND_SETCOLOURPARAMS;
                        if(new_params.flickerControl.allowableOverExposure < 0)
-                               new_params.flickerControl.allowableOverExposure = 
+                               new_params.flickerControl.allowableOverExposure =
                                        -find_over_exposure(new_params.colourParams.brightness);
                        if(new_params.flickerControl.flickerMode != 0)
                                command_flags |= COMMAND_SETFLICKERCTRL;
@@ -721,7 +721,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                                        /* Either base rate would work here */
                                        new_params.sensorFps.baserate = 1;
                                }
-                               new_params.flickerControl.coarseJump = 
+                               new_params.flickerControl.coarseJump =
                                        flicker_jumps[new_mains]
                                        [new_params.sensorFps.baserate]
                                        [new_params.sensorFps.divisor];
@@ -1085,7 +1085,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                } else if (MATCH("mains_frequency")) {
                        if (!retval && MATCH("50")) {
                                new_mains = 0;
-                               new_params.flickerControl.coarseJump = 
+                               new_params.flickerControl.coarseJump =
                                        flicker_jumps[new_mains]
                                        [new_params.sensorFps.baserate]
                                        [new_params.sensorFps.divisor];
@@ -1093,7 +1093,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                                        command_flags |= COMMAND_SETFLICKERCTRL;
                        } else if (!retval && MATCH("60")) {
                                new_mains = 1;
-                               new_params.flickerControl.coarseJump = 
+                               new_params.flickerControl.coarseJump =
                                        flicker_jumps[new_mains]
                                        [new_params.sensorFps.baserate]
                                        [new_params.sensorFps.divisor];
@@ -1103,7 +1103,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                                retval = -EINVAL;
                } else if (MATCH("allowable_overexposure")) {
                        if (!retval && MATCH("auto")) {
-                               new_params.flickerControl.allowableOverExposure = 
+                               new_params.flickerControl.allowableOverExposure =
                                        -find_over_exposure(new_params.colourParams.brightness);
                                if(new_params.flickerControl.flickerMode != 0)
                                        command_flags |= COMMAND_SETFLICKERCTRL;
@@ -1146,10 +1146,10 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                        command_flags |= COMMAND_SETCOMPRESSION;
                } else if (MATCH("compression_target")) {
                        if (!retval && MATCH("quality"))
-                               new_params.compressionTarget.frTargeting = 
+                               new_params.compressionTarget.frTargeting =
                                        CPIA_COMPRESSION_TARGET_QUALITY;
                        else if (!retval && MATCH("framerate"))
-                               new_params.compressionTarget.frTargeting = 
+                               new_params.compressionTarget.frTargeting =
                                        CPIA_COMPRESSION_TARGET_FRAMERATE;
                        else
                                retval = -EINVAL;
@@ -1173,7 +1173,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                        if (!retval) {
                                if(val > 0 && val <= 64)
                                        new_params.compressionTarget.targetQ = val;
-                               else 
+                               else
                                        retval = -EINVAL;
                        }
                        command_flags |= COMMAND_SETCOMPRESSIONTARGET;
@@ -1288,19 +1288,19 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                        }
                        command_flags |= COMMAND_SETCOMPRESSIONPARAMS;
                } else if (MATCH("toplight")) {
-                       if (!retval && MATCH("on"))
+                       if (!retval && MATCH("on"))
                                new_params.qx3.toplight = 1;
                        else if (!retval && MATCH("off"))
                                new_params.qx3.toplight = 0;
-                       else 
+                       else
                                retval = -EINVAL;
                        command_flags |= COMMAND_SETLIGHTS;
                } else if (MATCH("bottomlight")) {
-                       if (!retval && MATCH("on"))
+                       if (!retval && MATCH("on"))
                                new_params.qx3.bottomlight = 1;
-                       else if (!retval && MATCH("off"))  
+                       else if (!retval && MATCH("off"))
                                new_params.qx3.bottomlight = 0;
-                       else 
+                       else
                                retval = -EINVAL;
                        command_flags |= COMMAND_SETLIGHTS;
                } else {
@@ -1326,7 +1326,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                        }
                }
        }
-#undef MATCH   
+#undef MATCH
 #undef VALUE
 #undef FIRMWARE_VERSION
        if (!retval) {
@@ -1349,24 +1349,24 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
                retval = size;
        } else
                DBG("error: %d\n", retval);
-       
+
        mutex_unlock(&cam->param_lock);
-       
+
 out:
        free_page((unsigned long)page);
-       return retval;
+       return retval;
 }
 
 static void create_proc_cpia_cam(struct cam_data *cam)
 {
        char name[7];
        struct proc_dir_entry *ent;
-       
+
        if (!cpia_proc_root || !cam)
                return;
 
        sprintf(name, "video%d", cam->vdev.minor);
-       
+
        ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
        if (!ent)
                return;
@@ -1374,9 +1374,9 @@ static void create_proc_cpia_cam(struct cam_data *cam)
        ent->data = cam;
        ent->read_proc = cpia_read_proc;
        ent->write_proc = cpia_write_proc;
-       /* 
+       /*
           size of the proc entry is 3736 bytes for the standard webcam;
-          the extra features of the QX3 microscope add 189 bytes.
+          the extra features of the QX3 microscope add 189 bytes.
           (we have not yet probed the camera to see which type it is).
        */
        ent->size = 3736 + 189;
@@ -1386,10 +1386,10 @@ static void create_proc_cpia_cam(struct cam_data *cam)
 static void destroy_proc_cpia_cam(struct cam_data *cam)
 {
        char name[7];
-       
+
        if (!cam || !cam->proc_entry)
                return;
-       
+
        sprintf(name, "video%d", cam->vdev.minor);
        remove_proc_entry(name, cpia_proc_root);
        cam->proc_entry = NULL;
@@ -1596,13 +1596,13 @@ static void set_vw_size(struct cam_data *cam)
                cam->vc.width = cam->vw.width;
        if(cam->vc.height == 0)
                cam->vc.height = cam->vw.height;
-       
+
        cam->params.roi.colStart += cam->vc.x >> 3;
        cam->params.roi.colEnd = cam->params.roi.colStart +
-                                (cam->vc.width >> 3);
+                                (cam->vc.width >> 3);
        cam->params.roi.rowStart += cam->vc.y >> 2;
        cam->params.roi.rowEnd = cam->params.roi.rowStart +
-                                (cam->vc.height >> 2);
+                                (cam->vc.height >> 2);
 
        return;
 }
@@ -1624,7 +1624,7 @@ static int allocate_frame_buf(struct cam_data *cam)
 static int free_frame_buf(struct cam_data *cam)
 {
        int i;
-       
+
        rvfree(cam->frame_buf, FRAME_NUM*CPIA_MAX_FRAME_SIZE);
        cam->frame_buf = NULL;
        for (i=0; i < FRAME_NUM; i++)
@@ -1667,7 +1667,7 @@ static int do_command(struct cam_data *cam, u16 command, u8 a, u8 b, u8 c, u8 d)
                mutex_lock(&cam->param_lock);
                datasize=8;
                break;
-       case CPIA_COMMAND_ReadMCPorts: 
+       case CPIA_COMMAND_ReadMCPorts:
        case CPIA_COMMAND_ReadVCRegs:
                datasize = 4;
                break;
@@ -1746,10 +1746,10 @@ static int do_command(struct cam_data *cam, u16 command, u8 a, u8 b, u8 c, u8 d)
                        mutex_unlock(&cam->param_lock);
                        break;
 
-               case CPIA_COMMAND_ReadMCPorts: 
-                       if (!cam->params.qx3.qx3_detected) 
+               case CPIA_COMMAND_ReadMCPorts:
+                       if (!cam->params.qx3.qx3_detected)
                                break;
-                       /* test button press */ 
+                       /* test button press */
                        cam->params.qx3.button = ((data[1] & 0x02) == 0);
                        if (cam->params.qx3.button) {
                                /* button pressed - unlock the latch */
@@ -1770,9 +1770,9 @@ static int do_command(struct cam_data *cam, u16 command, u8 a, u8 b, u8 c, u8 d)
 
 /* send a command  to the camera with an additional data transaction */
 static int do_command_extended(struct cam_data *cam, u16 command,
-                               u8 a, u8 b, u8 c, u8 d,
-                               u8 e, u8 f, u8 g, u8 h,
-                               u8 i, u8 j, u8 k, u8 l)
+                              u8 a, u8 b, u8 c, u8 d,
+                              u8 e, u8 f, u8 g, u8 h,
+                              u8 i, u8 j, u8 k, u8 l)
 {
        int retval;
        u8 cmd[8], data[8];
@@ -1809,10 +1809,10 @@ static int do_command_extended(struct cam_data *cam, u16 command,
 #define LIMIT(x) ((((x)>0xffffff)?0xff0000:(((x)<=0xffff)?0:(x)&0xff0000))>>16)
 
 static int convert420(unsigned char *yuv, unsigned char *rgb, int out_fmt,
-                      int linesize, int mmap_kludge)
+                     int linesize, int mmap_kludge)
 {
        int y, u, v, r, g, b, y1;
-       
+
        /* Odd lines use the same u and v as the previous line.
         * Because of compression, it is necessary to get this
         * information from the decoded image. */
@@ -1925,7 +1925,7 @@ static int convert420(unsigned char *yuv, unsigned char *rgb, int out_fmt,
 
 
 static int yuvconvert(unsigned char *yuv, unsigned char *rgb, int out_fmt,
-                      int in_uyvy, int mmap_kludge)
+                     int in_uyvy, int mmap_kludge)
 {
        int y, u, v, r, g, b, y1;
 
@@ -2078,21 +2078,21 @@ static int parse_picture(struct cam_data *cam, int size)
                mutex_unlock(&cam->param_lock);
                return -1;
        }
-       
+
        if (ibuf[17] != SUBSAMPLE_420 && ibuf[17] != SUBSAMPLE_422) {
                LOG("illegal subtype %d\n",ibuf[17]);
                mutex_unlock(&cam->param_lock);
                return -1;
        }
        subsample_422 = ibuf[17] == SUBSAMPLE_422;
-       
+
        if (ibuf[18] != YUVORDER_YUYV && ibuf[18] != YUVORDER_UYVY) {
                LOG("illegal yuvorder %d\n",ibuf[18]);
                mutex_unlock(&cam->param_lock);
                return -1;
        }
        in_uyvy = ibuf[18] == YUVORDER_UYVY;
-       
+
        if ((ibuf[24] != cam->params.roi.colStart) ||
            (ibuf[25] != cam->params.roi.colEnd) ||
            (ibuf[26] != cam->params.roi.rowStart) ||
@@ -2104,20 +2104,20 @@ static int parse_picture(struct cam_data *cam, int size)
        cols = 8*(ibuf[25] - ibuf[24]);
        rows = 4*(ibuf[27] - ibuf[26]);
 
-       
+
        if ((ibuf[28] != NOT_COMPRESSED) && (ibuf[28] != COMPRESSED)) {
                LOG("illegal compression %d\n",ibuf[28]);
                mutex_unlock(&cam->param_lock);
                return -1;
        }
        compressed = (ibuf[28] == COMPRESSED);
-       
+
        if (ibuf[29] != NO_DECIMATION && ibuf[29] != DECIMATION_ENAB) {
                LOG("illegal decimation %d\n",ibuf[29]);
                mutex_unlock(&cam->param_lock);
                return -1;
        }
-       decimation = (ibuf[29] == DECIMATION_ENAB);     
+       decimation = (ibuf[29] == DECIMATION_ENAB);
 
        cam->params.yuvThreshold.yThreshold = ibuf[30];
        cam->params.yuvThreshold.uvThreshold = ibuf[31];
@@ -2131,7 +2131,7 @@ static int parse_picture(struct cam_data *cam, int size)
        cam->params.status.errorCode = ibuf[39];
        cam->fps = ibuf[41];
        mutex_unlock(&cam->param_lock);
-       
+
        linesize = skipcount(cols, out_fmt);
        ibuf += FRAME_HEADER_SIZE;
        size -= FRAME_HEADER_SIZE;
@@ -2150,14 +2150,14 @@ static int parse_picture(struct cam_data *cam, int size)
                        if (!compressed || (compressed && !(*ibuf & 1))) {
                                if(subsample_422 || even_line) {
                                obuf += yuvconvert(ibuf, obuf, out_fmt,
-                                                  in_uyvy, cam->mmap_kludge);
+                                                  in_uyvy, cam->mmap_kludge);
                                ibuf += 4;
                                ll -= 4;
                        } else {
                                        /* SUBSAMPLE_420 on an odd line */
                                        obuf += convert420(ibuf, obuf,
-                                                          out_fmt, linesize,
-                                                          cam->mmap_kludge);
+                                                          out_fmt, linesize,
+                                                          cam->mmap_kludge);
                                        ibuf += 2;
                                        ll -= 2;
                                }
@@ -2183,7 +2183,7 @@ static int parse_picture(struct cam_data *cam, int size)
 
                        if ((size > 3) && (ibuf[0] == EOI) && (ibuf[1] == EOI) &&
                           (ibuf[2] == EOI) && (ibuf[3] == EOI)) {
-                               size -= 4;
+                               size -= 4;
                                break;
                        }
 
@@ -2204,7 +2204,7 @@ static int parse_picture(struct cam_data *cam, int size)
                        return -1;
                }
        }
-       
+
        if(decimation) {
                /* interpolate odd rows */
                int i, j;
@@ -2233,7 +2233,7 @@ static int parse_picture(struct cam_data *cam, int size)
 static inline int init_stream_cap(struct cam_data *cam)
 {
        return do_command(cam, CPIA_COMMAND_InitStreamCap,
-                         0, cam->params.streamStartLine, 0, 0);
+                         0, cam->params.streamStartLine, 0, 0);
 }
 
 
@@ -2254,7 +2254,7 @@ static int find_over_exposure(int brightness)
        int MaxAllowableOverExposure, OverExposure;
 
        MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness -
-                                  FLICKER_BRIGHTNESS_CONSTANT;
+                                  FLICKER_BRIGHTNESS_CONSTANT;
 
        if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) {
                OverExposure = MaxAllowableOverExposure;
@@ -2280,62 +2280,62 @@ static void dispatch_commands(struct cam_data *cam)
        DEB_BYTE(cam->cmd_queue>>8);
        if (cam->cmd_queue & COMMAND_SETFORMAT) {
                do_command(cam, CPIA_COMMAND_SetFormat,
-                          cam->params.format.videoSize,
-                          cam->params.format.subSample,
-                          cam->params.format.yuvOrder, 0);
+                          cam->params.format.videoSize,
+                          cam->params.format.subSample,
+                          cam->params.format.yuvOrder, 0);
                do_command(cam, CPIA_COMMAND_SetROI,
-                          cam->params.roi.colStart, cam->params.roi.colEnd,
-                          cam->params.roi.rowStart, cam->params.roi.rowEnd);
+                          cam->params.roi.colStart, cam->params.roi.colEnd,
+                          cam->params.roi.rowStart, cam->params.roi.rowEnd);
                cam->first_frame = 1;
        }
 
        if (cam->cmd_queue & COMMAND_SETCOLOURPARAMS)
                do_command(cam, CPIA_COMMAND_SetColourParams,
-                          cam->params.colourParams.brightness,
-                          cam->params.colourParams.contrast,
-                          cam->params.colourParams.saturation, 0);
+                          cam->params.colourParams.brightness,
+                          cam->params.colourParams.contrast,
+                          cam->params.colourParams.saturation, 0);
 
        if (cam->cmd_queue & COMMAND_SETAPCOR)
                do_command(cam, CPIA_COMMAND_SetApcor,
-                          cam->params.apcor.gain1,
-                          cam->params.apcor.gain2,
-                          cam->params.apcor.gain4,
-                          cam->params.apcor.gain8);
+                          cam->params.apcor.gain1,
+                          cam->params.apcor.gain2,
+                          cam->params.apcor.gain4,
+                          cam->params.apcor.gain8);
 
        if (cam->cmd_queue & COMMAND_SETVLOFFSET)
                do_command(cam, CPIA_COMMAND_SetVLOffset,
-                          cam->params.vlOffset.gain1,
-                          cam->params.vlOffset.gain2,
-                          cam->params.vlOffset.gain4,
-                          cam->params.vlOffset.gain8);
+                          cam->params.vlOffset.gain1,
+                          cam->params.vlOffset.gain2,
+                          cam->params.vlOffset.gain4,
+                          cam->params.vlOffset.gain8);
 
        if (cam->cmd_queue & COMMAND_SETEXPOSURE) {
                do_command_extended(cam, CPIA_COMMAND_SetExposure,
-                                   cam->params.exposure.gainMode,
-                                   1,
-                                   cam->params.exposure.compMode,
-                                   cam->params.exposure.centreWeight,
-                                   cam->params.exposure.gain,
-                                   cam->params.exposure.fineExp,
-                                   cam->params.exposure.coarseExpLo,
-                                   cam->params.exposure.coarseExpHi,
-                                   cam->params.exposure.redComp,
-                                   cam->params.exposure.green1Comp,
-                                   cam->params.exposure.green2Comp,
-                                   cam->params.exposure.blueComp);
+                                   cam->params.exposure.gainMode,
+                                   1,
+                                   cam->params.exposure.compMode,
+                                   cam->params.exposure.centreWeight,
+                                   cam->params.exposure.gain,
+                                   cam->params.exposure.fineExp,
+                                   cam->params.exposure.coarseExpLo,
+                                   cam->params.exposure.coarseExpHi,
+                                   cam->params.exposure.redComp,
+                                   cam->params.exposure.green1Comp,
+                                   cam->params.exposure.green2Comp,
+                                   cam->params.exposure.blueComp);
                if(cam->params.exposure.expMode != 1) {
                        do_command_extended(cam, CPIA_COMMAND_SetExposure,
-                                           0,
-                                           cam->params.exposure.expMode,
-                                           0, 0,
-                                           cam->params.exposure.gain,
-                                           cam->params.exposure.fineExp,
-                                           cam->params.exposure.coarseExpLo,
-                                           cam->params.exposure.coarseExpHi,
-                                           0, 0, 0, 0);
+                                           0,
+                                           cam->params.exposure.expMode,
+                                           0, 0,
+                                           cam->params.exposure.gain,
+                                           cam->params.exposure.fineExp,
+                                           cam->params.exposure.coarseExpLo,
+                                           cam->params.exposure.coarseExpHi,
+                                           0, 0, 0, 0);
                }
        }
-       
+
        if (cam->cmd_queue & COMMAND_SETCOLOURBALANCE) {
                if (cam->params.colourBalance.balanceMode == 1) {
                        do_command(cam, CPIA_COMMAND_SetColourBalance,
@@ -2358,47 +2358,47 @@ static void dispatch_commands(struct cam_data *cam)
 
        if (cam->cmd_queue & COMMAND_SETCOMPRESSIONTARGET)
                do_command(cam, CPIA_COMMAND_SetCompressionTarget,
-                          cam->params.compressionTarget.frTargeting,
-                          cam->params.compressionTarget.targetFR,
-                          cam->params.compressionTarget.targetQ, 0);
+                          cam->params.compressionTarget.frTargeting,
+                          cam->params.compressionTarget.targetFR,
+                          cam->params.compressionTarget.targetQ, 0);
 
        if (cam->cmd_queue & COMMAND_SETYUVTHRESH)
                do_command(cam, CPIA_COMMAND_SetYUVThresh,
-                          cam->params.yuvThreshold.yThreshold,
-                          cam->params.yuvThreshold.uvThreshold, 0, 0);
+                          cam->params.yuvThreshold.yThreshold,
+                          cam->params.yuvThreshold.uvThreshold, 0, 0);
 
        if (cam->cmd_queue & COMMAND_SETCOMPRESSIONPARAMS)
                do_command_extended(cam, CPIA_COMMAND_SetCompressionParams,
-                           0, 0, 0, 0,
-                           cam->params.compressionParams.hysteresis,
-                           cam->params.compressionParams.threshMax,
-                           cam->params.compressionParams.smallStep,
-                           cam->params.compressionParams.largeStep,
-                           cam->params.compressionParams.decimationHysteresis,
-                           cam->params.compressionParams.frDiffStepThresh,
-                           cam->params.compressionParams.qDiffStepThresh,
-                           cam->params.compressionParams.decimationThreshMod);
+                           0, 0, 0, 0,
+                           cam->params.compressionParams.hysteresis,
+                           cam->params.compressionParams.threshMax,
+                           cam->params.compressionParams.smallStep,
+                           cam->params.compressionParams.largeStep,
+                           cam->params.compressionParams.decimationHysteresis,
+                           cam->params.compressionParams.frDiffStepThresh,
+                           cam->params.compressionParams.qDiffStepThresh,
+                           cam->params.compressionParams.decimationThreshMod);
 
        if (cam->cmd_queue & COMMAND_SETCOMPRESSION)
                do_command(cam, CPIA_COMMAND_SetCompression,
-                          cam->params.compression.mode,
+                          cam->params.compression.mode,
                           cam->params.compression.decimation, 0, 0);
 
        if (cam->cmd_queue & COMMAND_SETSENSORFPS)
                do_command(cam, CPIA_COMMAND_SetSensorFPS,
-                          cam->params.sensorFps.divisor,
-                          cam->params.sensorFps.baserate, 0, 0);
+                          cam->params.sensorFps.divisor,
+                          cam->params.sensorFps.baserate, 0, 0);
 
        if (cam->cmd_queue & COMMAND_SETFLICKERCTRL)
                do_command(cam, CPIA_COMMAND_SetFlickerCtrl,
-                          cam->params.flickerControl.flickerMode,
-                          cam->params.flickerControl.coarseJump,
-                          abs(cam->params.flickerControl.allowableOverExposure),
-                          0);
+                          cam->params.flickerControl.flickerMode,
+                          cam->params.flickerControl.coarseJump,
+                          abs(cam->params.flickerControl.allowableOverExposure),
+                          0);
 
        if (cam->cmd_queue & COMMAND_SETECPTIMING)
                do_command(cam, CPIA_COMMAND_SetECPTiming,
-                          cam->params.ecpTiming, 0, 0, 0);
+                          cam->params.ecpTiming, 0, 0, 0);
 
        if (cam->cmd_queue & COMMAND_PAUSE)
                do_command(cam, CPIA_COMMAND_EndStreamCap, 0, 0, 0, 0);
@@ -2409,9 +2409,9 @@ static void dispatch_commands(struct cam_data *cam)
        if (cam->cmd_queue & COMMAND_SETLIGHTS && cam->params.qx3.qx3_detected)
          {
            int p1 = (cam->params.qx3.bottomlight == 0) << 1;
-            int p2 = (cam->params.qx3.toplight == 0) << 3;
-            do_command(cam, CPIA_COMMAND_WriteVCReg,  0x90, 0x8F, 0x50, 0);
-            do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0);
+           int p2 = (cam->params.qx3.toplight == 0) << 3;
+           do_command(cam, CPIA_COMMAND_WriteVCReg,  0x90, 0x8F, 0x50, 0);
+           do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0);
          }
 
        cam->cmd_queue = COMMAND_NONE;
@@ -2422,11 +2422,11 @@ static void dispatch_commands(struct cam_data *cam)
 
 
 static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
-                        int on)
+                       int on)
 {
        /* Everything in here is from the Windows driver */
 #define FIRMWARE_VERSION(x,y) (params->version.firmwareVersion == (x) && \
-                               params->version.firmwareRevision == (y))
+                              params->version.firmwareRevision == (y))
 /* define for compgain calculation */
 #if 0
 #define COMPGAIN(base, curexp, newexp) \
@@ -2441,7 +2441,7 @@ static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
      (u16)(((u32)(curexp * (u8)(curcomp + 128)) / (u8)(basecomp - 128)))
 #endif
 
+
        int currentexp = params->exposure.coarseExpLo +
                         params->exposure.coarseExpHi*256;
        int startexp;
@@ -2482,7 +2482,7 @@ static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
                }
                if(FIRMWARE_VERSION(1,2))
                        params->exposure.compMode = 0;
-               else 
+               else
                        params->exposure.compMode = 1;
 
                params->apcor.gain1 = 0x18;
@@ -2533,14 +2533,14 @@ static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
 }
 
 #define FIRMWARE_VERSION(x,y) (cam->params.version.firmwareVersion == (x) && \
-                               cam->params.version.firmwareRevision == (y))
+                              cam->params.version.firmwareRevision == (y))
 /* monitor the exposure and adjust the sensor frame rate if needed */
 static void monitor_exposure(struct cam_data *cam)
 {
        u8 exp_acc, bcomp, gain, coarseL, cmd[8], data[8];
        int retval, light_exp, dark_exp, very_dark_exp;
        int old_exposure, new_exposure, framerate;
-       
+
        /* get necessary stats and register settings from camera */
        /* do_command can't handle this, so do it ourselves */
        cmd[0] = CPIA_COMMAND_ReadVPRegs>>8;
@@ -2564,17 +2564,17 @@ static void monitor_exposure(struct cam_data *cam)
 
        mutex_lock(&cam->param_lock);
        light_exp = cam->params.colourParams.brightness +
-                   TC - 50 + EXP_ACC_LIGHT;
+                   TC - 50 + EXP_ACC_LIGHT;
        if(light_exp > 255)
                light_exp = 255;
        dark_exp = cam->params.colourParams.brightness +
-                  TC - 50 - EXP_ACC_DARK;
+                  TC - 50 - EXP_ACC_DARK;
        if(dark_exp < 0)
                dark_exp = 0;
        very_dark_exp = dark_exp/2;
-       
+
        old_exposure = cam->params.exposure.coarseExpHi * 256 +
-                      cam->params.exposure.coarseExpLo;
+                      cam->params.exposure.coarseExpLo;
 
        if(!cam->params.flickerControl.disabled) {
                /* Flicker control on */
@@ -2667,11 +2667,11 @@ static void monitor_exposure(struct cam_data *cam)
                        cam->exposure_status = EXPOSURE_NORMAL;
                }
        }
-       
+
        framerate = cam->fps;
        if(framerate > 30 || framerate < 1)
                framerate = 1;
-       
+
        if(!cam->params.flickerControl.disabled) {
                /* Flicker control on */
                if((cam->exposure_status == EXPOSURE_VERY_DARK ||
@@ -2683,10 +2683,10 @@ static void monitor_exposure(struct cam_data *cam)
                        ++cam->params.sensorFps.divisor;
                        cam->cmd_queue |= COMMAND_SETSENSORFPS;
 
-                       cam->params.flickerControl.coarseJump = 
+                       cam->params.flickerControl.coarseJump =
                                flicker_jumps[cam->mainsFreq]
-                                            [cam->params.sensorFps.baserate]
-                                            [cam->params.sensorFps.divisor];
+                                            [cam->params.sensorFps.baserate]
+                                            [cam->params.sensorFps.divisor];
                        cam->cmd_queue |= COMMAND_SETFLICKERCTRL;
 
                        new_exposure = cam->params.flickerControl.coarseJump-1;
@@ -2704,15 +2704,15 @@ static void monitor_exposure(struct cam_data *cam)
                   cam->params.sensorFps.divisor > 0) {
 
                        /* light for too long */
-                       int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ; 
+                       int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ;
 
                        --cam->params.sensorFps.divisor;
                        cam->cmd_queue |= COMMAND_SETSENSORFPS;
 
-                       cam->params.flickerControl.coarseJump = 
+                       cam->params.flickerControl.coarseJump =
                                flicker_jumps[cam->mainsFreq]
-                                            [cam->params.sensorFps.baserate]
-                                            [cam->params.sensorFps.divisor];
+                                            [cam->params.sensorFps.baserate]
+                                            [cam->params.sensorFps.divisor];
                        cam->cmd_queue |= COMMAND_SETFLICKERCTRL;
 
                        new_exposure = cam->params.flickerControl.coarseJump-1;
@@ -2772,7 +2772,7 @@ static void monitor_exposure(struct cam_data *cam)
 
    It also adjust the colour balance when an exposure step is detected - as
    long as flicker is running
-*/   
+*/
 static void restart_flicker(struct cam_data *cam)
 {
        int cam_exposure, old_exp;
@@ -2786,22 +2786,22 @@ static void restart_flicker(struct cam_data *cam)
        }
        cam_exposure = cam->raw_image[39]*2;
        old_exp = cam->params.exposure.coarseExpLo +
-                 cam->params.exposure.coarseExpHi*256;
-       /* 
-         see how far away camera exposure is from a valid 
-         flicker exposure value
-       */
-       cam_exposure %= cam->params.flickerControl.coarseJump;
+                 cam->params.exposure.coarseExpHi*256;
+       /*
+         see how far away camera exposure is from a valid
+         flicker exposure value
+       */
+       cam_exposure %= cam->params.flickerControl.coarseJump;
        if(!cam->params.flickerControl.disabled &&
-          cam_exposure <= cam->params.flickerControl.coarseJump - 3) {
+          cam_exposure <= cam->params.flickerControl.coarseJump - 3) {
                /* Flicker control auto-disabled */
                cam->params.flickerControl.disabled = 1;
        }
-       
+
        if(cam->params.flickerControl.disabled &&
           cam->params.flickerControl.flickerMode &&
           old_exp > cam->params.flickerControl.coarseJump +
-                    ROUND_UP_EXP_FOR_FLICKER) {
+                    ROUND_UP_EXP_FOR_FLICKER) {
                /* exposure is now high enough to switch
                   flicker control back on */
                set_flicker(&cam->params, &cam->cmd_queue, 1);
@@ -2818,7 +2818,7 @@ static int clear_stall(struct cam_data *cam)
 {
        /* FIXME: Does this actually work? */
        LOG("Clearing stall\n");
-       
+
        cam->ops->streamRead(cam->lowlevel_data, cam->raw_image, 0);
        do_command(cam, CPIA_COMMAND_GetCameraStatus,0,0,0,0);
        return cam->params.status.streamState != STREAM_PAUSED;
@@ -2878,7 +2878,7 @@ static int fetch_frame(void *data)
                                        return -EINTR;
 
                                do_command(cam, CPIA_COMMAND_GetCameraStatus,
-                                          0, 0, 0, 0);
+                                          0, 0, 0, 0);
                        }
                        if(cam->params.status.streamState != STREAM_READY) {
                                continue;
@@ -2903,18 +2903,18 @@ static int fetch_frame(void *data)
 
                /* Switch flicker control back on if it got turned off */
                restart_flicker(cam);
-               
+
                /* If AEC is enabled, monitor the exposure and
                   adjust the sensor frame rate if needed */
                if(cam->params.exposure.expMode == 2)
                        monitor_exposure(cam);
-               
+
                /* camera idle now so dispatch queued commands */
                dispatch_commands(cam);
 
                /* Update our knowledge of the camera state */
-               do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0);
-               do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0);
+               do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0);
+               do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0);
                do_command(cam, CPIA_COMMAND_ReadMCPorts, 0, 0, 0, 0);
 
                /* decompress and convert image to by copying it from
@@ -2933,7 +2933,7 @@ static int fetch_frame(void *data)
                                   uncompressed. */
                                cam->first_frame = 1;
                                do_command(cam, CPIA_COMMAND_SetGrabMode,
-                                          CPIA_GRAB_SINGLE, 0, 0, 0);
+                                          CPIA_GRAB_SINGLE, 0, 0, 0);
                                /* FIXME: Trial & error - need up to 70ms for
                                   the grab mode change to complete ? */
                                msleep_interruptible(70);
@@ -2957,12 +2957,12 @@ static int fetch_frame(void *data)
                if (cam->first_frame) {
                        cam->first_frame = 0;
                        do_command(cam, CPIA_COMMAND_SetCompression,
-                                  cam->params.compression.mode,
+                                  cam->params.compression.mode,
                                   cam->params.compression.decimation, 0, 0);
 
                        /* Switch from single-grab to continuous grab */
                        do_command(cam, CPIA_COMMAND_SetGrabMode,
-                                  CPIA_GRAB_CONTINUOUS, 0, 0, 0);
+                                  CPIA_GRAB_CONTINUOUS, 0, 0, 0);
                }
                return 0;
        }
@@ -2977,12 +2977,12 @@ static int capture_frame(struct cam_data *cam, struct video_mmap *vm)
                if ((err = allocate_frame_buf(cam)))
                        return err;
        }
-       
+
        cam->curframe = vm->frame;
        cam->frame[cam->curframe].state = FRAME_READY;
        return fetch_frame(cam);
 }
-  
+
 static int goto_high_power(struct cam_data *cam)
 {
        if (do_command(cam, CPIA_COMMAND_GotoHiPower, 0, 0, 0, 0))
@@ -3039,22 +3039,22 @@ static void save_camera_state(struct cam_data *cam)
 static int set_camera_state(struct cam_data *cam)
 {
        cam->cmd_queue = COMMAND_SETCOMPRESSION |
-                        COMMAND_SETCOMPRESSIONTARGET |
-                        COMMAND_SETCOLOURPARAMS |
-                        COMMAND_SETFORMAT |
-                        COMMAND_SETYUVTHRESH |
-                        COMMAND_SETECPTIMING |
-                        COMMAND_SETCOMPRESSIONPARAMS |
-                        COMMAND_SETEXPOSURE |
-                        COMMAND_SETCOLOURBALANCE |
-                        COMMAND_SETSENSORFPS |
-                        COMMAND_SETAPCOR |
-                        COMMAND_SETFLICKERCTRL |
-                        COMMAND_SETVLOFFSET;
+                        COMMAND_SETCOMPRESSIONTARGET |
+                        COMMAND_SETCOLOURPARAMS |
+                        COMMAND_SETFORMAT |
+                        COMMAND_SETYUVTHRESH |
+                        COMMAND_SETECPTIMING |
+                        COMMAND_SETCOMPRESSIONPARAMS |
+                        COMMAND_SETEXPOSURE |
+                        COMMAND_SETCOLOURBALANCE |
+                        COMMAND_SETSENSORFPS |
+                        COMMAND_SETAPCOR |
+                        COMMAND_SETFLICKERCTRL |
+                        COMMAND_SETVLOFFSET;
 
        do_command(cam, CPIA_COMMAND_SetGrabMode, CPIA_GRAB_SINGLE,0,0,0);
        dispatch_commands(cam);
-       
+
        /* Wait 6 frames for the sensor to get all settings and
           AEC/ACB to settle */
        msleep_interruptible(6*(cam->params.sensorFps.baserate ? 33 : 40) *
@@ -3062,7 +3062,7 @@ static int set_camera_state(struct cam_data *cam)
 
        if(signal_pending(current))
                return -EINTR;
-       
+
        save_camera_state(cam);
 
        return 0;
@@ -3094,9 +3094,9 @@ static int reset_camera(struct cam_data *cam)
                if (goto_low_power(cam))
                        return -ENODEV;
        }
-       
+
        /* procedure described in developer's guide p3-28 */
-       
+
        /* Check the firmware version. */
        cam->params.version.firmwareVersion = 0;
        get_version_information(cam);
@@ -3113,14 +3113,14 @@ static int reset_camera(struct cam_data *cam)
        cam->params.qx3.qx3_detected = (cam->params.pnpID.vendor == 0x0813 &&
                                        cam->params.pnpID.product == 0x0001);
 
-       /* The fatal error checking should be done after
+       /* The fatal error checking should be done after
         * the camera powers up (developer's guide p 3-38) */
 
        /* Set streamState before transition to high power to avoid bug
         * in firmware 1-02 */
        do_command(cam, CPIA_COMMAND_ModifyCameraStatus, STREAMSTATE, 0,
-                  STREAM_NOT_READY, 0);
-       
+                  STREAM_NOT_READY, 0);
+
        /* GotoHiPower */
        err = goto_high_power(cam);
        if (err)
@@ -3142,16 +3142,16 @@ static int reset_camera(struct cam_data *cam)
                        /* Firmware 1-02 may do this for parallel port cameras,
                         * just clear the flags (developer's guide p 3-38) */
                        do_command(cam, CPIA_COMMAND_ModifyCameraStatus,
-                                  FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0);
+                                  FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0);
                }
        }
-       
+
        /* Check the camera status again */
        if (cam->params.status.fatalError) {
                if (cam->params.status.fatalError)
                        return -EIO;
        }
-       
+
        /* VPVersion can't be retrieved before the camera is in HiPower,
         * so get it here instead of in get_version_information. */
        do_command(cam, CPIA_COMMAND_GetVPVersion, 0, 0, 0, 0);
@@ -3193,24 +3193,24 @@ static int cpia_open(struct inode *inode, struct file *file)
                if (!cam->raw_image)
                        goto oops;
        }
-       
+
        if (!cam->decompressed_frame.data) {
                cam->decompressed_frame.data = rvmalloc(CPIA_MAX_FRAME_SIZE);
                if (!cam->decompressed_frame.data)
                        goto oops;
        }
-       
+
        /* open cpia */
        err = -ENODEV;
        if (cam->ops->open(cam->lowlevel_data))
                goto oops;
-       
+
        /* reset the camera */
        if ((err = reset_camera(cam)) != 0) {
                cam->ops->close(cam->lowlevel_data);
                goto oops;
        }
-       
+
        err = -EINTR;
        if(signal_pending(current))
                goto oops;
@@ -3224,7 +3224,7 @@ static int cpia_open(struct inode *inode, struct file *file)
 
        /* init it to something */
        cam->mmap_kludge = 0;
-       
+
        ++cam->open_count;
        file->private_data = dev;
        mutex_unlock(&cam->busy_lock);
@@ -3250,10 +3250,10 @@ static int cpia_close(struct inode *inode, struct file *file)
        struct cam_data *cam = dev->priv;
 
        if (cam->ops) {
-               /* Return ownership of /proc/cpia/videoX to root */
+               /* Return ownership of /proc/cpia/videoX to root */
                if(cam->proc_entry)
                        cam->proc_entry->uid = 0;
-       
+
                /* save camera state for later open (developers guide ch 3.5.3) */
                save_camera_state(cam);
 
@@ -3342,7 +3342,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf,
                return -EFAULT;
        }
        if (copy_to_user(buf, cam->decompressed_frame.data,
-                       cam->decompressed_frame.count)) {
+                       cam->decompressed_frame.count)) {
                DBG("copy_to_user failed\n");
                mutex_unlock(&cam->busy_lock);
                return -EFAULT;
@@ -3361,7 +3361,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
        if (!cam || !cam->ops)
                return -ENODEV;
-       
+
        /* make this _really_ smp-safe */
        if (mutex_lock_interruptible(&cam->busy_lock))
                return -EINTR;
@@ -3405,7 +3405,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                v->norm = 0;
                break;
        }
-       
+
        case VIDIOCSCHAN:
        {
                struct video_channel *v = arg;
@@ -3424,7 +3424,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                *pic = cam->vp;
                break;
        }
-       
+
        case VIDIOCSPICT:
        {
                struct video_picture *vp = arg;
@@ -3458,11 +3458,11 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
                /* Adjust flicker control if necessary */
                if(cam->params.flickerControl.allowableOverExposure < 0)
-                       cam->params.flickerControl.allowableOverExposure = 
+                       cam->params.flickerControl.allowableOverExposure =
                                -find_over_exposure(cam->params.colourParams.brightness);
                if(cam->params.flickerControl.flickerMode != 0)
                        cam->cmd_queue |= COMMAND_SETFLICKERCTRL;
-               
+
 
                /* queue command to update camera */
                cam->cmd_queue |= COMMAND_SETCOLOURPARAMS;
@@ -3482,7 +3482,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                *vw = cam->vw;
                break;
        }
-       
+
        case VIDIOCSWIN:
        {
                /* copy_from_user, check validity, copy to internal structure */
@@ -3514,7 +3514,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
                        /* video size is changing, reset the subcapture area */
                        memset(&cam->vc, 0, sizeof(cam->vc));
-                       
+
                        set_vw_size(cam);
                        DBG("%d / %d\n", cam->vw.width, cam->vw.height);
                        cam->cmd_queue |= COMMAND_SETFORMAT;
@@ -3547,7 +3547,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                        vm->offsets[i] = CPIA_MAX_FRAME_SIZE * i;
                break;
        }
-       
+
        case VIDIOCMCAPTURE:
        {
                struct video_mmap *vm = arg;
@@ -3597,7 +3597,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
                        /* video size is changing, reset the subcapture area */
                        memset(&cam->vc, 0, sizeof(cam->vc));
-                       
+
                        set_vw_size(cam);
                        cam->cmd_queue |= COMMAND_SETFORMAT;
                        dispatch_commands(cam);
@@ -3608,7 +3608,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
                break;
        }
-       
+
        case VIDIOCSYNC:
        {
                int *frame = arg;
@@ -3649,7 +3649,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                *vc = cam->vc;
 
                break;
-       }       
+       }
 
        case VIDIOCSCAPTURE:
        {
@@ -3665,7 +3665,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                        retval = -EINVAL;
                        break;
                }
-               
+
                /* Clip to the resolution we can set for the ROI
                   (every 8 columns and 4 rows) */
                vc->x      = vc->x      & ~(__u32)7;
@@ -3681,14 +3681,14 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                }
 
                DBG("%d,%d/%dx%d\n", vc->x,vc->y,vc->width, vc->height);
-               
+
                mutex_lock(&cam->param_lock);
-               
+
                cam->vc.x      = vc->x;
                cam->vc.y      = vc->y;
                cam->vc.width  = vc->width;
                cam->vc.height = vc->height;
-               
+
                set_vw_size(cam);
                cam->cmd_queue |= COMMAND_SETFORMAT;
 
@@ -3699,7 +3699,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                dispatch_commands(cam);
                break;
        }
-       
+
        case VIDIOCGUNIT:
        {
                struct video_unit *vu = arg;
@@ -3715,7 +3715,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
                break;
        }
 
-               
+
        /* pointless to implement overlay with this camera */
        case VIDIOCCAPTURE:
        case VIDIOCGFBUF:
@@ -3738,7 +3738,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
 
        mutex_unlock(&cam->busy_lock);
        return retval;
-} 
+}
 
 static int cpia_ioctl(struct inode *inode, struct file *file,
                     unsigned int cmd, unsigned long arg)
@@ -3759,7 +3759,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
 
        if (!cam || !cam->ops)
                return -ENODEV;
-       
+
        DBG("cpia_mmap: %ld\n", size);
 
        if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE)
@@ -3767,7 +3767,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
 
        if (!cam || !cam->ops)
                return -ENODEV;
-       
+
        /* make this _really_ smp-safe */
        if (mutex_lock_interruptible(&cam->busy_lock))
                return -EINTR;
@@ -3851,11 +3851,11 @@ static void reset_camera_struct(struct cam_data *cam)
        cam->params.flickerControl.flickerMode = 0;
        cam->params.flickerControl.disabled = 1;
 
-       cam->params.flickerControl.coarseJump = 
+       cam->params.flickerControl.coarseJump =
                flicker_jumps[cam->mainsFreq]
-                            [cam->params.sensorFps.baserate]
-                            [cam->params.sensorFps.divisor];
-       cam->params.flickerControl.allowableOverExposure = 
+                            [cam->params.sensorFps.baserate]
+                            [cam->params.sensorFps.divisor];
+       cam->params.flickerControl.allowableOverExposure =
                -find_over_exposure(cam->params.colourParams.brightness);
        cam->params.vlOffset.gain1 = 20;
        cam->params.vlOffset.gain2 = 24;
@@ -3870,21 +3870,21 @@ static void reset_camera_struct(struct cam_data *cam)
        cam->params.compressionParams.qDiffStepThresh = 3;
        cam->params.compressionParams.decimationThreshMod = 2;
        /* End of default values from Software Developer's Guide */
-       
+
        cam->transfer_rate = 0;
        cam->exposure_status = EXPOSURE_NORMAL;
-       
+
        /* Set Sensor FPS to 15fps. This seems better than 30fps
         * for indoor lighting. */
        cam->params.sensorFps.divisor = 1;
        cam->params.sensorFps.baserate = 1;
-       
+
        cam->params.yuvThreshold.yThreshold = 6; /* From windows driver */
        cam->params.yuvThreshold.uvThreshold = 6; /* From windows driver */
-       
+
        cam->params.format.subSample = SUBSAMPLE_422;
        cam->params.format.yuvOrder = YUVORDER_YUYV;
-       
+
        cam->params.compression.mode = CPIA_COMPRESSION_AUTO;
        cam->params.compressionTarget.frTargeting =
                CPIA_COMPRESSION_TARGET_QUALITY;
@@ -3898,7 +3898,7 @@ static void reset_camera_struct(struct cam_data *cam)
        cam->params.qx3.cradled = 0;
 
        cam->video_size = VIDEOSIZE_CIF;
-       
+
        cam->vp.colour = 32768;      /* 50% */
        cam->vp.hue = 32768;         /* 50% */
        cam->vp.brightness = 32768;  /* 50% */
@@ -3911,7 +3911,7 @@ static void reset_camera_struct(struct cam_data *cam)
        cam->vc.y = 0;
        cam->vc.width = 0;
        cam->vc.height = 0;
-       
+
        cam->vw.x = 0;
        cam->vw.y = 0;
        set_vw_size(cam);
@@ -3928,7 +3928,7 @@ static void reset_camera_struct(struct cam_data *cam)
 
 /* initialize cam_data structure  */
 static void init_camera_struct(struct cam_data *cam,
-                               struct cpia_camera_ops *ops )
+                              struct cpia_camera_ops *ops )
 {
        int i;
 
@@ -3945,7 +3945,7 @@ static void init_camera_struct(struct cam_data *cam,
 
        memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template));
        cam->vdev.priv = cam;
-       
+
        cam->curframe = 0;
        for (i = 0; i < FRAME_NUM; i++) {
                cam->frame[i].width = 0;
@@ -3961,15 +3961,15 @@ static void init_camera_struct(struct cam_data *cam,
 
 struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowlevel)
 {
-        struct cam_data *camera;
-       
+       struct cam_data *camera;
+
        if ((camera = kmalloc(sizeof(struct cam_data), GFP_KERNEL)) == NULL)
                return NULL;
 
-       
+
        init_camera_struct( camera, ops );
        camera->lowlevel_data = lowlevel;
-       
+
        /* register v4l device */
        if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
                kfree(camera);
@@ -3982,7 +3982,7 @@ struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowleve
        /* open cpia */
        if (camera->ops->open(camera->lowlevel_data))
                return camera;
-       
+
        /* reset the camera */
        if (reset_camera(camera) != 0) {
                camera->ops->close(camera->lowlevel_data);
@@ -4022,11 +4022,11 @@ void cpia_unregister_camera(struct cam_data *cam)
                DBG("camera open -- setting ops to NULL\n");
                cam->ops = NULL;
        }
-       
+
 #ifdef CONFIG_PROC_FS
        DBG("destroying /proc/cpia/video%d\n", cam->vdev.minor);
        destroy_proc_cpia_cam(cam);
-#endif 
+#endif
        if (!cam->open_count) {
                DBG("freeing camera\n");
                kfree(cam);
index de66782..dde27a6 100644 (file)
 struct cpia_camera_ops
 {
        /* open sets privdata to point to structure for this camera.
-         * Returns negative value on error, otherwise 0.
+        * Returns negative value on error, otherwise 0.
         */
        int (*open)(void *privdata);
-       
+
        /* Registers callback function cb to be called with cbdata
         * when an image is ready.  If cb is NULL, only single image grabs
         * should be used.  cb should immediately call streamRead to read
@@ -63,8 +63,8 @@ struct cpia_camera_ops
         * otherwise 0.
         */
        int (*registerCallback)(void *privdata, void (*cb)(void *cbdata),
-                               void *cbdata);
-       
+                               void *cbdata);
+
        /* transferCmd sends commands to the camera.  command MUST point to
         * an  8 byte buffer in kernel space. data can be NULL if no extra
         * data is needed.  The size of the data is given by the last 2
@@ -77,30 +77,30 @@ struct cpia_camera_ops
         * Returns negative value on error, otherwise 0.
         */
        int (*streamStart)(void *privdata);
-       
+
        /* streamStop terminates stream capture mode.
         * Returns negative value on error, otherwise 0.
         */
        int (*streamStop)(void *privdata);
-        
+
        /* streamRead reads a frame from the camera.  buffer points to a
-         * buffer large enough to hold a complete frame in kernel space.
-         * noblock indicates if this should be a non blocking read.
+        * buffer large enough to hold a complete frame in kernel space.
+        * noblock indicates if this should be a non blocking read.
         * Returns the number of bytes read, or negative value on error.
-         */
+        */
        int (*streamRead)(void *privdata, u8 *buffer, int noblock);
-       
+
        /* close disables the device until open() is called again.
         * Returns negative value on error, otherwise 0.
         */
        int (*close)(void *privdata);
-       
+
        /* If wait_for_stream_ready is non-zero, wait until the streamState
         * is STREAM_READY before calling streamRead.
         */
        int wait_for_stream_ready;
 
-       /* 
+       /*
         * Used to maintain lowlevel module usage counts
         */
        struct module *owner;
@@ -215,14 +215,14 @@ struct cam_params {
                u8 videoSize;           /* CIF/QCIF */
                u8 subSample;
                u8 yuvOrder;
-       } format;
-        struct {                        /* Intel QX3 specific data */
-                u8 qx3_detected;        /* a QX3 is present */
-                u8 toplight;            /* top light lit , R/W */
-                u8 bottomlight;         /* bottom light lit, R/W */
-                u8 button;              /* snapshot button pressed (R/O) */
-                u8 cradled;             /* microscope is in cradle (R/O) */
-        } qx3;
+       } format;
+       struct {                        /* Intel QX3 specific data */
+               u8 qx3_detected;        /* a QX3 is present */
+               u8 toplight;            /* top light lit , R/W */
+               u8 bottomlight;         /* bottom light lit, R/W */
+               u8 button;              /* snapshot button pressed (R/O) */
+               u8 cradled;             /* microscope is in cradle (R/O) */
+       } qx3;
        struct {
                u8 colStart;            /* skip first 8*colStart pixels */
                u8 colEnd;              /* finish at 8*colEnd pixels */
@@ -247,13 +247,13 @@ enum v4l_camstates {
 struct cam_data {
        struct list_head cam_data_list;
 
-        struct mutex busy_lock;     /* guard against SMP multithreading */
+       struct mutex busy_lock;     /* guard against SMP multithreading */
        struct cpia_camera_ops *ops;    /* lowlevel driver operations */
        void *lowlevel_data;            /* private data for lowlevel driver */
        u8 *raw_image;                  /* buffer for raw image data */
        struct cpia_frame decompressed_frame;
-                                        /* buffer to hold decompressed frame */
-       int image_size;                 /* sizeof last decompressed image */
+                                       /* buffer to hold decompressed frame */
+       int image_size;                 /* sizeof last decompressed image */
        int open_count;                 /* # of process that have camera open */
 
                                /* camera status */
@@ -265,7 +265,7 @@ struct cam_data {
        struct mutex param_lock;        /* params lock for this camera */
        struct cam_params params;       /* camera settings */
        struct proc_dir_entry *proc_entry;      /* /proc/cpia/videoX */
-       
+
                                        /* v4l */
        int video_size;                 /* VIDEO_SIZE_ */
        volatile enum v4l_camstates camstate;   /* v4l layer status */
@@ -277,7 +277,7 @@ struct cam_data {
                                /* mmap interface */
        int curframe;                   /* the current frame to grab into */
        u8 *frame_buf;                  /* frame buffer data */
-        struct cpia_frame frame[FRAME_NUM];
+       struct cpia_frame frame[FRAME_NUM];
                                /* FRAME_NUM-buffering, so we need a array */
 
        int first_frame;
@@ -424,7 +424,7 @@ void cpia_unregister_camera(struct cam_data *cam);
 #define DEB_BYTE(p)\
   DBG("%1d %1d %1d %1d %1d %1d %1d %1d \n",\
       (p)&0x80?1:0, (p)&0x40?1:0, (p)&0x20?1:0, (p)&0x10?1:0,\
-        (p)&0x08?1:0, (p)&0x04?1:0, (p)&0x02?1:0, (p)&0x01?1:0);
+       (p)&0x08?1:0, (p)&0x04?1:0, (p)&0x02?1:0, (p)&0x01?1:0);
 
 #endif /* __KERNEL__ */
 
index 74cff62..3021f21 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
-/* #define _CPIA_DEBUG_  1 */  
+/* #define _CPIA_DEBUG_  1 */
 
 #include <linux/config.h>
 
@@ -45,7 +45,7 @@
 
 static int cpia_pp_open(void *privdata);
 static int cpia_pp_registerCallback(void *privdata, void (*cb) (void *cbdata),
-                                    void *cbdata);
+                                   void *cbdata);
 static int cpia_pp_transferCmd(void *privdata, u8 *command, u8 *data);
 static int cpia_pp_streamStart(void *privdata);
 static int cpia_pp_streamStop(void *privdata);
@@ -93,7 +93,7 @@ struct pp_cam_entry {
        int stream_irq;
 };
 
-static struct cpia_camera_ops cpia_pp_ops = 
+static struct cpia_camera_ops cpia_pp_ops =
 {
        cpia_pp_open,
        cpia_pp_registerCallback,
@@ -123,7 +123,7 @@ static void cpia_parport_disable_irq( struct parport *port ) {
 }
 
 /* Special CPiA PPC modes: These are invoked by using the 1284 Extensibility
- * Link Flag during negotiation */  
+ * Link Flag during negotiation */
 #define UPLOAD_FLAG  0x08
 #define NIBBLE_TRANSFER 0x01
 #define ECP_TRANSFER 0x03
@@ -139,17 +139,17 @@ static void cpia_parport_disable_irq( struct parport *port ) {
 /*  CPiA nonstandard "Nibble" mode (no nDataAvail signal after each byte). */
 /* The standard kernel parport_ieee1284_read_nibble() fails with the CPiA... */
 
-static size_t cpia_read_nibble (struct parport *port, 
-                        void *buffer, size_t len, 
+static size_t cpia_read_nibble (struct parport *port,
+                        void *buffer, size_t len,
                         int flags)
 {
-       /* adapted verbatim, with one change, from 
+       /* adapted verbatim, with one change, from
           parport_ieee1284_read_nibble() in drivers/parport/ieee1284-ops.c */
 
        unsigned char *buf = buffer;
        int i;
        unsigned char byte = 0;
-       
+
        len *= 2; /* in nibbles */
        for (i=0; i < len; i++) {
                unsigned char nibble;
@@ -158,12 +158,12 @@ static size_t cpia_read_nibble (struct parport *port,
                 * after every second nibble to signal that more
                 * data is available.  (the total number of Bytes that
                 * should be sent is known; if too few are received, an error
-                * will be recorded after a timeout).  
+                * will be recorded after a timeout).
                 * This is incompatible with parport_ieee1284_read_nibble(),
                 * which expects to find nFault LO after every second nibble.
                 */
 
-               /* Solution: modify cpia_read_nibble to only check for 
+               /* Solution: modify cpia_read_nibble to only check for
                 * nDataAvail before the first nibble is sent.
                 */
 
@@ -216,7 +216,7 @@ static size_t cpia_read_nibble (struct parport *port,
                        /* Second nibble */
                        byte |= nibble << 4;
                        *buf++ = byte;
-               } else 
+               } else
                        byte = nibble;
        }
 
@@ -238,18 +238,18 @@ static size_t cpia_read_nibble (struct parport *port,
 }
 
 /* CPiA nonstandard "Nibble Stream" mode (2 nibbles per cycle, instead of 1)
- * (See CPiA Data sheet p. 31) 
- * 
- * "Nibble Stream" mode used by CPiA for uploads to non-ECP ports is a 
- * nonstandard variant of nibble mode which allows the same (mediocre) 
- * data flow of 8 bits per cycle as software-enabled ECP by TRISTATE-capable 
+ * (See CPiA Data sheet p. 31)
+ *
+ * "Nibble Stream" mode used by CPiA for uploads to non-ECP ports is a
+ * nonstandard variant of nibble mode which allows the same (mediocre)
+ * data flow of 8 bits per cycle as software-enabled ECP by TRISTATE-capable
  * parallel ports, but works also for  non-TRISTATE-capable ports.
  * (Standard nibble mode only send 4 bits per cycle)
  *
  */
 
-static size_t cpia_read_nibble_stream(struct parport *port, 
-                              void *buffer, size_t len, 
+static size_t cpia_read_nibble_stream(struct parport *port,
+                              void *buffer, size_t len,
                               int flags)
 {
        int i;
@@ -260,7 +260,7 @@ static size_t cpia_read_nibble_stream(struct parport *port,
                unsigned char nibble[2], byte = 0;
                int j;
 
-               /* Image Data is complete when 4 consecutive EOI bytes (0xff) are seen */ 
+               /* Image Data is complete when 4 consecutive EOI bytes (0xff) are seen */
                if (endseen > 3 )
                        break;
 
@@ -268,7 +268,7 @@ static size_t cpia_read_nibble_stream(struct parport *port,
                parport_frob_control (port,
                                      PARPORT_CONTROL_AUTOFD,
                                      PARPORT_CONTROL_AUTOFD);
-               
+
                /* Event 9: nAck goes low. */
                port->ieee1284.phase = IEEE1284_PH_REV_DATA;
                if (parport_wait_peripheral (port,
@@ -282,7 +282,7 @@ static size_t cpia_read_nibble_stream(struct parport *port,
 
                /* Read lower nibble */
                nibble[0] = parport_read_status (port) >>3;
-               
+
                /* Event 10: Set nAutoFd high. */
                parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
 
@@ -295,10 +295,10 @@ static size_t cpia_read_nibble_stream(struct parport *port,
                                 port->name);
                        break;
                }
-               
+
                /* Read upper nibble */
                nibble[1] = parport_read_status (port) >>3;
-               
+
                /* reassemble the byte */
                for (j = 0; j < 2 ; j++ ) {
                        nibble[j] &= ~8;
@@ -335,8 +335,8 @@ static void EndTransferMode(struct pp_cam_entry *cam)
 static int ForwardSetup(struct pp_cam_entry *cam)
 {
        int retry;
-       
-       /* The CPiA uses ECP protocol for Downloads from the Host to the camera. 
+
+       /* The CPiA uses ECP protocol for Downloads from the Host to the camera.
         * This will be software-emulated if ECP hardware is not present
         */
 
@@ -375,9 +375,9 @@ static int ReverseSetup(struct pp_cam_entry *cam, int extensibility)
        upload_mode = mode;
        if(extensibility) mode = UPLOAD_FLAG|transfer_mode|IEEE1284_EXT_LINK;
 
-       /* the usual camera maximum response time is 10ms, but after 
+       /* the usual camera maximum response time is 10ms, but after
         * receiving some commands, it needs up to 40ms. */
-               
+
        for(retry = 0; retry < 4; ++retry) {
                if(!parport_negotiate(cam->port, mode)) {
                        break;
@@ -439,10 +439,10 @@ static int ReadPacket(struct pp_cam_entry *cam, u8 *packet, size_t size)
 
        /* support for CPiA variant nibble reads */
        if(cam->port->ieee1284.mode == IEEE1284_MODE_NIBBLE) {
-               if(cpia_read_nibble(cam->port, packet, size, 0) != size) 
-                       retval = -EIO;                  
+               if(cpia_read_nibble(cam->port, packet, size, 0) != size)
+                       retval = -EIO;
        } else {
-               if(parport_read(cam->port, packet, size) != size) 
+               if(parport_read(cam->port, packet, size) != size)
                        retval = -EIO;
        }
        EndTransferMode(cam);
@@ -542,18 +542,18 @@ static int cpia_pp_streamRead(void *privdata, u8 *buffer, int noblock)
        block_size = PARPORT_CHUNK_SIZE;
        while( !cam->image_complete ) {
                cond_resched();
-               
+
                new_bytes = cpia_pp_read(cam->port, buffer, block_size );
                if( new_bytes <= 0 ) {
                        break;
                }
                i=-1;
                while(++i<new_bytes && endseen<4) {
-                       if(*buffer==EOI) {
-                               endseen++;
-                       } else {
-                               endseen=0;
-                       }
+                       if(*buffer==EOI) {
+                               endseen++;
+                       } else {
+                               endseen=0;
+                       }
                        buffer++;
                }
                read_bytes += i;
@@ -601,7 +601,7 @@ static int cpia_pp_transferCmd(void *privdata, u8 *command, u8 *data)
                }
                if((err = ReadPacket(cam, buffer, 8)) < 0) {
                        DBG("Error reading command result\n");
-                       return err;
+                      return err;
                }
                memcpy(data, buffer, databytes);
        } else if(command[0] == DATA_OUT) {
@@ -631,10 +631,10 @@ static int cpia_pp_transferCmd(void *privdata, u8 *command, u8 *data)
 static int cpia_pp_open(void *privdata)
 {
        struct pp_cam_entry *cam = (struct pp_cam_entry *)privdata;
-       
+
        if (cam == NULL)
                return -EINVAL;
-       
+
        if(cam->open_count == 0) {
                if (parport_claim(cam->pdev)) {
                        DBG("failed to claim the port\n");
@@ -645,12 +645,12 @@ static int cpia_pp_open(void *privdata)
                parport_write_control(cam->port, PARPORT_CONTROL_SELECT);
                udelay(50);
                parport_write_control(cam->port,
-                                     PARPORT_CONTROL_SELECT
-                                     | PARPORT_CONTROL_INIT);
+                                     PARPORT_CONTROL_SELECT
+                                     | PARPORT_CONTROL_INIT);
        }
-       
+
        ++cam->open_count;
-       
+
        return 0;
 }
 
@@ -663,7 +663,7 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo
 {
        struct pp_cam_entry *cam = privdata;
        int retval = 0;
-       
+
        if(cam->port->irq != PARPORT_IRQ_NONE) {
                INIT_WORK(&cam->cb_task, cb, cbdata);
        } else {
@@ -707,9 +707,9 @@ static int cpia_pp_register(struct parport *port)
                LOG("failed to allocate camera structure\n");
                return -ENOMEM;
        }
-       
+
        pdev = parport_register_device(port, "cpia_pp", NULL, NULL,
-                                      NULL, 0, cam);
+                                      NULL, 0, cam);
 
        if (!pdev) {
                LOG("failed to parport_register_device\n");
@@ -753,19 +753,19 @@ static void cpia_pp_detach (struct parport *port)
                }
                cpia = NULL;
        }
-       spin_unlock( &cam_list_lock_pp );                       
+       spin_unlock( &cam_list_lock_pp );
 
        if (!cpia) {
                DBG("cpia_pp_detach failed to find cam_data in cam_list\n");
                return;
        }
-       
-       cam = (struct pp_cam_entry *) cpia->lowlevel_data;      
+
+       cam = (struct pp_cam_entry *) cpia->lowlevel_data;
        cpia_unregister_camera(cpia);
-       if(cam->open_count > 0) 
+       if(cam->open_count > 0)
                cpia_pp_close(cam);
        parport_unregister_device(cam->pdev);
-       cpia->lowlevel_data = NULL;     
+       cpia->lowlevel_data = NULL;
        kfree(cam);
 }
 
@@ -805,14 +805,14 @@ static struct parport_driver cpia_pp_driver = {
 
 int cpia_pp_init(void)
 {
-       printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 
+       printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT,
               CPIA_PP_MAJ_VER,CPIA_PP_MIN_VER,CPIA_PP_PATCH_VER);
 
        if(parport_nr[0] == PPCPIA_PARPORT_OFF) {
                printk("  disabled\n");
                return 0;
        }
-       
+
        spin_lock_init( &cam_list_lock_pp );
 
        if (parport_register_driver (&cpia_pp_driver)) {
index 03275c3..9c49a4b 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
-/* #define _CPIA_DEBUG_  1 */  
+/* #define _CPIA_DEBUG_  1 */
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -85,7 +85,7 @@ struct usb_cpia {
 
 static int cpia_usb_open(void *privdata);
 static int cpia_usb_registerCallback(void *privdata, void (*cb) (void *cbdata),
-                                    void *cbdata);
+                                    void *cbdata);
 static int cpia_usb_transferCmd(void *privdata, u8 *command, u8 *data);
 static int cpia_usb_streamStart(void *privdata);
 static int cpia_usb_streamStop(void *privdata);
@@ -127,7 +127,7 @@ static void cpia_usb_complete(struct urb *urb, struct pt_regs *regs)
                ucpia->workbuff->status = FRAME_READING;
                ucpia->workbuff->length = 0;
        }
-                 
+
        for (i = 0; i < urb->number_of_packets; i++) {
                int n = urb->iso_frame_desc[i].actual_length;
                int st = urb->iso_frame_desc[i].status;
@@ -141,9 +141,9 @@ static void cpia_usb_complete(struct urb *urb, struct pt_regs *regs)
                        printk(KERN_DEBUG "cpia: scratch buf overflow!scr_len: %d, n: %d\n", ucpia->workbuff->length, n);
                        return;
                }
-           
+
                if (n) {
-                       if ((ucpia->workbuff->length > 0) || 
+                       if ((ucpia->workbuff->length > 0) ||
                            (0x19 == cdata[0] && 0x68 == cdata[1])) {
                                memcpy(ucpia->workbuff->data + ucpia->workbuff->length, cdata, n);
                                ucpia->workbuff->length += n;
@@ -160,7 +160,7 @@ static void cpia_usb_complete(struct urb *urb, struct pt_regs *regs)
                                ucpia->workbuff = ucpia->workbuff->next;
                                ucpia->workbuff->status = FRAME_EMPTY;
                                ucpia->workbuff->length = 0;
-                 
+
                                if (waitqueue_active(&ucpia->wq_stream))
                                        wake_up_interruptible(&ucpia->wq_stream);
                        }
@@ -178,7 +178,7 @@ static int cpia_usb_open(void *privdata)
        struct usb_cpia *ucpia = (struct usb_cpia *) privdata;
        struct urb *urb;
        int ret, retval = 0, fx, err;
-  
+
        if (!ucpia)
                return -EINVAL;
 
@@ -191,7 +191,7 @@ static int cpia_usb_open(void *privdata)
                retval = -EINVAL;
                goto error_0;
        }
-       
+
        ret = usb_set_interface(ucpia->dev, ucpia->iface, 3);
        if (ret < 0) {
                printk(KERN_ERR "cpia_usb_open: usb_set_interface error (ret = %d)\n", ret);
@@ -286,7 +286,7 @@ error_1:
 error_0:
        kfree (ucpia->sbuf[0].data);
        ucpia->sbuf[0].data = NULL;
-       
+
        return retval;
 }
 
@@ -307,7 +307,7 @@ static int WritePacket(struct usb_device *udev, const u8 *packet, u8 *buf, size_
        return usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                         packet[1] + (packet[0] << 8),
                         USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                        packet[2] + (packet[3] << 8), 
+                        packet[2] + (packet[3] << 8),
                         packet[4] + (packet[5] << 8), buf, size, 1000);
 }
 
@@ -324,7 +324,7 @@ static int ReadPacket(struct usb_device *udev, u8 *packet, u8 *buf, size_t size)
        return usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
                         packet[1] + (packet[0] << 8),
                         USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                        packet[2] + (packet[3] << 8), 
+                        packet[2] + (packet[3] << 8),
                         packet[4] + (packet[5] << 8), buf, size, 1000);
 }
 
@@ -393,7 +393,7 @@ static int cpia_usb_streamRead(void *privdata, u8 *frame, int noblock)
 
        if (!ucpia || !ucpia->present)
                return -1;
-  
+
        if (ucpia->curbuff->status != FRAME_READY)
                interruptible_sleep_on(&ucpia->wq_stream);
        else
@@ -403,7 +403,7 @@ static int cpia_usb_streamRead(void *privdata, u8 *frame, int noblock)
 
        if (!mybuff)
                return -1;
-  
+
        if (mybuff->status != FRAME_READY || mybuff->length < 4) {
                DBG("Something went wrong!\n");
                return -1;
@@ -411,7 +411,7 @@ static int cpia_usb_streamRead(void *privdata, u8 *frame, int noblock)
 
        memcpy(frame, mybuff->data, mybuff->length);
        mybuff->status = FRAME_EMPTY;
-  
+
 /*   DBG("read done, %d bytes, Header: %x/%x, Footer: %x%x%x%x\n",  */
 /*       mybuff->length, frame[0], frame[1], */
 /*       frame[mybuff->length-4], frame[mybuff->length-3],  */
@@ -447,7 +447,7 @@ static void cpia_usb_free_resources(struct usb_cpia *ucpia, int try)
 
        kfree(ucpia->sbuf[1].data);
        ucpia->sbuf[1].data = NULL;
+
        if (ucpia->sbuf[0].urb) {
                usb_kill_urb(ucpia->sbuf[0].urb);
                usb_free_urb(ucpia->sbuf[0].urb);
@@ -490,7 +490,7 @@ static int cpia_probe(struct usb_interface *intf,
        struct usb_cpia *ucpia;
        struct cam_data *cam;
        int ret;
-  
+
        /* A multi-config CPiA camera? */
        if (udev->descriptor.bNumConfigurations != 1)
                return -ENODEV;
@@ -539,7 +539,7 @@ static int cpia_probe(struct usb_interface *intf,
 
        /* Before register_camera, important */
        ucpia->present = 1;
-  
+
        cam = cpia_register_camera(&cpia_usb_ops, ucpia);
        if (!cam) {
                LOG("failed to cpia_register_camera\n");
@@ -591,7 +591,7 @@ static void cpia_disconnect(struct usb_interface *intf)
        struct cam_data *cam = usb_get_intfdata(intf);
        struct usb_cpia *ucpia;
        struct usb_device *udev;
-  
+
        usb_set_intfdata(intf, NULL);
        if (!cam)
                return;
@@ -600,7 +600,7 @@ static void cpia_disconnect(struct usb_interface *intf)
        spin_lock( &cam_list_lock_usb );
        list_del(&cam->cam_data_list);
        spin_unlock( &cam_list_lock_usb );
-       
+
        ucpia->present = 0;
 
        cpia_unregister_camera(cam);
@@ -631,7 +631,7 @@ static void cpia_disconnect(struct usb_interface *intf)
 
 static int __init usb_cpia_init(void)
 {
-       printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 
+       printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT,
               CPIA_USB_MAJ_VER,CPIA_USB_MIN_VER,CPIA_USB_PATCH_VER);
 
        spin_lock_init(&cam_list_lock_usb);
index 2b22f3a..621c0c6 100644 (file)
@@ -20,7 +20,7 @@
 #define __CS8420_H__
 
 /* Initialization Sequence */
-        
+
 static __u8 init8420[] = {
        1, 0x01,        2, 0x02,        3, 0x00,        4, 0x46,
        5, 0x24,        6, 0x84,        18, 0x18,       19, 0x13,
index 1774ab7..b9ba95f 100644 (file)
@@ -86,7 +86,7 @@ static int dabusb_add_buf_tail (pdabusb_t s, struct list_head *dst, struct list_
        return ret;
 }
 /*-------------------------------------------------------------------*/
-#ifdef DEBUG 
+#ifdef DEBUG
 static void dump_urb (struct urb *urb)
 {
        dbg("urb                   :%p", urb);
@@ -136,7 +136,7 @@ static int dabusb_free_queue (struct list_head *q)
        for (p = q->next; p != q;) {
                b = list_entry (p, buff_t, buff_list);
 
-#ifdef DEBUG 
+#ifdef DEBUG
                dump_urb(b->purb);
 #endif
                kfree(b->purb->transfer_buffer);
@@ -287,7 +287,7 @@ static int dabusb_bulk (pdabusb_t s, pbulk_transfer_t pb)
                }
 
        }
-       
+
        if( ret == -EPIPE ) {
                warn("CLEAR_FEATURE request to remove STALL condition.");
                if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe)))
@@ -328,7 +328,7 @@ static int dabusb_loadmem (pdabusb_t s, const char *fname)
        PINTEL_HEX_RECORD ptr = firmware;
 
        dbg("Enter dabusb_loadmem (internal)");
-       
+
        ret = dabusb_8051_reset (s, 1);
        while (ptr->Type == 0) {
 
@@ -449,7 +449,7 @@ static int dabusb_startrek (pdabusb_t s)
        if (!list_empty (&s->free_buff_list)) {
                pbuff_t end;
                int ret;
-               
+
        while (!dabusb_add_buf_tail (s, &s->rec_buff_list, &s->free_buff_list)) {
 
                        dbg("submitting: end:%p s->rec_buff_list:%p", s->rec_buff_list.prev, &s->rec_buff_list);
@@ -506,7 +506,7 @@ static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, l
                        err("error: rec_buf_list is empty");
                        goto err;
                }
-               
+
                b = list_entry (s->rec_buff_list.next, buff_t, buff_list);
                purb = b->purb;
 
@@ -783,9 +783,9 @@ static void dabusb_disconnect (struct usb_interface *intf)
        pdabusb_t s = usb_get_intfdata (intf);
 
        dbg("dabusb_disconnect");
-       
+
        init_waitqueue_entry(&__wait, current);
-       
+
        usb_set_intfdata (intf, NULL);
        if (s) {
                usb_deregister_dev (intf, &dabusb_class);
@@ -797,7 +797,7 @@ static void dabusb_disconnect (struct usb_interface *intf)
                        schedule();
                current->state = TASK_RUNNING;
                remove_wait_queue(&s->remove_ok, &__wait);
-               
+
                s->usbdev = NULL;
                s->overruns = 0;
        }
index 96b03e4..00eb34c 100644 (file)
@@ -10,7 +10,7 @@ typedef struct
 #define DABUSB_VERSION 0x1000
 #define IOCTL_DAB_BULK              _IOWR('d', 0x30, bulk_transfer_t)
 #define IOCTL_DAB_OVERRUNS         _IOR('d',  0x15, int)
-#define IOCTL_DAB_VERSION           _IOR('d', 0x3f, int) 
+#define IOCTL_DAB_VERSION           _IOR('d', 0x3f, int)
 
 #ifdef __KERNEL__
 
@@ -36,7 +36,7 @@ typedef struct
        struct list_head rec_buff_list;
 } dabusb_t,*pdabusb_t;
 
-typedef struct 
+typedef struct
 {
        pdabusb_t s;
        struct urb *purb;
index 2564680..3b4e998 100644 (file)
   Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing
 
  Version 0.30:
-       Markus: Updates for 2.5.x kernel and more ISO compliant source
+       Markus: Updates for 2.5.x kernel and more ISO compliant source
 
  Version 0.25:
-        PSL and Markus: Cleanup, radio now doesn't stop on device close
+       PSL and Markus: Cleanup, radio now doesn't stop on device close
 
  Version 0.24:
-       Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally
+       Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally
        right.  Some minor cleanup, improved standalone compilation
 
  Version 0.23:
-       Markus: Sign extension bug fixed by declaring transfer_buffer unsigned
+       Markus: Sign extension bug fixed by declaring transfer_buffer unsigned
 
  Version 0.22:
-       Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns, 
+       Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns,
        thanks to Mike Cox for pointing the problem out.
 
  Version 0.21:
-       Markus: Minor cleanup, warnings if something goes wrong, lame attempt
+       Markus: Minor cleanup, warnings if something goes wrong, lame attempt
        to adhere to Documentation/CodingStyle
 
- Version 0.2: 
-       Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
+ Version 0.2:
+       Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
        Markus: Copyright clarification
 
  Version 0.01: Markus: initial release
@@ -163,11 +163,11 @@ static struct usb_driver usb_dsbr100_driver = {
 static int dsbr100_start(dsbr100_device *radio)
 {
        if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS, 
+                       USB_REQ_GET_STATUS,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                        0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
        usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_ONOFF, 
+                       DSB100_ONOFF,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                        0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
                return -1;
@@ -179,11 +179,11 @@ static int dsbr100_start(dsbr100_device *radio)
 static int dsbr100_stop(dsbr100_device *radio)
 {
        if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS, 
+                       USB_REQ_GET_STATUS,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                        0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
        usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_ONOFF, 
+                       DSB100_ONOFF,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                        0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
                return -1;
@@ -195,16 +195,16 @@ static int dsbr100_setfreq(dsbr100_device *radio, int freq)
 {
        freq = (freq/16*80)/1000+856;
        if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       DSB100_TUNE, 
+                       DSB100_TUNE,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-                       (freq>>8)&0x00ff, freq&0xff, 
+                       (freq>>8)&0x00ff, freq&0xff,
                        radio->transfer_buffer, 8, 300)<0 ||
           usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS, 
+                       USB_REQ_GET_STATUS,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                        0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
        usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-                       USB_REQ_GET_STATUS, 
+                       USB_REQ_GET_STATUS,
                        USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
                        0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
                radio->stereo = -1;
@@ -219,7 +219,7 @@ sees a stereo signal or not.  Pity. */
 static void dsbr100_getstat(dsbr100_device *radio)
 {
        if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
-               USB_REQ_GET_STATUS, 
+               USB_REQ_GET_STATUS,
                USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
                0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
                radio->stereo = -1;
@@ -232,7 +232,7 @@ static void dsbr100_getstat(dsbr100_device *radio)
 
 /* check if the device is present and register with v4l and
 usb if it is */
-static int usb_dsbr100_probe(struct usb_interface *intf, 
+static int usb_dsbr100_probe(struct usb_interface *intf,
                         const struct usb_device_id *id)
 {
        dsbr100_device *radio;
@@ -243,7 +243,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
                kfree(radio);
                return -ENOMEM;
        }
-       memcpy(radio->videodev, &dsbr100_videodev_template, 
+       memcpy(radio->videodev, &dsbr100_videodev_template,
                sizeof(dsbr100_videodev_template));
        radio->removed = 0;
        radio->users = 0;
@@ -310,7 +310,7 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
                        struct video_tuner *v = arg;
 
                        dsbr100_getstat(radio);
-                       if(v->tuner)    /* Only 1 tuner */ 
+                       if(v->tuner)    /* Only 1 tuner */
                                return -EINVAL;
                        v->rangelow = FREQ_MIN*FREQ_MUL;
                        v->rangehigh = FREQ_MAX*FREQ_MUL;
@@ -355,12 +355,12 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
                        v->volume = 1;
                        v->step = 1;
                        strcpy(v->name, "Radio");
-                       return 0;                       
+                       return 0;
                }
                case VIDIOCSAUDIO: {
                        struct video_audio *v = arg;
 
-                       if (v->audio) 
+                       if (v->audio)
                                return -EINVAL;
                        if (v->flags&VIDEO_AUDIO_MUTE) {
                                if (dsbr100_stop(radio)==-1)
index eee8afc..2e5ca40 100644 (file)
@@ -180,7 +180,7 @@ et61x251_match_id(struct et61x251_device* cam, const struct usb_device_id *id)
 
 void
 et61x251_attach_sensor(struct et61x251_device* cam,
-                       struct et61x251_sensor* sensor)
+                      struct et61x251_sensor* sensor)
 {
        memcpy(&cam->sensor, sensor, sizeof(struct et61x251_sensor));
 }
@@ -199,7 +199,7 @@ do {                                                                          \
                        dev_info(&cam->usbdev->dev, fmt "\n", ## args);       \
                else if ((level) >= 3)                                        \
                        dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n",      \
-                                __FUNCTION__, __LINE__ , ## args);           \
+                                __FUNCTION__, __LINE__ , ## args);           \
        }                                                                     \
 } while (0)
 #      define KDBG(level, fmt, args...)                                      \
@@ -209,7 +209,7 @@ do {                                                                          \
                        pr_info("et61x251: " fmt "\n", ## args);              \
                else if ((level) == 3)                                        \
                        pr_debug("et61x251: [%s:%d] " fmt "\n", __FUNCTION__, \
-                                __LINE__ , ## args);                         \
+                                __LINE__ , ## args);                         \
        }                                                                     \
 } while (0)
 #      define V4LDBG(level, name, cmd)                                       \
@@ -226,7 +226,7 @@ do {                                                                          \
 #undef PDBG
 #define PDBG(fmt, args...)                                                    \
 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n",                              \
-         __FUNCTION__, __LINE__ , ## args)
+        __FUNCTION__, __LINE__ , ## args)
 
 #undef PDBGG
 #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
index 7cc01b8..dfc9dd7 100644 (file)
@@ -44,7 +44,7 @@
 /*****************************************************************************/
 
 #define ET61X251_MODULE_NAME    "V4L2 driver for ET61X[12]51 "                \
-                                "PC Camera Controllers"
+                               "PC Camera Controllers"
 #define ET61X251_MODULE_AUTHOR  "(C) 2006 Luca Risolia"
 #define ET61X251_AUTHOR_EMAIL   "<luca.risolia@studio.unibo.it>"
 #define ET61X251_MODULE_LICENSE "GPL"
@@ -63,68 +63,68 @@ MODULE_LICENSE(ET61X251_MODULE_LICENSE);
 static short video_nr[] = {[0 ... ET61X251_MAX_DEVICES-1] = -1};
 module_param_array(video_nr, short, NULL, 0444);
 MODULE_PARM_DESC(video_nr,
-                 "\n<-1|n[,...]> Specify V4L2 minor mode number."
-                 "\n -1 = use next available (default)"
-                 "\n  n = use minor number n (integer >= 0)"
-                 "\nYou can specify up to "
-                 __MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way."
-                 "\nFor example:"
-                 "\nvideo_nr=-1,2,-1 would assign minor number 2 to"
-                 "\nthe second registered camera and use auto for the first"
-                 "\none and for every other camera."
-                 "\n");
+                "\n<-1|n[,...]> Specify V4L2 minor mode number."
+                "\n -1 = use next available (default)"
+                "\n  n = use minor number n (integer >= 0)"
+                "\nYou can specify up to "
+                __MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way."
+                "\nFor example:"
+                "\nvideo_nr=-1,2,-1 would assign minor number 2 to"
+                "\nthe second registered camera and use auto for the first"
+                "\none and for every other camera."
+                "\n");
 
 static short force_munmap[] = {[0 ... ET61X251_MAX_DEVICES-1] =
-                               ET61X251_FORCE_MUNMAP};
+                              ET61X251_FORCE_MUNMAP};
 module_param_array(force_munmap, bool, NULL, 0444);
 MODULE_PARM_DESC(force_munmap,
-                 "\n<0|1[,...]> Force the application to unmap previously"
-                 "\nmapped buffer memory before calling any VIDIOC_S_CROP or"
-                 "\nVIDIOC_S_FMT ioctl's. Not all the applications support"
-                 "\nthis feature. This parameter is specific for each"
-                 "\ndetected camera."
-                 "\n 0 = do not force memory unmapping"
-                 "\n 1 = force memory unmapping (save memory)"
-                 "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
-                 "\n");
+                "\n<0|1[,...]> Force the application to unmap previously"
+                "\nmapped buffer memory before calling any VIDIOC_S_CROP or"
+                "\nVIDIOC_S_FMT ioctl's. Not all the applications support"
+                "\nthis feature. This parameter is specific for each"
+                "\ndetected camera."
+                "\n 0 = do not force memory unmapping"
+                "\n 1 = force memory unmapping (save memory)"
+                "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
+                "\n");
 
 static unsigned int frame_timeout[] = {[0 ... ET61X251_MAX_DEVICES-1] =
-                                       ET61X251_FRAME_TIMEOUT};
+                                      ET61X251_FRAME_TIMEOUT};
 module_param_array(frame_timeout, uint, NULL, 0644);
 MODULE_PARM_DESC(frame_timeout,
-                 "\n<n[,...]> Timeout for a video frame in seconds."
-                 "\nThis parameter is specific for each detected camera."
-                 "\nDefault value is "
-                 __MODULE_STRING(ET61X251_FRAME_TIMEOUT)"."
-                 "\n");
+                "\n<n[,...]> Timeout for a video frame in seconds."
+                "\nThis parameter is specific for each detected camera."
+                "\nDefault value is "
+                __MODULE_STRING(ET61X251_FRAME_TIMEOUT)"."
+                "\n");
 
 #ifdef ET61X251_DEBUG
 static unsigned short debug = ET61X251_DEBUG_LEVEL;
 module_param(debug, ushort, 0644);
 MODULE_PARM_DESC(debug,
-                 "\n<n> Debugging information level, from 0 to 3:"
-                 "\n0 = none (use carefully)"
-                 "\n1 = critical errors"
-                 "\n2 = significant informations"
-                 "\n3 = more verbose messages"
-                 "\nLevel 3 is useful for testing only, when only "
-                 "one device is used."
-                 "\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"."
-                 "\n");
+                "\n<n> Debugging information level, from 0 to 3:"
+                "\n0 = none (use carefully)"
+                "\n1 = critical errors"
+                "\n2 = significant informations"
+                "\n3 = more verbose messages"
+                "\nLevel 3 is useful for testing only, when only "
+                "one device is used."
+                "\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"."
+                "\n");
 #endif
 
 /*****************************************************************************/
 
 static u32
 et61x251_request_buffers(struct et61x251_device* cam, u32 count,
-                         enum et61x251_io_method io)
+                        enum et61x251_io_method io)
 {
        struct v4l2_pix_format* p = &(cam->sensor.pix_format);
        struct v4l2_rect* r = &(cam->sensor.cropcap.bounds);
        const size_t imagesize = cam->module_param.force_munmap ||
-                                io == IO_READ ?
-                                (p->width * p->height * p->priv) / 8 :
-                                (r->width * r->height * p->priv) / 8;
+                                io == IO_READ ?
+                                (p->width * p->height * p->priv) / 8 :
+                                (r->width * r->height * p->priv) / 8;
        void* buff = NULL;
        u32 i;
 
@@ -216,7 +216,7 @@ int et61x251_write_reg(struct et61x251_device* cam, u8 value, u16 index)
        *buff = value;
 
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
+                             0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
        if (res < 0) {
                DBG(3, "Failed to write a register (value 0x%02X, index "
                       "0x%02X, error %d)", value, index, res);
@@ -234,7 +234,7 @@ int et61x251_read_reg(struct et61x251_device* cam, u16 index)
        int res;
 
        res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
-                             0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
+                             0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                DBG(3, "Failed to read a register (index 0x%02X, error %d)",
                    index, res);
@@ -269,7 +269,7 @@ et61x251_i2c_wait(struct et61x251_device* cam, struct et61x251_sensor* sensor)
 
 int
 et61x251_i2c_try_read(struct et61x251_device* cam,
-                      struct et61x251_sensor* sensor, u8 address)
+                     struct et61x251_sensor* sensor, u8 address)
 {
        struct usb_device* udev = cam->usbdev;
        u8* data = cam->control_buffer;
@@ -280,14 +280,14 @@ et61x251_i2c_try_read(struct et61x251_device* cam,
        data[2] = cam->sensor.rsta | 0x10;
        data[3] = !(et61x251_read_reg(cam, 0x8b) & 0x02);
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT);
+                             0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
        err += et61x251_i2c_wait(cam, sensor);
 
        res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
-                             0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT);
+                             0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
@@ -302,7 +302,7 @@ et61x251_i2c_try_read(struct et61x251_device* cam,
 
 int
 et61x251_i2c_try_write(struct et61x251_device* cam,
-                       struct et61x251_sensor* sensor, u8 address, u8 value)
+                      struct et61x251_sensor* sensor, u8 address, u8 value)
 {
        struct usb_device* udev = cam->usbdev;
        u8* data = cam->control_buffer;
@@ -312,13 +312,13 @@ et61x251_i2c_try_write(struct et61x251_device* cam,
        data[1] = cam->sensor.i2c_slave_id;
        data[2] = cam->sensor.rsta | 0x12;
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
+                             0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
        data[0] = value;
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
+                             0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
@@ -335,8 +335,8 @@ et61x251_i2c_try_write(struct et61x251_device* cam,
 
 int
 et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
-                       u8 data3, u8 data4, u8 data5, u8 data6, u8 data7,
-                       u8 data8, u8 address)
+                      u8 data3, u8 data4, u8 data5, u8 data6, u8 data7,
+                      u8 data8, u8 address)
 {
        struct usb_device* udev = cam->usbdev;
        u8* data = cam->control_buffer;
@@ -350,7 +350,7 @@ et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
        data[5] = data7;
        data[6] = data8;
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT);
+                             0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
@@ -358,14 +358,14 @@ et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
        data[1] = cam->sensor.i2c_slave_id;
        data[2] = cam->sensor.rsta | 0x02 | (n << 4);
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
+                             0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
        /* Start writing through the serial interface */
        data[0] = data1;
        res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
-                             0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
+                             0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
        if (res < 0)
                err += res;
 
@@ -432,11 +432,11 @@ static void et61x251_urb_complete(struct urb *urb, struct pt_regs* regs)
 
        if (!(*f))
                (*f) = list_entry(cam->inqueue.next, struct et61x251_frame_t,
-                                 frame);
+                                 frame);
 
        imagesize = (cam->sensor.pix_format.width *
-                    cam->sensor.pix_format.height *
-                    cam->sensor.pix_format.priv) / 8;
+                    cam->sensor.pix_format.height *
+                    cam->sensor.pix_format.priv) / 8;
 
        for (i = 0; i < urb->number_of_packets; i++) {
                unsigned int len, status;
@@ -476,7 +476,7 @@ start_of_frame:
                if ((*f)->state == F_GRABBING) {
                        if (sof && (*f)->buf.bytesused) {
                                if (cam->sensor.pix_format.pixelformat ==
-                                                        V4L2_PIX_FMT_ET61X251)
+                                                        V4L2_PIX_FMT_ET61X251)
                                        goto end_of_frame;
                                else {
                                        DBG(3, "Not expected SOF detected "
@@ -508,8 +508,8 @@ end_of_frame:
                                list_move_tail(&(*f)->frame, &cam->outqueue);
                                if (!list_empty(&cam->inqueue))
                                        (*f) = list_entry(cam->inqueue.next,
-                                                      struct et61x251_frame_t,
-                                                         frame);
+                                                      struct et61x251_frame_t,
+                                                         frame);
                                else
                                        (*f) = NULL;
                                spin_unlock(&cam->queue_lock);
@@ -521,7 +521,7 @@ end_of_frame:
 
                                if (sof &&
                                    cam->sensor.pix_format.pixelformat ==
-                                                        V4L2_PIX_FMT_ET61X251)
+                                                        V4L2_PIX_FMT_ET61X251)
                                        goto start_of_frame;
                        }
                }
@@ -544,15 +544,15 @@ static int et61x251_start_transfer(struct et61x251_device* cam)
        struct usb_device *udev = cam->usbdev;
        struct urb* urb;
        const unsigned int wMaxPacketSize[] = {0, 256, 384, 512, 640, 768, 832,
-                                              864, 896, 920, 956, 980, 1000,
-                                              1022};
+                                              864, 896, 920, 956, 980, 1000,
+                                              1022};
        const unsigned int psz = wMaxPacketSize[ET61X251_ALTERNATE_SETTING];
        s8 i, j;
        int err = 0;
 
        for (i = 0; i < ET61X251_URBS; i++) {
                cam->transfer_buffer[i] = kzalloc(ET61X251_ISO_PACKETS * psz,
-                                                 GFP_KERNEL);
+                                                 GFP_KERNEL);
                if (!cam->transfer_buffer[i]) {
                        err = -ENOMEM;
                        DBG(1, "Not enough memory");
@@ -653,9 +653,9 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
 
        cam->stream = STREAM_INTERRUPT;
        timeout = wait_event_timeout(cam->wait_stream,
-                                    (cam->stream == STREAM_OFF) ||
-                                    (cam->state & DEV_DISCONNECTED),
-                                    ET61X251_URB_TIMEOUT);
+                                    (cam->stream == STREAM_OFF) ||
+                                    (cam->state & DEV_DISCONNECTED),
+                                    ET61X251_URB_TIMEOUT);
        if (cam->state & DEV_DISCONNECTED)
                return -ENODEV;
        else if (cam->stream != STREAM_OFF) {
@@ -699,7 +699,7 @@ static u8 et61x251_strtou8(const char* buff, size_t len, ssize_t* count)
 
 /*
    NOTE 1: being inside one of the following methods implies that the v4l
-           device exists for sure (see kobjects and reference counters)
+          device exists for sure (see kobjects and reference counters)
    NOTE 2: buffers are PAGE_SIZE long
 */
 
@@ -964,13 +964,13 @@ et61x251_store_i2c_val(struct class_device* cd, const char* buf, size_t len)
 
 
 static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR,
-                         et61x251_show_reg, et61x251_store_reg);
+                        et61x251_show_reg, et61x251_store_reg);
 static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR,
-                         et61x251_show_val, et61x251_store_val);
+                        et61x251_show_val, et61x251_store_val);
 static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR,
-                         et61x251_show_i2c_reg, et61x251_store_i2c_reg);
+                        et61x251_show_i2c_reg, et61x251_store_i2c_reg);
 static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
-                         et61x251_show_i2c_val, et61x251_store_i2c_val);
+                        et61x251_show_i2c_val, et61x251_store_i2c_val);
 
 
 static void et61x251_create_sysfs(struct et61x251_device* cam)
@@ -990,7 +990,7 @@ static void et61x251_create_sysfs(struct et61x251_device* cam)
 
 static int
 et61x251_set_pix_format(struct et61x251_device* cam,
-                        struct v4l2_pix_format* pix)
+                       struct v4l2_pix_format* pix)
 {
        int r, err = 0;
 
@@ -1007,7 +1007,7 @@ et61x251_set_pix_format(struct et61x251_device* cam,
 
 static int
 et61x251_set_compression(struct et61x251_device* cam,
-                         struct v4l2_jpegcompression* compression)
+                        struct v4l2_jpegcompression* compression)
 {
        int r, err = 0;
 
@@ -1049,9 +1049,9 @@ et61x251_set_crop(struct et61x251_device* cam, struct v4l2_rect* rect)
 {
        struct et61x251_sensor* s = &cam->sensor;
        u16 fmw_sx = (u16)(rect->left - s->cropcap.bounds.left +
-                          s->active_pixel.left),
+                          s->active_pixel.left),
            fmw_sy = (u16)(rect->top - s->cropcap.bounds.top +
-                          s->active_pixel.top),
+                          s->active_pixel.top),
            fmw_length = (u16)(rect->width),
            fmw_height = (u16)(rect->height);
        int err = 0;
@@ -1061,8 +1061,8 @@ et61x251_set_crop(struct et61x251_device* cam, struct v4l2_rect* rect)
        err += et61x251_write_reg(cam, fmw_length & 0xff, 0x6b);
        err += et61x251_write_reg(cam, fmw_height & 0xff, 0x6c);
        err += et61x251_write_reg(cam, (fmw_sx >> 8) | ((fmw_sy & 0x300) >> 6)
-                                      | ((fmw_length & 0x300) >> 4)
-                                      | ((fmw_height & 0x300) >> 2), 0x6d);
+                                      | ((fmw_length & 0x300) >> 4)
+                                      | ((fmw_height & 0x300) >> 2), 0x6d);
        if (err)
                return -EIO;
 
@@ -1203,8 +1203,8 @@ static int et61x251_open(struct inode* inode, struct file* filp)
                }
                mutex_unlock(&cam->dev_mutex);
                err = wait_event_interruptible_exclusive(cam->open,
-                                                 cam->state & DEV_DISCONNECTED
-                                                        || !cam->users);
+                                                 cam->state & DEV_DISCONNECTED
+                                                        || !cam->users);
                if (err) {
                        up_read(&et61x251_disconnect);
                        return err;
@@ -1277,7 +1277,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
 
 static ssize_t
 et61x251_read(struct file* filp, char __user * buf,
-              size_t count, loff_t* f_pos)
+             size_t count, loff_t* f_pos)
 {
        struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
        struct et61x251_frame_t* f, * i;
@@ -1310,7 +1310,7 @@ et61x251_read(struct file* filp, char __user * buf,
 
        if (cam->io == IO_NONE) {
                if (!et61x251_request_buffers(cam, cam->nreadbuffers,
-                                             IO_READ)) {
+                                             IO_READ)) {
                        DBG(1, "read() failed, not enough memory");
                        mutex_unlock(&cam->fileop_mutex);
                        return -ENOMEM;
@@ -1336,12 +1336,12 @@ et61x251_read(struct file* filp, char __user * buf,
                        return -EAGAIN;
                }
                timeout = wait_event_interruptible_timeout
-                         ( cam->wait_frame,
-                           (!list_empty(&cam->outqueue)) ||
-                           (cam->state & DEV_DISCONNECTED) ||
-                           (cam->state & DEV_MISCONFIGURED),
-                           cam->module_param.frame_timeout *
-                           1000 * msecs_to_jiffies(1) );
+                         ( cam->wait_frame,
+                           (!list_empty(&cam->outqueue)) ||
+                           (cam->state & DEV_DISCONNECTED) ||
+                           (cam->state & DEV_MISCONFIGURED),
+                           cam->module_param.frame_timeout *
+                           1000 * msecs_to_jiffies(1) );
                if (timeout < 0) {
                        mutex_unlock(&cam->fileop_mutex);
                        return timeout;
@@ -1408,7 +1408,7 @@ static unsigned int et61x251_poll(struct file *filp, poll_table *wait)
 
        if (cam->io == IO_NONE) {
                if (!et61x251_request_buffers(cam, cam->nreadbuffers,
-                                             IO_READ)) {
+                                             IO_READ)) {
                        DBG(1, "poll() failed, not enough memory");
                        goto error;
                }
@@ -1465,7 +1465,7 @@ static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma)
 {
        struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
        unsigned long size = vma->vm_end - vma->vm_start,
-                     start = vma->vm_start;
+                     start = vma->vm_start;
        void *pos;
        u32 i;
 
@@ -1533,13 +1533,13 @@ et61x251_vidioc_querycap(struct et61x251_device* cam, void __user * arg)
                .driver = "et61x251",
                .version = ET61X251_MODULE_VERSION_CODE,
                .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
-                               V4L2_CAP_STREAMING,
+                               V4L2_CAP_STREAMING,
        };
 
        strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card));
        if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0)
                strlcpy(cap.bus_info, cam->usbdev->dev.bus_id,
-                       sizeof(cap.bus_info));
+                       sizeof(cap.bus_info));
 
        if (copy_to_user(arg, &cap, sizeof(cap)))
                return -EFAULT;
@@ -1871,7 +1871,7 @@ et61x251_vidioc_g_fmt(struct et61x251_device* cam, void __user * arg)
                return -EINVAL;
 
        pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_ET61X251)
-                            ? 0 : (pfmt->width * pfmt->priv) / 8;
+                            ? 0 : (pfmt->width * pfmt->priv) / 8;
        pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8);
        pfmt->field = V4L2_FIELD_NONE;
        memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt));
@@ -1885,7 +1885,7 @@ et61x251_vidioc_g_fmt(struct et61x251_device* cam, void __user * arg)
 
 static int
 et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
-                          void __user * arg)
+                         void __user * arg)
 {
        struct et61x251_sensor* s = &cam->sensor;
        struct v4l2_format format;
@@ -1947,7 +1947,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
        pix->priv = pfmt->priv; /* bpp */
        pix->colorspace = pfmt->colorspace;
        pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_ET61X251)
-                           ? 0 : (pix->width * pix->priv) / 8;
+                           ? 0 : (pix->width * pix->priv) / 8;
        pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8);
        pix->field = V4L2_FIELD_NONE;
 
@@ -2020,7 +2020,7 @@ static int
 et61x251_vidioc_g_jpegcomp(struct et61x251_device* cam, void __user * arg)
 {
        if (copy_to_user(arg, &cam->compression,
-                        sizeof(cam->compression)))
+                        sizeof(cam->compression)))
                return -EFAULT;
 
        return 0;
@@ -2169,7 +2169,7 @@ et61x251_vidioc_qbuf(struct et61x251_device* cam, void __user * arg)
 
 static int
 et61x251_vidioc_dqbuf(struct et61x251_device* cam, struct file* filp,
-                      void __user * arg)
+                     void __user * arg)
 {
        struct v4l2_buffer b;
        struct et61x251_frame_t *f;
@@ -2188,12 +2188,12 @@ et61x251_vidioc_dqbuf(struct et61x251_device* cam, struct file* filp,
                if (filp->f_flags & O_NONBLOCK)
                        return -EAGAIN;
                timeout = wait_event_interruptible_timeout
-                         ( cam->wait_frame,
-                           (!list_empty(&cam->outqueue)) ||
-                           (cam->state & DEV_DISCONNECTED) ||
-                           (cam->state & DEV_MISCONFIGURED),
-                           cam->module_param.frame_timeout *
-                           1000 * msecs_to_jiffies(1) );
+                         ( cam->wait_frame,
+                           (!list_empty(&cam->outqueue)) ||
+                           (cam->state & DEV_DISCONNECTED) ||
+                           (cam->state & DEV_MISCONFIGURED),
+                           cam->module_param.frame_timeout *
+                           1000 * msecs_to_jiffies(1) );
                if (timeout < 0)
                        return timeout;
                if (cam->state & DEV_DISCONNECTED)
@@ -2317,7 +2317,7 @@ 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)
+                              unsigned int cmd, void __user * arg)
 {
        struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
 
@@ -2411,7 +2411,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
 
 
 static int et61x251_ioctl(struct inode* inode, struct file* filp,
-                         unsigned int cmd, unsigned long arg)
+                        unsigned int cmd, unsigned long arg)
 {
        struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
        int err = 0;
@@ -2518,7 +2518,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
        mutex_lock(&cam->dev_mutex);
 
        err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
-                                   video_nr[dev_nr]);
+                                   video_nr[dev_nr]);
        if (err) {
                DBG(1, "V4L2 device registration failed");
                if (err == -ENFILE && video_nr[dev_nr] == -1)
index 56841ae..65edd08 100644 (file)
@@ -47,7 +47,7 @@ et61x251_match_id(struct et61x251_device* cam, const struct usb_device_id *id);
 
 extern void
 et61x251_attach_sensor(struct et61x251_device* cam,
-                       struct et61x251_sensor* sensor);
+                      struct et61x251_sensor* sensor);
 
 /*****************************************************************************/
 
@@ -56,13 +56,13 @@ extern int et61x251_read_reg(struct et61x251_device*, u16 index);
 extern int et61x251_i2c_write(struct et61x251_device*, u8 address, u8 value);
 extern int et61x251_i2c_read(struct et61x251_device*, u8 address);
 extern int et61x251_i2c_try_write(struct et61x251_device*,
-                                  struct et61x251_sensor*, u8 address,
-                                  u8 value);
+                                 struct et61x251_sensor*, u8 address,
+                                 u8 value);
 extern int et61x251_i2c_try_read(struct et61x251_device*,
-                                 struct et61x251_sensor*, u8 address);
+                                struct et61x251_sensor*, u8 address);
 extern int et61x251_i2c_raw_write(struct et61x251_device*, u8 n, u8 data1,
-                                  u8 data2, u8 data3, u8 data4, u8 data5,
-                                  u8 data6, u8 data7, u8 data8, u8 address);
+                                 u8 data2, u8 data3, u8 data4, u8 data5,
+                                 u8 data6, u8 data7, u8 data8, u8 address);
 
 /*****************************************************************************/
 
@@ -100,13 +100,13 @@ struct et61x251_sensor {
 
        int (*init)(struct et61x251_device* cam);
        int (*get_ctrl)(struct et61x251_device* cam,
-                       struct v4l2_control* ctrl);
+                       struct v4l2_control* ctrl);
        int (*set_ctrl)(struct et61x251_device* cam,
-                       const struct v4l2_control* ctrl);
+                       const struct v4l2_control* ctrl);
        int (*set_crop)(struct et61x251_device* cam,
-                       const struct v4l2_rect* rect);
+                       const struct v4l2_rect* rect);
        int (*set_pix_format)(struct et61x251_device* cam,
-                             const struct v4l2_pix_format* pix);
+                             const struct v4l2_pix_format* pix);
 
        /* Private */
        struct v4l2_queryctrl _qctrl[ET61X251_MAX_CTRLS];
index 3998d76..a7d65b8 100644 (file)
@@ -46,20 +46,20 @@ static int tas5130d1b_init(struct et61x251_device* cam)
 
 
 static int tas5130d1b_set_ctrl(struct et61x251_device* cam,
-                               const struct v4l2_control* ctrl)
+                              const struct v4l2_control* ctrl)
 {
        int err = 0;
 
        switch (ctrl->id) {
        case V4L2_CID_GAIN:
                err += et61x251_i2c_raw_write(cam, 2, 0x20,
-                                             0xf6-ctrl->value, 0, 0, 0,
-                                             0, 0, 0, 0);
+                                             0xf6-ctrl->value, 0, 0, 0,
+                                             0, 0, 0, 0);
                break;
        case V4L2_CID_EXPOSURE:
                err += et61x251_i2c_raw_write(cam, 2, 0x40,
-                                             0x47-ctrl->value, 0, 0, 0,
-                                             0, 0, 0, 0);
+                                             0x47-ctrl->value, 0, 0, 0,
+                                             0, 0, 0, 0);
                break;
        default:
                return -EINVAL;
index da44579..fdc8e3f 100644 (file)
@@ -15,7 +15,7 @@
  *
  * Based on the Linux CPiA driver written by Peter Pregler,
  * Scott J. Bertin and Johannes Erdfelt.
- * 
+ *
  * Please see the file: Documentation/usb/ov511.txt
  * and the website at:  http://alpha.dyndns.org/ov511
  * for more info.
@@ -433,7 +433,7 @@ reg_w_mask(struct usb_ov511 *ov,
        return (reg_w(ov, reg, newval));
 }
 
-/* 
+/*
  * Writes multiple (n) byte value to a single register. Only valid with certain
  * registers (0x30 and 0xc4 - 0xce).
  */
@@ -629,7 +629,7 @@ ov511_i2c_write_internal(struct usb_ov511 *ov,
                /* Retry until idle */
                do
                        rc = reg_r(ov, R511_I2C_CTL);
-               while (rc > 0 && ((rc&1) == 0)); 
+               while (rc > 0 && ((rc&1) == 0));
                if (rc < 0)
                        break;
 
@@ -1752,7 +1752,7 @@ sensor_set_picture(struct usb_ov511 *ov, struct video_picture *p)
        ov->whiteness = p->whiteness;
 
        /* Don't return error if a setting is unsupported, or rest of settings
-         * will not be performed */
+        * will not be performed */
 
        rc = sensor_set_contrast(ov, p->contrast);
        if (FATAL_ERROR(rc))
@@ -1781,7 +1781,7 @@ sensor_get_picture(struct usb_ov511 *ov, struct video_picture *p)
        PDEBUG(4, "sensor_get_picture");
 
        /* Don't return error if a setting is unsupported, or rest of settings
-         * will not be performed */
+        * will not be performed */
 
        rc = sensor_get_contrast(ov, &(p->contrast));
        if (FATAL_ERROR(rc))
@@ -2251,7 +2251,7 @@ mode_init_ov_sensor_regs(struct usb_ov511 *ov, int width, int height,
 
        /******** Clock programming ********/
 
-       /* The OV6620 needs special handling. This prevents the 
+       /* The OV6620 needs special handling. This prevents the
         * severe banding that normally occurs */
        if (ov->sensor == SEN_OV6620 || ov->sensor == SEN_OV6630)
        {
@@ -2326,7 +2326,7 @@ set_ov_sensor_window(struct usb_ov511 *ov, int width, int height, int mode,
                     int sub_flag)
 {
        int ret;
-       int hwsbase, hwebase, vwsbase, vwebase, hwsize, vwsize; 
+       int hwsbase, hwebase, vwsbase, vwebase, hwsize, vwsize;
        int hoffset, voffset, hwscale = 0, vwscale = 0;
 
        /* The different sensor ICs handle setting up of window differently.
@@ -2575,7 +2575,7 @@ ov518_mode_init_regs(struct usb_ov511 *ov,
                /* OV518 needs U and V swapped */
                i2c_w_mask(ov, 0x15, 0x00, 0x01);
 
-               if (mode == VIDEO_PALETTE_GREY) {
+               if (mode == VIDEO_PALETTE_GREY) {
                        /* Set 16-bit input format (UV data are ignored) */
                        reg_w_mask(ov, 0x20, 0x00, 0x08);
 
@@ -2894,7 +2894,7 @@ make_8x8(unsigned char *pIn, unsigned char *pOut, int w)
  *           ...              ...                    ...
  *     56 57 ... 63   120 121 ... 127        248 249 ... 255
  *
- */ 
+ */
 static void
 yuv400raw_to_yuv400p(struct ov511_frame *frame,
                     unsigned char *pIn0, unsigned char *pOut0)
@@ -2923,7 +2923,7 @@ yuv400raw_to_yuv400p(struct ov511_frame *frame,
  *
  *      0  1 ...  7
  *      8  9 ... 15
- *           ...   
+ *           ...
  *     56 57 ... 63
  *
  * U and V are shipped at half resolution (1 U,V sample -> one 2x2 block).
@@ -3034,7 +3034,7 @@ decompress(struct usb_ov511 *ov, struct ov511_frame *frame,
  */
 static void
 deinterlace(struct ov511_frame *frame, int rawformat,
-            unsigned char *pIn0, unsigned char *pOut0)
+           unsigned char *pIn0, unsigned char *pOut0)
 {
        const int fieldheight = frame->rawheight / 2;
        const int fieldpix = fieldheight * frame->rawwidth;
@@ -3112,7 +3112,7 @@ ov51x_postprocess_grey(struct usb_ov511 *ov, struct ov511_frame *frame)
                                                     frame->tempdata);
 
                        deinterlace(frame, RAWFMT_YUV400, frame->tempdata,
-                                   frame->data);
+                                   frame->data);
                } else {
                        if (frame->compressed)
                                decompress(ov, frame, frame->rawdata,
@@ -3136,7 +3136,7 @@ ov51x_postprocess_yuv420(struct usb_ov511 *ov, struct ov511_frame *frame)
                                             frame->tempdata);
 
                deinterlace(frame, RAWFMT_YUV420, frame->tempdata,
-                           frame->data);
+                           frame->data);
        } else {
                if (frame->compressed)
                        decompress(ov, frame, frame->rawdata, frame->data);
@@ -3226,7 +3226,7 @@ ov511_move_data(struct usb_ov511 *ov, unsigned char *in, int n)
                frame->rawwidth = ((int)(in[9]) + 1) * 8;
                frame->rawheight = ((int)(in[10]) + 1) * 8;
 
-               PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d",
+               PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d",
                        ov->curframe, pnum, frame->rawwidth, frame->rawheight,
                        frame->bytes_recvd);
 
@@ -3527,10 +3527,10 @@ ov51x_isoc_irq(struct urb *urb, struct pt_regs *regs)
                return;
        }
 
-        if (urb->status == -ENOENT || urb->status == -ECONNRESET) {
-                PDEBUG(4, "URB unlinked");
-                return;
-        }
+       if (urb->status == -ENOENT || urb->status == -ECONNRESET) {
+               PDEBUG(4, "URB unlinked");
+               return;
+       }
 
        if (urb->status != -EINPROGRESS && urb->status != 0) {
                err("ERROR: urb->status=%d: %s", urb->status,
@@ -4627,8 +4627,8 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
        PDEBUG(4, "mmap: %ld (%lX) bytes", size, size);
 
        if (size > (((OV511_NUMFRAMES
-                     * MAX_DATA_SIZE(ov->maxwidth, ov->maxheight)
-                     + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))))
+                     * MAX_DATA_SIZE(ov->maxwidth, ov->maxheight)
+                     + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))))
                return -EINVAL;
 
        if (mutex_lock_interruptible(&ov->lock))
@@ -5062,7 +5062,7 @@ ov6xx0_configure(struct usb_ov511 *ov)
 }
 
 /* This initializes the KS0127 and KS0127B video decoders. */
-static int 
+static int
 ks0127_configure(struct usb_ov511 *ov)
 {
        int rc;
@@ -5193,7 +5193,7 @@ saa7111a_configure(struct usb_ov511 *ov)
                return -1;
 
        /* Detect version of decoder. This must be done after writing the
-         * initial regs or the decoder will lock up. */
+        * initial regs or the decoder will lock up. */
        rc = i2c_r(ov, 0x00);
 
        if (rc < 0) {
@@ -5216,13 +5216,13 @@ saa7111a_configure(struct usb_ov511 *ov)
 }
 
 /* This initializes the OV511/OV511+ and the sensor */
-static int 
+static int
 ov511_configure(struct usb_ov511 *ov)
 {
        static struct ov511_regvals aRegvalsInit511[] = {
                { OV511_REG_BUS, R51x_SYS_RESET,        0x7f },
-               { OV511_REG_BUS, R51x_SYS_INIT,         0x01 },
-               { OV511_REG_BUS, R51x_SYS_RESET,        0x7f },
+               { OV511_REG_BUS, R51x_SYS_INIT,         0x01 },
+               { OV511_REG_BUS, R51x_SYS_RESET,        0x7f },
                { OV511_REG_BUS, R51x_SYS_INIT,         0x01 },
                { OV511_REG_BUS, R51x_SYS_RESET,        0x3f },
                { OV511_REG_BUS, R51x_SYS_INIT,         0x01 },
@@ -5269,7 +5269,7 @@ ov511_configure(struct usb_ov511 *ov)
                err("Please notify " EMAIL " of the name,");
                err("manufacturer, model, and this number of your camera.");
                err("Also include the output of the detection process.");
-       } 
+       }
 
        if (ov->customid == 70)         /* USB Life TV (PAL/SECAM) */
                ov->pal = 1;
@@ -5336,17 +5336,17 @@ ov511_configure(struct usb_ov511 *ov)
 
                                        if (i2c_w(ov, 0x10, 0x00) < 0) {
                                                err("Can't determine sensor slave IDs");
-                                               goto error;
+                                               goto error;
                                        } else {
                                                if (ks0127_configure(ov) < 0) {
                                                        err("Failed to configure KS0127");
-                                                       goto error;
+                                                       goto error;
                                                }
                                        }
                                } else {
                                        if (saa7111a_configure(ov) < 0) {
                                                err("Failed to configure SAA7111A");
-                                               goto error;
+                                               goto error;
                                        }
                                }
                        } else {
@@ -5356,13 +5356,13 @@ ov511_configure(struct usb_ov511 *ov)
                } else {
                        if (ov6xx0_configure(ov) < 0) {
                                err("Failed to configure OV6xx0");
-                               goto error;
+                               goto error;
                        }
                }
        } else {
                if (ov7xx0_configure(ov) < 0) {
                        err("Failed to configure OV7xx0");
-                       goto error;
+                       goto error;
                }
        }
 
@@ -5381,12 +5381,12 @@ ov518_configure(struct usb_ov511 *ov)
        /* For 518 and 518+ */
        static struct ov511_regvals aRegvalsInit518[] = {
                { OV511_REG_BUS, R51x_SYS_RESET,        0x40 },
-               { OV511_REG_BUS, R51x_SYS_INIT,         0xe1 },
-               { OV511_REG_BUS, R51x_SYS_RESET,        0x3e },
+               { OV511_REG_BUS, R51x_SYS_INIT,         0xe1 },
+               { OV511_REG_BUS, R51x_SYS_RESET,        0x3e },
                { OV511_REG_BUS, R51x_SYS_INIT,         0xe1 },
                { OV511_REG_BUS, R51x_SYS_RESET,        0x00 },
                { OV511_REG_BUS, R51x_SYS_INIT,         0xe1 },
-               { OV511_REG_BUS, 0x46,                  0x00 }, 
+               { OV511_REG_BUS, 0x46,                  0x00 },
                { OV511_REG_BUS, 0x5d,                  0x03 },
                { OV511_DONE_BUS, 0x0, 0x00},
        };
@@ -5517,7 +5517,7 @@ ov518_configure(struct usb_ov511 *ov)
 
                        if (init_ov_sensor(ov) < 0) {
                                err("Can't determine sensor slave IDs");
-                               goto error;
+                               goto error;
                        } else {
                                err("Detected unsupported OV8xx0 sensor");
                                goto error;
@@ -5525,13 +5525,13 @@ ov518_configure(struct usb_ov511 *ov)
                } else {
                        if (ov6xx0_configure(ov) < 0) {
                                err("Failed to configure OV6xx0");
-                               goto error;
+                               goto error;
                        }
                }
        } else {
                if (ov7xx0_configure(ov) < 0) {
                        err("Failed to configure OV7xx0");
-                       goto error;
+                       goto error;
                }
        }
 
@@ -5564,28 +5564,28 @@ static ssize_t show_custom_id(struct class_device *cd, char *buf)
 {
        struct usb_ov511 *ov = cd_to_ov(cd);
        return sprintf(buf, "%d\n", ov->customid);
-} 
+}
 static CLASS_DEVICE_ATTR(custom_id, S_IRUGO, show_custom_id, NULL);
 
 static ssize_t show_model(struct class_device *cd, char *buf)
 {
        struct usb_ov511 *ov = cd_to_ov(cd);
        return sprintf(buf, "%s\n", ov->desc);
-} 
+}
 static CLASS_DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
 
 static ssize_t show_bridge(struct class_device *cd, char *buf)
 {
        struct usb_ov511 *ov = cd_to_ov(cd);
        return sprintf(buf, "%s\n", symbolic(brglist, ov->bridge));
-} 
+}
 static CLASS_DEVICE_ATTR(bridge, S_IRUGO, show_bridge, NULL);
 
 static ssize_t show_sensor(struct class_device *cd, char *buf)
 {
        struct usb_ov511 *ov = cd_to_ov(cd);
        return sprintf(buf, "%s\n", symbolic(senlist, ov->sensor));
-} 
+}
 static CLASS_DEVICE_ATTR(sensor, S_IRUGO, show_sensor, NULL);
 
 static ssize_t show_brightness(struct class_device *cd, char *buf)
@@ -5597,7 +5597,7 @@ static ssize_t show_brightness(struct class_device *cd, char *buf)
                return -ENODEV;
        sensor_get_brightness(ov, &x);
        return sprintf(buf, "%d\n", x >> 8);
-} 
+}
 static CLASS_DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
 
 static ssize_t show_saturation(struct class_device *cd, char *buf)
@@ -5609,7 +5609,7 @@ static ssize_t show_saturation(struct class_device *cd, char *buf)
                return -ENODEV;
        sensor_get_saturation(ov, &x);
        return sprintf(buf, "%d\n", x >> 8);
-} 
+}
 static CLASS_DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
 
 static ssize_t show_contrast(struct class_device *cd, char *buf)
@@ -5621,7 +5621,7 @@ static ssize_t show_contrast(struct class_device *cd, char *buf)
                return -ENODEV;
        sensor_get_contrast(ov, &x);
        return sprintf(buf, "%d\n", x >> 8);
-} 
+}
 static CLASS_DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
 
 static ssize_t show_hue(struct class_device *cd, char *buf)
@@ -5633,7 +5633,7 @@ static ssize_t show_hue(struct class_device *cd, char *buf)
                return -ENODEV;
        sensor_get_hue(ov, &x);
        return sprintf(buf, "%d\n", x >> 8);
-} 
+}
 static CLASS_DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL);
 
 static ssize_t show_exposure(struct class_device *cd, char *buf)
@@ -5645,7 +5645,7 @@ static ssize_t show_exposure(struct class_device *cd, char *buf)
                return -ENODEV;
        sensor_get_exposure(ov, &exp);
        return sprintf(buf, "%d\n", exp >> 8);
-} 
+}
 static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL);
 
 static void ov_create_sysfs(struct video_device *vdev)
index bce9b36..12b3d51 100644 (file)
 #define R511_COMP_QVY          0x76
 #define R511_COMP_QVUV         0x77
 #define R511_COMP_EN           0x78
-#define R511_COMP_LUT_EN       0x79            
+#define R511_COMP_LUT_EN       0x79
 #define R511_COMP_LUT_BEGIN    0x80
 
 /* --------------------------------- */
@@ -459,14 +459,14 @@ struct usb_ov511 {
        int subh;               /* Pix Array subcapture height */
 
        int curframe;           /* Current receiving sbuf */
-       struct ov511_frame frame[OV511_NUMFRAMES];      
+       struct ov511_frame frame[OV511_NUMFRAMES];
 
        struct ov511_sbuf sbuf[OV511_NUMSBUF];
 
        wait_queue_head_t wq;   /* Processes waiting */
 
        int snap_enabled;       /* Snapshot mode enabled */
-       
+
        int bridge;             /* Type of bridge (BRG_*) */
        int bclass;             /* Class of bridge (BCL_*) */
        int sensor;             /* Type of image sensor chip (SEN_*) */
@@ -512,7 +512,7 @@ struct symbolic_list {
 /* Returns the name of the matching element in the symbolic_list array. The
  * end of the list must be marked with an element that has a NULL name.
  */
-static inline char * 
+static inline char *
 symbolic(struct symbolic_list list[], int num)
 {
        int i;
index bca41ad..cba4cdf 100644 (file)
@@ -1,4 +1,4 @@
 ovcamchip-objs     := ovcamchip_core.o ov6x20.o ov6x30.o ov7x10.o ov7x20.o \
-                      ov76be.o
+                     ov76be.o
 
 obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip.o
index e76b53d..3fe9fa0 100644 (file)
@@ -266,17 +266,17 @@ static int ovcamchip_detect(struct i2c_client *c)
                PDEBUG(3, "Testing for 0V6xx0");
                c->addr = OV6xx0_SID;
                if (init_camchip(c) < 0) {
-                       return -ENODEV;
+                       return -ENODEV;
                } else {
                        if (ov6xx0_detect(c) < 0) {
                                PERROR("Failed to init OV6xx0");
-                               return -EIO;
+                               return -EIO;
                        }
                }
        } else {
                if (ov7xx0_detect(c) < 0) {
                        PERROR("Failed to init OV7xx0");
-                       return -EIO;
+                       return -EIO;
                }
        }
 
index 575e612..1231335 100644 (file)
@@ -82,6 +82,6 @@ extern int ov_write_regvals(struct i2c_client *c,
                            struct ovcamchip_regvals *rvals);
 
 extern int ov_write_mask(struct i2c_client *c, unsigned char reg,
-                        unsigned char value, unsigned char mask);
+                        unsigned char value, unsigned char mask);
 
 #endif
index 15fd85a..522e9dd 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
     planb - PlanB frame grabber driver
 
     PlanB is used in the 7x00/8x00 series of PowerMacintosh
@@ -584,7 +584,7 @@ finish:
        wake_up_interruptible(&pb->suspendq);
 }
 
-static void add_clip(struct planb *pb, struct video_clip *clip) 
+static void add_clip(struct planb *pb, struct video_clip *clip)
 {
        volatile unsigned char  *base;
        int     xc = clip->x, yc = clip->y;
@@ -758,7 +758,7 @@ static void cmd_buff(struct planb *pb)
                                                        PLANB_SET(CH_SYNC));
        tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel),
                                                        PLANB_SET(DMA_ABORT));
-       
+
        /* odd field data: */
        jump = virt_to_bus(c1 + nlines / 2);
        for (i=1; i < nlines; i += stepsize, c1++)
@@ -1247,7 +1247,7 @@ static volatile struct dbdma_cmd *setup_grab_cmd(int fr, struct planb *pb)
        tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFCLR, virt_to_bus(c1-3)); c1++;
        tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel),
                PLANB_SET(DMA_ABORT));
-       
+
        /* odd field data: */
        jump_addr = c1 + TAB_FACTOR * nlines / 2;
        jump = virt_to_bus(jump_addr);
@@ -1383,7 +1383,7 @@ static int planb_open(struct video_device *dev, int mode)
        pb->user++;
 
        DEBUG("PlanB: device opened\n");
-       return 0;   
+       return 0;
 }
 
 static void planb_close(struct video_device *dev)
@@ -1424,9 +1424,9 @@ static long planb_write(struct video_device *v, const char *buf,
 static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 {
        struct planb *pb=(struct planb *)dev;
-       
+
        switch (cmd)
-       {       
+       {
                case VIDIOCGCAP:
                {
                        struct video_capability b;
@@ -1440,26 +1440,26 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                        b.channels = 2; /* composite & svhs */
                        b.audios = 0;
                        b.maxwidth = PLANB_MAXPIXELS;
-                        b.maxheight = PLANB_MAXLINES;
-                        b.minwidth = 32; /* wild guess */
-                        b.minheight = 32;
-                        if (copy_to_user(arg,&b,sizeof(b)))
-                                return -EFAULT;
+                       b.maxheight = PLANB_MAXLINES;
+                       b.minwidth = 32; /* wild guess */
+                       b.minheight = 32;
+                       if (copy_to_user(arg,&b,sizeof(b)))
+                               return -EFAULT;
                        return 0;
                }
                case VIDIOCSFBUF:
                {
-                        struct video_buffer v;
+                       struct video_buffer v;
                        unsigned short bpp;
                        unsigned int fmt;
 
                        DEBUG("PlanB: IOCTL VIDIOCSFBUF\n");
 
-                        if (!capable(CAP_SYS_ADMIN)
+                       if (!capable(CAP_SYS_ADMIN)
                        || !capable(CAP_SYS_RAWIO))
-                                return -EPERM;
-                        if (copy_from_user(&v, arg,sizeof(v)))
-                                return -EFAULT;
+                               return -EPERM;
+                       if (copy_from_user(&v, arg,sizeof(v)))
+                               return -EFAULT;
                        planb_lock(pb);
                        switch(v.depth) {
                        case 8:
@@ -1478,7 +1478,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                                break;
                        default:
                                planb_unlock(pb);
-                                return -EINVAL;
+                               return -EINVAL;
                        }
                        if (bpp * v.width > v.bytesperline) {
                                planb_unlock(pb);
@@ -1493,7 +1493,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                        pb->win.bpl = pb->win.bpp * pb->win.swidth;
                        pb->win.pad = v.bytesperline - pb->win.bpl;
 
-                        DEBUG("PlanB: Display at %p is %d by %d, bytedepth %d,"
+                       DEBUG("PlanB: Display at %p is %d by %d, bytedepth %d,"
                                " bpl %d (+ %d)\n", v.base, v.width,v.height,
                                pb->win.bpp, pb->win.bpl, pb->win.pad);
 
@@ -1504,11 +1504,11 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                                resume_overlay(pb);
                        }
                        planb_unlock(pb);
-                       return 0;               
+                       return 0;
                }
                case VIDIOCGFBUF:
                {
-                        struct video_buffer v;
+                       struct video_buffer v;
 
                        DEBUG("PlanB: IOCTL VIDIOCGFBUF\n");
 
@@ -1518,15 +1518,15 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                        v.depth = pb->win.depth;
                        v.bytesperline = pb->win.bpl + pb->win.pad;
                        if (copy_to_user(arg, &v, sizeof(v)))
-                                return -EFAULT;
+                               return -EFAULT;
                        return 0;
                }
                case VIDIOCCAPTURE:
                {
                        int i;
 
-                        if(copy_from_user(&i, arg, sizeof(i)))
-                                return -EFAULT;
+                       if(copy_from_user(&i, arg, sizeof(i)))
+                               return -EFAULT;
                        if(i==0) {
                                DEBUG("PlanB: IOCTL VIDIOCCAPTURE Stop\n");
 
@@ -1695,7 +1695,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                        struct video_window     vw;
                        struct video_clip       clip;
                        int                     i;
-                       
+
                        DEBUG("PlanB: IOCTL VIDIOCSWIN\n");
 
                        if(copy_from_user(&vw,arg,sizeof(vw)))
@@ -1749,7 +1749,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                                return -EFAULT;
                        return 0;
                }
-               case VIDIOCSYNC: {
+               case VIDIOCSYNC: {
                        int i;
 
                        IDEBUG("PlanB: IOCTL VIDIOCSYNC\n");
@@ -1759,42 +1759,42 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 
                        IDEBUG("PlanB: sync to frame %d\n", i);
 
-                        if(i > (MAX_GBUFFERS - 1) || i < 0)
-                                return -EINVAL;
+                       if(i > (MAX_GBUFFERS - 1) || i < 0)
+                               return -EINVAL;
 chk_grab:
-                        switch (pb->frame_stat[i]) {
-                        case GBUFFER_UNUSED:
-                                return -EINVAL;
+                       switch (pb->frame_stat[i]) {
+                       case GBUFFER_UNUSED:
+                               return -EINVAL;
                        case GBUFFER_GRABBING:
                                IDEBUG("PlanB: waiting for grab"
                                                        " done (%d)\n", i);
-                               interruptible_sleep_on(&pb->capq);
+                               interruptible_sleep_on(&pb->capq);
                                if(signal_pending(current))
                                        return -EINTR;
                                goto chk_grab;
-                        case GBUFFER_DONE:
-                                pb->frame_stat[i] = GBUFFER_UNUSED;
-                                break;
-                        }
-                        return 0;
+                       case GBUFFER_DONE:
+                               pb->frame_stat[i] = GBUFFER_UNUSED;
+                               break;
+                       }
+                       return 0;
                }
 
-               case VIDIOCMCAPTURE:
+               case VIDIOCMCAPTURE:
                {
-                        struct video_mmap vm;
+                       struct video_mmap vm;
                        volatile unsigned int status;
 
                        IDEBUG("PlanB: IOCTL VIDIOCMCAPTURE\n");
 
                        if(copy_from_user((void *) &vm,(void *)arg,sizeof(vm)))
                                return -EFAULT;
-                        status = pb->frame_stat[vm.frame];
-                        if (status != GBUFFER_UNUSED)
-                                return -EBUSY;
+                       status = pb->frame_stat[vm.frame];
+                       if (status != GBUFFER_UNUSED)
+                               return -EBUSY;
 
-                       return vgrab(pb, &vm);
+                       return vgrab(pb, &vm);
                }
-               
+
                case VIDIOCGMBUF:
                {
                        int i;
@@ -1811,7 +1811,7 @@ chk_grab:
                                return -EFAULT;
                        return 0;
                }
-               
+
                case PLANBIOCGSAAREGS:
                {
                        struct planb_saa_regs preg;
@@ -1828,7 +1828,7 @@ chk_grab:
                                return -EFAULT;
                        return 0;
                }
-               
+
                case PLANBIOCSSAAREGS:
                {
                        struct planb_saa_regs preg;
@@ -1842,7 +1842,7 @@ chk_grab:
                        saa_set (preg.addr, preg.val, pb);
                        return 0;
                }
-               
+
                case PLANBIOCGSTAT:
                {
                        struct planb_stat_regs pstat;
@@ -1859,7 +1859,7 @@ chk_grab:
                                return -EFAULT;
                        return 0;
                }
-               
+
                case PLANBIOCSMODE: {
                        int v;
 
@@ -1985,10 +1985,10 @@ static int planb_mmap(struct vm_area_struct *vma, struct video_device *dev, cons
 {
        int i;
        struct planb *pb = (struct planb *)dev;
-        unsigned long start = (unsigned long)adr;
+       unsigned long start = (unsigned long)adr;
 
        if (size > MAX_GBUFFERS * PLANB_MAX_FBUF)
-               return -EINVAL;
+               return -EINVAL;
        if (!pb->rawbuf) {
                int err;
                if((err=grabbuf_alloc(pb)))
@@ -2091,10 +2091,10 @@ static int init_planb(struct planb *pb)
        /* clear interrupt mask */
        pb->intr_mask = PLANB_CLR_IRQ;
 
-        result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb);
-        if (result < 0) {
-               if (result==-EINVAL)
-                       printk(KERN_ERR "PlanB: Bad irq number (%d) "
+       result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb);
+       if (result < 0) {
+               if (result==-EINVAL)
+                       printk(KERN_ERR "PlanB: Bad irq number (%d) "
                                                "or handler\n", (int)pb->irq);
                else if (result==-EBUSY)
                        printk(KERN_ERR "PlanB: I don't know why, "
@@ -2102,7 +2102,7 @@ static int init_planb(struct planb *pb)
                return result;
        }
        disable_irq(pb->irq);
-        
+
        /* Now add the template and register the device unit. */
        memcpy(&pb->video_dev,&planb_template,sizeof(planb_template));
 
@@ -2143,7 +2143,7 @@ static int init_planb(struct planb *pb)
 }
 
 /*
- *     Scan for a PlanB controller, request the irq and map the io memory 
+ *     Scan for a PlanB controller, request the irq and map the io memory
  */
 
 static int find_planb(void)
@@ -2171,9 +2171,9 @@ static int find_planb(void)
        pb = &planbs[0];
        planb_num = 1;
 
-        if (planb_devices->n_addrs != 1) {
-                printk (KERN_WARNING "PlanB: expecting 1 address for planb "
-                       "(got %d)", planb_devices->n_addrs);
+       if (planb_devices->n_addrs != 1) {
+               printk (KERN_WARNING "PlanB: expecting 1 address for planb "
+                       "(got %d)", planb_devices->n_addrs);
                return 0;
        }
 
@@ -2236,7 +2236,7 @@ static int find_planb(void)
        pb->planb_base = planb_regs;
        pb->planb_base_phys = (struct planb_registers *)new_base;
        pb->irq = irq;
-       
+
        return planb_num;
 
 err_out_disable:
@@ -2251,7 +2251,7 @@ static void release_planb(void)
        int i;
        struct planb *pb;
 
-       for (i=0;i<planb_num; i++) 
+       for (i=0;i<planb_num; i++)
        {
                pb=&planbs[i];
 
@@ -2278,7 +2278,7 @@ static void release_planb(void)
 static int __init init_planbs(void)
 {
        int i;
-  
+
        if (find_planb()<=0)
                return -EIO;
 
@@ -2288,9 +2288,9 @@ static int __init init_planbs(void)
                                                        " with v4l\n", i);
                        release_planb();
                        return -EIO;
-               } 
+               }
                printk(KERN_INFO "PlanB: registered device %d with v4l\n", i);
-       }  
+       }
        return 0;
 }
 
index 79b6b56..9282321 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
     planb - PlanB frame grabber driver
 
     PlanB is used in the 7x00/8x00 series of PowerMacintosh
@@ -167,7 +167,7 @@ struct planb {
        struct  video_device video_dev;
        struct  video_picture picture;          /* Current picture params */
        struct  video_audio audio_dev;          /* Current audio params */
-  
+
        volatile struct planb_registers *planb_base;    /* virt base of planb */
        struct planb_registers *planb_base_phys;        /* phys base of planb */
        void    *priv_space;                    /* Org. alloc. mem for kfree */
@@ -209,7 +209,7 @@ struct planb {
        int gwidth[MAX_GBUFFERS], gheight[MAX_GBUFFERS];
        unsigned int gfmt[MAX_GBUFFERS];
        int gnorm_switch[MAX_GBUFFERS];
-        volatile unsigned int *frame_stat;
+       volatile unsigned int *frame_stat;
 #define GBUFFER_UNUSED       0x00U
 #define GBUFFER_GRABBING     0x01U
 #define GBUFFER_DONE         0x02U
index 05ca559..09835ca 100644 (file)
  *     Most of this code is directly derived from his userspace driver.
  *     His driver works so send any reports to alan@redhat.com unless the
  *     userspace driver also doesn't work for you...
- *      
+ *
  *      Changes:
  *      08/07/2003        Daniele Bellucci <bellucda@tiscali.it>
- *                        - pms_capture: report back -EFAULT 
+ *                        - pms_capture: report back -EFAULT
  */
 
 #include <linux/module.h>
@@ -66,14 +66,14 @@ static int standard                 = 0;    /* 0 - auto 1 - ntsc 2 - pal 3 - secam */
 /*
  *     I/O ports and Shared Memory
  */
+
 static int io_port             =       0x250;
 static int data_port           =       0x251;
 static int mem_base            =       0xC8000;
 static void __iomem *mem;
 static int video_nr             =       -1;
 
-       
+
 
 static inline void mvv_write(u8 index, u8 value)
 {
@@ -90,9 +90,9 @@ static int pms_i2c_stat(u8 slave)
 {
        int counter;
        int i;
-       
+
        outb(0x28, io_port);
-       
+
        counter=0;
        while((inb(data_port)&0x01)==0)
                if(counter++==256)
@@ -101,9 +101,9 @@ static int pms_i2c_stat(u8 slave)
        while((inb(data_port)&0x01)!=0)
                if(counter++==256)
                        break;
-                       
+
        outb(slave, io_port);
-       
+
        counter=0;
        while((inb(data_port)&0x01)==0)
                if(counter++==256)
@@ -112,7 +112,7 @@ static int pms_i2c_stat(u8 slave)
        while((inb(data_port)&0x01)!=0)
                if(counter++==256)
                        break;
-                       
+
        for(i=0;i<12;i++)
        {
                char st=inb(data_port);
@@ -122,7 +122,7 @@ static int pms_i2c_stat(u8 slave)
                        break;
        }
        outb(0x29, io_port);
-       return inb(data_port);          
+       return inb(data_port);
 }
 
 static int pms_i2c_write(u16 slave, u16 sub, u16 data)
@@ -130,19 +130,19 @@ static int pms_i2c_write(u16 slave, u16 sub, u16 data)
        int skip=0;
        int count;
        int i;
-       
+
        for(i=0;i<i2c_count;i++)
        {
                if((i2cinfo[i].slave==slave) &&
                   (i2cinfo[i].sub == sub))
                {
-                       if(i2cinfo[i].data==data)
-                               skip=1;
-                       i2cinfo[i].data=data;
-                       i=i2c_count+1;
+                       if(i2cinfo[i].data==data)
+                               skip=1;
+                       i2cinfo[i].data=data;
+                       i=i2c_count+1;
                }
        }
-       
+
        if(i==i2c_count && i2c_count<64)
        {
                i2cinfo[i2c_count].slave=slave;
@@ -150,16 +150,16 @@ static int pms_i2c_write(u16 slave, u16 sub, u16 data)
                i2cinfo[i2c_count].data=data;
                i2c_count++;
        }
-       
+
        if(skip)
                return 0;
-               
+
        mvv_write(0x29, sub);
        mvv_write(0x2A, data);
        mvv_write(0x28, slave);
-       
+
        outb(0x28, io_port);
-       
+
        count=0;
        while((inb(data_port)&1)==0)
                if(count>255)
@@ -167,9 +167,9 @@ static int pms_i2c_write(u16 slave, u16 sub, u16 data)
        while((inb(data_port)&1)!=0)
                if(count>255)
                        break;
-                       
+
        count=inb(data_port);
-       
+
        if(count&2)
                return -1;
        return count;
@@ -189,8 +189,8 @@ static int pms_i2c_read(int slave, int sub)
 
 static void pms_i2c_andor(int slave, int sub, int and, int or)
 {
-       u8 tmp; 
-       
+       u8 tmp;
+
        tmp=pms_i2c_read(slave, sub);
        tmp = (tmp&and)|or;
        pms_i2c_write(slave, sub, tmp);
@@ -199,7 +199,7 @@ static void pms_i2c_andor(int slave, int sub, int and, int or)
 /*
  *     Control functions
  */
+
 
 static void pms_videosource(short source)
 {
@@ -234,8 +234,8 @@ static void pms_colour(short colour)
                        break;
        }
 }
+
+
 static void pms_contrast(short contrast)
 {
        switch(decoder)
@@ -269,14 +269,14 @@ static void pms_format(short format)
 {
        int target;
        standard = format;
-       
+
        if(decoder==PHILIPS1)
                target=0x42;
        else if(decoder==PHILIPS2)
                target=0x8A;
        else
                return;
-                               
+
        switch(format)
        {
                case 0: /* Auto */
@@ -302,7 +302,7 @@ static void pms_format(short format)
 
 /*
  *     These features of the PMS card are not currently exposes. They
- *     could become a private v4l ioctl for PMSCONFIG or somesuch if 
+ *     could become a private v4l ioctl for PMSCONFIG or somesuch if
  *     people need it. We also don't yet use the PMS interrupt.
  */
 
@@ -324,7 +324,7 @@ static void pms_hstart(short start)
 /*
  *     Bandpass filters
  */
+
 static void pms_bandpass(short pass)
 {
        if(decoder==PHILIPS2)
@@ -493,7 +493,7 @@ static void pms_vert(u8 deciden, u8 decinum)
 /*
  *     Turn 16bit ratios into best small ratio the chipset can grok
  */
+
 static void pms_vertdeci(unsigned short decinum, unsigned short deciden)
 {
        /* Knock it down by /5 once */
@@ -546,7 +546,7 @@ static void pms_horzdeci(short decinum, short deciden)
                decinum=512;
                deciden=640;    /* 768 would be ideal */
        }
-       
+
        while(((decinum|deciden)&1)==0)
        {
                decinum>>=1;
@@ -559,7 +559,7 @@ static void pms_horzdeci(short decinum, short deciden)
        }
        if(deciden==32)
                deciden--;
-               
+
        mvv_write(0x24, 0x80|deciden);
        mvv_write(0x25, decinum);
 }
@@ -567,14 +567,14 @@ static void pms_horzdeci(short decinum, short deciden)
 static void pms_resolution(short width, short height)
 {
        int fg_height;
-       
+
        fg_height=height;
        if(fg_height>280)
                fg_height=280;
-               
+
        mvv_write(0x18, fg_height);
        mvv_write(0x19, fg_height>>8);
-       
+
        if(standard==1)
        {
                mvv_write(0x1A, 0xFC);
@@ -598,7 +598,7 @@ static void pms_resolution(short width, short height)
        mvv_write(0x42, 0x00);
        mvv_write(0x43, 0x00);
        mvv_write(0x44, MVVMEMORYWIDTH);
-       
+
        mvv_write(0x22, width+8);
        mvv_write(0x23, (width+8)>> 8);
 
@@ -618,7 +618,7 @@ static void pms_resolution(short width, short height)
 /*
  *     Set Input
  */
+
 static void pms_vcrinput(short input)
 {
        if(decoder==PHILIPS2)
@@ -643,20 +643,20 @@ static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
        mvv_write(0x08,r8); /* capture rgb555/565, init DRAM, PC enable */
 
 /*     printf("%d %d %d %d %d %x %x\n",width,height,voff,nom,den,mvv_buf); */
-  
-       for (y = 0; y < dev->height; y++ ) 
+
+       for (y = 0; y < dev->height; y++ )
        {
                writeb(0, mem);  /* synchronisiert neue Zeile */
-               
+
                /*
                 *      This is in truth a fifo, be very careful as if you
                 *      forgot this odd things will occur 8)
                 */
-                
+
                memcpy_fromio(tmp, mem, dw+32); /* discard 16 word   */
                cnt -= dev->height;
-               while (cnt <= 0) 
-               { 
+               while (cnt <= 0)
+               {
                        /*
                         *      Don't copy too far
                         */
@@ -666,7 +666,7 @@ static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
                        cnt += dev->height;
                        if (copy_to_user(buf, tmp+32, dt))
                                return len ? len : -EFAULT;
-                       buf += dt;    
+                       buf += dt;
                        len += dt;
                }
        }
@@ -683,7 +683,7 @@ static int pms_do_ioctl(struct inode *inode, struct file *file,
 {
        struct video_device *dev = video_devdata(file);
        struct pms_device *pd=(struct pms_device *)dev;
-       
+
        switch(cmd)
        {
                case VIDIOCGCAP:
@@ -806,7 +806,7 @@ static int pms_do_ioctl(struct inode *inode, struct file *file,
                            ||(p->palette==VIDEO_PALETTE_RGB555 && p->depth==15)))
                                return -EINVAL;
                        pd->picture= *p;
-                       
+
                        /*
                         *      Now load the card.
                         */
@@ -815,7 +815,7 @@ static int pms_do_ioctl(struct inode *inode, struct file *file,
                        pms_brightness(p->brightness>>8);
                        pms_hue(p->hue>>8);
                        pms_colour(p->colour>>8);
-                       pms_contrast(p->contrast>>8);   
+                       pms_contrast(p->contrast>>8);
                        mutex_unlock(&pd->lock);
                        return 0;
                }
@@ -873,7 +873,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
        struct video_device *v = video_devdata(file);
        struct pms_device *pd=(struct pms_device *)v;
        int len;
-       
+
        mutex_lock(&pd->lock);
        len=pms_capture(pd, buf, (pd->picture.depth==16)?0:1,count);
        mutex_unlock(&pd->lock);
@@ -905,13 +905,13 @@ static struct pms_device pms_device;
 /*
  *     Probe for and initialise the Mediavision PMS
  */
+
 static int init_mediavision(void)
 {
        int id;
        int idec, decst;
        int i;
-               
+
        unsigned char i2c_defs[]={
                0x4C,0x30,0x00,0xE8,
                0xB6,0xE2,0x00,0x00,
@@ -925,7 +925,7 @@ static int init_mediavision(void)
        mem = ioremap(mem_base, 0x800);
        if (!mem)
                return -ENOMEM;
-       
+
        if (!request_region(0x9A01, 1, "Mediavision PMS config"))
        {
                printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n");
@@ -941,18 +941,18 @@ static int init_mediavision(void)
        }
        outb(0xB8, 0x9A01);             /* Unlock */
        outb(io_port>>4, 0x9A01);       /* Set IO port */
-       
-       
+
+
        id=mvv_read(3);
        decst=pms_i2c_stat(0x43);
-       
+
        if(decst!=-1)
                idec=2;
        else if(pms_i2c_stat(0xb9)!=-1)
                idec=3;
        else if(pms_i2c_stat(0x8b)!=-1)
                idec=1;
-       else 
+       else
                idec=0;
 
        printk(KERN_INFO "PMS type is %d\n", idec);
@@ -966,11 +966,11 @@ static int init_mediavision(void)
        /*
         *      Ok we have a PMS of some sort
         */
-       
+
        mvv_write(0x04, mem_base>>12);  /* Set the memory area */
-       
+
        /* Ok now load the defaults */
-       
+
        for(i=0;i<0x19;i++)
        {
                if(i2c_defs[i]==0xFF)
@@ -978,7 +978,7 @@ static int init_mediavision(void)
                else
                        pms_i2c_write(0x8A, i, i2c_defs[i]);
        }
-       
+
        pms_i2c_write(0xB8,0x00,0x12);
        pms_i2c_write(0xB8,0x04,0x00);
        pms_i2c_write(0xB8,0x07,0x00);
@@ -987,18 +987,18 @@ static int init_mediavision(void)
        pms_i2c_write(0xB8,0x0A,0x00);
        pms_i2c_write(0xB8,0x0B,0x10);
        pms_i2c_write(0xB8,0x10,0x03);
-       
+
        mvv_write(0x01, 0x00);
        mvv_write(0x05, 0xA0);
        mvv_write(0x08, 0x25);
        mvv_write(0x09, 0x00);
-       mvv_write(0x0A, 0x20|MVVMEMORYWIDTH);   
-       
+       mvv_write(0x0A, 0x20|MVVMEMORYWIDTH);
+
        mvv_write(0x10, 0x02);
        mvv_write(0x1E, 0x0C);
        mvv_write(0x1F, 0x03);
        mvv_write(0x26, 0x06);
-       
+
        mvv_write(0x2B, 0x00);
        mvv_write(0x2C, 0x20);
        mvv_write(0x2D, 0x00);
@@ -1018,13 +1018,13 @@ static int init_mediavision(void)
 /*
  *     Initialization and module stuff
  */
+
 static int __init init_pms_cards(void)
 {
        printk(KERN_INFO "Mediavision Pro Movie Studio driver 0.02\n");
-       
+
        data_port = io_port +1;
-       
+
        if(init_mediavision())
        {
                printk(KERN_INFO "Board not found.\n");
index 2d93a77..8326684 100644 (file)
@@ -15,6 +15,6 @@ default:
 endif
 
 clean:
-       rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c 
+       rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c
        rm -rf .tmp_versions
 
index 04a640d..11f751a 100644 (file)
@@ -47,17 +47,17 @@ don't know how to set it properly in the driver. The options are:
 size
    Can be one of 'sqcif', 'qsif', 'qcif', 'sif', 'cif' or
    'vga', for an image size of resp. 128x96, 160x120, 176x144,
-   320x240, 352x288 and 640x480 (of course, only for those cameras that 
+   320x240, 352x288 and 640x480 (of course, only for those cameras that
    support these resolutions).
 
 fps
    Specifies the desired framerate. Is an integer in the range of 4-30.
 
 fbufs
-   This paramter specifies the number of internal buffers to use for storing 
-   frames from the cam. This will help if the process that reads images from 
-   the cam is a bit slow or momentarely busy. However, on slow machines it 
-   only introduces lag, so choose carefully. The default is 3, which is 
+   This paramter specifies the number of internal buffers to use for storing
+   frames from the cam. This will help if the process that reads images from
+   the cam is a bit slow or momentarely busy. However, on slow machines it
+   only introduces lag, so choose carefully. The default is 3, which is
    reasonable. You can set it between 2 and 5.
 
 mbufs
@@ -65,9 +65,9 @@ mbufs
    buffers to reserve for mmap(), VIDIOCCGMBUF, VIDIOCMCAPTURE and friends.
    The default is 2, which is adequate for most applications (double
    buffering).
-      
+
    Should you experience a lot of 'Dumping frame...' messages during
-   grabbing with a tool that uses mmap(), you might want to increase if. 
+   grabbing with a tool that uses mmap(), you might want to increase if.
    However, it doesn't really buffer images, it just gives you a bit more
    slack when your program is behind. But you need a multi-threaded or
    forked program to really take advantage of these buffers.
@@ -88,15 +88,15 @@ power_save
 
 compression (only useful with the plugin)
    With this option you can control the compression factor that the camera
-   uses to squeeze the image through the USB bus. You can set the 
+   uses to squeeze the image through the USB bus. You can set the
    parameter between 0 and 3:
      0 = prefer uncompressed images; if the requested mode is not available
-         in an uncompressed format, the driver will silently switch to low
-         compression.
+        in an uncompressed format, the driver will silently switch to low
+        compression.
      1 = low compression.
      2 = medium compression.
      3 = high compression.
-      
+
    High compression takes less bandwidth of course, but it could also
    introduce some unwanted artefacts. The default is 2, medium compression.
    See the FAQ on the website for an overview of which modes require
@@ -112,7 +112,7 @@ leds
    this is let the LED blink while the camera is in use. This:
 
      leds=500,500
-      
+
    will blink the LED once every second. But with:
 
      leds=0,0
@@ -123,7 +123,7 @@ leds
    when the camera is not used anymore.
 
    This parameter works only with the ToUCam range of cameras (720, 730, 740,
-   750) and OEMs. For other cameras this command is silently ignored, and 
+   750) and OEMs. For other cameras this command is silently ignored, and
    the LED cannot be controlled.
 
    Finally: this parameters does not take effect UNTIL the first time you
@@ -144,35 +144,35 @@ dev_hint
    format:
 
       [type[.serialnumber]:]node
-      
+
    The square brackets mean that both the type and the serialnumber are
    optional, but a serialnumber cannot be specified without a type (which
    would be rather pointless). The serialnumber is separated from the type
    by a '.'; the node number by a ':'.
-   
+
    This somewhat cryptic syntax is best explained by a few examples:
 
      dev_hint=3,5              The first detected cam gets assigned
-                               /dev/video3, the second /dev/video5. Any
-                               other cameras will get the first free 
-                               available slot (see below).
+                              /dev/video3, the second /dev/video5. Any
+                              other cameras will get the first free
+                              available slot (see below).
 
      dev_hint=645:1,680:2      The PCA645 camera will get /dev/video1,
-                               and a PCVC680 /dev/video2.
-                               
-     dev_hint=645.0123:3,645.4567:0    The PCA645 camera with serialnumber 
-               &