- available mmap or read/poll methods for video streaming through isochronous
data transfers;
- automatic detection of image sensor;
-- video formats is standard JPEG in various compression qualities
- (see also "Notes for V4L2 application developers" paragraph);
+- video format is standard JPEG;
- full support for the capabilities of every possible image sensors that can
be connected to the ZC0301 bridges, including, for istance, red, green,
blue and global gain adjustments and exposure control (see "Supported
of the new video frames, so you have to map the buffers again before any I/O
attempts on them.
-This driver supports the standard JPEG video format. The current compression
-quality may vary from 0 to 3 and can be selected or queried thanks to the
-VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2 ioctl's.
-
10. Contact information
=======================
11. Credits
===========
-- Informations about the chip internals to enable the I2C protocol have been
- taken from the documentation of the ZC030x Video4Linux1 driver written by
- Andrew Birkett <andy@nobugs.org>;
-- Initialization values of the ZC0301 connected to the PAS202BCB image sensor
- have been taken from the SPCA5XX driver maintained by
- Michel Xhaard <mxhaard@magic.fr>
+- Informations about the chip internals needed to enable the I2C protocol have
+ been taken from the documentation of the ZC030x Video4Linux1 driver written
+ by Andrew Birkett <andy@nobugs.org>;
+- Initialization values of the ZC0301 controller connected to the PAS202BCB
+ image sensor have been taken from the SPCA5XX driver maintained by
+ Michel Xhaard <mxhaard@magic.fr>.
* *
* Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> *
* *
- * Informations about the chip internals to enable the I2C protocol have *
- * been taken from the documentation of the ZC030x Video4Linux1 driver *
- * written by Andrew Birkett <andy@nobugs.org> *
+ * Informations about the chip internals needed to enable the I2C protocol *
+ * have been taken from the documentation of the ZC030x Video4Linux1 *
+ * driver written by Andrew Birkett <andy@nobugs.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia"
#define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
#define ZC0301_MODULE_LICENSE "GPL"
-#define ZC0301_MODULE_VERSION "1:1.00"
-#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 0)
+#define ZC0301_MODULE_VERSION "1:1.01"
+#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 1)
/*****************************************************************************/
if ((*f))
(*f)->state = F_QUEUED;
DBG(3, "Stream interrupted");
- wake_up_interruptible(&cam->wait_stream);
+ wake_up(&cam->wait_stream);
}
if (cam->state & DEV_DISCONNECTED)
ZC0301_URB_TIMEOUT);
if (cam->state & DEV_DISCONNECTED)
return -ENODEV;
- else if (!timeout) {
+ else if (cam->stream != STREAM_OFF) {
cam->state |= DEV_MISCONFIGURED;
DBG(1, "URB timeout reached. The camera is misconfigured. To "
"use it, close and open /dev/video%d again.",
if ((r = zc0301_read_reg(cam, 0x0008)) < 0)
err += r;
- err += zc0301_write_reg(cam, 0x0008,
- r | 0x11 | (compression->quality >> 1));
+ err += zc0301_write_reg(cam, 0x0008, r | 0x11 | compression->quality);
return err ? -EIO : 0;
}
static ssize_t
-zc0301_read(struct file* filp, char __user * buf,
- size_t count, loff_t* f_pos)
+zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_frame_t* f, * i;
memset(&i, 0, sizeof(i));
strcpy(i.name, "Camera");
+ i.type = V4L2_INPUT_TYPE_CAMERA;
if (copy_to_user(arg, &i, sizeof(i)))
return -EFAULT;
static int
-zc0301_vidioc_gs_input(struct zc0301_device* cam, void __user * arg)
+zc0301_vidioc_g_input(struct zc0301_device* cam, void __user * arg)
+{
+ int index = 0;
+
+ if (copy_to_user(arg, &index, sizeof(index)))
+ return -EFAULT;
+
+ return 0;
+}
+
+
+static int
+zc0301_vidioc_s_input(struct zc0301_device* cam, void __user * arg)
{
int index;
if (copy_from_user(&jc, arg, sizeof(jc)))
return -EFAULT;
- if (jc.quality < 0 || jc.quality > 3)
+ if (jc.quality != 0)
return -EINVAL;
if (cam->stream == STREAM_ON)
return zc0301_vidioc_enuminput(cam, arg);
case VIDIOC_G_INPUT:
+ return zc0301_vidioc_g_input(cam, arg);
+
case VIDIOC_S_INPUT:
- return zc0301_vidioc_gs_input(cam, arg);
+ return zc0301_vidioc_s_input(cam, arg);
case VIDIOC_QUERYCTRL:
return zc0301_vidioc_query_ctrl(cam, arg);
zc0301_stop_transfer(cam);
cam->state |= DEV_DISCONNECTED;
wake_up_interruptible(&cam->wait_frame);
- wake_up_interruptible(&cam->wait_stream);
+ wake_up(&cam->wait_stream);
} else {
cam->state |= DEV_DISCONNECTED;
zc0301_release_resources(cam);