Commit d56410e0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (3599b): Whitespace cleanups under drivers/media

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 9f6933be
......@@ -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
......
/*
/*
* 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,
......
/*
/*
* 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,
......
......@@ -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");
......
/*
/*
* 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,
......
/*
/*
* 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,
......
......@@ -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;
......
......@@ -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;
......
This diff is collapsed.
......@@ -52,10 +52,10 @@
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__ */
......
......@@ -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)) {
......
......@@ -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);
......
......@@ -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,
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -37,28 +37,28 @@
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)
......
......@@ -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 */
......
......@@ -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];
......
......@@ -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;
......
This diff is collapsed.
......@@ -130,7 +130,7 @@
#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;
......
ovcamchip-objs := ovcamchip_core.o ov6x20.o ov6x30.o ov7x10.o ov7x20.o \
ov76be.o
ov76be.o
obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip.o
......@@ -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;
}
}
......
......@@ -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
/*
/*
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;
}
......
/*
/*
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
......
......@@ -12,10 +12,10 @@
* 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");
......
......@@ -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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Linux driver for Philips webcam
/* Linux driver for Philips webcam
Various miscellaneous functions and tables.
(C) 1999-2003 Nemosoft Unv.
(C) 2004 Luc Saillard (luc@saillard.org)
......@@ -44,17 +44,17 @@ int pwc_decode_size(struct pwc_device *pdev, int width, int height)
int i, find;
/* Make sure we don't go beyond our max size.
NB: we have different limits for RAW and normal modes. In case
you don't have the decompressor loaded or use RAW mode,
the maximum viewable size is smaller.
*/
NB: we have different limits for RAW and normal modes. In case
you don't have the decompressor loaded or use RAW mode,
the maximum viewable size is smaller.
*/
if (pdev->vpalette == VIDEO_PALETTE_RAW)
{
if (width > pdev->abs_max.x || height > pdev->abs_max.y)
{
Debug("VIDEO_PALETTE_RAW: going beyond abs_max.\n");
return -1;
}
return -1;
}
}
else
{
......@@ -88,8 +88,8 @@ void pwc_construct(struct pwc_device *pdev)
pdev->view_min.y = 96;
pdev->view_max.x = 352;
pdev->view_max.y = 288;
pdev->abs_max.x = 352;
pdev->abs_max.y = 288;
pdev->abs_max.x = 352;
pdev->abs_max.y = 288;
pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QCIF | 1 << PSZ_CIF;
pdev->vcinterface = 2;
pdev->vendpoint = 4;
......@@ -105,8 +105,8 @@ void pwc_construct(struct pwc_device *pdev)
pdev->view_max.x = 640;
pdev->view_max.y = 480;
pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QSIF | 1 << PSZ_QCIF | 1 << PSZ_SIF | 1 << PSZ_CIF | 1 << PSZ_VGA;
pdev->abs_max.x = 640;
pdev->abs_max.y = 480;
pdev->abs_max.x = 640;
pdev->abs_max.y = 480;
pdev->vcinterface = 3;
pdev->vendpoint = 4;
pdev->frame_header_size = 0;
......@@ -121,8 +121,8 @@ void pwc_construct(struct pwc_device *pdev)
pdev->view_max.x = 640;
pdev->view_max.y = 480;
pdev->image_mask = 1 << PSZ_QSIF | 1 << PSZ_SIF | 1 << PSZ_VGA;
pdev->abs_max.x = 640;
pdev->abs_max.y = 480;
pdev->abs_max.x = 640;
pdev->abs_max.y = 480;
pdev->vcinterface = 3;
pdev->vendpoint = 5;
pdev->frame_header_size = TOUCAM_HEADER_SIZE;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment