/*
* OmniVision OV511 Camera-to-USB Bridge Driver
*
* Copyright (c) 1999-2003 Mark W. McClelland
* Original decompression code Copyright 1998-2000 OmniVision Technologies
* Many improvements by Bret Wallach <[email protected]>
* Color fixes by by Orion Sky Lawlor <[email protected]> (2/26/2000)
* Snapshot code by Kevin Moore
* OV7620 fixes by Charl P. Botha <[email protected]>
* Changes by Claudio Matsuoka <[email protected]>
* Original SAA7111A code by Dave Perks <[email protected]>
* URB error messages from pwc driver by Nemosoft
* generic_ioctl() code from videodev.c by Gerd Knorr and Alan Cox
* Memory management (rvmalloc) code from bttv driver, by Gerd Knorr and others
*
* Based on the Linux CPiA driver written by Peter Pregler,
* Scott J. Bertin and Johannes Erdfelt.
*
* Please see the file: linux/Documentation/usb/ov511.txt
* and the website at: http://alpha.dyndns.org/ov511
* for more info.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/pagemap.h>
#include <asm/io.h>
#include <asm/semaphore.h>
#include <asm/processor.h>
#include <linux/wrapper.h>
#include <linux/mm.h>
#if defined (__i386__)
#include <asm/cpufeature.h>
#endif
#include "ov511.h"
/*
* Version Information
*/
#define DRIVER_VERSION "v1.63 for Linux 2.4"
#define EMAIL "[email protected]"
#define DRIVER_AUTHOR "Mark McClelland <[email protected]> & Bret Wallach \
& Orion Sky Lawlor <[email protected]> & Kevin Moore & Charl P. Botha \
<[email protected]> & Claudio Matsuoka <[email protected]>"
#define DRIVER_DESC "ov511 USB Camera Driver"
#define OV511_I2C_RETRIES 3
#define ENABLE_Y_QUANTABLE 1
#define ENABLE_UV_QUANTABLE 1
#define OV511_MAX_UNIT_VIDEO 16
/* Pixel count * 3 bytes for RGB */
#define MAX_FRAME_SIZE(w, h) ((w) * (h) * 3)
#define MAX_DATA_SIZE(w, h) (MAX_FRAME_SIZE(w, h) + sizeof(struct timeval))
/* Max size * bytes per YUV420 pixel (1.5) + one extra isoc frame for safety */
#define MAX_RAW_DATA_SIZE(w, h) ((w) * (h) * 3 / 2 + 1024)
#define FATAL_ERROR(rc) ((rc) < 0 && (rc) != -EPERM)
/**********************************************************************
* Module Parameters
* (See ov511.txt for detailed descriptions of these)
**********************************************************************/
/* These variables (and all static globals) default to zero */
static int autobright = 1;
static int autogain = 1;
static int autoexp = 1;
static int debug;
static int snapshot;
static int fix_rgb_offset;
static int force_rgb;
static int cams = 1;
static int compress;
static int testpat;
static int dumppix;
static int led = 1;
static int dump_bridge;
static int dump_sensor;
static int printph;
static int phy = 0x1f;
static int phuv = 0x05;
static int pvy = 0x06;
static int pvuv = 0x06;
static int qhy = 0x14;
static int qhuv = 0x03;
static int qvy = 0x04;
static int qvuv = 0x04;
static int lightfreq;
static int bandingfilter;
static int clockdiv = -1;
static int packetsize = -1;
static int framedrop = -1;
static int fastset;
static int force_palette;
static int backlight;
static int unit_video[OV511_MAX_UNIT_VIDEO];
static int remove_zeros;
static int mirror;
static int ov518_color;
MODULE_PARM(autobright, "i");
MODULE_PARM_DESC(autobright, "Sensor automatically changes brightness");
MODULE_PARM(autogain, "i");
MODULE_PARM_DESC(autogain, "Sensor automatically changes gain");
MODULE_PARM(autoexp, "i");
MODULE_PARM_DESC(autoexp, "Sensor automatically changes exposure");
MODULE_PARM(debug, "i");
MODULE_PARM_DESC(debug,
"Debug level: 0=none, 1=inits, 2=warning, 3=config, 4=functions, 5=max");
MODULE_PARM(snapshot, "i");
MODULE_PARM_DESC(snapshot, "Enable snapshot mode");
MODULE_PARM(fix_rgb_offset, "i");
MODULE_PARM_DESC(fix_rgb_offset,
"Fix vertical misalignment of red and blue at 640x480");
MODULE_PARM(force_rgb, "i");
MODULE_PARM_DESC(force_rgb, "Read RGB instead of BGR");
MODULE_PARM(cams, "i");
MODULE_PARM_DESC(cams, "Number of simultaneous cameras");
MODULE_PARM(compress, "i");
MODULE_PARM_DESC(compress, "Turn on compression (not reliable yet)");
MODULE_PARM(testpat, "i");
MODULE_PARM_DESC(testpat,
"Replace image with vertical bar testpattern (only partially working)");
MODULE_PARM(dumppix, "i");
MODULE_PARM_DESC(dumppix, "Dump raw pixel data");
MODULE_PARM(led, "i");
MODULE_PARM_DESC(led,
"LED policy (OV511+ or later). 0=off, 1=on (default), 2=auto (on when open)");
MODULE_PARM(dump_bridge, "i");
MODULE_PARM_DESC(dump_bridge, "Dump the bridge registers");
MODULE_PARM(dump_sensor, "i");
MODULE_PARM_DESC(dump_sensor, "Dump the sensor registers");
MODULE_PARM(printph, "i");
MODULE_PARM_DESC(printph, "Print frame start/end headers");
MODULE_PARM(phy, "i");
MODULE_PARM_DESC(phy, "Prediction range (horiz. Y)");
MODULE_PARM(phuv, "i");
MODULE_PARM_DESC(phuv, "Prediction range (horiz. UV)");
MODULE_PARM(pvy, "i");
MODULE_PARM_DESC(pvy, "Prediction range (vert. Y)");
MODULE_PARM(pvuv, "i");
MODULE_PARM_DESC(pvuv, "Prediction range (vert. UV)");
MODULE_PARM(qhy, "i");
MODULE_PARM_DESC(qhy, "Quantization threshold (horiz. Y)");
MODULE_PARM(qhuv, "i");
MODULE_PARM_DESC(qhuv, "Quantization threshold (horiz. UV)");
MODULE_PARM(qvy, "i");
MODULE_PARM_DESC(qvy, "Quantization threshold (vert. Y)");
MODULE_PARM(qvuv, "i");
MODULE_PARM_DESC(qvuv, "Quantization threshold (vert. UV)");
MODULE_PARM(lightfreq, "i");
MODULE_PARM_DESC(lightfreq,
"Light frequency. Set to 50 or 60 Hz, or zero for default settings");
MODULE_PARM(bandingfilter, "i");
MODULE_PARM_DESC(bandingfilter,
"Enable banding filter (to reduce effects of fluorescent lighting)");
MODULE_PARM(clockdiv, "i");
MODULE_PARM_DESC(clockdiv, "Force pixel clock divisor to a specific value");
MODULE_PARM(packetsize, "i");
MODULE_PARM_DESC(packetsize, "Force a specific isoc packet size");
MODULE_PARM(framedrop, "i");
MODULE_PARM_DESC(framedrop, "Force a specific frame drop register setting");
MODULE_PARM(fastset, "i");
MODULE_PARM_DESC(fastset, "Allows picture settings to take effect immediately");
MODULE_PARM(force_palette, "i");
MODULE_PARM_DESC(force_palette, "Force the palette to a specific value");
MODULE_PARM(backlight, "i");
MODULE_PARM_DESC(backlight, "For objects that are lit from behind");
MODULE_PARM(unit_video, "1-" __MODULE_STRING(OV511_MAX_UNIT_VIDEO) "i");
MODULE_PARM_DESC(unit_video,
"Force use of specific minor number(s). 0 is not allowed.");
MODULE_PARM(remove_zeros, "i");
MODULE_PARM_DESC(remove_zeros,
"Remove zero-padding from uncompressed incoming data");
MODULE_PARM(mirror, "i");
MODULE_PARM_DESC(mirror, "Reverse image horizontally");
MODULE_PARM(ov518_color, "i");
MODULE_PARM_DESC(ov518_color, "Enable OV518 color (experimental)");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
/**********************************************************************
* Miscellaneous Globals
**********************************************************************/
static struct usb_driver ov511_driver;
static struct ov51x_decomp_ops *ov511_decomp_ops;
static struct ov51x_decomp_ops *ov511_mmx_decomp_ops;
static struct ov5
没有合适的资源?快使用搜索试试~ 我知道了~
usb.rar_EP9315_linux usb
共222个文件
c:109个
h:97个
makefile:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 17 浏览量
2022-09-22
17:41:36
上传
评论
收藏 1.28MB RAR 举报
温馨提示
ep9315平台下USB驱动的源码,在目标系统上测试通过,linux内核版本为2.4.21
资源推荐
资源详情
资源评论
收起资源包目录
usb.rar_EP9315_linux usb (222个子文件)
ov511.c 162KB
audio.c 126KB
ibmcam.c 120KB
io_edgeport.c 97KB
usb-uhci.c 84KB
uhci.c 75KB
io_ti.c 71KB
usb-ohci.c 68KB
usbnet.c 67KB
usb.c 65KB
usbvideo.c 65KB
pwc-if.c 62KB
edb7312-usb.c 60KB
digi_acceleport.c 59KB
usb-midi.c 56KB
isd200.c 55KB
keyspan.c 52KB
ftdi_sio.c 52KB
CDCEther.c 47KB
usbserial.c 47KB
stv680.c 45KB
sddr09.c 45KB
hcd.c 41KB
se401.c 40KB
bluetooth.c 38KB
transport.c 38KB
scanner.c 36KB
vicam.c 36KB
pwc-ctrl.c 36KB
hid-core.c 35KB
hc_sl811.c 34KB
kaweth.c 34KB
usb.c 34KB
devio.c 31KB
hc_simple.c 30KB
ehci-q.c 30KB
printer.c 29KB
pegasus.c 29KB
kl5kusb105.c 29KB
ehci-sched.c 29KB
visor.c 28KB
ehci-hcd.c 28KB
auerisdn.c 28KB
hub.c 28KB
microtek.c 28KB
auermain.c 26KB
sddr55.c 26KB
shuttle_usbat.c 26KB
brlvger.c 26KB
jumpshot.c 26KB
konicawc.c 25KB
keyspan_pda.c 25KB
datafab.c 23KB
mct_u232.c 23KB
scsiglue.c 23KB
catc.c 23KB
mdc800.c 23KB
freecom.c 22KB
ultracam.c 22KB
whiteheat.c 21KB
kobil_sct.c 20KB
inode.c 20KB
pl2303.c 20KB
dabusb.c 19KB
acm.c 19KB
auerisdn_b.c 19KB
wacom.c 18KB
devices.c 18KB
hpusbscsi.c 18KB
uss720.c 18KB
rtl8150.c 17KB
ehci-dbg.c 17KB
usb-skeleton.c 17KB
belkin_sa.c 17KB
ipaq.c 17KB
ir-usb.c 17KB
hiddev.c 16KB
empeg.c 15KB
debug.c 15KB
auerchar.c 15KB
dc2xx.c 14KB
hc_sl811_rh.c 14KB
cyberjack.c 13KB
auerchain.c 13KB
powermate.c 13KB
rio500.c 12KB
hid-input.c 12KB
usb-ohci-pci.c 11KB
tiglusb.c 11KB
omninet.c 10KB
dsbr100.c 10KB
protocol.c 10KB
ehci-hub.c 9KB
usblcd.c 8KB
aiptek.c 8KB
usbkbd.c 8KB
emi26.c 8KB
usb-debug.c 7KB
ehci-mem.c 6KB
usbmouse.c 6KB
共 222 条
- 1
- 2
- 3
资源评论
林当时
- 粉丝: 100
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功