V4L/DVB (3599b): Whitespace cleanups under drivers/media
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
9f6933be66
commit
d56410e0a5
@ -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"
|
||||
|
||||
@ -564,14 +564,14 @@ 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
|
||||
and 'Orbit'/'Sphere'
|
||||
* Samsung MPC-C10, MPC-C30
|
||||
* Creative Webcam 5, Pro Ex
|
||||
* SOTEC Afina Eye
|
||||
* Visionite VCS-UC300, VCS-UM100
|
||||
|
@ -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:
|
||||
{
|
||||
|
@ -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");
|
||||
|
@ -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. */
|
||||
|
@ -67,11 +67,11 @@ MODULE_SUPPORTED_DEVICE("video");
|
||||
static unsigned short colorspace_conv = 0;
|
||||
module_param(colorspace_conv, ushort, 0444);
|
||||
MODULE_PARM_DESC(colorspace_conv,
|
||||
"\n<n> Colorspace conversion:"
|
||||
"\n0 = disable"
|
||||
"\n1 = enable"
|
||||
"\nDefault value is 0"
|
||||
"\n");
|
||||
"\n<n> Colorspace conversion:"
|
||||
"\n0 = disable"
|
||||
"\n1 = enable"
|
||||
"\nDefault value is 0"
|
||||
"\n");
|
||||
|
||||
#define ABOUT "V4L-Driver for Vision CPiA based cameras"
|
||||
|
||||
@ -208,7 +208,7 @@ static u8 flicker_jumps[2][2][4] =
|
||||
static void reset_camera_struct(struct cam_data *cam);
|
||||
static int find_over_exposure(int brightness);
|
||||
static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
|
||||
int on);
|
||||
int on);
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
@ -262,7 +262,7 @@ static void rvfree(void *mem, unsigned long size)
|
||||
static struct proc_dir_entry *cpia_proc_root=NULL;
|
||||
|
||||
static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
int count, int *eof, void *data)
|
||||
int count, int *eof, void *data)
|
||||
{
|
||||
char *out = page;
|
||||
int len, tmp;
|
||||
@ -276,58 +276,58 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
out += sprintf(out, "V4L Driver version: %d.%d.%d\n",
|
||||
CPIA_MAJ_VER, CPIA_MIN_VER, CPIA_PATCH_VER);
|
||||
out += sprintf(out, "CPIA Version: %d.%02d (%d.%d)\n",
|
||||
cam->params.version.firmwareVersion,
|
||||
cam->params.version.firmwareRevision,
|
||||
cam->params.version.vcVersion,
|
||||
cam->params.version.vcRevision);
|
||||
cam->params.version.firmwareVersion,
|
||||
cam->params.version.firmwareRevision,
|
||||
cam->params.version.vcVersion,
|
||||
cam->params.version.vcRevision);
|
||||
out += sprintf(out, "CPIA PnP-ID: %04x:%04x:%04x\n",
|
||||
cam->params.pnpID.vendor, cam->params.pnpID.product,
|
||||
cam->params.pnpID.deviceRevision);
|
||||
cam->params.pnpID.vendor, cam->params.pnpID.product,
|
||||
cam->params.pnpID.deviceRevision);
|
||||
out += sprintf(out, "VP-Version: %d.%d %04x\n",
|
||||
cam->params.vpVersion.vpVersion,
|
||||
cam->params.vpVersion.vpRevision,
|
||||
cam->params.vpVersion.cameraHeadID);
|
||||
cam->params.vpVersion.vpVersion,
|
||||
cam->params.vpVersion.vpRevision,
|
||||
cam->params.vpVersion.cameraHeadID);
|
||||
|
||||
out += sprintf(out, "system_state: %#04x\n",
|
||||
cam->params.status.systemState);
|
||||
cam->params.status.systemState);
|
||||
out += sprintf(out, "grab_state: %#04x\n",
|
||||
cam->params.status.grabState);
|
||||
cam->params.status.grabState);
|
||||
out += sprintf(out, "stream_state: %#04x\n",
|
||||
cam->params.status.streamState);
|
||||
cam->params.status.streamState);
|
||||
out += sprintf(out, "fatal_error: %#04x\n",
|
||||
cam->params.status.fatalError);
|
||||
cam->params.status.fatalError);
|
||||
out += sprintf(out, "cmd_error: %#04x\n",
|
||||
cam->params.status.cmdError);
|
||||
cam->params.status.cmdError);
|
||||
out += sprintf(out, "debug_flags: %#04x\n",
|
||||
cam->params.status.debugFlags);
|
||||
cam->params.status.debugFlags);
|
||||
out += sprintf(out, "vp_status: %#04x\n",
|
||||
cam->params.status.vpStatus);
|
||||
cam->params.status.vpStatus);
|
||||
out += sprintf(out, "error_code: %#04x\n",
|
||||
cam->params.status.errorCode);
|
||||
cam->params.status.errorCode);
|
||||
/* QX3 specific entries */
|
||||
if (cam->params.qx3.qx3_detected) {
|
||||
out += sprintf(out, "button: %4d\n",
|
||||
cam->params.qx3.button);
|
||||
cam->params.qx3.button);
|
||||
out += sprintf(out, "cradled: %4d\n",
|
||||
cam->params.qx3.cradled);
|
||||
cam->params.qx3.cradled);
|
||||
}
|
||||
out += sprintf(out, "video_size: %s\n",
|
||||
cam->params.format.videoSize == VIDEOSIZE_CIF ?
|
||||
cam->params.format.videoSize == VIDEOSIZE_CIF ?
|
||||
"CIF " : "QCIF");
|
||||
out += sprintf(out, "roi: (%3d, %3d) to (%3d, %3d)\n",
|
||||
cam->params.roi.colStart*8,
|
||||
cam->params.roi.rowStart*4,
|
||||
cam->params.roi.colEnd*8,
|
||||
cam->params.roi.rowEnd*4);
|
||||
cam->params.roi.colStart*8,
|
||||
cam->params.roi.rowStart*4,
|
||||
cam->params.roi.colEnd*8,
|
||||
cam->params.roi.rowEnd*4);
|
||||
out += sprintf(out, "actual_fps: %3d\n", cam->fps);
|
||||
out += sprintf(out, "transfer_rate: %4dkB/s\n",
|
||||
cam->transfer_rate);
|
||||
cam->transfer_rate);
|
||||
|
||||
out += sprintf(out, "\nread-write\n");
|
||||
out += sprintf(out, "----------------------- current min"
|
||||
" max default comment\n");
|
||||
" max default comment\n");
|
||||
out += sprintf(out, "brightness: %8d %8d %8d %8d\n",
|
||||
cam->params.colourParams.brightness, 0, 100, 50);
|
||||
cam->params.colourParams.brightness, 0, 100, 50);
|
||||
if (cam->params.version.firmwareVersion == 1 &&
|
||||
cam->params.version.firmwareRevision == 2)
|
||||
/* 1-02 firmware limits contrast to 80 */
|
||||
@ -336,26 +336,26 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
tmp = 96;
|
||||
|
||||
out += sprintf(out, "contrast: %8d %8d %8d %8d"
|
||||
" steps of 8\n",
|
||||
cam->params.colourParams.contrast, 0, tmp, 48);
|
||||
" steps of 8\n",
|
||||
cam->params.colourParams.contrast, 0, tmp, 48);
|
||||
out += sprintf(out, "saturation: %8d %8d %8d %8d\n",
|
||||
cam->params.colourParams.saturation, 0, 100, 50);
|
||||
cam->params.colourParams.saturation, 0, 100, 50);
|
||||
tmp = (25000+5000*cam->params.sensorFps.baserate)/
|
||||
(1<<cam->params.sensorFps.divisor);
|
||||
out += sprintf(out, "sensor_fps: %4d.%03d %8d %8d %8d\n",
|
||||
tmp/1000, tmp%1000, 3, 30, 15);
|
||||
tmp/1000, tmp%1000, 3, 30, 15);
|
||||
out += sprintf(out, "stream_start_line: %8d %8d %8d %8d\n",
|
||||
2*cam->params.streamStartLine, 0,
|
||||
2*cam->params.streamStartLine, 0,
|
||||
cam->params.format.videoSize == VIDEOSIZE_CIF ? 288:144,
|
||||
cam->params.format.videoSize == VIDEOSIZE_CIF ? 240:120);
|
||||
out += sprintf(out, "sub_sample: %8s %8s %8s %8s\n",
|
||||
cam->params.format.subSample == SUBSAMPLE_420 ?
|
||||
cam->params.format.subSample == SUBSAMPLE_420 ?
|
||||
"420" : "422", "420", "422", "422");
|
||||
out += sprintf(out, "yuv_order: %8s %8s %8s %8s\n",
|
||||
cam->params.format.yuvOrder == YUVORDER_YUYV ?
|
||||
cam->params.format.yuvOrder == YUVORDER_YUYV ?
|
||||
"YUYV" : "UYVY", "YUYV" , "UYVY", "YUYV");
|
||||
out += sprintf(out, "ecp_timing: %8s %8s %8s %8s\n",
|
||||
cam->params.ecpTiming ? "slow" : "normal", "slow",
|
||||
cam->params.ecpTiming ? "slow" : "normal", "slow",
|
||||
"normal", "normal");
|
||||
|
||||
if (cam->params.colourBalance.balanceMode == 2) {
|
||||
@ -366,11 +366,11 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
out += sprintf(out, "color_balance_mode: %8s %8s %8s"
|
||||
" %8s\n", tmpstr, "manual", "auto", "auto");
|
||||
out += sprintf(out, "red_gain: %8d %8d %8d %8d\n",
|
||||
cam->params.colourBalance.redGain, 0, 212, 32);
|
||||
cam->params.colourBalance.redGain, 0, 212, 32);
|
||||
out += sprintf(out, "green_gain: %8d %8d %8d %8d\n",
|
||||
cam->params.colourBalance.greenGain, 0, 212, 6);
|
||||
cam->params.colourBalance.greenGain, 0, 212, 6);
|
||||
out += sprintf(out, "blue_gain: %8d %8d %8d %8d\n",
|
||||
cam->params.colourBalance.blueGain, 0, 212, 92);
|
||||
cam->params.colourBalance.blueGain, 0, 212, 92);
|
||||
|
||||
if (cam->params.version.firmwareVersion == 1 &&
|
||||
cam->params.version.firmwareRevision == 2)
|
||||
@ -381,11 +381,11 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
|
||||
if (cam->params.exposure.gainMode == 0)
|
||||
out += sprintf(out, "max_gain: unknown %28s"
|
||||
" powers of 2\n", tmpstr);
|
||||
" powers of 2\n", tmpstr);
|
||||
else
|
||||
out += sprintf(out, "max_gain: %8d %28s"
|
||||
" 1,2,4 or 8 \n",
|
||||
1<<(cam->params.exposure.gainMode-1), tmpstr);
|
||||
1<<(cam->params.exposure.gainMode-1), tmpstr);
|
||||
|
||||
switch(cam->params.exposure.expMode) {
|
||||
case 1:
|
||||
@ -402,10 +402,10 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
out += sprintf(out, "exposure_mode: %8s %8s %8s"
|
||||
" %8s\n", tmpstr, "manual", "auto", "auto");
|
||||
out += sprintf(out, "centre_weight: %8s %8s %8s %8s\n",
|
||||
(2-cam->params.exposure.centreWeight) ? "on" : "off",
|
||||
"off", "on", "on");
|
||||
(2-cam->params.exposure.centreWeight) ? "on" : "off",
|
||||
"off", "on", "on");
|
||||
out += sprintf(out, "gain: %8d %8d max_gain %8d 1,2,4,8 possible\n",
|
||||
1<<cam->params.exposure.gain, 1, 1);
|
||||
1<<cam->params.exposure.gain, 1, 1);
|
||||
if (cam->params.version.firmwareVersion == 1 &&
|
||||
cam->params.version.firmwareRevision == 2)
|
||||
/* 1-02 firmware limits fineExp/2 to 127 */
|
||||
@ -414,7 +414,7 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
tmp = 510;
|
||||
|
||||
out += sprintf(out, "fine_exp: %8d %8d %8d %8d\n",
|
||||
cam->params.exposure.fineExp*2, 0, tmp, 0);
|
||||
cam->params.exposure.fineExp*2, 0, tmp, 0);
|
||||
if (cam->params.version.firmwareVersion == 1 &&
|
||||
cam->params.version.firmwareRevision == 2)
|
||||
/* 1-02 firmware limits coarseExpHi to 0 */
|
||||
@ -426,46 +426,46 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
" %8d\n", cam->params.exposure.coarseExpLo+
|
||||
256*cam->params.exposure.coarseExpHi, 0, tmp, 185);
|
||||
out += sprintf(out, "red_comp: %8d %8d %8d %8d\n",
|
||||
cam->params.exposure.redComp, COMP_RED, 255, COMP_RED);
|
||||
cam->params.exposure.redComp, COMP_RED, 255, COMP_RED);
|
||||
out += sprintf(out, "green1_comp: %8d %8d %8d %8d\n",
|
||||
cam->params.exposure.green1Comp, COMP_GREEN1, 255,
|
||||
cam->params.exposure.green1Comp, COMP_GREEN1, 255,
|
||||
COMP_GREEN1);
|
||||
out += sprintf(out, "green2_comp: %8d %8d %8d %8d\n",
|
||||
cam->params.exposure.green2Comp, COMP_GREEN2, 255,
|
||||
cam->params.exposure.green2Comp, COMP_GREEN2, 255,
|
||||
COMP_GREEN2);
|
||||
out += sprintf(out, "blue_comp: %8d %8d %8d %8d\n",
|
||||
cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE);
|
||||
cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE);
|
||||
|
||||
out += sprintf(out, "apcor_gain1: %#8x %#8x %#8x %#8x\n",
|
||||
cam->params.apcor.gain1, 0, 0xff, 0x1c);
|
||||
cam->params.apcor.gain1, 0, 0xff, 0x1c);
|
||||
out += sprintf(out, "apcor_gain2: %#8x %#8x %#8x %#8x\n",
|
||||
cam->params.apcor.gain2, 0, 0xff, 0x1a);
|
||||
cam->params.apcor.gain2, 0, 0xff, 0x1a);
|
||||
out += sprintf(out, "apcor_gain4: %#8x %#8x %#8x %#8x\n",
|
||||
cam->params.apcor.gain4, 0, 0xff, 0x2d);
|
||||
cam->params.apcor.gain4, 0, 0xff, 0x2d);
|
||||
out += sprintf(out, "apcor_gain8: %#8x %#8x %#8x %#8x\n",
|
||||
cam->params.apcor.gain8, 0, 0xff, 0x2a);
|
||||
cam->params.apcor.gain8, 0, 0xff, 0x2a);
|
||||
out += sprintf(out, "vl_offset_gain1: %8d %8d %8d %8d\n",
|
||||
cam->params.vlOffset.gain1, 0, 255, 24);
|
||||
cam->params.vlOffset.gain1, 0, 255, 24);
|
||||
out += sprintf(out, "vl_offset_gain2: %8d %8d %8d %8d\n",
|
||||
cam->params.vlOffset.gain2, 0, 255, 28);
|
||||
cam->params.vlOffset.gain2, 0, 255, 28);
|
||||
out += sprintf(out, "vl_offset_gain4: %8d %8d %8d %8d\n",
|
||||
cam->params.vlOffset.gain4, 0, 255, 30);
|
||||
cam->params.vlOffset.gain4, 0, 255, 30);
|
||||
out += sprintf(out, "vl_offset_gain8: %8d %8d %8d %8d\n",
|
||||
cam->params.vlOffset.gain8, 0, 255, 30);
|
||||
cam->params.vlOffset.gain8, 0, 255, 30);
|
||||
out += sprintf(out, "flicker_control: %8s %8s %8s %8s\n",
|
||||
cam->params.flickerControl.flickerMode ? "on" : "off",
|
||||
cam->params.flickerControl.flickerMode ? "on" : "off",
|
||||
"off", "on", "off");
|
||||
out += sprintf(out, "mains_frequency: %8d %8d %8d %8d"
|
||||
" only 50/60\n",
|
||||
cam->mainsFreq ? 60 : 50, 50, 60, 50);
|
||||
" only 50/60\n",
|
||||
cam->mainsFreq ? 60 : 50, 50, 60, 50);
|
||||
if(cam->params.flickerControl.allowableOverExposure < 0)
|
||||
out += sprintf(out, "allowable_overexposure: %4dauto auto %8d auto\n",
|
||||
-cam->params.flickerControl.allowableOverExposure,
|
||||
255);
|
||||
-cam->params.flickerControl.allowableOverExposure,
|
||||
255);
|
||||
else
|
||||
out += sprintf(out, "allowable_overexposure: %8d auto %8d auto\n",
|
||||
cam->params.flickerControl.allowableOverExposure,
|
||||
255);
|
||||
cam->params.flickerControl.allowableOverExposure,
|
||||
255);
|
||||
out += sprintf(out, "compression_mode: ");
|
||||
switch(cam->params.compression.mode) {
|
||||
case CPIA_COMPRESSION_NONE:
|
||||
@ -483,49 +483,49 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
}
|
||||
out += sprintf(out, " none,auto,manual auto\n");
|
||||
out += sprintf(out, "decimation_enable: %8s %8s %8s %8s\n",
|
||||
cam->params.compression.decimation ==
|
||||
cam->params.compression.decimation ==
|
||||
DECIMATION_ENAB ? "on":"off", "off", "on",
|
||||
"off");
|
||||
out += sprintf(out, "compression_target: %9s %9s %9s %9s\n",
|
||||
cam->params.compressionTarget.frTargeting ==
|
||||
cam->params.compressionTarget.frTargeting ==
|
||||
CPIA_COMPRESSION_TARGET_FRAMERATE ?
|
||||
"framerate":"quality",
|
||||
"framerate", "quality", "quality");
|
||||
out += sprintf(out, "target_framerate: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionTarget.targetFR, 1, 30, 15);
|
||||
cam->params.compressionTarget.targetFR, 1, 30, 15);
|
||||
out += sprintf(out, "target_quality: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionTarget.targetQ, 1, 64, 5);
|
||||
cam->params.compressionTarget.targetQ, 1, 64, 5);
|
||||
out += sprintf(out, "y_threshold: %8d %8d %8d %8d\n",
|
||||
cam->params.yuvThreshold.yThreshold, 0, 31, 6);
|
||||
cam->params.yuvThreshold.yThreshold, 0, 31, 6);
|
||||
out += sprintf(out, "uv_threshold: %8d %8d %8d %8d\n",
|
||||
cam->params.yuvThreshold.uvThreshold, 0, 31, 6);
|
||||
cam->params.yuvThreshold.uvThreshold, 0, 31, 6);
|
||||
out += sprintf(out, "hysteresis: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.hysteresis, 0, 255, 3);
|
||||
cam->params.compressionParams.hysteresis, 0, 255, 3);
|
||||
out += sprintf(out, "threshold_max: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.threshMax, 0, 255, 11);
|
||||
cam->params.compressionParams.threshMax, 0, 255, 11);
|
||||
out += sprintf(out, "small_step: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.smallStep, 0, 255, 1);
|
||||
cam->params.compressionParams.smallStep, 0, 255, 1);
|
||||
out += sprintf(out, "large_step: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.largeStep, 0, 255, 3);
|
||||
cam->params.compressionParams.largeStep, 0, 255, 3);
|
||||
out += sprintf(out, "decimation_hysteresis: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.decimationHysteresis,
|
||||
cam->params.compressionParams.decimationHysteresis,
|
||||
0, 255, 2);
|
||||
out += sprintf(out, "fr_diff_step_thresh: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.frDiffStepThresh,
|
||||
cam->params.compressionParams.frDiffStepThresh,
|
||||
0, 255, 5);
|
||||
out += sprintf(out, "q_diff_step_thresh: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.qDiffStepThresh,
|
||||
cam->params.compressionParams.qDiffStepThresh,
|
||||
0, 255, 3);
|
||||
out += sprintf(out, "decimation_thresh_mod: %8d %8d %8d %8d\n",
|
||||
cam->params.compressionParams.decimationThreshMod,
|
||||
cam->params.compressionParams.decimationThreshMod,
|
||||
0, 255, 2);
|
||||
/* QX3 specific entries */
|
||||
if (cam->params.qx3.qx3_detected) {
|
||||
out += sprintf(out, "toplight: %8s %8s %8s %8s\n",
|
||||
cam->params.qx3.toplight ? "on" : "off",
|
||||
cam->params.qx3.toplight ? "on" : "off",
|
||||
"off", "on", "off");
|
||||
out += sprintf(out, "bottomlight: %8s %8s %8s %8s\n",
|
||||
cam->params.qx3.bottomlight ? "on" : "off",
|
||||
cam->params.qx3.bottomlight ? "on" : "off",
|
||||
"off", "on", "off");
|
||||
}
|
||||
|
||||
@ -543,7 +543,7 @@ static int cpia_read_proc(char *page, char **start, off_t off,
|
||||
|
||||
|
||||
static int match(char *checkstr, char **buffer, unsigned long *count,
|
||||
int *find_colon, int *err)
|
||||
int *find_colon, int *err)
|
||||
{
|
||||
int ret, colon_found = 1;
|
||||
int len = strlen(checkstr);
|
||||
@ -583,7 +583,7 @@ static unsigned long int value(char **buffer, unsigned long *count, int *err)
|
||||
}
|
||||
|
||||
static int cpia_write_proc(struct file *file, const char __user *buf,
|
||||
unsigned long count, void *data)
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct cam_data *cam = data;
|
||||
struct cam_params new_params;
|
||||
@ -639,7 +639,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
|
||||
#define MATCH(x) (match(x, &buffer, &count, &find_colon, &retval))
|
||||
#define VALUE (value(&buffer,&count, &retval))
|
||||
#define FIRMWARE_VERSION(x,y) (new_params.version.firmwareVersion == (x) && \
|
||||
new_params.version.firmwareRevision == (y))
|
||||
new_params.version.firmwareRevision == (y))
|
||||
|
||||
retval = 0;
|
||||
while (count && !retval) {
|
||||
@ -1288,7 +1288,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
|
||||
}
|
||||
command_flags |= COMMAND_SETCOMPRESSIONPARAMS;
|
||||
} else if (MATCH("toplight")) {
|
||||
if (!retval && MATCH("on"))
|
||||
if (!retval && MATCH("on"))
|
||||
new_params.qx3.toplight = 1;
|
||||
else if (!retval && MATCH("off"))
|
||||
new_params.qx3.toplight = 0;
|
||||
@ -1296,7 +1296,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
|
||||
retval = -EINVAL;
|
||||
command_flags |= COMMAND_SETLIGHTS;
|
||||
} else if (MATCH("bottomlight")) {
|
||||
if (!retval && MATCH("on"))
|
||||
if (!retval && MATCH("on"))
|
||||
new_params.qx3.bottomlight = 1;
|
||||
else if (!retval && MATCH("off"))
|
||||
new_params.qx3.bottomlight = 0;
|
||||
@ -1354,7 +1354,7 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
|
||||
|
||||
out:
|
||||
free_page((unsigned long)page);
|
||||
return retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void create_proc_cpia_cam(struct cam_data *cam)
|
||||
@ -1376,7 +1376,7 @@ static void create_proc_cpia_cam(struct cam_data *cam)
|
||||
ent->write_proc = cpia_write_proc;
|
||||
/*
|
||||
size of the proc entry is 3736 bytes for the standard webcam;
|
||||
the extra features of the QX3 microscope add 189 bytes.
|
||||
the extra features of the QX3 microscope add 189 bytes.
|
||||
(we have not yet probed the camera to see which type it is).
|
||||
*/
|
||||
ent->size = 3736 + 189;
|
||||
@ -1599,10 +1599,10 @@ static void set_vw_size(struct cam_data *cam)
|
||||
|
||||
cam->params.roi.colStart += cam->vc.x >> 3;
|
||||
cam->params.roi.colEnd = cam->params.roi.colStart +
|
||||
(cam->vc.width >> 3);
|
||||
(cam->vc.width >> 3);
|
||||
cam->params.roi.rowStart += cam->vc.y >> 2;
|
||||
cam->params.roi.rowEnd = cam->params.roi.rowStart +
|
||||
(cam->vc.height >> 2);
|
||||
(cam->vc.height >> 2);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1770,9 +1770,9 @@ static int do_command(struct cam_data *cam, u16 command, u8 a, u8 b, u8 c, u8 d)
|
||||
|
||||
/* send a command to the camera with an additional data transaction */
|
||||
static int do_command_extended(struct cam_data *cam, u16 command,
|
||||
u8 a, u8 b, u8 c, u8 d,
|
||||
u8 e, u8 f, u8 g, u8 h,
|
||||
u8 i, u8 j, u8 k, u8 l)
|
||||
u8 a, u8 b, u8 c, u8 d,
|
||||
u8 e, u8 f, u8 g, u8 h,
|
||||
u8 i, u8 j, u8 k, u8 l)
|
||||
{
|
||||
int retval;
|
||||
u8 cmd[8], data[8];
|
||||
@ -1809,7 +1809,7 @@ static int do_command_extended(struct cam_data *cam, u16 command,
|
||||
#define LIMIT(x) ((((x)>0xffffff)?0xff0000:(((x)<=0xffff)?0:(x)&0xff0000))>>16)
|
||||
|
||||
static int convert420(unsigned char *yuv, unsigned char *rgb, int out_fmt,
|
||||
int linesize, int mmap_kludge)
|
||||
int linesize, int mmap_kludge)
|
||||
{
|
||||
int y, u, v, r, g, b, y1;
|
||||
|
||||
@ -1925,7 +1925,7 @@ static int convert420(unsigned char *yuv, unsigned char *rgb, int out_fmt,
|
||||
|
||||
|
||||
static int yuvconvert(unsigned char *yuv, unsigned char *rgb, int out_fmt,
|
||||
int in_uyvy, int mmap_kludge)
|
||||
int in_uyvy, int mmap_kludge)
|
||||
{
|
||||
int y, u, v, r, g, b, y1;
|
||||
|
||||
@ -2150,14 +2150,14 @@ static int parse_picture(struct cam_data *cam, int size)
|
||||
if (!compressed || (compressed && !(*ibuf & 1))) {
|
||||
if(subsample_422 || even_line) {
|
||||
obuf += yuvconvert(ibuf, obuf, out_fmt,
|
||||
in_uyvy, cam->mmap_kludge);
|
||||
in_uyvy, cam->mmap_kludge);
|
||||
ibuf += 4;
|
||||
ll -= 4;
|
||||
} else {
|
||||
/* SUBSAMPLE_420 on an odd line */
|
||||
obuf += convert420(ibuf, obuf,
|
||||
out_fmt, linesize,
|
||||
cam->mmap_kludge);
|
||||
out_fmt, linesize,
|
||||
cam->mmap_kludge);
|
||||
ibuf += 2;
|
||||
ll -= 2;
|
||||
}
|
||||
@ -2183,7 +2183,7 @@ static int parse_picture(struct cam_data *cam, int size)
|
||||
|
||||
if ((size > 3) && (ibuf[0] == EOI) && (ibuf[1] == EOI) &&
|
||||
(ibuf[2] == EOI) && (ibuf[3] == EOI)) {
|
||||
size -= 4;
|
||||
size -= 4;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2233,7 +2233,7 @@ static int parse_picture(struct cam_data *cam, int size)
|
||||
static inline int init_stream_cap(struct cam_data *cam)
|
||||
{
|
||||
return do_command(cam, CPIA_COMMAND_InitStreamCap,
|
||||
0, cam->params.streamStartLine, 0, 0);
|
||||
0, cam->params.streamStartLine, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -2254,7 +2254,7 @@ static int find_over_exposure(int brightness)
|
||||
int MaxAllowableOverExposure, OverExposure;
|
||||
|
||||
MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness -
|
||||
FLICKER_BRIGHTNESS_CONSTANT;
|
||||
FLICKER_BRIGHTNESS_CONSTANT;
|
||||
|
||||
if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) {
|
||||
OverExposure = MaxAllowableOverExposure;
|
||||
@ -2280,59 +2280,59 @@ static void dispatch_commands(struct cam_data *cam)
|
||||
DEB_BYTE(cam->cmd_queue>>8);
|
||||
if (cam->cmd_queue & COMMAND_SETFORMAT) {
|
||||
do_command(cam, CPIA_COMMAND_SetFormat,
|
||||
cam->params.format.videoSize,
|
||||
cam->params.format.subSample,
|
||||
cam->params.format.yuvOrder, 0);
|
||||
cam->params.format.videoSize,
|
||||
cam->params.format.subSample,
|
||||
cam->params.format.yuvOrder, 0);
|
||||
do_command(cam, CPIA_COMMAND_SetROI,
|
||||
cam->params.roi.colStart, cam->params.roi.colEnd,
|
||||
cam->params.roi.rowStart, cam->params.roi.rowEnd);
|
||||
cam->params.roi.colStart, cam->params.roi.colEnd,
|
||||
cam->params.roi.rowStart, cam->params.roi.rowEnd);
|
||||
cam->first_frame = 1;
|
||||
}
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETCOLOURPARAMS)
|
||||
do_command(cam, CPIA_COMMAND_SetColourParams,
|
||||
cam->params.colourParams.brightness,
|
||||
cam->params.colourParams.contrast,
|
||||
cam->params.colourParams.saturation, 0);
|
||||
cam->params.colourParams.brightness,
|
||||
cam->params.colourParams.contrast,
|
||||
cam->params.colourParams.saturation, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETAPCOR)
|
||||
do_command(cam, CPIA_COMMAND_SetApcor,
|
||||
cam->params.apcor.gain1,
|
||||
cam->params.apcor.gain2,
|
||||
cam->params.apcor.gain4,
|
||||
cam->params.apcor.gain8);
|
||||
cam->params.apcor.gain1,
|
||||
cam->params.apcor.gain2,
|
||||
cam->params.apcor.gain4,
|
||||
cam->params.apcor.gain8);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETVLOFFSET)
|
||||
do_command(cam, CPIA_COMMAND_SetVLOffset,
|
||||
cam->params.vlOffset.gain1,
|
||||
cam->params.vlOffset.gain2,
|
||||
cam->params.vlOffset.gain4,
|
||||
cam->params.vlOffset.gain8);
|
||||
cam->params.vlOffset.gain1,
|
||||
cam->params.vlOffset.gain2,
|
||||
cam->params.vlOffset.gain4,
|
||||
cam->params.vlOffset.gain8);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETEXPOSURE) {
|
||||
do_command_extended(cam, CPIA_COMMAND_SetExposure,
|
||||
cam->params.exposure.gainMode,
|
||||
1,
|
||||
cam->params.exposure.compMode,
|
||||
cam->params.exposure.centreWeight,
|
||||
cam->params.exposure.gain,
|
||||
cam->params.exposure.fineExp,
|
||||
cam->params.exposure.coarseExpLo,
|
||||
cam->params.exposure.coarseExpHi,
|
||||
cam->params.exposure.redComp,
|
||||
cam->params.exposure.green1Comp,
|
||||
cam->params.exposure.green2Comp,
|
||||
cam->params.exposure.blueComp);
|
||||
cam->params.exposure.gainMode,
|
||||
1,
|
||||
cam->params.exposure.compMode,
|
||||
cam->params.exposure.centreWeight,
|
||||
cam->params.exposure.gain,
|
||||
cam->params.exposure.fineExp,
|
||||
cam->params.exposure.coarseExpLo,
|
||||
cam->params.exposure.coarseExpHi,
|
||||
cam->params.exposure.redComp,
|
||||
cam->params.exposure.green1Comp,
|
||||
cam->params.exposure.green2Comp,
|
||||
cam->params.exposure.blueComp);
|
||||
if(cam->params.exposure.expMode != 1) {
|
||||
do_command_extended(cam, CPIA_COMMAND_SetExposure,
|
||||
0,
|
||||
cam->params.exposure.expMode,
|
||||
0, 0,
|
||||
cam->params.exposure.gain,
|
||||
cam->params.exposure.fineExp,
|
||||
cam->params.exposure.coarseExpLo,
|
||||
cam->params.exposure.coarseExpHi,
|
||||
0, 0, 0, 0);
|
||||
0,
|
||||
cam->params.exposure.expMode,
|
||||
0, 0,
|
||||
cam->params.exposure.gain,
|
||||
cam->params.exposure.fineExp,
|
||||
cam->params.exposure.coarseExpLo,
|
||||
cam->params.exposure.coarseExpHi,
|
||||
0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2358,47 +2358,47 @@ static void dispatch_commands(struct cam_data *cam)
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETCOMPRESSIONTARGET)
|
||||
do_command(cam, CPIA_COMMAND_SetCompressionTarget,
|
||||
cam->params.compressionTarget.frTargeting,
|
||||
cam->params.compressionTarget.targetFR,
|
||||
cam->params.compressionTarget.targetQ, 0);
|
||||
cam->params.compressionTarget.frTargeting,
|
||||
cam->params.compressionTarget.targetFR,
|
||||
cam->params.compressionTarget.targetQ, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETYUVTHRESH)
|
||||
do_command(cam, CPIA_COMMAND_SetYUVThresh,
|
||||
cam->params.yuvThreshold.yThreshold,
|
||||
cam->params.yuvThreshold.uvThreshold, 0, 0);
|
||||
cam->params.yuvThreshold.yThreshold,
|
||||
cam->params.yuvThreshold.uvThreshold, 0, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETCOMPRESSIONPARAMS)
|
||||
do_command_extended(cam, CPIA_COMMAND_SetCompressionParams,
|
||||
0, 0, 0, 0,
|
||||
cam->params.compressionParams.hysteresis,
|
||||
cam->params.compressionParams.threshMax,
|
||||
cam->params.compressionParams.smallStep,
|
||||
cam->params.compressionParams.largeStep,
|
||||
cam->params.compressionParams.decimationHysteresis,
|
||||
cam->params.compressionParams.frDiffStepThresh,
|
||||
cam->params.compressionParams.qDiffStepThresh,
|
||||
cam->params.compressionParams.decimationThreshMod);
|
||||
0, 0, 0, 0,
|
||||
cam->params.compressionParams.hysteresis,
|
||||
cam->params.compressionParams.threshMax,
|
||||
cam->params.compressionParams.smallStep,
|
||||
cam->params.compressionParams.largeStep,
|
||||
cam->params.compressionParams.decimationHysteresis,
|
||||
cam->params.compressionParams.frDiffStepThresh,
|
||||
cam->params.compressionParams.qDiffStepThresh,
|
||||
cam->params.compressionParams.decimationThreshMod);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETCOMPRESSION)
|
||||
do_command(cam, CPIA_COMMAND_SetCompression,
|
||||
cam->params.compression.mode,
|
||||
cam->params.compression.mode,
|
||||
cam->params.compression.decimation, 0, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETSENSORFPS)
|
||||
do_command(cam, CPIA_COMMAND_SetSensorFPS,
|
||||
cam->params.sensorFps.divisor,
|
||||
cam->params.sensorFps.baserate, 0, 0);
|
||||
cam->params.sensorFps.divisor,
|
||||
cam->params.sensorFps.baserate, 0, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETFLICKERCTRL)
|
||||
do_command(cam, CPIA_COMMAND_SetFlickerCtrl,
|
||||
cam->params.flickerControl.flickerMode,
|
||||
cam->params.flickerControl.coarseJump,
|
||||
abs(cam->params.flickerControl.allowableOverExposure),
|
||||
0);
|
||||
cam->params.flickerControl.flickerMode,
|
||||
cam->params.flickerControl.coarseJump,
|
||||
abs(cam->params.flickerControl.allowableOverExposure),
|
||||
0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_SETECPTIMING)
|
||||
do_command(cam, CPIA_COMMAND_SetECPTiming,
|
||||
cam->params.ecpTiming, 0, 0, 0);
|
||||
cam->params.ecpTiming, 0, 0, 0);
|
||||
|
||||
if (cam->cmd_queue & COMMAND_PAUSE)
|
||||
do_command(cam, CPIA_COMMAND_EndStreamCap, 0, 0, 0, 0);
|
||||
@ -2409,9 +2409,9 @@ static void dispatch_commands(struct cam_data *cam)
|
||||
if (cam->cmd_queue & COMMAND_SETLIGHTS && cam->params.qx3.qx3_detected)
|
||||
{
|
||||
int p1 = (cam->params.qx3.bottomlight == 0) << 1;
|
||||
int p2 = (cam->params.qx3.toplight == 0) << 3;
|
||||
do_command(cam, CPIA_COMMAND_WriteVCReg, 0x90, 0x8F, 0x50, 0);
|
||||
do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0);
|
||||
int p2 = (cam->params.qx3.toplight == 0) << 3;
|
||||
do_command(cam, CPIA_COMMAND_WriteVCReg, 0x90, 0x8F, 0x50, 0);
|
||||
do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0);
|
||||
}
|
||||
|
||||
cam->cmd_queue = COMMAND_NONE;
|
||||
@ -2422,11 +2422,11 @@ static void dispatch_commands(struct cam_data *cam)
|
||||
|
||||
|
||||
static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
|
||||
int on)
|
||||
int on)
|
||||
{
|
||||
/* Everything in here is from the Windows driver */
|
||||
#define FIRMWARE_VERSION(x,y) (params->version.firmwareVersion == (x) && \
|
||||
params->version.firmwareRevision == (y))
|
||||
params->version.firmwareRevision == (y))
|
||||
/* define for compgain calculation */
|
||||
#if 0
|
||||
#define COMPGAIN(base, curexp, newexp) \
|
||||
@ -2533,7 +2533,7 @@ static void set_flicker(struct cam_params *params, volatile u32 *command_flags,
|
||||
}
|
||||
|
||||
#define FIRMWARE_VERSION(x,y) (cam->params.version.firmwareVersion == (x) && \
|
||||
cam->params.version.firmwareRevision == (y))
|
||||
cam->params.version.firmwareRevision == (y))
|
||||
/* monitor the exposure and adjust the sensor frame rate if needed */
|
||||
static void monitor_exposure(struct cam_data *cam)
|
||||
{
|
||||
@ -2564,17 +2564,17 @@ static void monitor_exposure(struct cam_data *cam)
|
||||
|
||||
mutex_lock(&cam->param_lock);
|
||||
light_exp = cam->params.colourParams.brightness +
|
||||
TC - 50 + EXP_ACC_LIGHT;
|
||||
TC - 50 + EXP_ACC_LIGHT;
|
||||
if(light_exp > 255)
|
||||
light_exp = 255;
|
||||
dark_exp = cam->params.colourParams.brightness +
|
||||
TC - 50 - EXP_ACC_DARK;
|
||||
TC - 50 - EXP_ACC_DARK;
|
||||
if(dark_exp < 0)
|
||||
dark_exp = 0;
|
||||
very_dark_exp = dark_exp/2;
|
||||
|
||||
old_exposure = cam->params.exposure.coarseExpHi * 256 +
|
||||
cam->params.exposure.coarseExpLo;
|
||||
cam->params.exposure.coarseExpLo;
|
||||
|
||||
if(!cam->params.flickerControl.disabled) {
|
||||
/* Flicker control on */
|
||||
@ -2685,8 +2685,8 @@ static void monitor_exposure(struct cam_data *cam)
|
||||
|
||||
cam->params.flickerControl.coarseJump =
|
||||
flicker_jumps[cam->mainsFreq]
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
cam->cmd_queue |= COMMAND_SETFLICKERCTRL;
|
||||
|
||||
new_exposure = cam->params.flickerControl.coarseJump-1;
|
||||
@ -2704,15 +2704,15 @@ static void monitor_exposure(struct cam_data *cam)
|
||||
cam->params.sensorFps.divisor > 0) {
|
||||
|
||||
/* light for too long */
|
||||
int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ;
|
||||
int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ;
|
||||
|
||||
--cam->params.sensorFps.divisor;
|
||||
cam->cmd_queue |= COMMAND_SETSENSORFPS;
|
||||
|
||||
cam->params.flickerControl.coarseJump =
|
||||
flicker_jumps[cam->mainsFreq]
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
cam->cmd_queue |= COMMAND_SETFLICKERCTRL;
|
||||
|
||||
new_exposure = cam->params.flickerControl.coarseJump-1;
|
||||
@ -2786,14 +2786,14 @@ static void restart_flicker(struct cam_data *cam)
|
||||
}
|
||||
cam_exposure = cam->raw_image[39]*2;
|
||||
old_exp = cam->params.exposure.coarseExpLo +
|
||||
cam->params.exposure.coarseExpHi*256;
|
||||
/*
|
||||
cam->params.exposure.coarseExpHi*256;
|
||||
/*
|
||||
see how far away camera exposure is from a valid
|
||||
flicker exposure value
|
||||
*/
|
||||
cam_exposure %= cam->params.flickerControl.coarseJump;
|
||||
flicker exposure value
|
||||
*/
|
||||
cam_exposure %= cam->params.flickerControl.coarseJump;
|
||||
if(!cam->params.flickerControl.disabled &&
|
||||
cam_exposure <= cam->params.flickerControl.coarseJump - 3) {
|
||||
cam_exposure <= cam->params.flickerControl.coarseJump - 3) {
|
||||
/* Flicker control auto-disabled */
|
||||
cam->params.flickerControl.disabled = 1;
|
||||
}
|
||||
@ -2801,7 +2801,7 @@ static void restart_flicker(struct cam_data *cam)
|
||||
if(cam->params.flickerControl.disabled &&
|
||||
cam->params.flickerControl.flickerMode &&
|
||||
old_exp > cam->params.flickerControl.coarseJump +
|
||||
ROUND_UP_EXP_FOR_FLICKER) {
|
||||
ROUND_UP_EXP_FOR_FLICKER) {
|
||||
/* exposure is now high enough to switch
|
||||
flicker control back on */
|
||||
set_flicker(&cam->params, &cam->cmd_queue, 1);
|
||||
@ -2878,7 +2878,7 @@ static int fetch_frame(void *data)
|
||||
return -EINTR;
|
||||
|
||||
do_command(cam, CPIA_COMMAND_GetCameraStatus,
|
||||
0, 0, 0, 0);
|
||||
0, 0, 0, 0);
|
||||
}
|
||||
if(cam->params.status.streamState != STREAM_READY) {
|
||||
continue;
|
||||
@ -2913,8 +2913,8 @@ static int fetch_frame(void *data)
|
||||
dispatch_commands(cam);
|
||||
|
||||
/* Update our knowledge of the camera state */
|
||||
do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0);
|
||||
do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0);
|
||||
do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0);
|
||||
do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0);
|
||||
do_command(cam, CPIA_COMMAND_ReadMCPorts, 0, 0, 0, 0);
|
||||
|
||||
/* decompress and convert image to by copying it from
|
||||
@ -2933,7 +2933,7 @@ static int fetch_frame(void *data)
|
||||
uncompressed. */
|
||||
cam->first_frame = 1;
|
||||
do_command(cam, CPIA_COMMAND_SetGrabMode,
|
||||
CPIA_GRAB_SINGLE, 0, 0, 0);
|
||||
CPIA_GRAB_SINGLE, 0, 0, 0);
|
||||
/* FIXME: Trial & error - need up to 70ms for
|
||||
the grab mode change to complete ? */
|
||||
msleep_interruptible(70);
|
||||
@ -2957,12 +2957,12 @@ static int fetch_frame(void *data)
|
||||
if (cam->first_frame) {
|
||||
cam->first_frame = 0;
|
||||
do_command(cam, CPIA_COMMAND_SetCompression,
|
||||
cam->params.compression.mode,
|
||||
cam->params.compression.mode,
|
||||
cam->params.compression.decimation, 0, 0);
|
||||
|
||||
/* Switch from single-grab to continuous grab */
|
||||
do_command(cam, CPIA_COMMAND_SetGrabMode,
|
||||
CPIA_GRAB_CONTINUOUS, 0, 0, 0);
|
||||
CPIA_GRAB_CONTINUOUS, 0, 0, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -3039,18 +3039,18 @@ static void save_camera_state(struct cam_data *cam)
|
||||
static int set_camera_state(struct cam_data *cam)
|
||||
{
|
||||
cam->cmd_queue = COMMAND_SETCOMPRESSION |
|
||||
COMMAND_SETCOMPRESSIONTARGET |
|
||||
COMMAND_SETCOLOURPARAMS |
|
||||
COMMAND_SETFORMAT |
|
||||
COMMAND_SETYUVTHRESH |
|
||||
COMMAND_SETECPTIMING |
|
||||
COMMAND_SETCOMPRESSIONPARAMS |
|
||||
COMMAND_SETEXPOSURE |
|
||||
COMMAND_SETCOLOURBALANCE |
|
||||
COMMAND_SETSENSORFPS |
|
||||
COMMAND_SETAPCOR |
|
||||
COMMAND_SETFLICKERCTRL |
|
||||
COMMAND_SETVLOFFSET;
|
||||
COMMAND_SETCOMPRESSIONTARGET |
|
||||
COMMAND_SETCOLOURPARAMS |
|
||||
COMMAND_SETFORMAT |
|
||||
COMMAND_SETYUVTHRESH |
|
||||
COMMAND_SETECPTIMING |
|
||||
COMMAND_SETCOMPRESSIONPARAMS |
|
||||
COMMAND_SETEXPOSURE |
|
||||
COMMAND_SETCOLOURBALANCE |
|
||||
COMMAND_SETSENSORFPS |
|
||||
COMMAND_SETAPCOR |
|
||||
COMMAND_SETFLICKERCTRL |
|
||||
COMMAND_SETVLOFFSET;
|
||||
|
||||
do_command(cam, CPIA_COMMAND_SetGrabMode, CPIA_GRAB_SINGLE,0,0,0);
|
||||
dispatch_commands(cam);
|
||||
@ -3113,13 +3113,13 @@ static int reset_camera(struct cam_data *cam)
|
||||
cam->params.qx3.qx3_detected = (cam->params.pnpID.vendor == 0x0813 &&
|
||||
cam->params.pnpID.product == 0x0001);
|
||||
|
||||
/* The fatal error checking should be done after
|
||||
/* The fatal error checking should be done after
|
||||
* the camera powers up (developer's guide p 3-38) */
|
||||
|
||||
/* Set streamState before transition to high power to avoid bug
|
||||
* in firmware 1-02 */
|
||||
do_command(cam, CPIA_COMMAND_ModifyCameraStatus, STREAMSTATE, 0,
|
||||
STREAM_NOT_READY, 0);
|
||||
STREAM_NOT_READY, 0);
|
||||
|
||||
/* GotoHiPower */
|
||||
err = goto_high_power(cam);
|
||||
@ -3142,7 +3142,7 @@ static int reset_camera(struct cam_data *cam)
|
||||
/* Firmware 1-02 may do this for parallel port cameras,
|
||||
* just clear the flags (developer's guide p 3-38) */
|
||||
do_command(cam, CPIA_COMMAND_ModifyCameraStatus,
|
||||
FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0);
|
||||
FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3250,7 +3250,7 @@ static int cpia_close(struct inode *inode, struct file *file)
|
||||
struct cam_data *cam = dev->priv;
|
||||
|
||||
if (cam->ops) {
|
||||
/* Return ownership of /proc/cpia/videoX to root */
|
||||
/* Return ownership of /proc/cpia/videoX to root */
|
||||
if(cam->proc_entry)
|
||||
cam->proc_entry->uid = 0;
|
||||
|
||||
@ -3342,7 +3342,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf,
|
||||
return -EFAULT;
|
||||
}
|
||||
if (copy_to_user(buf, cam->decompressed_frame.data,
|
||||
cam->decompressed_frame.count)) {
|
||||
cam->decompressed_frame.count)) {
|
||||
DBG("copy_to_user failed\n");
|
||||
mutex_unlock(&cam->busy_lock);
|
||||
return -EFAULT;
|
||||
@ -3853,8 +3853,8 @@ static void reset_camera_struct(struct cam_data *cam)
|
||||
|
||||
cam->params.flickerControl.coarseJump =
|
||||
flicker_jumps[cam->mainsFreq]
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
[cam->params.sensorFps.baserate]
|
||||
[cam->params.sensorFps.divisor];
|
||||
cam->params.flickerControl.allowableOverExposure =
|
||||
-find_over_exposure(cam->params.colourParams.brightness);
|
||||
cam->params.vlOffset.gain1 = 20;
|
||||
@ -3928,7 +3928,7 @@ static void reset_camera_struct(struct cam_data *cam)
|
||||
|
||||
/* initialize cam_data structure */
|
||||
static void init_camera_struct(struct cam_data *cam,
|
||||
struct cpia_camera_ops *ops )
|
||||
struct cpia_camera_ops *ops )
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -3961,7 +3961,7 @@ static void init_camera_struct(struct cam_data *cam,
|
||||
|
||||
struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowlevel)
|
||||
{
|
||||
struct cam_data *camera;
|
||||
struct cam_data *camera;
|
||||
|
||||
if ((camera = kmalloc(sizeof(struct cam_data), GFP_KERNEL)) == NULL)
|
||||
return NULL;
|
||||
|
@ -52,7 +52,7 @@
|
||||
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);
|
||||
|
||||
@ -63,7 +63,7 @@ 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
|
||||
@ -84,10 +84,10 @@ struct cpia_camera_ops
|
||||
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.
|
||||
@ -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 */
|
||||
@ -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__ */
|
||||
|
||||
|
@ -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);
|
||||
@ -549,11 +549,11 @@ static int cpia_pp_streamRead(void *privdata, u8 *buffer, int noblock)
|
||||
}
|
||||
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) {
|
||||
@ -645,8 +645,8 @@ 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;
|
||||
@ -709,7 +709,7 @@ static int cpia_pp_register(struct parport *port)
|
||||
}
|
||||
|
||||
pdev = parport_register_device(port, "cpia_pp", NULL, NULL,
|
||||
NULL, 0, cam);
|
||||
NULL, 0, cam);
|
||||
|
||||
if (!pdev) {
|
||||
LOG("failed to parport_register_device\n");
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module
|
||||
Markus: Copyright clarification
|
||||
|
||||
Version 0.01: Markus: initial release
|
||||
@ -200,7 +200,7 @@ static int dsbr100_setfreq(dsbr100_device *radio, int freq)
|
||||
(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),
|
||||
|
@ -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 */
|
||||
|
@ -44,7 +44,7 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
#define ET61X251_MODULE_NAME "V4L2 driver for ET61X[12]51 " \
|
||||
"PC Camera Controllers"
|
||||
"PC Camera Controllers"
|
||||
#define ET61X251_MODULE_AUTHOR "(C) 2006 Luca Risolia"
|
||||
#define ET61X251_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
|
||||
#define ET61X251_MODULE_LICENSE "GPL"
|
||||
@ -63,68 +63,68 @@ MODULE_LICENSE(ET61X251_MODULE_LICENSE);
|
||||
static short video_nr[] = {[0 ... ET61X251_MAX_DEVICES-1] = -1};
|
||||
module_param_array(video_nr, short, NULL, 0444);
|
||||
MODULE_PARM_DESC(video_nr,
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "
|
||||
__MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second registered camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "
|
||||
__MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second registered camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
|
||||
static short force_munmap[] = {[0 ... ET61X251_MAX_DEVICES-1] =
|
||||
ET61X251_FORCE_MUNMAP};
|
||||
ET61X251_FORCE_MUNMAP};
|
||||
module_param_array(force_munmap, bool, NULL, 0444);
|
||||
MODULE_PARM_DESC(force_munmap,
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
|
||||
static unsigned int frame_timeout[] = {[0 ... ET61X251_MAX_DEVICES-1] =
|
||||
ET61X251_FRAME_TIMEOUT};
|
||||
ET61X251_FRAME_TIMEOUT};
|
||||
module_param_array(frame_timeout, uint, NULL, 0644);
|
||||
MODULE_PARM_DESC(frame_timeout,
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "
|
||||
__MODULE_STRING(ET61X251_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "
|
||||
__MODULE_STRING(ET61X251_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
|
||||
#ifdef ET61X251_DEBUG
|
||||
static unsigned short debug = ET61X251_DEBUG_LEVEL;
|
||||
module_param(debug, ushort, 0644);
|
||||
MODULE_PARM_DESC(debug,
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static u32
|
||||
et61x251_request_buffers(struct et61x251_device* cam, u32 count,
|
||||
enum et61x251_io_method io)
|
||||
enum et61x251_io_method io)
|
||||
{
|
||||
struct v4l2_pix_format* p = &(cam->sensor.pix_format);
|
||||
struct v4l2_rect* r = &(cam->sensor.cropcap.bounds);
|
||||
const size_t imagesize = cam->module_param.force_munmap ||
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
void* buff = NULL;
|
||||
u32 i;
|
||||
|
||||
@ -216,7 +216,7 @@ int et61x251_write_reg(struct et61x251_device* cam, u8 value, u16 index)
|
||||
*buff = value;
|
||||
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
|
||||
0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0) {
|
||||
DBG(3, "Failed to write a register (value 0x%02X, index "
|
||||
"0x%02X, error %d)", value, index, res);
|
||||
@ -234,7 +234,7 @@ int et61x251_read_reg(struct et61x251_device* cam, u16 index)
|
||||
int res;
|
||||
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
|
||||
0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
|
||||
0, index, buff, 1, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
DBG(3, "Failed to read a register (index 0x%02X, error %d)",
|
||||
index, res);
|
||||
@ -269,7 +269,7 @@ et61x251_i2c_wait(struct et61x251_device* cam, struct et61x251_sensor* sensor)
|
||||
|
||||
int
|
||||
et61x251_i2c_try_read(struct et61x251_device* cam,
|
||||
struct et61x251_sensor* sensor, u8 address)
|
||||
struct et61x251_sensor* sensor, u8 address)
|
||||
{
|
||||
struct usb_device* udev = cam->usbdev;
|
||||
u8* data = cam->control_buffer;
|
||||
@ -280,14 +280,14 @@ et61x251_i2c_try_read(struct et61x251_device* cam,
|
||||
data[2] = cam->sensor.rsta | 0x10;
|
||||
data[3] = !(et61x251_read_reg(cam, 0x8b) & 0x02);
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
err += et61x251_i2c_wait(cam, sensor);
|
||||
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
|
||||
0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -302,7 +302,7 @@ et61x251_i2c_try_read(struct et61x251_device* cam,
|
||||
|
||||
int
|
||||
et61x251_i2c_try_write(struct et61x251_device* cam,
|
||||
struct et61x251_sensor* sensor, u8 address, u8 value)
|
||||
struct et61x251_sensor* sensor, u8 address, u8 value)
|
||||
{
|
||||
struct usb_device* udev = cam->usbdev;
|
||||
u8* data = cam->control_buffer;
|
||||
@ -312,13 +312,13 @@ et61x251_i2c_try_write(struct et61x251_device* cam,
|
||||
data[1] = cam->sensor.i2c_slave_id;
|
||||
data[2] = cam->sensor.rsta | 0x12;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
data[0] = value;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -335,8 +335,8 @@ et61x251_i2c_try_write(struct et61x251_device* cam,
|
||||
|
||||
int
|
||||
et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
|
||||
u8 data3, u8 data4, u8 data5, u8 data6, u8 data7,
|
||||
u8 data8, u8 address)
|
||||
u8 data3, u8 data4, u8 data5, u8 data6, u8 data7,
|
||||
u8 data8, u8 address)
|
||||
{
|
||||
struct usb_device* udev = cam->usbdev;
|
||||
u8* data = cam->control_buffer;
|
||||
@ -350,7 +350,7 @@ et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
|
||||
data[5] = data7;
|
||||
data[6] = data8;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -358,14 +358,14 @@ et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2,
|
||||
data[1] = cam->sensor.i2c_slave_id;
|
||||
data[2] = cam->sensor.rsta | 0x02 | (n << 4);
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
/* Start writing through the serial interface */
|
||||
data[0] = data1;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41,
|
||||
0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
|
||||
0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -432,11 +432,11 @@ static void et61x251_urb_complete(struct urb *urb, struct pt_regs* regs)
|
||||
|
||||
if (!(*f))
|
||||
(*f) = list_entry(cam->inqueue.next, struct et61x251_frame_t,
|
||||
frame);
|
||||
frame);
|
||||
|
||||
imagesize = (cam->sensor.pix_format.width *
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
|
||||
for (i = 0; i < urb->number_of_packets; i++) {
|
||||
unsigned int len, status;
|
||||
@ -476,7 +476,7 @@ start_of_frame:
|
||||
if ((*f)->state == F_GRABBING) {
|
||||
if (sof && (*f)->buf.bytesused) {
|
||||
if (cam->sensor.pix_format.pixelformat ==
|
||||
V4L2_PIX_FMT_ET61X251)
|
||||
V4L2_PIX_FMT_ET61X251)
|
||||
goto end_of_frame;
|
||||
else {
|
||||
DBG(3, "Not expected SOF detected "
|
||||
@ -508,8 +508,8 @@ end_of_frame:
|
||||
list_move_tail(&(*f)->frame, &cam->outqueue);
|
||||
if (!list_empty(&cam->inqueue))
|
||||
(*f) = list_entry(cam->inqueue.next,
|
||||
struct et61x251_frame_t,
|
||||
frame);
|
||||
struct et61x251_frame_t,
|
||||
frame);
|
||||
else
|
||||
(*f) = NULL;
|
||||
spin_unlock(&cam->queue_lock);
|
||||
@ -521,7 +521,7 @@ end_of_frame:
|
||||
|
||||
if (sof &&
|
||||
cam->sensor.pix_format.pixelformat ==
|
||||
V4L2_PIX_FMT_ET61X251)
|
||||
V4L2_PIX_FMT_ET61X251)
|
||||
goto start_of_frame;
|
||||
}
|
||||
}
|
||||
@ -544,15 +544,15 @@ static int et61x251_start_transfer(struct et61x251_device* cam)
|
||||
struct usb_device *udev = cam->usbdev;
|
||||
struct urb* urb;
|
||||
const unsigned int wMaxPacketSize[] = {0, 256, 384, 512, 640, 768, 832,
|
||||
864, 896, 920, 956, 980, 1000,
|
||||
1022};
|
||||
864, 896, 920, 956, 980, 1000,
|
||||
1022};
|
||||
const unsigned int psz = wMaxPacketSize[ET61X251_ALTERNATE_SETTING];
|
||||
s8 i, j;
|
||||
int err = 0;
|
||||
|
||||
for (i = 0; i < ET61X251_URBS; i++) {
|
||||
cam->transfer_buffer[i] = kzalloc(ET61X251_ISO_PACKETS * psz,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL);
|
||||
if (!cam->transfer_buffer[i]) {
|
||||
err = -ENOMEM;
|
||||
DBG(1, "Not enough memory");
|
||||
@ -653,9 +653,9 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
|
||||
|
||||
cam->stream = STREAM_INTERRUPT;
|
||||
timeout = wait_event_timeout(cam->wait_stream,
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
ET61X251_URB_TIMEOUT);
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
ET61X251_URB_TIMEOUT);
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
return -ENODEV;
|
||||
else if (cam->stream != STREAM_OFF) {
|
||||
@ -699,7 +699,7 @@ static u8 et61x251_strtou8(const char* buff, size_t len, ssize_t* count)
|
||||
|
||||
/*
|
||||
NOTE 1: being inside one of the following methods implies that the v4l
|
||||
device exists for sure (see kobjects and reference counters)
|
||||
device exists for sure (see kobjects and reference counters)
|
||||
NOTE 2: buffers are PAGE_SIZE long
|
||||
*/
|
||||
|
||||
@ -964,13 +964,13 @@ et61x251_store_i2c_val(struct class_device* cd, const char* buf, size_t len)
|
||||
|
||||
|
||||
static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR,
|
||||
et61x251_show_reg, et61x251_store_reg);
|
||||
et61x251_show_reg, et61x251_store_reg);
|
||||
static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR,
|
||||
et61x251_show_val, et61x251_store_val);
|
||||
et61x251_show_val, et61x251_store_val);
|
||||
static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR,
|
||||
et61x251_show_i2c_reg, et61x251_store_i2c_reg);
|
||||
et61x251_show_i2c_reg, et61x251_store_i2c_reg);
|
||||
static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
|
||||
et61x251_show_i2c_val, et61x251_store_i2c_val);
|
||||
et61x251_show_i2c_val, et61x251_store_i2c_val);
|
||||
|
||||
|
||||
static void et61x251_create_sysfs(struct et61x251_device* cam)
|
||||
@ -990,7 +990,7 @@ static void et61x251_create_sysfs(struct et61x251_device* cam)
|
||||
|
||||
static int
|
||||
et61x251_set_pix_format(struct et61x251_device* cam,
|
||||
struct v4l2_pix_format* pix)
|
||||
struct v4l2_pix_format* pix)
|
||||
{
|
||||
int r, err = 0;
|
||||
|
||||
@ -1007,7 +1007,7 @@ et61x251_set_pix_format(struct et61x251_device* cam,
|
||||
|
||||
static int
|
||||
et61x251_set_compression(struct et61x251_device* cam,
|
||||
struct v4l2_jpegcompression* compression)
|
||||
struct v4l2_jpegcompression* compression)
|
||||
{
|
||||
int r, err = 0;
|
||||
|
||||
@ -1049,9 +1049,9 @@ et61x251_set_crop(struct et61x251_device* cam, struct v4l2_rect* rect)
|
||||
{
|
||||
struct et61x251_sensor* s = &cam->sensor;
|
||||
u16 fmw_sx = (u16)(rect->left - s->cropcap.bounds.left +
|
||||
s->active_pixel.left),
|
||||
s->active_pixel.left),
|
||||
fmw_sy = (u16)(rect->top - s->cropcap.bounds.top +
|
||||
s->active_pixel.top),
|
||||
s->active_pixel.top),
|
||||
fmw_length = (u16)(rect->width),
|
||||
fmw_height = (u16)(rect->height);
|
||||
int err = 0;
|
||||
@ -1061,8 +1061,8 @@ et61x251_set_crop(struct et61x251_device* cam, struct v4l2_rect* rect)
|
||||
err += et61x251_write_reg(cam, fmw_length & 0xff, 0x6b);
|
||||
err += et61x251_write_reg(cam, fmw_height & 0xff, 0x6c);
|
||||
err += et61x251_write_reg(cam, (fmw_sx >> 8) | ((fmw_sy & 0x300) >> 6)
|
||||
| ((fmw_length & 0x300) >> 4)
|
||||
| ((fmw_height & 0x300) >> 2), 0x6d);
|
||||
| ((fmw_length & 0x300) >> 4)
|
||||
| ((fmw_height & 0x300) >> 2), 0x6d);
|
||||
if (err)
|
||||
return -EIO;
|
||||
|
||||
@ -1203,8 +1203,8 @@ static int et61x251_open(struct inode* inode, struct file* filp)
|
||||
}
|
||||
mutex_unlock(&cam->dev_mutex);
|
||||
err = wait_event_interruptible_exclusive(cam->open,
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
if (err) {
|
||||
up_read(&et61x251_disconnect);
|
||||
return err;
|
||||
@ -1277,7 +1277,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
|
||||
|
||||
static ssize_t
|
||||
et61x251_read(struct file* filp, char __user * buf,
|
||||
size_t count, loff_t* f_pos)
|
||||
size_t count, loff_t* f_pos)
|
||||
{
|
||||
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
struct et61x251_frame_t* f, * i;
|
||||
@ -1310,7 +1310,7 @@ et61x251_read(struct file* filp, char __user * buf,
|
||||
|
||||
if (cam->io == IO_NONE) {
|
||||
if (!et61x251_request_buffers(cam, cam->nreadbuffers,
|
||||
IO_READ)) {
|
||||
IO_READ)) {
|
||||
DBG(1, "read() failed, not enough memory");
|
||||
mutex_unlock(&cam->fileop_mutex);
|
||||
return -ENOMEM;
|
||||
@ -1336,12 +1336,12 @@ et61x251_read(struct file* filp, char __user * buf,
|
||||
return -EAGAIN;
|
||||
}
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0) {
|
||||
mutex_unlock(&cam->fileop_mutex);
|
||||
return timeout;
|
||||
@ -1408,7 +1408,7 @@ static unsigned int et61x251_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
if (cam->io == IO_NONE) {
|
||||
if (!et61x251_request_buffers(cam, cam->nreadbuffers,
|
||||
IO_READ)) {
|
||||
IO_READ)) {
|
||||
DBG(1, "poll() failed, not enough memory");
|
||||
goto error;
|
||||
}
|
||||
@ -1465,7 +1465,7 @@ static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma)
|
||||
{
|
||||
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
unsigned long size = vma->vm_end - vma->vm_start,
|
||||
start = vma->vm_start;
|
||||
start = vma->vm_start;
|
||||
void *pos;
|
||||
u32 i;
|
||||
|
||||
@ -1533,13 +1533,13 @@ et61x251_vidioc_querycap(struct et61x251_device* cam, void __user * arg)
|
||||
.driver = "et61x251",
|
||||
.version = ET61X251_MODULE_VERSION_CODE,
|
||||
.capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
|
||||
V4L2_CAP_STREAMING,
|
||||
V4L2_CAP_STREAMING,
|
||||
};
|
||||
|
||||
strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card));
|
||||
if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0)
|
||||
strlcpy(cap.bus_info, cam->usbdev->dev.bus_id,
|
||||
sizeof(cap.bus_info));
|
||||
sizeof(cap.bus_info));
|
||||
|
||||
if (copy_to_user(arg, &cap, sizeof(cap)))
|
||||
return -EFAULT;
|
||||
@ -1871,7 +1871,7 @@ et61x251_vidioc_g_fmt(struct et61x251_device* cam, void __user * arg)
|
||||
return -EINVAL;
|
||||
|
||||
pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_ET61X251)
|
||||
? 0 : (pfmt->width * pfmt->priv) / 8;
|
||||
? 0 : (pfmt->width * pfmt->priv) / 8;
|
||||
pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8);
|
||||
pfmt->field = V4L2_FIELD_NONE;
|
||||
memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt));
|
||||
@ -1885,7 +1885,7 @@ et61x251_vidioc_g_fmt(struct et61x251_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct et61x251_sensor* s = &cam->sensor;
|
||||
struct v4l2_format format;
|
||||
@ -1947,7 +1947,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
|
||||
pix->priv = pfmt->priv; /* bpp */
|
||||
pix->colorspace = pfmt->colorspace;
|
||||
pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_ET61X251)
|
||||
? 0 : (pix->width * pix->priv) / 8;
|
||||
? 0 : (pix->width * pix->priv) / 8;
|
||||
pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8);
|
||||
pix->field = V4L2_FIELD_NONE;
|
||||
|
||||
@ -2020,7 +2020,7 @@ static int
|
||||
et61x251_vidioc_g_jpegcomp(struct et61x251_device* cam, void __user * arg)
|
||||
{
|
||||
if (copy_to_user(arg, &cam->compression,
|
||||
sizeof(cam->compression)))
|
||||
sizeof(cam->compression)))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
@ -2169,7 +2169,7 @@ et61x251_vidioc_qbuf(struct et61x251_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
et61x251_vidioc_dqbuf(struct et61x251_device* cam, struct file* filp,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct v4l2_buffer b;
|
||||
struct et61x251_frame_t *f;
|
||||
@ -2188,12 +2188,12 @@ et61x251_vidioc_dqbuf(struct et61x251_device* cam, struct file* filp,
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0)
|
||||
return timeout;
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
@ -2317,7 +2317,7 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
|
||||
|
||||
|
||||
static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, void __user * arg)
|
||||
unsigned int cmd, void __user * arg)
|
||||
{
|
||||
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
|
||||
@ -2411,7 +2411,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
|
||||
|
||||
static int et61x251_ioctl(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
int err = 0;
|
||||
@ -2518,7 +2518,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||
mutex_lock(&cam->dev_mutex);
|
||||
|
||||
err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
|
||||
video_nr[dev_nr]);
|
||||
video_nr[dev_nr]);
|
||||
if (err) {
|
||||
DBG(1, "V4L2 device registration failed");
|
||||
if (err == -ENFILE && video_nr[dev_nr] == -1)
|
||||
|
@ -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;
|
||||
|
@ -1752,7 +1752,7 @@ sensor_set_picture(struct usb_ov511 *ov, struct video_picture *p)
|
||||
ov->whiteness = p->whiteness;
|
||||
|
||||
/* Don't return error if a setting is unsupported, or rest of settings
|
||||
* will not be performed */
|
||||
* will not be performed */
|
||||
|
||||
rc = sensor_set_contrast(ov, p->contrast);
|
||||
if (FATAL_ERROR(rc))
|
||||
@ -1781,7 +1781,7 @@ sensor_get_picture(struct usb_ov511 *ov, struct video_picture *p)
|
||||
PDEBUG(4, "sensor_get_picture");
|
||||
|
||||
/* Don't return error if a setting is unsupported, or rest of settings
|
||||
* will not be performed */
|
||||
* will not be performed */
|
||||
|
||||
rc = sensor_get_contrast(ov, &(p->contrast));
|
||||
if (FATAL_ERROR(rc))
|
||||
@ -2575,7 +2575,7 @@ ov518_mode_init_regs(struct usb_ov511 *ov,
|
||||
/* OV518 needs U and V swapped */
|
||||
i2c_w_mask(ov, 0x15, 0x00, 0x01);
|
||||
|
||||
if (mode == VIDEO_PALETTE_GREY) {
|
||||
if (mode == VIDEO_PALETTE_GREY) {
|
||||
/* Set 16-bit input format (UV data are ignored) */
|
||||
reg_w_mask(ov, 0x20, 0x00, 0x08);
|
||||
|
||||
@ -3034,7 +3034,7 @@ decompress(struct usb_ov511 *ov, struct ov511_frame *frame,
|
||||
*/
|
||||
static void
|
||||
deinterlace(struct ov511_frame *frame, int rawformat,
|
||||
unsigned char *pIn0, unsigned char *pOut0)
|
||||
unsigned char *pIn0, unsigned char *pOut0)
|
||||
{
|
||||
const int fieldheight = frame->rawheight / 2;
|
||||
const int fieldpix = fieldheight * frame->rawwidth;
|
||||
@ -3112,7 +3112,7 @@ ov51x_postprocess_grey(struct usb_ov511 *ov, struct ov511_frame *frame)
|
||||
frame->tempdata);
|
||||
|
||||
deinterlace(frame, RAWFMT_YUV400, frame->tempdata,
|
||||
frame->data);
|
||||
frame->data);
|
||||
} else {
|
||||
if (frame->compressed)
|
||||
decompress(ov, frame, frame->rawdata,
|
||||
@ -3136,7 +3136,7 @@ ov51x_postprocess_yuv420(struct usb_ov511 *ov, struct ov511_frame *frame)
|
||||
frame->tempdata);
|
||||
|
||||
deinterlace(frame, RAWFMT_YUV420, frame->tempdata,
|
||||
frame->data);
|
||||
frame->data);
|
||||
} else {
|
||||
if (frame->compressed)
|
||||
decompress(ov, frame, frame->rawdata, frame->data);
|
||||
@ -3226,7 +3226,7 @@ ov511_move_data(struct usb_ov511 *ov, unsigned char *in, int n)
|
||||
frame->rawwidth = ((int)(in[9]) + 1) * 8;
|
||||
frame->rawheight = ((int)(in[10]) + 1) * 8;
|
||||
|
||||
PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d",
|
||||
PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d",
|
||||
ov->curframe, pnum, frame->rawwidth, frame->rawheight,
|
||||
frame->bytes_recvd);
|
||||
|
||||
@ -3527,10 +3527,10 @@ ov51x_isoc_irq(struct urb *urb, struct pt_regs *regs)
|
||||
return;
|
||||
}
|
||||
|
||||
if (urb->status == -ENOENT || urb->status == -ECONNRESET) {
|
||||
PDEBUG(4, "URB unlinked");
|
||||
return;
|
||||
}
|
||||
if (urb->status == -ENOENT || urb->status == -ECONNRESET) {
|
||||
PDEBUG(4, "URB unlinked");
|
||||
return;
|
||||
}
|
||||
|
||||
if (urb->status != -EINPROGRESS && urb->status != 0) {
|
||||
err("ERROR: urb->status=%d: %s", urb->status,
|
||||
@ -4627,8 +4627,8 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
PDEBUG(4, "mmap: %ld (%lX) bytes", size, size);
|
||||
|
||||
if (size > (((OV511_NUMFRAMES
|
||||
* MAX_DATA_SIZE(ov->maxwidth, ov->maxheight)
|
||||
+ PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))))
|
||||
* MAX_DATA_SIZE(ov->maxwidth, ov->maxheight)
|
||||
+ PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))))
|
||||
return -EINVAL;
|
||||
|
||||
if (mutex_lock_interruptible(&ov->lock))
|
||||
@ -5193,7 +5193,7 @@ saa7111a_configure(struct usb_ov511 *ov)
|
||||
return -1;
|
||||
|
||||
/* Detect version of decoder. This must be done after writing the
|
||||
* initial regs or the decoder will lock up. */
|
||||
* initial regs or the decoder will lock up. */
|
||||
rc = i2c_r(ov, 0x00);
|
||||
|
||||
if (rc < 0) {
|
||||
@ -5221,8 +5221,8 @@ ov511_configure(struct usb_ov511 *ov)
|
||||
{
|
||||
static struct ov511_regvals aRegvalsInit511[] = {
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x7f },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0x01 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x7f },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0x01 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x7f },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0x01 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x3f },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0x01 },
|
||||
@ -5336,17 +5336,17 @@ ov511_configure(struct usb_ov511 *ov)
|
||||
|
||||
if (i2c_w(ov, 0x10, 0x00) < 0) {
|
||||
err("Can't determine sensor slave IDs");
|
||||
goto error;
|
||||
goto error;
|
||||
} else {
|
||||
if (ks0127_configure(ov) < 0) {
|
||||
err("Failed to configure KS0127");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (saa7111a_configure(ov) < 0) {
|
||||
err("Failed to configure SAA7111A");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -5356,13 +5356,13 @@ ov511_configure(struct usb_ov511 *ov)
|
||||
} else {
|
||||
if (ov6xx0_configure(ov) < 0) {
|
||||
err("Failed to configure OV6xx0");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ov7xx0_configure(ov) < 0) {
|
||||
err("Failed to configure OV7xx0");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5381,8 +5381,8 @@ ov518_configure(struct usb_ov511 *ov)
|
||||
/* For 518 and 518+ */
|
||||
static struct ov511_regvals aRegvalsInit518[] = {
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x40 },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0xe1 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x3e },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0xe1 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x3e },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0xe1 },
|
||||
{ OV511_REG_BUS, R51x_SYS_RESET, 0x00 },
|
||||
{ OV511_REG_BUS, R51x_SYS_INIT, 0xe1 },
|
||||
@ -5517,7 +5517,7 @@ ov518_configure(struct usb_ov511 *ov)
|
||||
|
||||
if (init_ov_sensor(ov) < 0) {
|
||||
err("Can't determine sensor slave IDs");
|
||||
goto error;
|
||||
goto error;
|
||||
} else {
|
||||
err("Detected unsupported OV8xx0 sensor");
|
||||
goto error;
|
||||
@ -5525,13 +5525,13 @@ ov518_configure(struct usb_ov511 *ov)
|
||||
} else {
|
||||
if (ov6xx0_configure(ov) < 0) {
|
||||
err("Failed to configure OV6xx0");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ov7xx0_configure(ov) < 0) {
|
||||
err("Failed to configure OV7xx0");
|
||||
goto error;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
ovcamchip-objs := ovcamchip_core.o ov6x20.o ov6x30.o ov7x10.o ov7x20.o \
|
||||
ov76be.o
|
||||
ov76be.o
|
||||
|
||||
obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip.o
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
@ -1508,7 +1508,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
|
||||
}
|
||||
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");
|
||||
|
||||
@ -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,40 +1759,40 @@ 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:
|
||||
@ -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, "
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -136,10 +136,10 @@ static int pms_i2c_write(u16 slave, u16 sub, u16 data)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,8 @@ compression (only useful with the plugin)
|
||||
uses to squeeze the image through the USB bus. You can set the
|
||||
parameter between 0 and 3:
|
||||
0 = prefer uncompressed images; if the requested mode is not available
|
||||
in an uncompressed format, the driver will silently switch to low
|
||||
compression.
|
||||
in an uncompressed format, the driver will silently switch to low
|
||||
compression.
|
||||
1 = low compression.
|
||||
2 = medium compression.
|
||||
3 = high compression.
|
||||
@ -153,21 +153,21 @@ dev_hint
|
||||
This somewhat cryptic syntax is best explained by a few examples:
|
||||
|
||||
dev_hint=3,5 The first detected cam gets assigned
|
||||
/dev/video3, the second /dev/video5. Any
|
||||
other cameras will get the first free
|
||||
available slot (see below).
|
||||
/dev/video3, the second /dev/video5. Any
|
||||
other cameras will get the first free
|
||||
available slot (see below).
|
||||
|
||||
dev_hint=645:1,680:2 The PCA645 camera will get /dev/video1,
|
||||
and a PCVC680 /dev/video2.
|
||||
and a PCVC680 /dev/video2.
|
||||
|
||||
dev_hint=645.0123:3,645.4567:0 The PCA645 camera with serialnumber
|
||||
0123 goes to /dev/video3, the same
|
||||
camera model with the 4567 serial
|
||||
gets /dev/video0.
|
||||
0123 goes to /dev/video3, the same
|
||||
camera model with the 4567 serial
|
||||
gets /dev/video0.
|
||||
|
||||
dev_hint=750:1,4,5,6 The PCVC750 camera will get /dev/video1, the
|
||||
next 3 Philips cams will use /dev/video4
|
||||
through /dev/video6.
|
||||
next 3 Philips cams will use /dev/video4
|
||||
through /dev/video6.
|
||||
|
||||
Some points worth knowing:
|
||||
- Serialnumbers are case sensitive and must be written full, including
|
||||
@ -192,7 +192,7 @@ trace
|
||||
Value Value Description Default
|
||||
(dec) (hex)
|
||||
1 0x1 Module initialization; this will log messages On
|
||||
while loading and unloading the module
|
||||
while loading and unloading the module
|
||||
|
||||
2 0x2 probe() and disconnect() traces On
|
||||
|
||||
@ -203,7 +203,7 @@ trace
|
||||
16 0x10 Memory allocation of buffers, etc. Off
|
||||
|
||||
32 0x20 Showing underflow, overflow and Dumping frame On
|
||||
messages
|
||||
messages
|
||||
|
||||
64 0x40 Show viewport and image sizes Off
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
/*
|
||||
Changes
|
||||
2001/08/03 Alvarado Added methods for changing white balance and
|
||||
red/green gains
|
||||
red/green gains
|
||||
*/
|
||||
|
||||
/* Control functions for the cam; brightness, contrast, video mode, etc. */
|
||||
@ -205,11 +205,11 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
|
||||
{ /* closest match of framerate */
|
||||
0, 0, 0, 0, 4, /* 0-4 */
|
||||
5, 5, 7, 7, 10, /* 5-9 */
|
||||
10, 10, 12, 12, 15, /* 10-14 */
|
||||
15, 15, 15, 20, 20, /* 15-19 */
|
||||
20, 20, 20, 24, 24, /* 20-24 */
|
||||
24, 24, 24, 24, 24, /* 25-29 */
|
||||
24 /* 30 */
|
||||
10, 10, 12, 12, 15, /* 10-14 */
|
||||
15, 15, 15, 20, 20, /* 15-19 */
|
||||
20, 20, 20, 24, 24, /* 20-24 */
|
||||
24, 24, 24, 24, 24, /* 25-29 */
|
||||
24 /* 30 */
|
||||
};
|
||||
int frames2table[31] =
|
||||
{ 0, 0, 0, 0, 0, /* 0-4 */
|
||||
@ -358,7 +358,7 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
|
||||
*/
|
||||
if (pdev->vpalette == VIDEO_PALETTE_RAW)
|
||||
{
|
||||
Info("Choosing VGA/5 BAYER mode (%d).\n", pdev->vpalette);
|
||||
Info("Choosing VGA/5 BAYER mode (%d).\n", pdev->vpalette);
|
||||
pChoose = &RawEntry;
|
||||
}
|
||||
else
|
||||
@ -368,9 +368,9 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Find a supported framerate with progressively higher compression ratios
|
||||
/* Find a supported framerate with progressively higher compression ratios
|
||||
if the preferred ratio is not available.
|
||||
Skip this step when using RAW modes.
|
||||
Skip this step when using RAW modes.
|
||||
*/
|
||||
while (compression <= 3) {
|
||||
pChoose = &Kiara_table[size][fps][compression];
|
||||
@ -463,9 +463,9 @@ static void pwc_set_image_buffer_size(struct pwc_device *pdev)
|
||||
*/
|
||||
int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot)
|
||||
{
|
||||
int ret, size;
|
||||
int ret, size;
|
||||
|
||||
Trace(TRACE_FLOW, "set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette);
|
||||
Trace(TRACE_FLOW, "set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette);
|
||||
size = pwc_decode_size(pdev, width, height);
|
||||
if (size < 0) {
|
||||
Debug("Could not find suitable size.\n");
|
||||
@ -473,7 +473,7 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
|
||||
}
|
||||
Debug("decode_size = %d.\n", size);
|
||||
|
||||
ret = -EINVAL;
|
||||
ret = -EINVAL;
|
||||
switch(pdev->type) {
|
||||
case 645:
|
||||
case 646:
|
||||
@ -800,7 +800,7 @@ static inline int pwc_get_awb(struct pwc_device *pdev)
|
||||
|
||||
static inline int pwc_set_red_gain(struct pwc_device *pdev, int value)
|
||||
{
|
||||
unsigned char buf;
|
||||
unsigned char buf;
|
||||
|
||||
if (value < 0)
|
||||
value = 0;
|
||||
@ -1237,7 +1237,7 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCSAWB:
|
||||
case VIDIOCPWCSAWB:
|
||||
{
|
||||
struct pwc_whitebalance *wb = arg;
|
||||
|
||||
@ -1270,9 +1270,9 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
|
||||
ret = pwc_read_red_gain(pdev, &wb->read_red);
|
||||
if (ret < 0)
|
||||
break;
|
||||
ret = pwc_read_blue_gain(pdev, &wb->read_blue);
|
||||
if (ret < 0)
|
||||
break;
|
||||
ret = pwc_read_blue_gain(pdev, &wb->read_blue);
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1304,7 +1304,7 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCSLED:
|
||||
case VIDIOCPWCSLED:
|
||||
{
|
||||
struct pwc_leds *leds = arg;
|
||||
ret = pwc_set_leds(pdev, leds->led_on, leds->led_off);
|
||||
@ -1381,61 +1381,61 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
|
||||
size->width = pdev->image.x;
|
||||
size->height = pdev->image.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
case VIDIOCPWCMPTRESET:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
int *flags = arg;
|
||||
case VIDIOCPWCMPTRESET:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
int *flags = arg;
|
||||
|
||||
ret = pwc_mpt_reset(pdev, *flags);
|
||||
if (ret >= 0)
|
||||
{
|
||||
pdev->pan_angle = 0;
|
||||
pdev->tilt_angle = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (ret >= 0)
|
||||
{
|
||||
pdev->pan_angle = 0;
|
||||
pdev->tilt_angle = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCMPTGRANGE:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_range *range = arg;
|
||||
*range = pdev->angle_range;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VIDIOCPWCMPTGRANGE:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_range *range = arg;
|
||||
*range = pdev->angle_range;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCMPTSANGLE:
|
||||
{
|
||||
int new_pan, new_tilt;
|
||||
case VIDIOCPWCMPTSANGLE:
|
||||
{
|
||||
int new_pan, new_tilt;
|
||||
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_angles *angles = arg;
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_angles *angles = arg;
|
||||
/* The camera can only set relative angles, so
|
||||
do some calculations when getting an absolute angle .
|
||||
*/
|
||||
if (angles->absolute)
|
||||
{
|
||||
new_pan = angles->pan;
|
||||
new_tilt = angles->tilt;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_pan = pdev->pan_angle + angles->pan;
|
||||
new_tilt = pdev->tilt_angle + angles->tilt;
|
||||
new_pan = angles->pan;
|
||||
new_tilt = angles->tilt;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_pan = pdev->pan_angle + angles->pan;
|
||||
new_tilt = pdev->tilt_angle + angles->tilt;
|
||||
}
|
||||
/* check absolute ranges */
|
||||
if (new_pan < pdev->angle_range.pan_min ||
|
||||
@ -1465,51 +1465,51 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
|
||||
if (ret == -EPIPE) /* stall -> out of range */
|
||||
ret = -ERANGE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCMPTGANGLE:
|
||||
{
|
||||
case VIDIOCPWCMPTGANGLE:
|
||||
{
|
||||
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_angles *angles = arg;
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_angles *angles = arg;
|
||||
|
||||
angles->absolute = 1;
|
||||
angles->pan = pdev->pan_angle;
|
||||
angles->tilt = pdev->tilt_angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
angles->absolute = 1;
|
||||
angles->pan = pdev->pan_angle;
|
||||
angles->tilt = pdev->tilt_angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCMPTSTATUS:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_status *status = arg;
|
||||
ret = pwc_mpt_get_status(pdev, status);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
case VIDIOCPWCMPTSTATUS:
|
||||
{
|
||||
if (pdev->features & FEATURE_MOTOR_PANTILT)
|
||||
{
|
||||
struct pwc_mpt_status *status = arg;
|
||||
ret = pwc_mpt_get_status(pdev, status);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -ENXIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VIDIOCPWCGVIDCMD:
|
||||
{
|
||||
struct pwc_video_command *cmd = arg;
|
||||
|
||||
cmd->type = pdev->type;
|
||||
cmd->type = pdev->type;
|
||||
cmd->release = pdev->release;
|
||||
cmd->command_len = pdev->cmd_len;
|
||||
memcpy(&cmd->command_buf, pdev->cmd_buf, pdev->cmd_len);
|
||||
|
@ -205,12 +205,12 @@ static struct video_device pwc_template = {
|
||||
*/
|
||||
static inline unsigned long kvirt_to_pa(unsigned long adr)
|
||||
{
|
||||
unsigned long kva, ret;
|
||||
unsigned long kva, ret;
|
||||
|
||||
kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
|
||||
kva |= adr & (PAGE_SIZE-1); /* restore the offset */
|
||||
ret = __pa(kva);
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void * rvmalloc(unsigned long size)
|
||||
@ -219,13 +219,13 @@ static void * rvmalloc(unsigned long size)
|
||||
unsigned long adr;
|
||||
|
||||
size=PAGE_ALIGN(size);
|
||||
mem=vmalloc_32(size);
|
||||
mem=vmalloc_32(size);
|
||||
if (mem)
|
||||
{
|
||||
memset(mem, 0, size); /* Clear the ram out, no junk to the user */
|
||||
adr=(unsigned long) mem;
|
||||
adr=(unsigned long) mem;
|
||||
while (size > 0)
|
||||
{
|
||||
{
|
||||
SetPageReserved(vmalloc_to_page((void *)adr));
|
||||
adr+=PAGE_SIZE;
|
||||
size-=PAGE_SIZE;
|
||||
@ -236,13 +236,13 @@ static void * rvmalloc(unsigned long size)
|
||||
|
||||
static void rvfree(void * mem, unsigned long size)
|
||||
{
|
||||
unsigned long adr;
|
||||
unsigned long adr;
|
||||
|
||||
if (mem)
|
||||
{
|
||||
adr=(unsigned long) mem;
|
||||
adr=(unsigned long) mem;
|
||||
while ((long) size > 0)
|
||||
{
|
||||
{
|
||||
ClearPageReserved(vmalloc_to_page((void *)adr));
|
||||
adr+=PAGE_SIZE;
|
||||
size-=PAGE_SIZE;
|
||||
@ -673,8 +673,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
|
||||
pdev->visoc_errors = 0;
|
||||
|
||||
/* vsync: 0 = don't copy data
|
||||
1 = sync-hunt
|
||||
2 = synched
|
||||
1 = sync-hunt
|
||||
2 = synched
|
||||
*/
|
||||
/* Compact data */
|
||||
for (i = 0; i < urb->number_of_packets; i++) {
|
||||
@ -737,9 +737,9 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
|
||||
after a short frame; this condition is filtered out specifically. A 4 byte
|
||||
frame doesn't make sense anyway.
|
||||
So we get either this sequence:
|
||||
drop_bit set -> 4 byte frame -> short frame -> good frame
|
||||
drop_bit set -> 4 byte frame -> short frame -> good frame
|
||||
Or this one:
|
||||
drop_bit set -> short frame -> good frame
|
||||
drop_bit set -> short frame -> good frame
|
||||
So we drop either 3 or 2 frames in all!
|
||||
*/
|
||||
if (fbuf->filled == 4)
|
||||
@ -881,12 +881,12 @@ static int pwc_isoc_init(struct pwc_device *pdev)
|
||||
|
||||
urb->interval = 1; // devik
|
||||
urb->dev = udev;
|
||||
urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);
|
||||
urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);
|
||||
urb->transfer_flags = URB_ISO_ASAP;
|
||||
urb->transfer_buffer = pdev->sbuf[i].data;
|
||||
urb->transfer_buffer_length = ISO_BUFFER_SIZE;
|
||||
urb->complete = pwc_isoc_handler;
|
||||
urb->context = pdev;
|
||||
urb->transfer_buffer = pdev->sbuf[i].data;
|
||||
urb->transfer_buffer_length = ISO_BUFFER_SIZE;
|
||||
urb->complete = pwc_isoc_handler;
|
||||
urb->context = pdev;
|
||||
urb->start_frame = 0;
|
||||
urb->number_of_packets = ISO_FRAMES_PER_DESC;
|
||||
for (j = 0; j < ISO_FRAMES_PER_DESC; j++) {
|
||||
@ -957,11 +957,11 @@ int pwc_try_video_mode(struct pwc_device *pdev, int width, int height, int new_f
|
||||
/* Try to set video mode... */
|
||||
start = ret = pwc_set_video_mode(pdev, width, height, new_fps, new_compression, new_snapshot);
|
||||
if (ret) {
|
||||
Trace(TRACE_FLOW, "pwc_set_video_mode attempt 1 failed.\n");
|
||||
Trace(TRACE_FLOW, "pwc_set_video_mode attempt 1 failed.\n");
|
||||
/* That failed... restore old mode (we know that worked) */
|
||||
start = pwc_set_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, pdev->vcompression, pdev->vsnapshot);
|
||||
if (start) {
|
||||
Trace(TRACE_FLOW, "pwc_set_video_mode attempt 2 failed.\n");
|
||||
Trace(TRACE_FLOW, "pwc_set_video_mode attempt 2 failed.\n");
|
||||
}
|
||||
}
|
||||
if (start == 0)
|
||||
@ -1155,13 +1155,13 @@ static int pwc_video_close(struct inode *inode, struct file *file)
|
||||
/*
|
||||
* FIXME: what about two parallel reads ????
|
||||
* ANSWER: Not supported. You can't open the device more than once,
|
||||
despite what the V4L1 interface says. First, I don't see
|
||||
the need, second there's no mechanism of alerting the
|
||||
2nd/3rd/... process of events like changing image size.
|
||||
And I don't see the point of blocking that for the
|
||||
2nd/3rd/... process.
|
||||
In multi-threaded environments reading parallel from any
|
||||
device is tricky anyhow.
|
||||
despite what the V4L1 interface says. First, I don't see
|
||||
the need, second there's no mechanism of alerting the
|
||||
2nd/3rd/... process of events like changing image size.
|
||||
And I don't see the point of blocking that for the
|
||||
2nd/3rd/... process.
|
||||
In multi-threaded environments reading parallel from any
|
||||
device is tricky anyhow.
|
||||
*/
|
||||
|
||||
static ssize_t pwc_video_read(struct file *file, char __user * buf,
|
||||
@ -1171,7 +1171,7 @@ static ssize_t pwc_video_read(struct file *file, char __user * buf,
|
||||
struct pwc_device *pdev;
|
||||
int noblock = file->f_flags & O_NONBLOCK;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
int bytes_to_read;
|
||||
int bytes_to_read;
|
||||
|
||||
Trace(TRACE_READ, "video_read(0x%p, %p, %zu) called.\n", vdev, buf, count);
|
||||
if (vdev == NULL)
|
||||
@ -1193,18 +1193,18 @@ static ssize_t pwc_video_read(struct file *file, char __user * buf,
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -pdev->error_status ;
|
||||
}
|
||||
if (noblock) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -EWOULDBLOCK;
|
||||
}
|
||||
if (signal_pending(current)) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
schedule();
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (noblock) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -EWOULDBLOCK;
|
||||
}
|
||||
if (signal_pending(current)) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
schedule();
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
}
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
@ -1218,7 +1218,7 @@ static ssize_t pwc_video_read(struct file *file, char __user * buf,
|
||||
if (pdev->vpalette == VIDEO_PALETTE_RAW)
|
||||
bytes_to_read = pdev->frame_size;
|
||||
else
|
||||
bytes_to_read = pdev->view.size;
|
||||
bytes_to_read = pdev->view.size;
|
||||
|
||||
/* copy bytes to user space; we allow for partial reads */
|
||||
if (count + pdev->image_read_pos > bytes_to_read)
|
||||
@ -1348,11 +1348,11 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
|
||||
struct video_picture *p = arg;
|
||||
/*
|
||||
* FIXME: Suppose we are mid read
|
||||
ANSWER: No problem: the firmware of the camera
|
||||
can handle brightness/contrast/etc
|
||||
changes at _any_ time, and the palette
|
||||
is used exactly once in the uncompress
|
||||
routine.
|
||||
ANSWER: No problem: the firmware of the camera
|
||||
can handle brightness/contrast/etc
|
||||
changes at _any_ time, and the palette
|
||||
is used exactly once in the uncompress
|
||||
routine.
|
||||
*/
|
||||
pwc_set_brightness(pdev, p->brightness);
|
||||
pwc_set_contrast(pdev, p->contrast);
|
||||
@ -1384,7 +1384,7 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
|
||||
vw->height = pdev->view.y;
|
||||
vw->chromakey = 0;
|
||||
vw->flags = (pdev->vframes << PWC_FPS_SHIFT) |
|
||||
(pdev->vsnapshot ? PWC_FPS_SNAPSHOT : 0);
|
||||
(pdev->vsnapshot ? PWC_FPS_SNAPSHOT : 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1515,7 +1515,7 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
|
||||
|
||||
FIXME: needs auditing for safety.
|
||||
QUESTION: In what respect? I think that using the
|
||||
frameq is safe now.
|
||||
frameq is safe now.
|
||||
*/
|
||||
add_wait_queue(&pdev->frameq, &wait);
|
||||
while (pdev->full_frames == NULL) {
|
||||
@ -1525,13 +1525,13 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
|
||||
return -pdev->error_status;
|
||||
}
|
||||
|
||||
if (signal_pending(current)) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
schedule();
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (signal_pending(current)) {
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
schedule();
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
}
|
||||
remove_wait_queue(&pdev->frameq, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
@ -1770,11 +1770,11 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
|
||||
name = "Logitech QuickCam (res.)";
|
||||
type_id = 730; /* Assuming CMOS */
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
return -ENODEV;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (vendor_id == 0x055d) {
|
||||
/* I don't know the difference between the C10 and the C30;
|
||||
I suppose the difference is the sensor, but both cameras
|
||||
@ -1880,9 +1880,9 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
|
||||
if (vendor_id == 0x046D && product_id == 0x08B5)
|
||||
{
|
||||
/* Logitech QuickCam Orbit
|
||||
The ranges have been determined experimentally; they may differ from cam to cam.
|
||||
Also, the exact ranges left-right and up-down are different for my cam
|
||||
*/
|
||||
The ranges have been determined experimentally; they may differ from cam to cam.
|
||||
Also, the exact ranges left-right and up-down are different for my cam
|
||||
*/
|
||||
pdev->angle_range.pan_min = -7000;
|
||||
pdev->angle_range.pan_max = 7000;
|
||||
pdev->angle_range.tilt_min = -3000;
|
||||
@ -2189,7 +2189,7 @@ static int __init usb_pwc_init(void)
|
||||
device_hint[i].type = 0; /* not filled */
|
||||
} /* ..for MAX_DEV_HINTS */
|
||||
|
||||
Trace(TRACE_PROBE, "Registering driver at address 0x%p.\n", &pwc_driver);
|
||||
Trace(TRACE_PROBE, "Registering driver at address 0x%p.\n", &pwc_driver);
|
||||
return usb_register(&pwc_driver);
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,10 @@
|
||||
/*
|
||||
Changes
|
||||
2001/08/03 Alvarado Added ioctl constants to access methods for
|
||||
changing white balance and red/blue gains
|
||||
changing white balance and red/blue gains
|
||||
2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE
|
||||
2003/12/13 Nemosft Unv. Some modifications to make interfacing to
|
||||
PWCX easier
|
||||
PWCX easier
|
||||
*/
|
||||
|
||||
/* These are private ioctl() commands, specific for the Philips webcams.
|
||||
@ -45,10 +45,10 @@
|
||||
|
||||
The #define names are built up like follows:
|
||||
VIDIOC VIDeo IOCtl prefix
|
||||
PWC Philps WebCam
|
||||
G optional: Get
|
||||
S optional: Set
|
||||
... the function
|
||||
PWC Philps WebCam
|
||||
G optional: Get
|
||||
S optional: Set
|
||||
... the function
|
||||
*/
|
||||
|
||||
|
||||
@ -185,8 +185,8 @@ struct pwc_video_command
|
||||
int type; /* camera type (645, 675, 730, etc.) */
|
||||
int release; /* release number */
|
||||
|
||||
int size; /* one of PSZ_* */
|
||||
int alternate;
|
||||
int size; /* one of PSZ_* */
|
||||
int alternate;
|
||||
int command_len; /* length of USB video command */
|
||||
unsigned char command_buf[13]; /* Actual USB video command */
|
||||
int bandlength; /* >0 = compressed */
|
||||
|
@ -48,270 +48,270 @@ const struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4] =
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
},
|
||||
/* QSIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
{1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
{2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
{1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}},
|
||||
{2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
|
||||
{2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
|
||||
{1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
|
||||
{3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}},
|
||||
{2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
|
||||
{2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
|
||||
{1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}},
|
||||
{3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}},
|
||||
{2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}},
|
||||
{1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
|
||||
{4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}},
|
||||
{3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}},
|
||||
{2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}},
|
||||
{1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}},
|
||||
{3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}},
|
||||
{2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}},
|
||||
{1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}},
|
||||
{5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}},
|
||||
{3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}},
|
||||
{2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}},
|
||||
{1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}},
|
||||
{5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}},
|
||||
{3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}},
|
||||
{2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}},
|
||||
{8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}},
|
||||
{5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}},
|
||||
{3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}},
|
||||
{2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}},
|
||||
},
|
||||
},
|
||||
/* QCIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
},
|
||||
/* SIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}},
|
||||
{3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}},
|
||||
{2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}},
|
||||
{1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}},
|
||||
{4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}},
|
||||
{3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}},
|
||||
{2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}},
|
||||
{1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}},
|
||||
{3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}},
|
||||
{2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}},
|
||||
{0, },
|
||||
{6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}},
|
||||
{3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}},
|
||||
{2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}},
|
||||
{4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}},
|
||||
{3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}},
|
||||
{0, },
|
||||
{9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}},
|
||||
{4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}},
|
||||
{3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}},
|
||||
{5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}},
|
||||
{3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}},
|
||||
{0, },
|
||||
{9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}},
|
||||
{5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}},
|
||||
{3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}},
|
||||
{6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}},
|
||||
{4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}},
|
||||
{0, },
|
||||
{9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}},
|
||||
{6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}},
|
||||
{4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}},
|
||||
{4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}},
|
||||
{0, },
|
||||
{9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}},
|
||||
{4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}},
|
||||
},
|
||||
},
|
||||
/* CIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
},
|
||||
/* VGA */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{0, },
|
||||
{6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}},
|
||||
{4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}},
|
||||
{3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}},
|
||||
{0, },
|
||||
{6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}},
|
||||
{4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}},
|
||||
{3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}},
|
||||
{6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}},
|
||||
{4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}},
|
||||
{0, },
|
||||
{9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}},
|
||||
{6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}},
|
||||
{4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}},
|
||||
{0, },
|
||||
{9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
|
||||
{8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -46,270 +46,270 @@ const struct Timon_table_entry Timon_table[PSZ_MAX][6][4] =
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
{1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
{2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
{3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
{4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
{5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
{7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
|
||||
},
|
||||
},
|
||||
/* QSIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
{1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}},
|
||||
{2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
{3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}},
|
||||
{2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}},
|
||||
{3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
|
||||
{4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}},
|
||||
{3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
{3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
|
||||
{5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
{3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}},
|
||||
{5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}},
|
||||
{3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}},
|
||||
{2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}},
|
||||
{5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}},
|
||||
{3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}},
|
||||
{2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
},
|
||||
},
|
||||
/* QCIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
{1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}},
|
||||
{2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}},
|
||||
{3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}},
|
||||
{2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}},
|
||||
{3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}},
|
||||
{4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}},
|
||||
{3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}},
|
||||
{4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}},
|
||||
{3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
{6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}},
|
||||
{4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}},
|
||||
{3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}},
|
||||
{5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
{3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
{9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}},
|
||||
{5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
{3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
|
||||
{2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}},
|
||||
{2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}},
|
||||
{0, },
|
||||
{9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}},
|
||||
{2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}},
|
||||
},
|
||||
},
|
||||
/* SIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}},
|
||||
{3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}},
|
||||
{2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}},
|
||||
{1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}},
|
||||
{4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}},
|
||||
{3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}},
|
||||
{2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}},
|
||||
{1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}},
|
||||
{3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}},
|
||||
{2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}},
|
||||
{0, },
|
||||
{6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}},
|
||||
{3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}},
|
||||
{2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}},
|
||||
{4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}},
|
||||
{3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}},
|
||||
{0, },
|
||||
{9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}},
|
||||
{4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}},
|
||||
{3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}},
|
||||
{5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}},
|
||||
{3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}},
|
||||
{0, },
|
||||
{9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}},
|
||||
{5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}},
|
||||
{3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}},
|
||||
{6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}},
|
||||
{4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}},
|
||||
{0, },
|
||||
{9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}},
|
||||
{6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}},
|
||||
{4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}},
|
||||
{6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}},
|
||||
{4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}},
|
||||
{0, },
|
||||
{9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}},
|
||||
{6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}},
|
||||
{4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}},
|
||||
},
|
||||
},
|
||||
/* CIF */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}},
|
||||
{4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}},
|
||||
{2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}},
|
||||
{1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}},
|
||||
{6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}},
|
||||
{4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}},
|
||||
{2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}},
|
||||
{1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}},
|
||||
{4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}},
|
||||
{2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}},
|
||||
{0, },
|
||||
{9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}},
|
||||
{4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}},
|
||||
{2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}},
|
||||
{5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}},
|
||||
{3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}},
|
||||
{0, },
|
||||
{9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}},
|
||||
{5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}},
|
||||
{3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}},
|
||||
{6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}},
|
||||
{4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}},
|
||||
{0, },
|
||||
{9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}},
|
||||
{6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}},
|
||||
{4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}},
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}},
|
||||
{7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}},
|
||||
{5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
{0, },
|
||||
{9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}},
|
||||
{7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}},
|
||||
{5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}},
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}},
|
||||
{6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}},
|
||||
{0, },
|
||||
{9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}},
|
||||
{6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}},
|
||||
},
|
||||
},
|
||||
/* VGA */
|
||||
{
|
||||
/* 5 fps */
|
||||
{
|
||||
{0, },
|
||||
{6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}},
|
||||
{4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}},
|
||||
{3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}},
|
||||
{0, },
|
||||
{6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}},
|
||||
{4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}},
|
||||
{3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}},
|
||||
},
|
||||
/* 10 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}},
|
||||
{4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}},
|
||||
{0, },
|
||||
{9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}},
|
||||
{6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}},
|
||||
{4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}},
|
||||
},
|
||||
/* 15 fps */
|
||||
{
|
||||
{0, },
|
||||
{9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
|
||||
{9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
|
||||
{8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}},
|
||||
{0, },
|
||||
{9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
|
||||
{9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
|
||||
{8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}},
|
||||
},
|
||||
/* 20 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 25 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
/* 30 fps */
|
||||
{
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
{0, },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -110,8 +110,8 @@ int pwc_decompress(struct pwc_device *pdev)
|
||||
*/
|
||||
int flags;
|
||||
|
||||
flags = PWCX_FLAG_PLANAR;
|
||||
if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot)
|
||||
flags = PWCX_FLAG_PLANAR;
|
||||
if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot)
|
||||
{
|
||||
printk(KERN_ERR "pwc: Mode Bayer is not supported for now\n");
|
||||
flags |= PWCX_FLAG_BAYER;
|
||||
|
@ -150,8 +150,8 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
|
||||
client=kmalloc(sizeof(*client), GFP_KERNEL);
|
||||
if(client==NULL)
|
||||
return -ENOMEM;
|
||||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
memcpy(client, &client_template, sizeof(*client));
|
||||
t = kzalloc(sizeof(*t), GFP_KERNEL);
|
||||
if(t==NULL)
|
||||
|
@ -139,7 +139,7 @@ saa7110_read (struct i2c_client *client)
|
||||
|
||||
static int
|
||||
saa7110_selmux (struct i2c_client *client,
|
||||
int chan)
|
||||
int chan)
|
||||
{
|
||||
static const unsigned char modes[9][8] = {
|
||||
/* mode 0 */
|
||||
|
@ -70,7 +70,7 @@ struct saa7146
|
||||
int irqstate; /* irq routine is state driven */
|
||||
int writemode;
|
||||
int playmode;
|
||||
unsigned int nr;
|
||||
unsigned int nr;
|
||||
unsigned long irq; /* IRQ used by SAA7146 card */
|
||||
unsigned short id;
|
||||
unsigned char revision;
|
||||
|
@ -114,16 +114,16 @@ static int se401_sndctrl(int set, struct usb_se401 *se401, unsigned short req,
|
||||
unsigned short value, unsigned char *cp, int size)
|
||||
{
|
||||
return usb_control_msg (
|
||||
se401->dev,
|
||||
set ? usb_sndctrlpipe(se401->dev, 0) : usb_rcvctrlpipe(se401->dev, 0),
|
||||
req,
|
||||
(set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
value,
|
||||
0,
|
||||
cp,
|
||||
size,
|
||||
1000
|
||||
);
|
||||
se401->dev,
|
||||
set ? usb_sndctrlpipe(se401->dev, 0) : usb_rcvctrlpipe(se401->dev, 0),
|
||||
req,
|
||||
(set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
value,
|
||||
0,
|
||||
cp,
|
||||
size,
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
static int se401_set_feature(struct usb_se401 *se401, unsigned short selector,
|
||||
@ -140,30 +140,30 @@ static int se401_set_feature(struct usb_se401 *se401, unsigned short selector,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
param,
|
||||
selector,
|
||||
NULL,
|
||||
0,
|
||||
1000
|
||||
);
|
||||
NULL,
|
||||
0,
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
static unsigned short se401_get_feature(struct usb_se401 *se401,
|
||||
unsigned short selector)
|
||||
unsigned short selector)
|
||||
{
|
||||
/* For 'set' the selecetor should be in index, not sure if the spec is
|
||||
wrong here to....
|
||||
*/
|
||||
unsigned char cp[2];
|
||||
usb_control_msg (
|
||||
se401->dev,
|
||||
usb_rcvctrlpipe(se401->dev, 0),
|
||||
SE401_REQ_GET_EXT_FEATURE,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0,
|
||||
selector,
|
||||
cp,
|
||||
2,
|
||||
1000
|
||||
);
|
||||
usb_control_msg (
|
||||
se401->dev,
|
||||
usb_rcvctrlpipe(se401->dev, 0),
|
||||
SE401_REQ_GET_EXT_FEATURE,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0,
|
||||
selector,
|
||||
cp,
|
||||
2,
|
||||
1000
|
||||
);
|
||||
return cp[0]+cp[1]*256;
|
||||
}
|
||||
|
||||
@ -433,8 +433,8 @@ static int se401_start_stream(struct usb_se401 *se401)
|
||||
int err=0, i;
|
||||
se401->streaming=1;
|
||||
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
|
||||
/* Set picture settings */
|
||||
se401_set_feature(se401, HV7131_REG_MODE_B, 0x05);/*windowed + pix intg */
|
||||
@ -866,7 +866,7 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401)
|
||||
{
|
||||
int i;
|
||||
|
||||
se401->dev = NULL;
|
||||
se401->dev = NULL;
|
||||
|
||||
for (i=0; i<SE401_NUMSBUF; i++)
|
||||
if (se401->urb[i]) {
|
||||
@ -882,9 +882,9 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401)
|
||||
usb_kill_urb(se401->inturb);
|
||||
usb_free_urb(se401->inturb);
|
||||
}
|
||||
info("%s disconnected", se401->camera_name);
|
||||
info("%s disconnected", se401->camera_name);
|
||||
|
||||
/* Free the memory */
|
||||
/* Free the memory */
|
||||
kfree(se401->width);
|
||||
kfree(se401->height);
|
||||
kfree(se401);
|
||||
@ -920,11 +920,11 @@ static int se401_open(struct inode *inode, struct file *file)
|
||||
static int se401_close(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct video_device *dev = file->private_data;
|
||||
struct usb_se401 *se401 = (struct usb_se401 *)dev;
|
||||
struct usb_se401 *se401 = (struct usb_se401 *)dev;
|
||||
int i;
|
||||
|
||||
rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES);
|
||||
if (se401->removed) {
|
||||
if (se401->removed) {
|
||||
usb_se401_remove_disconnected(se401);
|
||||
info("device unregistered");
|
||||
} else {
|
||||
@ -942,12 +942,12 @@ static int se401_do_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, void *arg)
|
||||
{
|
||||
struct video_device *vdev = file->private_data;
|
||||
struct usb_se401 *se401 = (struct usb_se401 *)vdev;
|
||||
struct usb_se401 *se401 = (struct usb_se401 *)vdev;
|
||||
|
||||
if (!se401->dev)
|
||||
return -EIO;
|
||||
if (!se401->dev)
|
||||
return -EIO;
|
||||
|
||||
switch (cmd) {
|
||||
switch (cmd) {
|
||||
case VIDIOCGCAP:
|
||||
{
|
||||
struct video_capability *b = arg;
|
||||
@ -981,8 +981,8 @@ static int se401_do_ioctl(struct inode *inode, struct file *file,
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
case VIDIOCGPICT:
|
||||
{
|
||||
case VIDIOCGPICT:
|
||||
{
|
||||
struct video_picture *p = arg;
|
||||
|
||||
se401_get_pict(se401, p);
|
||||
@ -1007,7 +1007,7 @@ static int se401_do_ioctl(struct inode *inode, struct file *file,
|
||||
if (se401_set_size(se401, vw->width, vw->height))
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
case VIDIOCGWIN:
|
||||
{
|
||||
struct video_window *vw = arg;
|
||||
@ -1095,11 +1095,11 @@ static int se401_do_ioctl(struct inode *inode, struct file *file,
|
||||
case VIDIOCGAUDIO:
|
||||
case VIDIOCSAUDIO:
|
||||
return -EINVAL;
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
} /* end switch */
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
} /* end switch */
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int se401_ioctl(struct inode *inode, struct file *file,
|
||||
@ -1183,24 +1183,24 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
}
|
||||
mutex_unlock(&se401->lock);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations se401_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = se401_open,
|
||||
.release = se401_close,
|
||||
.read = se401_read,
|
||||
.mmap = se401_mmap,
|
||||
.open = se401_open,
|
||||
.release = se401_close,
|
||||
.read = se401_read,
|
||||
.mmap = se401_mmap,
|
||||
.ioctl = se401_ioctl,
|
||||
.compat_ioctl = v4l_compat_ioctl32,
|
||||
.llseek = no_llseek,
|
||||
};
|
||||
static struct video_device se401_template = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "se401 USB camera",
|
||||
.type = VID_TYPE_CAPTURE,
|
||||
.hardware = VID_HARDWARE_SE401,
|
||||
.name = "se401 USB camera",
|
||||
.type = VID_TYPE_CAPTURE,
|
||||
.hardware = VID_HARDWARE_SE401,
|
||||
.fops = &se401_fops,
|
||||
};
|
||||
|
||||
@ -1209,12 +1209,12 @@ static struct video_device se401_template = {
|
||||
/***************************/
|
||||
static int se401_init(struct usb_se401 *se401, int button)
|
||||
{
|
||||
int i=0, rc;
|
||||
unsigned char cp[0x40];
|
||||
int i=0, rc;
|
||||
unsigned char cp[0x40];
|
||||
char temp[200];
|
||||
|
||||
/* led on */
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
|
||||
/* get camera descriptor */
|
||||
rc=se401_sndctrl(0, se401, SE401_REQ_GET_CAMERA_DESCRIPTOR, 0, cp, sizeof(cp));
|
||||
@ -1254,7 +1254,7 @@ static int se401_init(struct usb_se401 *se401, int button)
|
||||
return 1;
|
||||
}
|
||||
/* set output mode (BAYER) */
|
||||
se401_sndctrl(1, se401, SE401_REQ_SET_OUTPUT_MODE, SE401_FORMAT_BAYER, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_SET_OUTPUT_MODE, SE401_FORMAT_BAYER, NULL, 0);
|
||||
|
||||
rc=se401_sndctrl(0, se401, SE401_REQ_GET_BRT, 0, cp, sizeof(cp));
|
||||
se401->brightness=cp[0]+cp[1]*256;
|
||||
@ -1292,71 +1292,71 @@ static int se401_init(struct usb_se401 *se401, int button)
|
||||
} else
|
||||
se401->inturb=NULL;
|
||||
|
||||
/* Flash the led */
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 0, NULL, 0);
|
||||
/* Flash the led */
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 0, NULL, 0);
|
||||
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 0, NULL, 0);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int se401_probe(struct usb_interface *intf,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
struct usb_device *dev = interface_to_usbdev(intf);
|
||||
struct usb_interface_descriptor *interface;
|
||||
struct usb_se401 *se401;
|
||||
char *camera_name=NULL;
|
||||
struct usb_interface_descriptor *interface;
|
||||
struct usb_se401 *se401;
|
||||
char *camera_name=NULL;
|
||||
int button=1;
|
||||
|
||||
/* We don't handle multi-config cameras */
|
||||
if (dev->descriptor.bNumConfigurations != 1)
|
||||
return -ENODEV;
|
||||
/* We don't handle multi-config cameras */
|
||||
if (dev->descriptor.bNumConfigurations != 1)
|
||||
return -ENODEV;
|
||||
|
||||
interface = &intf->cur_altsetting->desc;
|
||||
interface = &intf->cur_altsetting->desc;
|
||||
|
||||
/* Is it an se401? */
|
||||
if (le16_to_cpu(dev->descriptor.idVendor) == 0x03e8 &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x0004) {
|
||||
camera_name="Endpoints/Aox SE401";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x0471 &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x030b) {
|
||||
camera_name="Philips PCVC665K";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
/* Is it an se401? */
|
||||
if (le16_to_cpu(dev->descriptor.idVendor) == 0x03e8 &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x0004) {
|
||||
camera_name="Endpoints/Aox SE401";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x0471 &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x030b) {
|
||||
camera_name="Philips PCVC665K";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x5001) {
|
||||
camera_name="Kensington VideoCAM 67014";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x5002) {
|
||||
camera_name="Kensington VideoCAM 6701(5/7)";
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
} else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
|
||||
le16_to_cpu(dev->descriptor.idProduct) == 0x5003) {
|
||||
camera_name="Kensington VideoCAM 67016";
|
||||
button=0;
|
||||
} else
|
||||
return -ENODEV;
|
||||
|
||||
/* Checking vendor/product should be enough, but what the hell */
|
||||
if (interface->bInterfaceClass != 0x00)
|
||||
/* Checking vendor/product should be enough, but what the hell */
|
||||
if (interface->bInterfaceClass != 0x00)
|
||||
return -ENODEV;
|
||||
if (interface->bInterfaceSubClass != 0x00)
|
||||
if (interface->bInterfaceSubClass != 0x00)
|
||||
return -ENODEV;
|
||||
|
||||
/* We found one */
|
||||
info("SE401 camera found: %s", camera_name);
|
||||
/* We found one */
|
||||
info("SE401 camera found: %s", camera_name);
|
||||
|
||||
if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) {
|
||||
err("couldn't kmalloc se401 struct");
|
||||
if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) {
|
||||
err("couldn't kmalloc se401 struct");
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
se401->dev = dev;
|
||||
se401->iface = interface->bInterfaceNumber;
|
||||
se401->camera_name = camera_name;
|
||||
se401->dev = dev;
|
||||
se401->iface = interface->bInterfaceNumber;
|
||||
se401->camera_name = camera_name;
|
||||
|
||||
info("firmware version: %02x", le16_to_cpu(dev->descriptor.bcdDevice) & 255);
|
||||
|
||||
if (se401_init(se401, button)) {
|
||||
if (se401_init(se401, button)) {
|
||||
kfree(se401);
|
||||
return -EIO;
|
||||
}
|
||||
@ -1375,7 +1375,7 @@ static int se401_probe(struct usb_interface *intf,
|
||||
info("registered new video device: video%d", se401->vdev.minor);
|
||||
|
||||
usb_set_intfdata (intf, se401);
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void se401_disconnect(struct usb_interface *intf)
|
||||
@ -1400,10 +1400,10 @@ static void se401_disconnect(struct usb_interface *intf)
|
||||
}
|
||||
|
||||
static struct usb_driver se401_driver = {
|
||||
.name = "se401",
|
||||
.id_table = device_table,
|
||||
.name = "se401",
|
||||
.id_table = device_table,
|
||||
.probe = se401_probe,
|
||||
.disconnect = se401_disconnect,
|
||||
.disconnect = se401_disconnect,
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
sn9c102-objs := sn9c102_core.o sn9c102_hv7131d.o sn9c102_mi0343.o \
|
||||
sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \
|
||||
sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \
|
||||
sn9c102_tas5130d1b.o
|
||||
sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \
|
||||
sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \
|
||||
sn9c102_tas5130d1b.o
|
||||
|
||||
obj-$(CONFIG_USB_SN9C102) += sn9c102.o
|
||||
|
||||
|
@ -164,7 +164,7 @@ sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id)
|
||||
|
||||
void
|
||||
sn9c102_attach_sensor(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor)
|
||||
struct sn9c102_sensor* sensor)
|
||||
{
|
||||
memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor));
|
||||
}
|
||||
@ -183,7 +183,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 V4LDBG(level, name, cmd) \
|
||||
@ -198,7 +198,7 @@ do { \
|
||||
pr_info("sn9c102: " fmt "\n", ## args); \
|
||||
else if ((level) == 3) \
|
||||
pr_debug("sn9c102: [%s:%d] " fmt "\n", __FUNCTION__, \
|
||||
__LINE__ , ## args); \
|
||||
__LINE__ , ## args); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
@ -210,7 +210,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 */
|
||||
|
@ -62,53 +62,53 @@ MODULE_LICENSE(SN9C102_MODULE_LICENSE);
|
||||
static short video_nr[] = {[0 ... SN9C102_MAX_DEVICES-1] = -1};
|
||||
module_param_array(video_nr, short, NULL, 0444);
|
||||
MODULE_PARM_DESC(video_nr,
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES)
|
||||
" cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES)
|
||||
" cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
|
||||
static short force_munmap[] = {[0 ... SN9C102_MAX_DEVICES-1] =
|
||||
SN9C102_FORCE_MUNMAP};
|
||||
SN9C102_FORCE_MUNMAP};
|
||||
module_param_array(force_munmap, bool, NULL, 0444);
|
||||
MODULE_PARM_DESC(force_munmap,
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
|
||||
static unsigned int frame_timeout[] = {[0 ... SN9C102_MAX_DEVICES-1] =
|
||||
SN9C102_FRAME_TIMEOUT};
|
||||
SN9C102_FRAME_TIMEOUT};
|
||||
module_param_array(frame_timeout, uint, NULL, 0644);
|
||||
MODULE_PARM_DESC(frame_timeout,
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
|
||||
#ifdef SN9C102_DEBUG
|
||||
static unsigned short debug = SN9C102_DEBUG_LEVEL;
|
||||
module_param(debug, ushort, 0644);
|
||||
MODULE_PARM_DESC(debug,
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -133,14 +133,14 @@ static sn9c102_eof_header_t sn9c102_eof_header[] = {
|
||||
|
||||
static u32
|
||||
sn9c102_request_buffers(struct sn9c102_device* cam, u32 count,
|
||||
enum sn9c102_io_method io)
|
||||
enum sn9c102_io_method io)
|
||||
{
|
||||
struct v4l2_pix_format* p = &(cam->sensor.pix_format);
|
||||
struct v4l2_rect* r = &(cam->sensor.cropcap.bounds);
|
||||
const size_t imagesize = cam->module_param.force_munmap ||
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
void* buff = NULL;
|
||||
u32 i;
|
||||
|
||||
@ -232,8 +232,8 @@ int sn9c102_write_regs(struct sn9c102_device* cam, u8* buff, u16 index)
|
||||
return -1;
|
||||
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41,
|
||||
index, 0, buff, sizeof(buff),
|
||||
SN9C102_CTRL_TIMEOUT*sizeof(buff));
|
||||
index, 0, buff, sizeof(buff),
|
||||
SN9C102_CTRL_TIMEOUT*sizeof(buff));
|
||||
if (res < 0) {
|
||||
DBG(3, "Failed to write registers (index 0x%02X, error %d)",
|
||||
index, res);
|
||||
@ -259,7 +259,7 @@ int sn9c102_write_reg(struct sn9c102_device* cam, u8 value, u16 index)
|
||||
*buff = value;
|
||||
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41,
|
||||
index, 0, buff, 1, SN9C102_CTRL_TIMEOUT);
|
||||
index, 0, buff, 1, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0) {
|
||||
DBG(3, "Failed to write a register (value 0x%02X, index "
|
||||
"0x%02X, error %d)", value, index, res);
|
||||
@ -280,7 +280,7 @@ static int sn9c102_read_reg(struct sn9c102_device* cam, u16 index)
|
||||
int res;
|
||||
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
|
||||
index, 0, buff, 1, SN9C102_CTRL_TIMEOUT);
|
||||
index, 0, buff, 1, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
DBG(3, "Failed to read a register (index 0x%02X, error %d)",
|
||||
index, res);
|
||||
@ -320,7 +320,7 @@ sn9c102_i2c_wait(struct sn9c102_device* cam, struct sn9c102_sensor* sensor)
|
||||
|
||||
static int
|
||||
sn9c102_i2c_detect_read_error(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor)
|
||||
struct sn9c102_sensor* sensor)
|
||||
{
|
||||
int r;
|
||||
r = sn9c102_read_reg(cam, 0x08);
|
||||
@ -330,7 +330,7 @@ sn9c102_i2c_detect_read_error(struct sn9c102_device* cam,
|
||||
|
||||
static int
|
||||
sn9c102_i2c_detect_write_error(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor)
|
||||
struct sn9c102_sensor* sensor)
|
||||
{
|
||||
int r;
|
||||
r = sn9c102_read_reg(cam, 0x08);
|
||||
@ -340,8 +340,8 @@ sn9c102_i2c_detect_write_error(struct sn9c102_device* cam,
|
||||
|
||||
int
|
||||
sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 data0, u8 data1,
|
||||
u8 n, u8 buffer[])
|
||||
struct sn9c102_sensor* sensor, u8 data0, u8 data1,
|
||||
u8 n, u8 buffer[])
|
||||
{
|
||||
struct usb_device* udev = cam->usbdev;
|
||||
u8* data = cam->control_buffer;
|
||||
@ -349,12 +349,12 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
|
||||
/* Write cycle */
|
||||
data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) |
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10;
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10;
|
||||
data[1] = data0; /* I2C slave id */
|
||||
data[2] = data1; /* address */
|
||||
data[7] = 0x10;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41,
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -362,12 +362,12 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
|
||||
/* Read cycle - n bytes */
|
||||
data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) |
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) |
|
||||
(n << 4) | 0x02;
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) |
|
||||
(n << 4) | 0x02;
|
||||
data[1] = data0;
|
||||
data[7] = 0x10;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41,
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -375,7 +375,7 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
|
||||
/* The first read byte will be placed in data[4] */
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1,
|
||||
0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT);
|
||||
0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -398,8 +398,8 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
|
||||
int
|
||||
sn9c102_i2c_try_raw_write(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 n, u8 data0,
|
||||
u8 data1, u8 data2, u8 data3, u8 data4, u8 data5)
|
||||
struct sn9c102_sensor* sensor, u8 n, u8 data0,
|
||||
u8 data1, u8 data2, u8 data3, u8 data4, u8 data5)
|
||||
{
|
||||
struct usb_device* udev = cam->usbdev;
|
||||
u8* data = cam->control_buffer;
|
||||
@ -407,8 +407,8 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam,
|
||||
|
||||
/* Write cycle. It usually is address + value */
|
||||
data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) |
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0)
|
||||
| ((n - 1) << 4);
|
||||
((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0)
|
||||
| ((n - 1) << 4);
|
||||
data[1] = data0;
|
||||
data[2] = data1;
|
||||
data[3] = data2;
|
||||
@ -417,7 +417,7 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam,
|
||||
data[6] = data5;
|
||||
data[7] = 0x14;
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41,
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
err += res;
|
||||
|
||||
@ -437,20 +437,20 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam,
|
||||
|
||||
int
|
||||
sn9c102_i2c_try_read(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 address)
|
||||
struct sn9c102_sensor* sensor, u8 address)
|
||||
{
|
||||
return sn9c102_i2c_try_raw_read(cam, sensor, sensor->i2c_slave_id,
|
||||
address, 1, NULL);
|
||||
address, 1, NULL);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
sn9c102_i2c_try_write(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 address, u8 value)
|
||||
struct sn9c102_sensor* sensor, u8 address, u8 value)
|
||||
{
|
||||
return sn9c102_i2c_try_raw_write(cam, sensor, 3,
|
||||
sensor->i2c_slave_id, address,
|
||||
value, 0, 0, 0);
|
||||
sensor->i2c_slave_id, address,
|
||||
value, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -484,7 +484,7 @@ sn9c102_find_sof_header(struct sn9c102_device* cam, void* mem, size_t len)
|
||||
n = sizeof(sn9c103_sof_header) / soflen;
|
||||
}
|
||||
|
||||
for (i = 0; (len >= soflen) && (i <= len - soflen); i++)
|
||||
for (i = 0; (len >= soflen) && (i <= len - soflen); i++)
|
||||
for (j = 0; j < n; j++)
|
||||
/* The invariable part of the header is 6 bytes long */
|
||||
if ((cam->bridge != BRIDGE_SN9C103 &&
|
||||
@ -552,15 +552,15 @@ static void sn9c102_urb_complete(struct urb *urb, struct pt_regs* regs)
|
||||
|
||||
if (!(*f))
|
||||
(*f) = list_entry(cam->inqueue.next, struct sn9c102_frame_t,
|
||||
frame);
|
||||
frame);
|
||||
|
||||
imagesize = (cam->sensor.pix_format.width *
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
|
||||
soflen = (cam->bridge) == BRIDGE_SN9C103 ?
|
||||
sizeof(sn9c103_sof_header_t) :
|
||||
sizeof(sn9c102_sof_header_t);
|
||||
sizeof(sn9c103_sof_header_t) :
|
||||
sizeof(sn9c102_sof_header_t);
|
||||
|
||||
for (i = 0; i < urb->number_of_packets; i++) {
|
||||
unsigned int img, len, status;
|
||||
@ -611,19 +611,19 @@ end_of_frame:
|
||||
|
||||
if ((*f)->buf.bytesused == imagesize ||
|
||||
(cam->sensor.pix_format.pixelformat ==
|
||||
V4L2_PIX_FMT_SN9C10X && eof)) {
|
||||
V4L2_PIX_FMT_SN9C10X && eof)) {
|
||||
u32 b;
|
||||
b = (*f)->buf.bytesused;
|
||||
(*f)->state = F_DONE;
|
||||
(*f)->buf.sequence= ++cam->frame_count;
|
||||
spin_lock(&cam->queue_lock);
|
||||
list_move_tail(&(*f)->frame,
|
||||
&cam->outqueue);
|
||||
&cam->outqueue);
|
||||
if (!list_empty(&cam->inqueue))
|
||||
(*f) = list_entry(
|
||||
cam->inqueue.next,
|
||||
struct sn9c102_frame_t,
|
||||
frame );
|
||||
cam->inqueue.next,
|
||||
struct sn9c102_frame_t,
|
||||
frame );
|
||||
else
|
||||
(*f) = NULL;
|
||||
spin_unlock(&cam->queue_lock);
|
||||
@ -702,18 +702,18 @@ static int sn9c102_start_transfer(struct sn9c102_device* cam)
|
||||
struct usb_device *udev = cam->usbdev;
|
||||
struct urb* urb;
|
||||
const unsigned int sn9c102_wMaxPacketSize[] = {0, 128, 256, 384, 512,
|
||||
680, 800, 900, 1023};
|
||||
680, 800, 900, 1023};
|
||||
const unsigned int sn9c103_wMaxPacketSize[] = {0, 128, 256, 384, 512,
|
||||
680, 800, 900, 1003};
|
||||
680, 800, 900, 1003};
|
||||
const unsigned int psz = (cam->bridge == BRIDGE_SN9C103) ?
|
||||
sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] :
|
||||
sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING];
|
||||
sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] :
|
||||
sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING];
|
||||
s8 i, j;
|
||||
int err = 0;
|
||||
|
||||
for (i = 0; i < SN9C102_URBS; i++) {
|
||||
cam->transfer_buffer[i] = kzalloc(SN9C102_ISO_PACKETS * psz,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL);
|
||||
if (!cam->transfer_buffer[i]) {
|
||||
err = -ENOMEM;
|
||||
DBG(1, "Not enough memory");
|
||||
@ -815,9 +815,9 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam)
|
||||
|
||||
cam->stream = STREAM_INTERRUPT;
|
||||
timeout = wait_event_timeout(cam->wait_stream,
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
SN9C102_URB_TIMEOUT);
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
SN9C102_URB_TIMEOUT);
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
return -ENODEV;
|
||||
else if (cam->stream != STREAM_OFF) {
|
||||
@ -861,7 +861,7 @@ static u8 sn9c102_strtou8(const char* buff, size_t len, ssize_t* count)
|
||||
|
||||
/*
|
||||
NOTE 1: being inside one of the following methods implies that the v4l
|
||||
device exists for sure (see kobjects and reference counters)
|
||||
device exists for sure (see kobjects and reference counters)
|
||||
NOTE 2: buffers are PAGE_SIZE long
|
||||
*/
|
||||
|
||||
@ -1226,18 +1226,18 @@ static ssize_t sn9c102_show_frame_header(struct class_device* cd, char* buf)
|
||||
|
||||
|
||||
static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR,
|
||||
sn9c102_show_reg, sn9c102_store_reg);
|
||||
sn9c102_show_reg, sn9c102_store_reg);
|
||||
static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR,
|
||||
sn9c102_show_val, sn9c102_store_val);
|
||||
sn9c102_show_val, sn9c102_store_val);
|
||||
static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR,
|
||||
sn9c102_show_i2c_reg, sn9c102_store_i2c_reg);
|
||||
sn9c102_show_i2c_reg, sn9c102_store_i2c_reg);
|
||||
static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
|
||||
sn9c102_show_i2c_val, sn9c102_store_i2c_val);
|
||||
sn9c102_show_i2c_val, sn9c102_store_i2c_val);
|
||||
static CLASS_DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green);
|
||||
static CLASS_DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue);
|
||||
static CLASS_DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red);
|
||||
static CLASS_DEVICE_ATTR(frame_header, S_IRUGO,
|
||||
sn9c102_show_frame_header, NULL);
|
||||
sn9c102_show_frame_header, NULL);
|
||||
|
||||
|
||||
static void sn9c102_create_sysfs(struct sn9c102_device* cam)
|
||||
@ -1278,7 +1278,7 @@ sn9c102_set_pix_format(struct sn9c102_device* cam, struct v4l2_pix_format* pix)
|
||||
|
||||
static int
|
||||
sn9c102_set_compression(struct sn9c102_device* cam,
|
||||
struct v4l2_jpegcompression* compression)
|
||||
struct v4l2_jpegcompression* compression)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -1469,8 +1469,8 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
|
||||
}
|
||||
mutex_unlock(&cam->dev_mutex);
|
||||
err = wait_event_interruptible_exclusive(cam->open,
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
if (err) {
|
||||
up_read(&sn9c102_disconnect);
|
||||
return err;
|
||||
@ -1600,12 +1600,12 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
|
||||
return -EAGAIN;
|
||||
}
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0) {
|
||||
mutex_unlock(&cam->fileop_mutex);
|
||||
return timeout;
|
||||
@ -1672,7 +1672,7 @@ static unsigned int sn9c102_poll(struct file *filp, poll_table *wait)
|
||||
|
||||
if (cam->io == IO_NONE) {
|
||||
if (!sn9c102_request_buffers(cam, cam->nreadbuffers,
|
||||
IO_READ)) {
|
||||
IO_READ)) {
|
||||
DBG(1, "poll() failed, not enough memory");
|
||||
goto error;
|
||||
}
|
||||
@ -1729,7 +1729,7 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma)
|
||||
{
|
||||
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
unsigned long size = vma->vm_end - vma->vm_start,
|
||||
start = vma->vm_start;
|
||||
start = vma->vm_start;
|
||||
void *pos;
|
||||
u32 i;
|
||||
|
||||
@ -1797,13 +1797,13 @@ sn9c102_vidioc_querycap(struct sn9c102_device* cam, void __user * arg)
|
||||
.driver = "sn9c102",
|
||||
.version = SN9C102_MODULE_VERSION_CODE,
|
||||
.capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
|
||||
V4L2_CAP_STREAMING,
|
||||
V4L2_CAP_STREAMING,
|
||||
};
|
||||
|
||||
strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card));
|
||||
if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0)
|
||||
strlcpy(cap.bus_info, cam->usbdev->dev.bus_id,
|
||||
sizeof(cap.bus_info));
|
||||
sizeof(cap.bus_info));
|
||||
|
||||
if (copy_to_user(arg, &cap, sizeof(cap)))
|
||||
return -EFAULT;
|
||||
@ -2138,7 +2138,7 @@ sn9c102_vidioc_g_fmt(struct sn9c102_device* cam, void __user * arg)
|
||||
return -EINVAL;
|
||||
|
||||
pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_SN9C10X)
|
||||
? 0 : (pfmt->width * pfmt->priv) / 8;
|
||||
? 0 : (pfmt->width * pfmt->priv) / 8;
|
||||
pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8);
|
||||
pfmt->field = V4L2_FIELD_NONE;
|
||||
memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt));
|
||||
@ -2152,7 +2152,7 @@ sn9c102_vidioc_g_fmt(struct sn9c102_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct sn9c102_sensor* s = &cam->sensor;
|
||||
struct v4l2_format format;
|
||||
@ -2214,7 +2214,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
|
||||
pix->priv = pfmt->priv; /* bpp */
|
||||
pix->colorspace = pfmt->colorspace;
|
||||
pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_SN9C10X)
|
||||
? 0 : (pix->width * pix->priv) / 8;
|
||||
? 0 : (pix->width * pix->priv) / 8;
|
||||
pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8);
|
||||
pix->field = V4L2_FIELD_NONE;
|
||||
|
||||
@ -2287,7 +2287,7 @@ static int
|
||||
sn9c102_vidioc_g_jpegcomp(struct sn9c102_device* cam, void __user * arg)
|
||||
{
|
||||
if (copy_to_user(arg, &cam->compression,
|
||||
sizeof(cam->compression)))
|
||||
sizeof(cam->compression)))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
@ -2436,7 +2436,7 @@ sn9c102_vidioc_qbuf(struct sn9c102_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
sn9c102_vidioc_dqbuf(struct sn9c102_device* cam, struct file* filp,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct v4l2_buffer b;
|
||||
struct sn9c102_frame_t *f;
|
||||
@ -2455,12 +2455,12 @@ sn9c102_vidioc_dqbuf(struct sn9c102_device* cam, struct file* filp,
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0)
|
||||
return timeout;
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
@ -2584,7 +2584,7 @@ sn9c102_vidioc_s_parm(struct sn9c102_device* cam, void __user * arg)
|
||||
|
||||
|
||||
static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, void __user * arg)
|
||||
unsigned int cmd, void __user * arg)
|
||||
{
|
||||
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
|
||||
@ -2678,7 +2678,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
|
||||
|
||||
static int sn9c102_ioctl(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
int err = 0;
|
||||
@ -2761,7 +2761,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||
}
|
||||
|
||||
cam->bridge = (id->idProduct & 0xffc0) == 0x6080 ?
|
||||
BRIDGE_SN9C103 : BRIDGE_SN9C102;
|
||||
BRIDGE_SN9C103 : BRIDGE_SN9C102;
|
||||
switch (cam->bridge) {
|
||||
case BRIDGE_SN9C101:
|
||||
case BRIDGE_SN9C102:
|
||||
@ -2807,7 +2807,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||
mutex_lock(&cam->dev_mutex);
|
||||
|
||||
err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
|
||||
video_nr[dev_nr]);
|
||||
video_nr[dev_nr]);
|
||||
if (err) {
|
||||
DBG(1, "V4L2 device registration failed");
|
||||
if (err == -ENFILE && video_nr[dev_nr] == -1)
|
||||
|
@ -45,7 +45,7 @@ static int hv7131d_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int hv7131d_get_ctrl(struct sn9c102_device* cam,
|
||||
struct v4l2_control* ctrl)
|
||||
struct v4l2_control* ctrl)
|
||||
{
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
@ -89,7 +89,7 @@ static int hv7131d_get_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int hv7131d_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -122,7 +122,7 @@ static int hv7131d_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int hv7131d_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &hv7131d;
|
||||
int err = 0;
|
||||
@ -137,7 +137,7 @@ static int hv7131d_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int hv7131d_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -39,64 +39,64 @@ static int mi0343_init(struct sn9c102_device* cam)
|
||||
err += sn9c102_write_reg(cam, 0xa0, 0x19);
|
||||
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x0d, 0x00, 0x01, 0, 0);
|
||||
0x0d, 0x00, 0x01, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x0d, 0x00, 0x00, 0, 0);
|
||||
0x0d, 0x00, 0x00, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x03, 0x01, 0xe1, 0, 0);
|
||||
0x03, 0x01, 0xe1, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x04, 0x02, 0x81, 0, 0);
|
||||
0x04, 0x02, 0x81, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x05, 0x00, 0x17, 0, 0);
|
||||
0x05, 0x00, 0x17, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x06, 0x00, 0x11, 0, 0);
|
||||
0x06, 0x00, 0x11, 0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id,
|
||||
0x62, 0x04, 0x9a, 0, 0);
|
||||
0x62, 0x04, 0x9a, 0, 0);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static int mi0343_get_ctrl(struct sn9c102_device* cam,
|
||||
struct v4l2_control* ctrl)
|
||||
struct v4l2_control* ctrl)
|
||||
{
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x09, 2+1, mi0343_i2c_data) < 0)
|
||||
0x09, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
ctrl->value = mi0343_i2c_data[2];
|
||||
return 0;
|
||||
case V4L2_CID_GAIN:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x35, 2+1, mi0343_i2c_data) < 0)
|
||||
0x35, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
break;
|
||||
case V4L2_CID_HFLIP:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x20, 2+1, mi0343_i2c_data) < 0)
|
||||
0x20, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
ctrl->value = mi0343_i2c_data[3] & 0x20 ? 1 : 0;
|
||||
return 0;
|
||||
case V4L2_CID_VFLIP:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x20, 2+1, mi0343_i2c_data) < 0)
|
||||
0x20, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
ctrl->value = mi0343_i2c_data[3] & 0x80 ? 1 : 0;
|
||||
return 0;
|
||||
case V4L2_CID_RED_BALANCE:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x2d, 2+1, mi0343_i2c_data) < 0)
|
||||
0x2d, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
break;
|
||||
case V4L2_CID_BLUE_BALANCE:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x2c, 2+1, mi0343_i2c_data) < 0)
|
||||
0x2c, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
break;
|
||||
case SN9C102_V4L2_CID_GREEN_BALANCE:
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id,
|
||||
0x2e, 2+1, mi0343_i2c_data) < 0)
|
||||
0x2e, 2+1, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
break;
|
||||
default:
|
||||
@ -122,7 +122,7 @@ static int mi0343_get_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int mi0343_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
u16 reg = 0;
|
||||
int err = 0;
|
||||
@ -144,51 +144,51 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam,
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x09, ctrl->value, 0x00,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x09, ctrl->value, 0x00,
|
||||
0, 0);
|
||||
break;
|
||||
case V4L2_CID_GAIN:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x35, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x35, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
break;
|
||||
case V4L2_CID_HFLIP:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x20, ctrl->value ? 0x40:0x00,
|
||||
ctrl->value ? 0x20:0x00,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x20, ctrl->value ? 0x40:0x00,
|
||||
ctrl->value ? 0x20:0x00,
|
||||
0, 0);
|
||||
break;
|
||||
case V4L2_CID_VFLIP:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x20, ctrl->value ? 0x80:0x00,
|
||||
ctrl->value ? 0x80:0x00,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x20, ctrl->value ? 0x80:0x00,
|
||||
ctrl->value ? 0x80:0x00,
|
||||
0, 0);
|
||||
break;
|
||||
case V4L2_CID_RED_BALANCE:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x2d, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x2d, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
break;
|
||||
case V4L2_CID_BLUE_BALANCE:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x2c, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x2c, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
break;
|
||||
case SN9C102_V4L2_CID_GREEN_BALANCE:
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x2b, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x2b, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x2e, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x2e, reg >> 8, reg & 0xff,
|
||||
0, 0);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@ -199,7 +199,7 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int mi0343_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &mi0343;
|
||||
int err = 0;
|
||||
@ -214,19 +214,19 @@ static int mi0343_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int mi0343_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) {
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x0a, 0x00, 0x03, 0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x0a, 0x00, 0x03, 0, 0);
|
||||
err += sn9c102_write_reg(cam, 0x20, 0x19);
|
||||
} else {
|
||||
err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4,
|
||||
mi0343.i2c_slave_id,
|
||||
0x0a, 0x00, 0x05, 0, 0);
|
||||
mi0343.i2c_slave_id,
|
||||
0x0a, 0x00, 0x05, 0, 0);
|
||||
err += sn9c102_write_reg(cam, 0xa0, 0x19);
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ int sn9c102_probe_mi0343(struct sn9c102_device* cam)
|
||||
return -EIO;
|
||||
|
||||
if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 0x00,
|
||||
2, mi0343_i2c_data) < 0)
|
||||
2, mi0343_i2c_data) < 0)
|
||||
return -EIO;
|
||||
|
||||
if (mi0343_i2c_data[4] != 0x32 && mi0343_i2c_data[3] != 0xe3)
|
||||
|
@ -69,7 +69,7 @@ static int ov7630_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int ov7630_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -89,8 +89,8 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam,
|
||||
break;
|
||||
case V4L2_CID_CONTRAST:
|
||||
err += ctrl->value ? sn9c102_i2c_write(cam, 0x05,
|
||||
(ctrl->value-1) | 0x20)
|
||||
: sn9c102_i2c_write(cam, 0x05, 0x00);
|
||||
(ctrl->value-1) | 0x20)
|
||||
: sn9c102_i2c_write(cam, 0x05, 0x00);
|
||||
break;
|
||||
case V4L2_CID_BRIGHTNESS:
|
||||
err += sn9c102_i2c_write(cam, 0x06, ctrl->value);
|
||||
@ -100,8 +100,8 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam,
|
||||
break;
|
||||
case V4L2_CID_HUE:
|
||||
err += ctrl->value ? sn9c102_i2c_write(cam, 0x04,
|
||||
(ctrl->value-1) | 0x20)
|
||||
: sn9c102_i2c_write(cam, 0x04, 0x00);
|
||||
(ctrl->value-1) | 0x20)
|
||||
: sn9c102_i2c_write(cam, 0x04, 0x00);
|
||||
break;
|
||||
case V4L2_CID_DO_WHITE_BALANCE:
|
||||
err += sn9c102_i2c_write(cam, 0x0c, ctrl->value);
|
||||
@ -139,7 +139,7 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int ov7630_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &ov7630;
|
||||
int err = 0;
|
||||
@ -152,7 +152,7 @@ static int ov7630_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int ov7630_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -54,7 +54,7 @@ static int pas106b_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int pas106b_get_ctrl(struct sn9c102_device* cam,
|
||||
struct v4l2_control* ctrl)
|
||||
struct v4l2_control* ctrl)
|
||||
{
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
@ -103,7 +103,7 @@ static int pas106b_get_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas106b_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -141,7 +141,7 @@ static int pas106b_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas106b_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &pas106b;
|
||||
int err = 0;
|
||||
@ -156,7 +156,7 @@ static int pas106b_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas106b_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -54,7 +54,7 @@ static int pas202bca_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int pas202bca_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -68,7 +68,7 @@ static int pas202bca_set_pix_format(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas202bca_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -102,7 +102,7 @@ static int pas202bca_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas202bca_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &pas202bca;
|
||||
int err = 0;
|
||||
|
@ -59,7 +59,7 @@ static int pas202bcb_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int pas202bcb_get_ctrl(struct sn9c102_device* cam,
|
||||
struct v4l2_control* ctrl)
|
||||
struct v4l2_control* ctrl)
|
||||
{
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
@ -102,7 +102,7 @@ static int pas202bcb_get_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas202bcb_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -116,7 +116,7 @@ static int pas202bcb_set_pix_format(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas202bcb_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -150,7 +150,7 @@ static int pas202bcb_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int pas202bcb_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &pas202bcb;
|
||||
int err = 0;
|
||||
@ -167,7 +167,7 @@ static int pas202bcb_set_crop(struct sn9c102_device* cam,
|
||||
static struct sn9c102_sensor pas202bcb = {
|
||||
.name = "PAS202BCB",
|
||||
.maintainer = "Carlos Eduardo Medaglia Dyonisio "
|
||||
"<medaglia@undl.org.br>",
|
||||
"<medaglia@undl.org.br>",
|
||||
.sysfs_ops = SN9C102_I2C_READ | SN9C102_I2C_WRITE,
|
||||
.frequency = SN9C102_I2C_400KHZ | SN9C102_I2C_100KHZ,
|
||||
.interface = SN9C102_I2C_2WIRES,
|
||||
|
@ -96,7 +96,7 @@ sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id);
|
||||
/* Attach a probed sensor to the camera. */
|
||||
extern void
|
||||
sn9c102_attach_sensor(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor);
|
||||
struct sn9c102_sensor* sensor);
|
||||
|
||||
/*
|
||||
Each SN9C10x camera has proper PID/VID identifiers.
|
||||
@ -105,7 +105,7 @@ sn9c102_attach_sensor(struct sn9c102_device* cam,
|
||||
*/
|
||||
#define SN9C102_USB_DEVICE(vend, prod, intclass) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
|
||||
USB_DEVICE_ID_MATCH_INT_CLASS, \
|
||||
USB_DEVICE_ID_MATCH_INT_CLASS, \
|
||||
.idVendor = (vend), \
|
||||
.idProduct = (prod), \
|
||||
.bInterfaceClass = (intclass)
|
||||
@ -168,9 +168,9 @@ static const struct usb_device_id sn9c102_id_table[] = { \
|
||||
|
||||
/* The "try" I2C I/O versions are used when probing the sensor */
|
||||
extern int sn9c102_i2c_try_write(struct sn9c102_device*,struct sn9c102_sensor*,
|
||||
u8 address, u8 value);
|
||||
u8 address, u8 value);
|
||||
extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*,
|
||||
u8 address);
|
||||
u8 address);
|
||||
|
||||
/*
|
||||
These must be used if and only if the sensor doesn't implement the standard
|
||||
@ -184,12 +184,12 @@ extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*,
|
||||
byte.
|
||||
*/
|
||||
extern int sn9c102_i2c_try_raw_write(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 n,
|
||||
u8 data0, u8 data1, u8 data2, u8 data3,
|
||||
u8 data4, u8 data5);
|
||||
struct sn9c102_sensor* sensor, u8 n,
|
||||
u8 data0, u8 data1, u8 data2, u8 data3,
|
||||
u8 data4, u8 data5);
|
||||
extern int sn9c102_i2c_try_raw_read(struct sn9c102_device* cam,
|
||||
struct sn9c102_sensor* sensor, u8 data0,
|
||||
u8 data1, u8 n, u8 buffer[]);
|
||||
struct sn9c102_sensor* sensor, u8 data0,
|
||||
u8 data1, u8 n, u8 buffer[]);
|
||||
|
||||
/* To be used after the sensor struct has been attached to the camera struct */
|
||||
extern int sn9c102_i2c_write(struct sn9c102_device*, u8 address, u8 value);
|
||||
@ -252,8 +252,8 @@ struct sn9c102_sensor {
|
||||
|
||||
/*
|
||||
NOTE: Where not noted,most of the functions below are not mandatory.
|
||||
Set to null if you do not implement them. If implemented,
|
||||
they must return 0 on success, the proper error otherwise.
|
||||
Set to null if you do not implement them. If implemented,
|
||||
they must return 0 on success, the proper error otherwise.
|
||||
*/
|
||||
|
||||
int (*init)(struct sn9c102_device* cam);
|
||||
@ -279,7 +279,7 @@ struct sn9c102_sensor {
|
||||
|
||||
int (*get_ctrl)(struct sn9c102_device* cam, struct v4l2_control* ctrl);
|
||||
int (*set_ctrl)(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl);
|
||||
const struct v4l2_control* ctrl);
|
||||
/*
|
||||
You must implement at least the set_ctrl method if you have defined
|
||||
the list above. The returned value must follow the V4L2
|
||||
@ -317,13 +317,13 @@ struct sn9c102_sensor {
|
||||
defined the correct default bounds in the structures.
|
||||
See the V4L2 API for further details.
|
||||
NOTE: once you have defined the bounds of the active window
|
||||
(struct cropcap.bounds) you must not change them.anymore.
|
||||
(struct cropcap.bounds) you must not change them.anymore.
|
||||
Only 'bounds' and 'defrect' fields are mandatory, other fields
|
||||
will be ignored.
|
||||
*/
|
||||
|
||||
int (*set_crop)(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect);
|
||||
const struct v4l2_rect* rect);
|
||||
/*
|
||||
To be called on VIDIOC_C_SETCROP. The core module always calls a
|
||||
default routine which configures the appropriate SN9C10X regs (also
|
||||
@ -333,11 +333,11 @@ struct sn9c102_sensor {
|
||||
the chip to match those values; on error return the corresponding
|
||||
error code without rolling back.
|
||||
NOTE: in case, you must program the SN9C10X chip to get rid of
|
||||
blank pixels or blank lines at the _start_ of each line or
|
||||
frame after each HSYNC or VSYNC, so that the image starts with
|
||||
real RGB data (see regs 0x12, 0x13) (having set H_SIZE and,
|
||||
V_SIZE you don't have to care about blank pixels or blank
|
||||
lines at the end of each line or frame).
|
||||
blank pixels or blank lines at the _start_ of each line or
|
||||
frame after each HSYNC or VSYNC, so that the image starts with
|
||||
real RGB data (see regs 0x12, 0x13) (having set H_SIZE and,
|
||||
V_SIZE you don't have to care about blank pixels or blank
|
||||
lines at the end of each line or frame).
|
||||
*/
|
||||
|
||||
struct v4l2_pix_format pix_format;
|
||||
@ -349,17 +349,17 @@ struct sn9c102_sensor {
|
||||
number of bits per pixel for uncompressed video, 8 or 9 (despite the
|
||||
current value of 'pixelformat').
|
||||
NOTE 1: both 'width' and 'height' _must_ be either 1/1 or 1/2 or 1/4
|
||||
of cropcap.defrect.width and cropcap.defrect.height. I
|
||||
suggest 1/1.
|
||||
of cropcap.defrect.width and cropcap.defrect.height. I
|
||||
suggest 1/1.
|
||||
NOTE 2: The initial compression quality is defined by the first bit
|
||||
of reg 0x17 during the initialization of the image sensor.
|
||||
of reg 0x17 during the initialization of the image sensor.
|
||||
NOTE 3: as said above, you have to program the SN9C10X chip to get
|
||||
rid of any blank pixels, so that the output of the sensor
|
||||
matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR).
|
||||
rid of any blank pixels, so that the output of the sensor
|
||||
matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR).
|
||||
*/
|
||||
|
||||
int (*set_pix_format)(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix);
|
||||
const struct v4l2_pix_format* pix);
|
||||
/*
|
||||
To be called on VIDIOC_S_FMT, when switching from the SBGGR8 to
|
||||
SN9C10X pixel format or viceversa. On error return the corresponding
|
||||
|
@ -45,7 +45,7 @@ static int tas5110c1b_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int tas5110c1b_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -62,7 +62,7 @@ static int tas5110c1b_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int tas5110c1b_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &tas5110c1b;
|
||||
int err = 0;
|
||||
@ -82,7 +82,7 @@ static int tas5110c1b_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int tas5110c1b_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -43,7 +43,7 @@ static int tas5130d1b_init(struct sn9c102_device* cam)
|
||||
|
||||
|
||||
static int tas5130d1b_set_ctrl(struct sn9c102_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -63,7 +63,7 @@ static int tas5130d1b_set_ctrl(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int tas5130d1b_set_crop(struct sn9c102_device* cam,
|
||||
const struct v4l2_rect* rect)
|
||||
const struct v4l2_rect* rect)
|
||||
{
|
||||
struct sn9c102_sensor* s = &tas5130d1b;
|
||||
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104,
|
||||
@ -83,7 +83,7 @@ static int tas5130d1b_set_crop(struct sn9c102_device* cam,
|
||||
|
||||
|
||||
static int tas5130d1b_set_pix_format(struct sn9c102_device* cam,
|
||||
const struct v4l2_pix_format* pix)
|
||||
const struct v4l2_pix_format* pix)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -612,7 +612,7 @@ static void stv680_video_irq (struct urb *urb, struct pt_regs *regs)
|
||||
|
||||
case BUFFER_UNUSED:
|
||||
memcpy (stv680->scratch[stv680->scratch_next].data,
|
||||
(unsigned char *) urb->transfer_buffer, length);
|
||||
(unsigned char *) urb->transfer_buffer, length);
|
||||
stv680->scratch[stv680->scratch_next].state = BUFFER_READY;
|
||||
stv680->scratch[stv680->scratch_next].length = length;
|
||||
if (waitqueue_active (&stv680->wq)) {
|
||||
|
@ -35,7 +35,7 @@ static int debug = 0; /* insmod parameter */
|
||||
module_param(debug, int, 0644);
|
||||
MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
|
||||
#define dprintk(args...) \
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
|
||||
#define SWITCH 0x00
|
||||
#define LEVEL_ADJUST 0x02
|
||||
|
@ -37,7 +37,7 @@ static int debug = 0; /* insmod parameter */
|
||||
module_param(debug, int, 0644);
|
||||
MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
|
||||
#define dprintk(args...) \
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
|
||||
#define TEA6415C_NUM_INPUTS 8
|
||||
#define TEA6415C_NUM_OUTPUTS 6
|
||||
|
@ -37,7 +37,7 @@ static int debug = 0; /* insmod parameter */
|
||||
module_param(debug, int, 0644);
|
||||
MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
|
||||
#define dprintk(args...) \
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0)
|
||||
|
||||
/* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */
|
||||
static unsigned short normal_i2c[] = { I2C_ADDR_TEA6420_1, I2C_ADDR_TEA6420_2, I2C_CLIENT_END };
|
||||
|
@ -59,7 +59,7 @@ tuner_getstatus (struct i2c_client *c)
|
||||
static int
|
||||
tuner_islocked (struct i2c_client *c)
|
||||
{
|
||||
return (tuner_getstatus(c) & TUNER_FL);
|
||||
return (tuner_getstatus(c) & TUNER_FL);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -117,17 +117,17 @@ tuner_attach(struct i2c_adapter *adap, int addr, int kind)
|
||||
return -1;
|
||||
this_adap++;
|
||||
|
||||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
client_template.adapter = adap;
|
||||
client_template.addr = addr;
|
||||
|
||||
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (client == NULL)
|
||||
return -ENOMEM;
|
||||
memcpy(client, &client_template, sizeof(struct i2c_client));
|
||||
if (client == NULL)
|
||||
return -ENOMEM;
|
||||
memcpy(client, &client_template, sizeof(struct i2c_client));
|
||||
|
||||
printk("tuner: SAB3036 found, status %02x\n", tuner_getstatus(client));
|
||||
|
||||
i2c_attach_client(client);
|
||||
i2c_attach_client(client);
|
||||
|
||||
if (i2c_master_send(client, buffer, 2) != 2)
|
||||
printk("tuner: i2c i/o error 1\n");
|
||||
@ -186,7 +186,7 @@ i2c_driver_tuner =
|
||||
|
||||
static struct i2c_client client_template =
|
||||
{
|
||||
.driver = &i2c_driver_tuner,
|
||||
.driver = &i2c_driver_tuner,
|
||||
.name = "SAB3036",
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
enum ctrl_req {
|
||||
SetWhitebal = 0x01,
|
||||
SetBrightness = 0x02,
|
||||
SetSharpness = 0x03,
|
||||
SetSharpness = 0x03,
|
||||
SetContrast = 0x04,
|
||||
SetSaturation = 0x05,
|
||||
};
|
||||
@ -132,24 +132,24 @@ struct konicawc {
|
||||
|
||||
static int konicawc_ctrl_msg(struct uvd *uvd, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
|
||||
{
|
||||
int retval = usb_control_msg(uvd->dev,
|
||||
int retval = usb_control_msg(uvd->dev,
|
||||
dir ? usb_rcvctrlpipe(uvd->dev, 0) : usb_sndctrlpipe(uvd->dev, 0),
|
||||
request, 0x40 | dir, value, index, buf, len, 1000);
|
||||
return retval < 0 ? retval : 0;
|
||||
return retval < 0 ? retval : 0;
|
||||
}
|
||||
|
||||
|
||||
static inline void konicawc_camera_on(struct uvd *uvd)
|
||||
{
|
||||
DEBUG(0, "camera on");
|
||||
konicawc_set_misc(uvd, 0x2, 1, 0x0b);
|
||||
DEBUG(0, "camera on");
|
||||
konicawc_set_misc(uvd, 0x2, 1, 0x0b);
|
||||
}
|
||||
|
||||
|
||||
static inline void konicawc_camera_off(struct uvd *uvd)
|
||||
{
|
||||
DEBUG(0, "camera off");
|
||||
konicawc_set_misc(uvd, 0x2, 0, 0x0b);
|
||||
DEBUG(0, "camera off");
|
||||
konicawc_set_misc(uvd, 0x2, 0, 0x0b);
|
||||
}
|
||||
|
||||
|
||||
@ -367,16 +367,16 @@ static int konicawc_compress_iso(struct uvd *uvd, struct urb *dataurb, struct ur
|
||||
|
||||
static void resubmit_urb(struct uvd *uvd, struct urb *urb)
|
||||
{
|
||||
int i, ret;
|
||||
for (i = 0; i < FRAMES_PER_DESC; i++) {
|
||||
urb->iso_frame_desc[i].status = 0;
|
||||
}
|
||||
urb->dev = uvd->dev;
|
||||
urb->status = 0;
|
||||
int i, ret;
|
||||
for (i = 0; i < FRAMES_PER_DESC; i++) {
|
||||
urb->iso_frame_desc[i].status = 0;
|
||||
}
|
||||
urb->dev = uvd->dev;
|
||||
urb->status = 0;
|
||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
DEBUG(3, "submitting urb of length %d", urb->transfer_buffer_length);
|
||||
if(ret)
|
||||
err("usb_submit_urb error (%d)", ret);
|
||||
if(ret)
|
||||
err("usb_submit_urb error (%d)", ret);
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
typedef struct {
|
||||
int initialized; /* Had we already sent init sequence? */
|
||||
int camera_model; /* What type of IBM camera we got? */
|
||||
int has_hdr;
|
||||
int has_hdr;
|
||||
} ultracam_t;
|
||||
#define ULTRACAM_T(uvd) ((ultracam_t *)((uvd)->user_data))
|
||||
|
||||
|
@ -1454,8 +1454,8 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
|
||||
struct video_buffer *vb = arg;
|
||||
|
||||
memset(vb, 0, sizeof(*vb));
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case VIDIOCKEY:
|
||||
return 0;
|
||||
|
||||
@ -1963,14 +1963,14 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
|
||||
info("%s($%p,%d.)", __FUNCTION__, uvd, frameNum);
|
||||
|
||||
switch (frame->frameState) {
|
||||
case FrameState_Unused:
|
||||
case FrameState_Unused:
|
||||
if (uvd->debug >= 2)
|
||||
info("%s: FrameState_Unused", __FUNCTION__);
|
||||
return -EINVAL;
|
||||
case FrameState_Ready:
|
||||
case FrameState_Grabbing:
|
||||
case FrameState_Error:
|
||||
{
|
||||
case FrameState_Ready:
|
||||
case FrameState_Grabbing:
|
||||
case FrameState_Error:
|
||||
{
|
||||
int ntries, signalPending;
|
||||
redo:
|
||||
if (!CAMERA_IS_OPERATIONAL(uvd)) {
|
||||
@ -2027,8 +2027,8 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
|
||||
goto redo;
|
||||
}
|
||||
/* Note that we fall through to meet our destiny below */
|
||||
}
|
||||
case FrameState_Done:
|
||||
}
|
||||
case FrameState_Done:
|
||||
/*
|
||||
* Do all necessary postprocessing of data prepared in
|
||||
* "interrupt" code and the collecting code above. The
|
||||
|
@ -189,11 +189,11 @@ struct usbvideo_frame {
|
||||
|
||||
/* Statistics that can be overlaid on screen */
|
||||
struct usbvideo_statistics {
|
||||
unsigned long frame_num; /* Sequential number of the frame */
|
||||
unsigned long urb_count; /* How many URBs we received so far */
|
||||
unsigned long urb_length; /* Length of last URB */
|
||||
unsigned long data_count; /* How many bytes we received */
|
||||
unsigned long header_count; /* How many frame headers we found */
|
||||
unsigned long frame_num; /* Sequential number of the frame */
|
||||
unsigned long urb_count; /* How many URBs we received so far */
|
||||
unsigned long urb_length; /* Length of last URB */
|
||||
unsigned long data_count; /* How many bytes we received */
|
||||
unsigned long header_count; /* How many frame headers we found */
|
||||
unsigned long iso_skip_count; /* How many empty ISO packets received */
|
||||
unsigned long iso_err_count; /* How many bad ISO packets received */
|
||||
};
|
||||
|
@ -69,10 +69,10 @@
|
||||
#define VICAM_HEADER_SIZE 64
|
||||
|
||||
#define clamp( x, l, h ) max_t( __typeof__( x ), \
|
||||
( l ), \
|
||||
min_t( __typeof__( x ), \
|
||||
( h ), \
|
||||
( x ) ) )
|
||||
( l ), \
|
||||
min_t( __typeof__( x ), \
|
||||
( h ), \
|
||||
( x ) ) )
|
||||
|
||||
/* Not sure what all the bytes in these char
|
||||
* arrays do, but they're necessary to make
|
||||
|
@ -80,24 +80,24 @@
|
||||
master_data -> data ref. for the master (e.g. the zr36055,57,67)
|
||||
readreg -> ref. to read-fn from register (setup by master, used by slave)
|
||||
writereg -> ref. to write-fn to register (setup by master, used by slave)
|
||||
this two functions do the lowlevel I/O job
|
||||
this two functions do the lowlevel I/O job
|
||||
|
||||
==== slave functionality setup ====
|
||||
slave_data -> data ref. for the slave (e.g. the zr36050,60)
|
||||
check -> fn-ref. checks availability of an device, returns -EIO on failure or
|
||||
the type on success
|
||||
this makes espcecially sense if a driver module supports more than
|
||||
one codec which may be quite similar to access, nevertheless it
|
||||
is good for a first functionality check
|
||||
the type on success
|
||||
this makes espcecially sense if a driver module supports more than
|
||||
one codec which may be quite similar to access, nevertheless it
|
||||
is good for a first functionality check
|
||||
|
||||
-- main functions you always need for compression/decompression --
|
||||
|
||||
set_mode -> this fn-ref. resets the entire codec, and sets up the mode
|
||||
with the last defined norm/size (or device default if not
|
||||
available) - it returns 0 if the mode is possible
|
||||
with the last defined norm/size (or device default if not
|
||||
available) - it returns 0 if the mode is possible
|
||||
set_size -> this fn-ref. sets the norm and image size for
|
||||
compression/decompression (returns 0 on success)
|
||||
the norm param is defined in videodev.h (VIDEO_MODE_*)
|
||||
compression/decompression (returns 0 on success)
|
||||
the norm param is defined in videodev.h (VIDEO_MODE_*)
|
||||
|
||||
additional setup may be available, too - but the codec should work with
|
||||
some default values even without this
|
||||
@ -112,8 +112,8 @@
|
||||
if the device delivers pictures, they may be handled here
|
||||
put_image -> puts image data to the codec (not needed for 36050/60)
|
||||
get_image -> gets image data from the codec (not needed for 36050/60)
|
||||
the calls include frame numbers and flags (even/odd/...)
|
||||
if needed and a flag which allows blocking until its ready
|
||||
the calls include frame numbers and flags (even/odd/...)
|
||||
if needed and a flag which allows blocking until its ready
|
||||
*/
|
||||
|
||||
/* ============== */
|
||||
|
@ -1555,12 +1555,12 @@ static void vino_update_line_size(struct vino_channel_settings *vcs)
|
||||
unsigned int w = vcs->clipping.right - vcs->clipping.left;
|
||||
unsigned int d = vcs->decimation;
|
||||
unsigned int bpp = vino_data_formats[vcs->data_format].bpp;
|
||||
unsigned int lsize;
|
||||
unsigned int lsize;
|
||||
|
||||
dprintk("update_line_size(): before: w = %d, d = %d, "
|
||||
"line_size = %d\n", w, d, vcs->line_size);
|
||||
|
||||
/* line size must be multiple of 8 bytes */
|
||||
/* line size must be multiple of 8 bytes */
|
||||
lsize = (bpp * (w / d)) & ~7;
|
||||
w = (lsize / bpp) * d;
|
||||
|
||||
|
@ -176,8 +176,8 @@ vpx3220_write_block (struct i2c_client *client,
|
||||
|
||||
static int
|
||||
vpx3220_write_fp_block (struct i2c_client *client,
|
||||
const u16 *data,
|
||||
unsigned int len)
|
||||
const u16 *data,
|
||||
unsigned int len)
|
||||
{
|
||||
u8 reg;
|
||||
int ret = 0;
|
||||
@ -324,7 +324,7 @@ vpx3220_command (struct i2c_client *client,
|
||||
|
||||
case VIDEO_MODE_PAL:
|
||||
vpx3220_write_fp_block(client, init_pal,
|
||||
sizeof(init_pal) >> 1);
|
||||
sizeof(init_pal) >> 1);
|
||||
break;
|
||||
case VIDEO_MODE_SECAM:
|
||||
vpx3220_write_fp_block(client, init_secam,
|
||||
@ -332,7 +332,7 @@ vpx3220_command (struct i2c_client *client,
|
||||
break;
|
||||
default:
|
||||
vpx3220_write_fp_block(client, init_pal,
|
||||
sizeof(init_pal) >> 1);
|
||||
sizeof(init_pal) >> 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -411,7 +411,7 @@ vpx3220_command (struct i2c_client *client,
|
||||
|
||||
/* Here we back up the input selection because it gets
|
||||
overwritten when we fill the registers with the
|
||||
choosen video norm */
|
||||
choosen video norm */
|
||||
temp_input = vpx3220_fp_read(client, 0xf2);
|
||||
|
||||
dprintk(1, KERN_DEBUG "%s: DECODER_SET_NORM %d\n",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -61,7 +61,7 @@
|
||||
|
||||
/* Maximum data payload sizes in bytes for alternate settings */
|
||||
static const u16 wMaxPacketSize[] = {1023, 959, 895, 831, 767, 703, 639, 575,
|
||||
511, 447, 383, 319, 255, 191, 127, 63};
|
||||
511, 447, 383, 319, 255, 191, 127, 63};
|
||||
#define W9968CF_PACKET_SIZE 1023 /* according to wMaxPacketSizes[] */
|
||||
#define W9968CF_MIN_PACKET_SIZE 63 /* minimum value */
|
||||
#define W9968CF_ISO_PACKETS 5 /* n.of packets for isochronous transfers */
|
||||
@ -134,7 +134,7 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
|
||||
****************************************************************************/
|
||||
|
||||
#define W9968CF_MODULE_NAME "V4L driver for W996[87]CF JPEG USB " \
|
||||
"Dual Mode Camera Chip"
|
||||
"Dual Mode Camera Chip"
|
||||
#define W9968CF_MODULE_VERSION "1:1.33-basic"
|
||||
#define W9968CF_MODULE_AUTHOR "(C) 2002-2004 Luca Risolia"
|
||||
#define W9968CF_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
|
||||
@ -270,9 +270,9 @@ struct w9968cf_device {
|
||||
|
||||
/* Locks */
|
||||
struct mutex dev_mutex, /* for probe, disconnect,open and close */
|
||||
fileop_mutex; /* for read and ioctl */
|
||||
fileop_mutex; /* for read and ioctl */
|
||||
spinlock_t urb_lock, /* for submit_urb() and unlink_urb() */
|
||||
flist_lock; /* for requested frame list accesses */
|
||||
flist_lock; /* for requested frame list accesses */
|
||||
wait_queue_head_t open, wait_queue;
|
||||
|
||||
char command[16]; /* name of the program holding the device */
|
||||
@ -299,7 +299,7 @@ struct w9968cf_device {
|
||||
dev_warn(&cam->dev, fmt "\n", ## args); \
|
||||
else if ((level) >= 5) \
|
||||
dev_info(&cam->dev, "[%s:%d] " fmt "\n", \
|
||||
__FUNCTION__, __LINE__ , ## args); \
|
||||
__FUNCTION__, __LINE__ , ## args); \
|
||||
} \
|
||||
}
|
||||
/* For generic kernel (not device specific) messages */
|
||||
@ -311,7 +311,7 @@ struct w9968cf_device {
|
||||
pr_info("w9968cf: " fmt "\n", ## args); \
|
||||
else if ((level) >= 5) \
|
||||
pr_debug("w9968cf: [%s:%d] " fmt "\n", __FUNCTION__, \
|
||||
__LINE__ , ## args); \
|
||||
__LINE__ , ## args); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
|
@ -79,8 +79,8 @@ static const unsigned char UV_QUANTABLE[64] = {
|
||||
|
||||
extern void w9968cf_init_decoder(void);
|
||||
extern int w9968cf_check_headers(const unsigned char* Pin,
|
||||
const unsigned long BUF_SIZE);
|
||||
const unsigned long BUF_SIZE);
|
||||
extern int w9968cf_decode(const char* Pin, const unsigned long BUF_SIZE,
|
||||
const unsigned W, const unsigned H, char* Pout);
|
||||
const unsigned W, const unsigned H, char* Pout);
|
||||
|
||||
#endif /* _W9968CF_DECODER_H_ */
|
||||
|
@ -29,7 +29,7 @@ struct w9968cf_vpp_t {
|
||||
struct module* owner;
|
||||
int (*check_headers)(const unsigned char*, const unsigned long);
|
||||
int (*decode)(const char*, const unsigned long, const unsigned,
|
||||
const unsigned, char*);
|
||||
const unsigned, char*);
|
||||
void (*swap_yuvbytes)(void*, unsigned long);
|
||||
void (*uyvy_to_rgbx)(u8*, unsigned long, u8*, u16, u8);
|
||||
void (*scale_up)(u8*, u8*, u16, u16, u16, u16, u16);
|
||||
|
@ -157,7 +157,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...) \
|
||||
@ -167,7 +167,7 @@ do { \
|
||||
pr_info("zc0301: " fmt "\n", ## args); \
|
||||
else if ((level) == 3) \
|
||||
pr_debug("zc0301: [%s:%d] " fmt "\n", __FUNCTION__, \
|
||||
__LINE__ , ## args); \
|
||||
__LINE__ , ## args); \
|
||||
} \
|
||||
} while (0)
|
||||
# define V4LDBG(level, name, cmd) \
|
||||
@ -184,7 +184,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 */
|
||||
|
@ -48,7 +48,7 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
#define ZC0301_MODULE_NAME "V4L2 driver for ZC0301 " \
|
||||
"Image Processor and Control Chip"
|
||||
"Image Processor and Control Chip"
|
||||
#define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia"
|
||||
#define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
|
||||
#define ZC0301_MODULE_LICENSE "GPL"
|
||||
@ -67,67 +67,67 @@ MODULE_LICENSE(ZC0301_MODULE_LICENSE);
|
||||
static short video_nr[] = {[0 ... ZC0301_MAX_DEVICES-1] = -1};
|
||||
module_param_array(video_nr, short, NULL, 0444);
|
||||
MODULE_PARM_DESC(video_nr,
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "
|
||||
__MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second registered camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
"\n<-1|n[,...]> Specify V4L2 minor mode number."
|
||||
"\n -1 = use next available (default)"
|
||||
"\n n = use minor number n (integer >= 0)"
|
||||
"\nYou can specify up to "
|
||||
__MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way."
|
||||
"\nFor example:"
|
||||
"\nvideo_nr=-1,2,-1 would assign minor number 2 to"
|
||||
"\nthe second registered camera and use auto for the first"
|
||||
"\none and for every other camera."
|
||||
"\n");
|
||||
|
||||
static short force_munmap[] = {[0 ... ZC0301_MAX_DEVICES-1] =
|
||||
ZC0301_FORCE_MUNMAP};
|
||||
ZC0301_FORCE_MUNMAP};
|
||||
module_param_array(force_munmap, bool, NULL, 0444);
|
||||
MODULE_PARM_DESC(force_munmap,
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
"\n<0|1[,...]> Force the application to unmap previously"
|
||||
"\nmapped buffer memory before calling any VIDIOC_S_CROP or"
|
||||
"\nVIDIOC_S_FMT ioctl's. Not all the applications support"
|
||||
"\nthis feature. This parameter is specific for each"
|
||||
"\ndetected camera."
|
||||
"\n 0 = do not force memory unmapping"
|
||||
"\n 1 = force memory unmapping (save memory)"
|
||||
"\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
|
||||
"\n");
|
||||
|
||||
static unsigned int frame_timeout[] = {[0 ... ZC0301_MAX_DEVICES-1] =
|
||||
ZC0301_FRAME_TIMEOUT};
|
||||
ZC0301_FRAME_TIMEOUT};
|
||||
module_param_array(frame_timeout, uint, NULL, 0644);
|
||||
MODULE_PARM_DESC(frame_timeout,
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
"\n<n[,...]> Timeout for a video frame in seconds."
|
||||
"\nThis parameter is specific for each detected camera."
|
||||
"\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"."
|
||||
"\n");
|
||||
|
||||
#ifdef ZC0301_DEBUG
|
||||
static unsigned short debug = ZC0301_DEBUG_LEVEL;
|
||||
module_param(debug, ushort, 0644);
|
||||
MODULE_PARM_DESC(debug,
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
"\n<n> Debugging information level, from 0 to 3:"
|
||||
"\n0 = none (use carefully)"
|
||||
"\n1 = critical errors"
|
||||
"\n2 = significant informations"
|
||||
"\n3 = more verbose messages"
|
||||
"\nLevel 3 is useful for testing only, when only "
|
||||
"one device is used."
|
||||
"\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"."
|
||||
"\n");
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static u32
|
||||
zc0301_request_buffers(struct zc0301_device* cam, u32 count,
|
||||
enum zc0301_io_method io)
|
||||
enum zc0301_io_method io)
|
||||
{
|
||||
struct v4l2_pix_format* p = &(cam->sensor.pix_format);
|
||||
struct v4l2_rect* r = &(cam->sensor.cropcap.bounds);
|
||||
const size_t imagesize = cam->module_param.force_munmap ||
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
io == IO_READ ?
|
||||
(p->width * p->height * p->priv) / 8 :
|
||||
(r->width * r->height * p->priv) / 8;
|
||||
void* buff = NULL;
|
||||
u32 i;
|
||||
|
||||
@ -216,7 +216,7 @@ int zc0301_write_reg(struct zc0301_device* cam, u16 index, u16 value)
|
||||
int res;
|
||||
|
||||
res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0xa0, 0x40,
|
||||
value, index, NULL, 0, ZC0301_CTRL_TIMEOUT);
|
||||
value, index, NULL, 0, ZC0301_CTRL_TIMEOUT);
|
||||
if (res < 0) {
|
||||
DBG(3, "Failed to write a register (index 0x%04X, "
|
||||
"value 0x%02X, error %d)",index, value, res);
|
||||
@ -234,7 +234,7 @@ int zc0301_read_reg(struct zc0301_device* cam, u16 index)
|
||||
int res;
|
||||
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0xa1, 0xc0,
|
||||
0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT);
|
||||
0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT);
|
||||
if (res < 0)
|
||||
DBG(3, "Failed to read a register (index 0x%04X, error %d)",
|
||||
index, res);
|
||||
@ -337,11 +337,11 @@ static void zc0301_urb_complete(struct urb *urb, struct pt_regs* regs)
|
||||
|
||||
if (!(*f))
|
||||
(*f) = list_entry(cam->inqueue.next, struct zc0301_frame_t,
|
||||
frame);
|
||||
frame);
|
||||
|
||||
imagesize = (cam->sensor.pix_format.width *
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
cam->sensor.pix_format.height *
|
||||
cam->sensor.pix_format.priv) / 8;
|
||||
|
||||
for (i = 0; i < urb->number_of_packets; i++) {
|
||||
unsigned int len, status;
|
||||
@ -395,8 +395,8 @@ end_of_frame:
|
||||
list_move_tail(&(*f)->frame, &cam->outqueue);
|
||||
if (!list_empty(&cam->inqueue))
|
||||
(*f) = list_entry(cam->inqueue.next,
|
||||
struct zc0301_frame_t,
|
||||
frame);
|
||||
struct zc0301_frame_t,
|
||||
frame);
|
||||
else
|
||||
(*f) = NULL;
|
||||
spin_unlock(&cam->queue_lock);
|
||||
@ -429,14 +429,14 @@ static int zc0301_start_transfer(struct zc0301_device* cam)
|
||||
struct usb_device *udev = cam->usbdev;
|
||||
struct urb* urb;
|
||||
const unsigned int wMaxPacketSize[] = {0, 128, 192, 256, 384,
|
||||
512, 768, 1023};
|
||||
512, 768, 1023};
|
||||
const unsigned int psz = wMaxPacketSize[ZC0301_ALTERNATE_SETTING];
|
||||
s8 i, j;
|
||||
int err = 0;
|
||||
|
||||
for (i = 0; i < ZC0301_URBS; i++) {
|
||||
cam->transfer_buffer[i] = kzalloc(ZC0301_ISO_PACKETS * psz,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL);
|
||||
if (!cam->transfer_buffer[i]) {
|
||||
err = -ENOMEM;
|
||||
DBG(1, "Not enough memory");
|
||||
@ -528,9 +528,9 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
|
||||
|
||||
cam->stream = STREAM_INTERRUPT;
|
||||
timeout = wait_event_timeout(cam->wait_stream,
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
ZC0301_URB_TIMEOUT);
|
||||
(cam->stream == STREAM_OFF) ||
|
||||
(cam->state & DEV_DISCONNECTED),
|
||||
ZC0301_URB_TIMEOUT);
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
return -ENODEV;
|
||||
else if (cam->stream != STREAM_OFF) {
|
||||
@ -548,7 +548,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
|
||||
|
||||
static int
|
||||
zc0301_set_compression(struct zc0301_device* cam,
|
||||
struct v4l2_jpegcompression* compression)
|
||||
struct v4l2_jpegcompression* compression)
|
||||
{
|
||||
int r, err = 0;
|
||||
|
||||
@ -670,8 +670,8 @@ static int zc0301_open(struct inode* inode, struct file* filp)
|
||||
}
|
||||
mutex_unlock(&cam->dev_mutex);
|
||||
err = wait_event_interruptible_exclusive(cam->open,
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
cam->state & DEV_DISCONNECTED
|
||||
|| !cam->users);
|
||||
if (err) {
|
||||
up_read(&zc0301_disconnect);
|
||||
return err;
|
||||
@ -802,12 +802,12 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
|
||||
return -EAGAIN;
|
||||
}
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0) {
|
||||
mutex_unlock(&cam->fileop_mutex);
|
||||
return timeout;
|
||||
@ -930,7 +930,7 @@ static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma)
|
||||
{
|
||||
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
unsigned long size = vma->vm_end - vma->vm_start,
|
||||
start = vma->vm_start;
|
||||
start = vma->vm_start;
|
||||
void *pos;
|
||||
u32 i;
|
||||
|
||||
@ -998,13 +998,13 @@ zc0301_vidioc_querycap(struct zc0301_device* cam, void __user * arg)
|
||||
.driver = "zc0301",
|
||||
.version = ZC0301_MODULE_VERSION_CODE,
|
||||
.capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
|
||||
V4L2_CAP_STREAMING,
|
||||
V4L2_CAP_STREAMING,
|
||||
};
|
||||
|
||||
strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card));
|
||||
if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0)
|
||||
strlcpy(cap.bus_info, cam->usbdev->dev.bus_id,
|
||||
sizeof(cap.bus_info));
|
||||
sizeof(cap.bus_info));
|
||||
|
||||
if (copy_to_user(arg, &cap, sizeof(cap)))
|
||||
return -EFAULT;
|
||||
@ -1337,7 +1337,7 @@ zc0301_vidioc_g_fmt(struct zc0301_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct zc0301_sensor* s = &cam->sensor;
|
||||
struct v4l2_format format;
|
||||
@ -1600,7 +1600,7 @@ zc0301_vidioc_qbuf(struct zc0301_device* cam, void __user * arg)
|
||||
|
||||
static int
|
||||
zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp,
|
||||
void __user * arg)
|
||||
void __user * arg)
|
||||
{
|
||||
struct v4l2_buffer b;
|
||||
struct zc0301_frame_t *f;
|
||||
@ -1619,12 +1619,12 @@ zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp,
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
timeout = wait_event_interruptible_timeout
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
( cam->wait_frame,
|
||||
(!list_empty(&cam->outqueue)) ||
|
||||
(cam->state & DEV_DISCONNECTED) ||
|
||||
(cam->state & DEV_MISCONFIGURED),
|
||||
cam->module_param.frame_timeout *
|
||||
1000 * msecs_to_jiffies(1) );
|
||||
if (timeout < 0)
|
||||
return timeout;
|
||||
if (cam->state & DEV_DISCONNECTED)
|
||||
@ -1748,7 +1748,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
|
||||
|
||||
|
||||
static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, void __user * arg)
|
||||
unsigned int cmd, void __user * arg)
|
||||
{
|
||||
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
|
||||
@ -1842,7 +1842,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
|
||||
|
||||
|
||||
static int zc0301_ioctl(struct inode* inode, struct file* filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
|
||||
int err = 0;
|
||||
@ -1948,7 +1948,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
|
||||
mutex_lock(&cam->dev_mutex);
|
||||
|
||||
err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
|
||||
video_nr[dev_nr]);
|
||||
video_nr[dev_nr]);
|
||||
if (err) {
|
||||
DBG(1, "V4L2 device registration failed");
|
||||
if (err == -ENFILE && video_nr[dev_nr] == -1)
|
||||
|
@ -24,10 +24,10 @@
|
||||
|
||||
/*
|
||||
NOTE: Sensor controls are disabled for now, becouse changing them while
|
||||
streaming sometimes results in out-of-sync video frames. We'll use
|
||||
the default initialization, until we know how to stop and start video
|
||||
in the chip. However, the image quality still looks good under various
|
||||
light conditions.
|
||||
streaming sometimes results in out-of-sync video frames. We'll use
|
||||
the default initialization, until we know how to stop and start video
|
||||
in the chip. However, the image quality still looks good under various
|
||||
light conditions.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
@ -165,7 +165,7 @@ static int pas202bcb_init(struct zc0301_device* cam)
|
||||
|
||||
|
||||
static int pas202bcb_get_ctrl(struct zc0301_device* cam,
|
||||
struct v4l2_control* ctrl)
|
||||
struct v4l2_control* ctrl)
|
||||
{
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_EXPOSURE:
|
||||
@ -208,7 +208,7 @@ static int pas202bcb_get_ctrl(struct zc0301_device* cam,
|
||||
|
||||
|
||||
static int pas202bcb_set_ctrl(struct zc0301_device* cam,
|
||||
const struct v4l2_control* ctrl)
|
||||
const struct v4l2_control* ctrl)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -51,7 +51,7 @@ zc0301_attach_sensor(struct zc0301_device* cam, struct zc0301_sensor* sensor);
|
||||
|
||||
#define ZC0301_USB_DEVICE(vend, prod, intclass) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
|
||||
USB_DEVICE_ID_MATCH_INT_CLASS, \
|
||||
USB_DEVICE_ID_MATCH_INT_CLASS, \
|
||||
.idVendor = (vend), \
|
||||
.idProduct = (prod), \
|
||||
.bInterfaceClass = (intclass)
|
||||
@ -92,7 +92,7 @@ struct zc0301_sensor {
|
||||
int (*init)(struct zc0301_device*);
|
||||
int (*get_ctrl)(struct zc0301_device*, struct v4l2_control* ctrl);
|
||||
int (*set_ctrl)(struct zc0301_device*,
|
||||
const struct v4l2_control* ctrl);
|
||||
const struct v4l2_control* ctrl);
|
||||
int (*set_crop)(struct zc0301_device*, const struct v4l2_rect* rect);
|
||||
|
||||
/* Private */
|
||||
|
@ -824,7 +824,7 @@ zr36057_set_jpg (struct zoran *zr,
|
||||
(tvn->Wt << ZR36057_HSP_LineTot);
|
||||
btwrite(reg, ZR36057_HSP);
|
||||
reg = ((zr->jpg_settings.img_x +
|
||||
tvn->HStart + 4) << ZR36057_FHAP_NAX) |
|
||||
tvn->HStart + 4) << ZR36057_FHAP_NAX) |
|
||||
(zr->jpg_settings.img_width << ZR36057_FHAP_PAX);
|
||||
btwrite(reg, ZR36057_FHAP);
|
||||
|
||||
|
@ -94,7 +94,7 @@
|
||||
V4L2_CAP_VIDEO_CAPTURE |\
|
||||
V4L2_CAP_VIDEO_OUTPUT |\
|
||||
V4L2_CAP_VIDEO_OVERLAY \
|
||||
)
|
||||
)
|
||||
#endif
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
@ -165,7 +165,7 @@ const struct zoran_format zoran_formats[] = {
|
||||
#endif
|
||||
.depth = 16,
|
||||
.flags = ZORAN_FORMAT_CAPTURE |
|
||||
ZORAN_FORMAT_OVERLAY,
|
||||
ZORAN_FORMAT_OVERLAY,
|
||||
}, {
|
||||
.name = "Hardware-encoded Motion-JPEG",
|
||||
.palette = -1,
|
||||
@ -670,7 +670,7 @@ jpg_fbuffer_free (struct file *file)
|
||||
j]))));
|
||||
free_page((unsigned long)
|
||||
bus_to_virt
|
||||
(le32_to_cpu
|
||||
(le32_to_cpu
|
||||
(fh->jpg_buffers.
|
||||
buffer[i].
|
||||
frag_tab[2 * j])));
|
||||
@ -1871,7 +1871,7 @@ zoran_v4l2_buffer_status (struct file *file,
|
||||
|
||||
static int
|
||||
zoran_set_norm (struct zoran *zr,
|
||||
int norm) /* VIDEO_MODE_* */
|
||||
int norm) /* VIDEO_MODE_* */
|
||||
{
|
||||
int norm_encoder, on;
|
||||
|
||||
@ -2006,9 +2006,9 @@ zoran_set_input (struct zoran *zr,
|
||||
|
||||
static int
|
||||
zoran_do_ioctl (struct inode *inode,
|
||||
struct file *file,
|
||||
unsigned int cmd,
|
||||
void *arg)
|
||||
struct file *file,
|
||||
unsigned int cmd,
|
||||
void *arg)
|
||||
{
|
||||
struct zoran_fh *fh = file->private_data;
|
||||
struct zoran *zr = fh->zr;
|
||||
|
@ -143,8 +143,8 @@ zr36016_readi (struct zr36016 *ptr,
|
||||
|
||||
static void
|
||||
zr36016_writei (struct zr36016 *ptr,
|
||||
u16 reg,
|
||||
u8 value)
|
||||
u16 reg,
|
||||
u8 value)
|
||||
{
|
||||
dprintk(4, "%s: writing indirect 0x%02x to 0x%04x\n", ptr->name,
|
||||
value, reg);
|
||||
@ -232,17 +232,17 @@ zr36016_basic_test (struct zr36016 *ptr)
|
||||
static int zr36016_pushit (struct zr36016 *ptr,
|
||||
u16 startreg,
|
||||
u16 len,
|
||||
const char *data)
|
||||
const char *data)
|
||||
{
|
||||
int i=0;
|
||||
int i=0;
|
||||
|
||||
dprintk(4, "%s: write data block to 0x%04x (len=%d)\n",
|
||||
dprintk(4, "%s: write data block to 0x%04x (len=%d)\n",
|
||||
ptr->name, startreg,len);
|
||||
while (i<len) {
|
||||
zr36016_writei(ptr, startreg++, data[i++]);
|
||||
}
|
||||
while (i<len) {
|
||||
zr36016_writei(ptr, startreg++, data[i++]);
|
||||
}
|
||||
|
||||
return i;
|
||||
return i;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -218,9 +218,9 @@ zr36050_basic_test (struct zr36050 *ptr)
|
||||
|
||||
static int
|
||||
zr36050_pushit (struct zr36050 *ptr,
|
||||
u16 startreg,
|
||||
u16 len,
|
||||
const char *data)
|
||||
u16 startreg,
|
||||
u16 len,
|
||||
const char *data)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -345,7 +345,7 @@ static const char zr36050_decimation_v[8] = { 1, 1, 1, 0, 0, 0, 0, 0 };
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* SOF (start of frame) segment depends on width, height and sampling ratio
|
||||
of each color component */
|
||||
of each color component */
|
||||
|
||||
static int
|
||||
zr36050_set_sof (struct zr36050 *ptr)
|
||||
@ -377,7 +377,7 @@ zr36050_set_sof (struct zr36050 *ptr)
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* SOS (start of scan) segment depends on the used scan components
|
||||
of each color component */
|
||||
of each color component */
|
||||
|
||||
static int
|
||||
zr36050_set_sos (struct zr36050 *ptr)
|
||||
|
@ -27,14 +27,14 @@
|
||||
#define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */
|
||||
#define ZR36057_VFEHCR_HSPol (1<<30)
|
||||
#define ZR36057_VFEHCR_HStart 10
|
||||
#define ZR36057_VFEHCR_HEnd 0
|
||||
#define ZR36057_VFEHCR_Hmask 0x3ff
|
||||
#define ZR36057_VFEHCR_HEnd 0
|
||||
#define ZR36057_VFEHCR_Hmask 0x3ff
|
||||
|
||||
#define ZR36057_VFEVCR 0x004 /* Video Front End, Vertical Configuration Register */
|
||||
#define ZR36057_VFEVCR_VSPol (1<<30)
|
||||
#define ZR36057_VFEVCR_VStart 10
|
||||
#define ZR36057_VFEVCR_VEnd 0
|
||||
#define ZR36057_VFEVCR_Vmask 0x3ff
|
||||
#define ZR36057_VFEVCR_VEnd 0
|
||||
#define ZR36057_VFEVCR_Vmask 0x3ff
|
||||
|
||||
#define ZR36057_VFESPFR 0x008 /* Video Front End, Scaler and Pixel Format Register */
|
||||
#define ZR36057_VFESPFR_ExtFl (1<<26)
|
||||
|
@ -208,9 +208,9 @@ zr36060_basic_test (struct zr36060 *ptr)
|
||||
|
||||
static int
|
||||
zr36060_pushit (struct zr36060 *ptr,
|
||||
u16 startreg,
|
||||
u16 len,
|
||||
const char *data)
|
||||
u16 startreg,
|
||||
u16 len,
|
||||
const char *data)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -335,7 +335,7 @@ static const char zr36060_decimation_v[8] = { 1, 1, 1, 0, 0, 0, 0, 0 };
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* SOF (start of frame) segment depends on width, height and sampling ratio
|
||||
of each color component */
|
||||
of each color component */
|
||||
|
||||
static int
|
||||
zr36060_set_sof (struct zr36060 *ptr)
|
||||
@ -368,7 +368,7 @@ zr36060_set_sof (struct zr36060 *ptr)
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* SOS (start of scan) segment depends on the used scan components
|
||||
of each color component */
|
||||
of each color component */
|
||||
|
||||
static int
|
||||
zr36060_set_sos (struct zr36060 *ptr)
|
||||
@ -385,7 +385,7 @@ zr36060_set_sos (struct zr36060 *ptr)
|
||||
for (i = 0; i < NO_OF_COMPONENTS; i++) {
|
||||
sos_data[5 + (i * 2)] = i; // index
|
||||
sos_data[6 + (i * 2)] = (zr36060_td[i] << 4) |
|
||||
zr36060_ta[i]; // AC/DC tbl.sel.
|
||||
zr36060_ta[i]; // AC/DC tbl.sel.
|
||||
}
|
||||
sos_data[2 + 1 + (2 * NO_OF_COMPONENTS) + 2] = 00; // scan start
|
||||
sos_data[2 + 1 + (2 * NO_OF_COMPONENTS) + 3] = 0x3f;
|
||||
|
@ -812,12 +812,12 @@ void zoran_close(struct video_device* dev)
|
||||
|
||||
zoran_common_close(ztv);
|
||||
|
||||
/*
|
||||
* This is sucky but right now I can't find a good way to
|
||||
* be sure its safe to free the buffer. We wait 5-6 fields
|
||||
* which is more than sufficient to be sure.
|
||||
*/
|
||||
msleep(100); /* Wait 1/10th of a second */
|
||||
/*
|
||||
* This is sucky but right now I can't find a good way to
|
||||
* be sure its safe to free the buffer. We wait 5-6 fields
|
||||
* which is more than sufficient to be sure.
|
||||
*/
|
||||
msleep(100); /* Wait 1/10th of a second */
|
||||
|
||||
/* free the allocated framebuffer */
|
||||
bfree(ztv->fbuffer, ZORAN_MAX_FBUFSIZE);
|
||||
@ -1557,12 +1557,12 @@ void vbi_close(struct video_device *dev)
|
||||
|
||||
zoran_common_close(ztv);
|
||||
|
||||
/*
|
||||
* This is sucky but right now I can't find a good way to
|
||||
* be sure its safe to free the buffer. We wait 5-6 fields
|
||||
* which is more than sufficient to be sure.
|
||||
*/
|
||||
msleep(100); /* Wait 1/10th of a second */
|
||||
/*
|
||||
* This is sucky but right now I can't find a good way to
|
||||
* be sure its safe to free the buffer. We wait 5-6 fields
|
||||
* which is more than sufficient to be sure.
|
||||
*/
|
||||
msleep(100); /* Wait 1/10th of a second */
|
||||
|
||||
for (item=ztv->readinfo; item!=ztv->readinfo+ZORAN_VBI_BUFFERS; item++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user