Commit 0e8f510d authored by Luca Risolia's avatar Luca Risolia Committed by Greg Kroah-Hartman

[PATCH] USB: W996[87]CF driver update

This patch contains updates and one bug fix.
parent 8d4f1c82
......@@ -2670,9 +2670,9 @@ S: 70110 Kuopio
S: Finland
N: Luca Risolia
E: luca_ing@libero.it
D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chip
S: Via Libertà 41/a
E: luca.risolia@studio.unibo.it
D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips
S: Via Liberta' 41/A
S: Osio Sotto, 24046, Bergamo
S: Italy
......
This diff is collapsed.
......@@ -2223,7 +2223,7 @@ S: Maintained
USB W996[87]CF DRIVER
P: Luca Risolia
M: luca_ing@libero.it
M: luca.risolia@studio.unibo.it
L: linux-usb-devel@lists.sourceforge.net
W: http://go.lamarinapunto.com
S: Maintained
......
......@@ -182,24 +182,21 @@ config USB_W9968CF
tristate "USB W996[87]CF JPEG Dual Mode Camera support"
depends on USB && VIDEO_DEV && I2C
---help---
Say Y here if you want support for cameras based on
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 contains code that
allows you to use higher resolutions and framerates, and can't
be included into the official Linux kernel for performance
purposes.
At the moment the driver needs a third-part module for the CMOS
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.
At the moment the driver needs a third-party module for the CMOS
sensors, which is available on internet: it is recommended to read
<file:Documentation/usb/w9968cf.txt> for more informations and for
a list of supported cameras.
This driver uses the Video For Linux and the I2C APIs.
You must say Y or M to both "Video For Linux" and
"I2C Support" to use this driver.
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This driver uses the Video For Linux and the I2C APIs. You must say
Y or M to both "Video For Linux" and "I2C Support" to use this
driver.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
......
This diff is collapsed.
/***************************************************************************
* Video4Linux driver for W996[87]CF JPEG USB Dual Mode Camera Chip. *
* *
* Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it> *
* Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -28,6 +28,7 @@
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/config.h>
#include <linux/param.h>
#include <asm/semaphore.h>
#include <asm/types.h>
......@@ -105,7 +106,7 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
#define W9968CF_LARGEVIEW 1 /* 0 disable, 1 enable */
#define W9968CF_UPSCALING 0 /* 0 disable, 1 enable */
#define W9968CF_SENSOR_MONO 0 /* 0 not monochrome, 1 monochrome sensor */
#define W9968CF_MONOCHROME 0 /* 0 not monochrome, 1 monochrome sensor */
#define W9968CF_BRIGHTNESS 31000 /* from 0 to 65535 */
#define W9968CF_HUE 32768 /* from 0 to 65535 */
#define W9968CF_COLOUR 32768 /* from 0 to 65535 */
......@@ -129,9 +130,10 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
#define W9968CF_MODULE_NAME "V4L driver for W996[87]CF JPEG USB " \
"Dual Mode Camera Chip"
#define W9968CF_MODULE_VERSION "v1.22"
#define W9968CF_MODULE_AUTHOR "(C) 2002 2003 Luca Risolia"
#define W9968CF_AUTHOR_EMAIL "<luca_ing@libero.it>"
#define W9968CF_MODULE_VERSION "v1.25-basic"
#define W9968CF_MODULE_AUTHOR "(C) 2002-2004 Luca Risolia"
#define W9968CF_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
#define W9968CF_MODULE_LICENSE "GPL"
static u8 w9968cf_vppmod_present; /* status flag: yes=1, no=0 */
......@@ -171,6 +173,7 @@ enum w9968cf_frame_status {
};
struct w9968cf_frame_t {
#define W9968CF_HW_BUF_SIZE 640*480*2 /* buf.size of original frames */
void* buffer;
u32 length;
enum w9968cf_frame_status status;
......@@ -194,8 +197,8 @@ struct semaphore w9968cf_devlist_sem; /* semaphore for list traversal */
struct w9968cf_device {
enum w9968cf_model_id id; /* private device identifier */
struct video_device v4ldev; /* V4L structure */
struct list_head v4llist; /* entry of the list of V4L cameras */
struct video_device* v4ldev; /* -> V4L structure */
struct list_head v4llist; /* entry of the list of V4L cameras */
struct usb_device* usbdev; /* -> main USB structure */
struct urb* urb[W9968CF_URBS]; /* -> USB request block structs */
......@@ -207,9 +210,9 @@ struct w9968cf_device {
struct w9968cf_frame_t frame_tmp; /* temporary frame */
struct w9968cf_frame_t* frame_current; /* -> frame being grabbed */
struct w9968cf_frame_t* requested_frame[W9968CF_MAX_BUFFERS];
void* vpp_buffer; /* -> helper buffer for post-processing routines */
void* vpp_buffer; /*-> helper buf.for video post-processing routines */
u8 max_buffers, /* number of requested buffers */
u8 max_buffers, /* number of requested buffers */
force_palette, /* yes=1/no=0 */
force_rgb, /* read RGB instead of BGR, yes=1, no=0 */
double_buffer, /* hardware double buffering yes=1/no=0 */
......@@ -220,15 +223,17 @@ struct w9968cf_device {
decompression, /* 0=disabled, 1=forced, 2=allowed */
upscaling; /* software image scaling, 0=enabled, 1=disabled */
struct video_picture picture; /* current window settings */
struct video_window window; /* current picture settings */
struct video_picture picture; /* current picture settings */
struct video_window window; /* current window settings */
u16 hw_depth, /* depth (used by the chip) */
hw_palette, /* palette (used by the chip) */
hw_width, /* width (used by the chip) */
hw_height, /* height (used by the chip) */
hs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
vs_polarity; /* 0=negative sync pulse, 1=positive sync pulse */
vs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
start_cropx, /* pixels from HS inactive edge to 1st cropped pixel*/
start_cropy; /* pixels from VS incative edge to 1st cropped pixel*/
enum w9968cf_vpp_flag vpp_flag; /* post-processing routines in use */
......@@ -239,16 +244,15 @@ struct w9968cf_device {
users, /* flag: number of users holding the device */
streaming; /* flag: yes=1, no=0 */
int sensor; /* type of image CMOS sensor chip (CC_*) */
/* Determined by CMOS sensor type */
u16 maxwidth,
maxheight,
minwidth,
minheight,
start_cropx,
start_cropy;
u8 sensor_initialized; /* flag: yes=1, no=0 */
/* Determined by CMOS sensor type: */
int sensor, /* type of image sensor chip (CC_*) */
monochrome; /* CMOS sensor is (probably) monochrome */
u16 maxwidth, /* maximum width supported by the CMOS sensor */
maxheight, /* maximum height supported by the CMOS sensor */
minwidth, /* minimum width supported by the CMOS sensor */
minheight; /* minimum height supported by the CMOS sensor */
u8 auto_brt, /* auto brightness enabled flag */
auto_exp, /* auto exposure enabled flag */
backlight, /* backlight exposure algorithm flag */
......@@ -256,7 +260,6 @@ struct w9968cf_device {
lightfreq, /* power (lighting) frequency */
bandfilt; /* banding filter enabled flag */
s8 clockdiv; /* clock divisor */
int sensor_mono; /* CMOS sensor is (probably) monochrome */
/* I2C interface to kernel */
struct i2c_adapter i2c_adapter;
......@@ -271,14 +274,9 @@ struct w9968cf_device {
wait_queue_head_t open, wait_queue;
};
#define W9968CF_HW_BUF_SIZE 640*480*2 /* buf. size for original video frames */
#define SENSOR_FORMAT VIDEO_PALETTE_UYVY
#define SENSOR_FATAL_ERROR(rc) ((rc) < 0 && (rc) != -EPERM)
/****************************************************************************
* Macros and other constants *
* Macros for debugging *
****************************************************************************/
#undef DBG
......@@ -294,7 +292,7 @@ if ( ((specific_debug) && (debug == (level))) || \
else if ((level) == 4) \
warn(fmt, ## args); \
else if ((level) >= 5) \
info("[%s,%d] " fmt, \
info("[%s:%d] " fmt, \
__PRETTY_FUNCTION__, __LINE__ , ## args); \
} \
}
......@@ -305,7 +303,7 @@ if ( ((specific_debug) && (debug == (level))) || \
#undef PDBG
#undef PDBGG
#define PDBG(fmt, args...) info("[%s, %d] "fmt, \
#define PDBG(fmt, args...) info("[%s:%d] "fmt, \
__PRETTY_FUNCTION__, __LINE__ , ## args);
#define PDBGG(fmt, args...) do {;} while(0); /* nothing: it's a placeholder */
......
/***************************************************************************
* Video decoder for the W996[87]CF driver for Linux. *
* *
* Copyright (C) 2003 by Luca Risolia <luca_ing@libero.it> *
* Copyright (C) 2003 2004 by Luca Risolia <luca.risolia@studio.unibo.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......
/***************************************************************************
* Various definitions for compatibility with external modules. *
* Various definitions for compatibility with OVCAMCHIP external module. *
* This file is part of the W996[87]CF driver for Linux. *
* *
* Copyright (C) 2002 2003 by Luca Risolia <luca_ing@libero.it> *
* The definitions have been taken from the OVCAMCHIP module written by *
* Mark McClelland. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -27,10 +28,8 @@
#include <asm/ioctl.h>
#include <asm/types.h>
/* The following values have been copied from the "ovcamchip" module. */
#ifndef I2C_DRIVERID_OVCAMCHIP
# define I2C_DRIVERID_OVCAMCHIP 0xf00f
# define I2C_DRIVERID_OVCAMCHIP 0xf00f
#endif
/* Controls */
......@@ -77,10 +76,10 @@ struct ovcamchip_window {
int width;
int height;
int format;
int quarter; /* Scale width and height down 2x */
int quarter; /* Scale width and height down 2x */
/* This stuff will be removed eventually */
int clockdiv; /* Clock divisor setting */
int clockdiv; /* Clock divisor setting */
};
/* Commands.
......
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