public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support for OmniVision OV534 based USB cameras.
@ 2008-08-16  5:00 majortrips
  2008-08-16  6:58 ` Hans de Goede
  2008-08-16 11:36 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 29+ messages in thread
From: majortrips @ 2008-08-16  5:00 UTC (permalink / raw)
  To: video4linux-list

Adds suport for OmniVision OV534 based cameras:
 - Hercules Blog Webcam
 - Hercules Dualpix HD Webcam
 - Sony HD PS3 Eye (SLEH 00201)

Currently only supports 640x480 YUYV non-interlaced output.

Signed-off-by: Mark Ferrell <majortrips@gmail.com>
---
diff --git a/linux/Documentation/video4linux/ov534.txt b/linux/Documentation/video4linux/ov534.txt
new file mode 100644
--- /dev/null
+++ b/linux/Documentation/video4linux/ov534.txt
@@ -0,0 +1,30 @@
+OmniVision OV534 USB2.0 Camera driver.
+Written by Mark Ferrell <majortrips--a.t--gmail.com>
+
+The OV534 is the chipset used by the Hercules Blog Webcam and Hercules Dualpix
+HD Webcam.  A variation of this chip, the ov538, is used Sony's HD PS3 Eye
+(SLEH 00201).  There is currently no known public information about what is
+different between the ov534 and the ov538.
+
+The original code for initializating the camera and retrieving an image from it
+was written by Jim Paris on ps2dev.org and submitted under the GPL.  It is my
+understanding that Jim sniffed the USB traffic to see what the Playstation3 was
+sending to the camera to initialize it and to start/stop captures.
+
+The V4L interface of the driver was based on the vivi driver with the only
+functionality changes being the addition of USB support, the addition of Jim's
+control code, and a rewrite of the buffer fill code to pull directly from the
+camera.
+
+The ov534 outputs frames in YUYV format, non-interlaced, at 640x480. This
+format does not yet have wide support among user-land applications.  Though at
+the time of this writing xawtv was known to work correctly.
+
+Online information about the ov534 claims that it is capable of handling
+320x240 resolutions as well as supporting JPEG compression, but the commands to
+toggle the size and compression are currently unknown.
+
+If you use the camera with Xawtv you need to force the output resolution to
+640x480 with the geometry command. i.e. xawtv -geometry 640x480
+
+Good Luck
diff --git a/linux/drivers/media/video/Kconfig b/linux/drivers/media/video/Kconfig
--- a/linux/drivers/media/video/Kconfig
+++ b/linux/drivers/media/video/Kconfig
@@ -970,6 +970,17 @@ config USB_S2255
 	  Say Y here if you want support for the Sensoray 2255 USB device.
 	  This driver can be compiled as a module, called s2255drv.
 
+config USB_OV534
+	tristate "USB OV534 Camera support"
+	depends on VIDEO_V4L2
+	select VIDEOBUF_VMALLOC
+	default n
+	help
+	  Say Y here if you want support for OV534 based USB cameras.
+	  Hercules Blog Webcam, Hercules Dualpix HD Webcam, and the
+	  Sony HD Eye for PS3 (SLEH 00201).
+	  This driver can be compiled as a module, called ov534.
+
 endif # V4L_USB_DRIVERS
 
 endif # VIDEO_CAPTURE_DRIVERS
diff --git a/linux/drivers/media/video/Makefile b/linux/drivers/media/video/Makefile
--- a/linux/drivers/media/video/Makefile
+++ b/linux/drivers/media/video/Makefile
@@ -110,6 +110,7 @@ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
 
 obj-$(CONFIG_USB_DABUSB)        += dabusb.o
 obj-$(CONFIG_USB_OV511)         += ov511.o
+obj-$(CONFIG_USB_OV534)		+= ov534.o
 obj-$(CONFIG_USB_SE401)         += se401.o
 obj-$(CONFIG_USB_STV680)        += stv680.o
 obj-$(CONFIG_USB_W9968CF)       += w9968cf.o
diff --git a/linux/drivers/media/video/ov534.c b/linux/drivers/media/video/ov534.c
new file mode 100644
--- /dev/null
+++ b/linux/drivers/media/video/ov534.c
@@ -0,0 +1,1411 @@
+/*
+ * OmniVision OV534 USB Camera driver
+ *
+ * Cameras:
+ *	Hercules Blog Webcam
+ *	Hercules Dualpix HD Webcam
+ *	Sony HD Eye for PS3 (SLEH 00201)
+ *
+ * Copyright (c) 2008  Mark Ferrell <majortrips--a.t--gmail.com>
+ *
+ * Camera control based on eye.c by Jim Paris <jim--a.t--jtan.com>
+ *
+ * V4L2 code based on vivi.c, see original file for credits.
+ *	
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/usb.h>
+#include <linux/vmalloc.h>
+#include <linux/slab.h>
+#include <linux/proc_fs.h>
+#include <linux/highmem.h>
+#include <linux/videodev2.h>
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+/* Include V4L1 specific functions. Should be removed soon */
+#include <linux/videodev.h>
+#endif
+#include <media/videobuf-vmalloc.h>
+#include <media/v4l2-common.h>
+#include <media/v4l2-dev.h>
+#include <media/v4l2-ioctl.h>
+#include <linux/kthread.h>
+#include <linux/freezer.h>
+
+#define OV534_MODULE_NAME	"ov534"
+#define OV534_MODULE_DESC	"OmniVision OV534"
+#define OV534_AUTHOR		"Mark Ferrell"
+
+#define OV534_MAJOR_VERSION	0
+#define OV534_MINOR_VERSION	0
+#define OV534_RELEASE		5
+#define OV534_VERSION	KERNEL_VERSION(OV534_MAJOR_VERSION, OV534_MINOR_VERSION, OV534_RELEASE)
+
+#define OV534_REG_ADDRESS	0xf1   /* ? */
+#define OV534_REG_SUBADDR	0xf2
+#define OV534_REG_WRITE		0xf3
+#define OV534_REG_READ		0xf4
+#define OV534_REG_OPERATION	0xf5
+#define OV534_REG_STATUS	0xf6
+
+#define OV534_OP_WRITE_3	0x37
+#define OV534_OP_WRITE_2	0x33
+#define OV534_OP_READ_2		0xf9
+
+/* Wake up at about 30 fps */
+#define CTRL_TIMEOUT 500
+#define WAKE_NUMERATOR 30
+#define WAKE_DENOMINATOR 1001
+
+
+/* globals */
+static unsigned int vid_limit = 16;	/* Video memory limit, in Mb */
+static struct video_device ov534;	/* Video device */
+static int video_nr = -1;		/* /dev/videoN, -1 for autodetect */
+
+/* module params */
+module_param_named(debug, ov534.debug, int, 0644);
+MODULE_PARM_DESC(debug, "debug level [0-4]");
+
+/* supported controls */
+static struct v4l2_queryctrl ov534_qctrl[] = {
+	{
+		.id            = V4L2_CID_AUDIO_VOLUME,
+		.name          = "Volume",
+		.minimum       = 0,
+		.maximum       = 65535,
+		.step          = 65535/100,
+		.default_value = 65535,
+		.flags         = 0,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+	}, {
+		.id            = V4L2_CID_BRIGHTNESS,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+		.name          = "Brightness",
+		.minimum       = 0,
+		.maximum       = 255,
+		.step          = 1,
+		.default_value = 127,
+		.flags         = 0,
+	}, {
+		.id            = V4L2_CID_CONTRAST,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+		.name          = "Contrast",
+		.minimum       = 0,
+		.maximum       = 255,
+		.step          = 0x1,
+		.default_value = 0x10,
+		.flags         = 0,
+	}, {
+		.id            = V4L2_CID_SATURATION,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+		.name          = "Saturation",
+		.minimum       = 0,
+		.maximum       = 255,
+		.step          = 0x1,
+		.default_value = 127,
+		.flags         = 0,
+	}, {
+		.id            = V4L2_CID_HUE,
+		.type          = V4L2_CTRL_TYPE_INTEGER,
+		.name          = "Hue",
+		.minimum       = -128,
+		.maximum       = 127,
+		.step          = 0x1,
+		.default_value = 0,
+		.flags         = 0,
+	}
+};
+
+static int qctl_regs[ARRAY_SIZE(ov534_qctrl)];
+#define PDEBUG(level, fmt, args...) \
+	if (ov534.debug >= level) info("[%s:%d] " fmt, __PRETTY_FUNCTION__, __LINE__ , ## args)
+
+static struct usb_device_id device_table[] = {
+	{USB_DEVICE(0x06f8, 0x3002)},	/* Hercules Blog Webcam */
+	{USB_DEVICE(0x06f8, 0x3003)},	/* Hercules Dualpix HD Weblog */
+	{USB_DEVICE(0x1415, 0x2000)},	/* Sony HD Eye for PS3 (SLEH 00201) */
+	{}			/* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(usb, device_table);
+
+struct ov534_fmt {
+	char		*name;
+	u32		fourcc;
+	int		depth;
+	enum v4l2_field field;
+};
+
+static struct ov534_fmt format[] = {
+	{ .name		= "4:2:2, packed, YUYV",
+	  .fourcc	= V4L2_PIX_FMT_YUYV,
+	  .depth	= 16,
+	  .field	= V4L2_FIELD_NONE,
+	},
+};
+
+struct ov534_buffer {
+	struct videobuf_buffer	vb;
+	struct ov534_fmt	*fmt;
+};
+
+struct ov534_dmaqueue {
+	struct list_head	active;
+
+	/* thread for generating video stream*/
+	struct task_struct	*kthread;
+	wait_queue_head_t	wq;
+	/* Counters to control fps rate */
+	int			frame;
+	int			ini_jiffies;
+};
+
+static LIST_HEAD(ov534_devlist);
+
+struct ov534_dev {
+	struct list_head	ov534_devlist;
+
+	spinlock_t		slock;
+	struct mutex		mutex;
+
+	int			users;
+
+	/* various device info */
+	struct video_device	*vfd;
+	struct usb_device	*udev;
+	struct usb_interface	*interface;
+	struct ov534_dmaqueue	vidq;
+
+	/* Several counters */
+	int			h, m, s, ms;
+	unsigned long		jiffies;
+	char			timestr[13];
+
+};
+
+struct ov534_fh {
+	struct ov534_dev	*dev;
+
+	/* video capture */
+	struct ov534_fmt	*fmt;
+	unsigned int		width, height;
+	struct videobuf_queue	vb_vidq;
+
+	enum v4l2_buf_type	type;
+};
+
+
+/* ------------------------------------------------------------------
+	Camera operations
+   ------------------------------------------------------------------*/
+
+static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val)
+{
+	u16 data = val;
+	int ret;
+
+	PDEBUG(2, "reg=0x%04x, val=0%04x", reg, val);
+	ret = usb_control_msg(udev,
+			      usb_sndctrlpipe(udev, 0),
+			      0x1,
+			      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+			      0x0, reg, &data, 1, CTRL_TIMEOUT);
+	if (ret < 0)
+		PDEBUG(1, "write failed");
+}
+
+static u16 ov534_reg_read(struct usb_device *udev, u16 reg)
+{
+	u16 data;
+	int ret;
+
+	ret = usb_control_msg(udev,
+			      usb_rcvctrlpipe(udev, 0),
+			      0x1,
+			      USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+			      0x0, reg, &data, 1, CTRL_TIMEOUT);
+	PDEBUG(2, "reg=0x%04x, data=0x%04x", reg, data);
+	if (ret < 0)
+		PDEBUG(1, "read failed");
+	return data;
+}
+
+static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val)
+{
+	u16 data;
+
+	ov534_reg_write(udev, reg, val);
+	data = ov534_reg_read(udev, reg);
+	if (data != val) {
+		PDEBUG(1, "unexpected result from read: 0x%04x != 0x%04x",
+		       val, data);
+	}
+}
+
+/* Two bits control LED: 0x21 bit 7 and 0x23 bit 7. 
+ * (direction and output)? */
+static void ov534_set_led(struct usb_device *udev, int status)
+{
+	u16 data;
+
+	PDEBUG(2, "led status: %d", status);
+
+	data = ov534_reg_read(udev, 0x21);
+	data |= 0x80;
+	ov534_reg_write(udev, 0x21, data);
+
+	data = ov534_reg_read(udev, 0x23);
+	if (status) {
+		data |=  0x80;
+	} else  {
+		data &= ~(0x80);
+	}
+	ov534_reg_write(udev, 0x23, data);
+}
+
+static int sccb_check_status(struct usb_device *udev)
+{
+	u16 data;
+	int i;
+
+	for (i = 0; i < 5; i++) {
+		data = ov534_reg_read(udev, OV534_REG_STATUS);
+		switch (data & 0xFF) {
+			case 0x00: return 1;
+			case 0x04: return 0;
+			case 0x03: break;
+			default:
+				PDEBUG(1, "sccb status 0x%02x, attempt %d/5\n",
+			       		data, i+1);
+		}
+	}
+	return 0;
+}
+
+static void sccb_reg_write(struct usb_device *udev, u16 reg, u16 val)
+{
+	PDEBUG(2, "reg: 0x%04x, val: 0x%04x", reg, val);
+	ov534_reg_write(udev, OV534_REG_SUBADDR, reg);
+	ov534_reg_write(udev, OV534_REG_WRITE, val);
+	ov534_reg_write(udev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
+
+	if (!sccb_check_status(udev)) {
+		PDEBUG(1, "sccb_reg_write failed");
+	}
+}
+
+static void ov534_setup(struct usb_device *udev)
+{
+	ov534_reg_verify_write(udev, 0xe7, 0x3a);
+
+	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
+	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
+	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
+	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x42);
+
+	ov534_reg_verify_write(udev, 0xc2,0x0c);
+	ov534_reg_verify_write(udev, 0x88,0xf8);
+	ov534_reg_verify_write(udev, 0xc3,0x69);
+	ov534_reg_verify_write(udev, 0x89,0xff);
+	ov534_reg_verify_write(udev, 0x76,0x03);
+	ov534_reg_verify_write(udev, 0x92,0x01);
+	ov534_reg_verify_write(udev, 0x93,0x18);
+	ov534_reg_verify_write(udev, 0x94,0x10);
+	ov534_reg_verify_write(udev, 0x95,0x10);
+	ov534_reg_verify_write(udev, 0xe2,0x00);
+	ov534_reg_verify_write(udev, 0xe7,0x3e);
+
+	ov534_reg_write(udev, 0x1c,0x0a);
+	ov534_reg_write(udev, 0x1d,0x22);
+	ov534_reg_write(udev, 0x1d,0x06);
+
+	ov534_reg_verify_write(udev, 0x96,0x00);
+
+	ov534_reg_write(udev, 0x97,0x20);
+	ov534_reg_write(udev, 0x97,0x20);
+	ov534_reg_write(udev, 0x97,0x20);
+	ov534_reg_write(udev, 0x97,0x0a);
+	ov534_reg_write(udev, 0x97,0x3f);
+	ov534_reg_write(udev, 0x97,0x4a);
+	ov534_reg_write(udev, 0x97,0x20);
+	ov534_reg_write(udev, 0x97,0x15);
+	ov534_reg_write(udev, 0x97,0x0b);
+
+	ov534_reg_verify_write(udev, 0x8e,0x40);
+	ov534_reg_verify_write(udev, 0x1f,0x81);
+	ov534_reg_verify_write(udev, 0x34,0x05);
+	ov534_reg_verify_write(udev, 0xe3,0x04);
+	ov534_reg_verify_write(udev, 0x88,0x00);
+	ov534_reg_verify_write(udev, 0x89,0x00);
+	ov534_reg_verify_write(udev, 0x76,0x00);
+	ov534_reg_verify_write(udev, 0xe7,0x2e);
+	ov534_reg_verify_write(udev, 0x31,0xf9);
+	ov534_reg_verify_write(udev, 0x25,0x42);
+	ov534_reg_verify_write(udev, 0x21,0xf0);
+
+	ov534_reg_write(udev, 0x1c,0x00);
+	ov534_reg_write(udev, 0x1d,0x40);
+	ov534_reg_write(udev, 0x1d,0x02);
+	ov534_reg_write(udev, 0x1d,0x00);
+	ov534_reg_write(udev, 0x1d,0x02);
+	ov534_reg_write(udev, 0x1d,0x57);
+	ov534_reg_write(udev, 0x1d,0xff);
+
+	ov534_reg_verify_write(udev, 0x8d,0x1c);
+	ov534_reg_verify_write(udev, 0x8e,0x80);
+	ov534_reg_verify_write(udev, 0xe5,0x04);
+
+	ov534_set_led(udev, 1);
+
+	sccb_reg_write(udev, 0x12,0x80);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x11,0x01);
+
+	ov534_set_led(udev, 0);
+
+	sccb_reg_write(udev, 0x3d,0x03);
+	sccb_reg_write(udev, 0x17,0x26);
+	sccb_reg_write(udev, 0x18,0xa0);
+	sccb_reg_write(udev, 0x19,0x07);
+	sccb_reg_write(udev, 0x1a,0xf0);
+	sccb_reg_write(udev, 0x32,0x00);
+	sccb_reg_write(udev, 0x29,0xa0);
+	sccb_reg_write(udev, 0x2c,0xf0);
+	sccb_reg_write(udev, 0x65,0x20);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x42,0x7f);
+	sccb_reg_write(udev, 0x63,0xe0);
+	sccb_reg_write(udev, 0x64,0xff);
+	sccb_reg_write(udev, 0x66,0x00);
+	sccb_reg_write(udev, 0x13,0xf0);
+	sccb_reg_write(udev, 0x0d,0x41);
+	sccb_reg_write(udev, 0x0f,0xc5);
+	sccb_reg_write(udev, 0x14,0x11);
+
+	ov534_set_led(udev, 1);
+
+	sccb_reg_write(udev, 0x22,0x7f);
+	sccb_reg_write(udev, 0x23,0x03);
+	sccb_reg_write(udev, 0x24,0x40);
+	sccb_reg_write(udev, 0x25,0x30);
+	sccb_reg_write(udev, 0x26,0xa1);
+	sccb_reg_write(udev, 0x2a,0x00);
+	sccb_reg_write(udev, 0x2b,0x00);
+	sccb_reg_write(udev, 0x6b,0xaa);
+	sccb_reg_write(udev, 0x13,0xff);
+
+	ov534_set_led(udev, 0);
+
+	sccb_reg_write(udev, 0x90,0x05);
+	sccb_reg_write(udev, 0x91,0x01);
+	sccb_reg_write(udev, 0x92,0x03);
+	sccb_reg_write(udev, 0x93,0x00);
+	sccb_reg_write(udev, 0x94,0x60);
+	sccb_reg_write(udev, 0x95,0x3c);
+	sccb_reg_write(udev, 0x96,0x24);
+	sccb_reg_write(udev, 0x97,0x1e);
+	sccb_reg_write(udev, 0x98,0x62);
+	sccb_reg_write(udev, 0x99,0x80);
+	sccb_reg_write(udev, 0x9a,0x1e);
+	sccb_reg_write(udev, 0x9b,0x08);
+	sccb_reg_write(udev, 0x9c,0x20);
+	sccb_reg_write(udev, 0x9e,0x81);
+
+	ov534_set_led(udev, 1);
+
+	sccb_reg_write(udev, 0xa6,0x04);
+	sccb_reg_write(udev, 0x7e,0x0c);
+	sccb_reg_write(udev, 0x7f,0x16);
+	sccb_reg_write(udev, 0x80,0x2a);
+	sccb_reg_write(udev, 0x81,0x4e);
+	sccb_reg_write(udev, 0x82,0x61);
+	sccb_reg_write(udev, 0x83,0x6f);
+	sccb_reg_write(udev, 0x84,0x7b);
+	sccb_reg_write(udev, 0x85,0x86);
+	sccb_reg_write(udev, 0x86,0x8e);
+	sccb_reg_write(udev, 0x87,0x97);
+	sccb_reg_write(udev, 0x88,0xa4);
+	sccb_reg_write(udev, 0x89,0xaf);
+	sccb_reg_write(udev, 0x8a,0xc5);
+	sccb_reg_write(udev, 0x8b,0xd7);
+	sccb_reg_write(udev, 0x8c,0xe8);
+	sccb_reg_write(udev, 0x8d,0x20);
+
+	sccb_reg_write(udev, 0x0c,0x90);
+
+
+	ov534_reg_verify_write(udev, 0xc0,0x50);
+	ov534_reg_verify_write(udev, 0xc1,0x3c);
+	ov534_reg_verify_write(udev, 0xc2,0x0c);
+
+	ov534_set_led(udev, 1);
+
+	sccb_reg_write(udev, 0x2b,0x00);
+	sccb_reg_write(udev, 0x22,0x7f);
+	sccb_reg_write(udev, 0x23,0x03);
+	sccb_reg_write(udev, 0x11,0x01);
+	sccb_reg_write(udev, 0x0c,0xd0);
+	sccb_reg_write(udev, 0x64,0xff);
+	sccb_reg_write(udev, 0x0d,0x41);
+
+	sccb_reg_write(udev, 0x14,0x41);
+	sccb_reg_write(udev, 0x0e,0xcd);
+	sccb_reg_write(udev, 0xac,0xbf);
+	sccb_reg_write(udev, 0x8e,0x00);
+	sccb_reg_write(udev, 0x0c,0xd0);
+
+	ov534_reg_write(udev, 0xe0,0x09);
+	ov534_set_led(udev, 0);
+}
+
+
+/* ------------------------------------------------------------------
+	DMA and thread functions
+   ------------------------------------------------------------------*/
+
+static void ov534_fillbuff(struct ov534_dev *dev, struct ov534_buffer *buf)
+{
+	int size  = ((buf->vb.height * buf->vb.width * 16) >> 3) - 4;
+	struct timeval ts;
+	unsigned char *tmpbuf;
+	void *vbuf = videobuf_to_vmalloc(&buf->vb);
+	int ret, len;
+
+	if (!vbuf)
+		return;
+
+	tmpbuf = kmalloc(size + 4, GFP_ATOMIC);
+	if (!tmpbuf)
+		return;
+
+	PDEBUG(2, "reading frame, size=%d", size);
+	ov534_reg_write(dev->udev, 0xe0, 0x00);
+	ret = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, 0x1),
+			   tmpbuf, size, &len, CTRL_TIMEOUT);
+	ov534_reg_write(dev->udev, 0xe0, 0x09);
+	if (ret < 0) {
+		PDEBUG(1, "error reading bulk msg (%d)", ret);
+	} else {
+		PDEBUG(2, "read=%d, expected=%d", len, size);
+	}
+
+	memcpy(vbuf, tmpbuf, size);
+
+	kfree(tmpbuf);
+
+	/* Updates stream time */
+
+	dev->ms += jiffies_to_msecs(jiffies-dev->jiffies);
+	dev->jiffies = jiffies;
+	if (dev->ms >= 1000) {
+		dev->ms -= 1000;
+		dev->s++;
+		if (dev->s >= 60) {
+			dev->s -= 60;
+			dev->m++;
+			if (dev->m > 60) {
+				dev->m -= 60;
+				dev->h++;
+				if (dev->h > 24)
+					dev->h -= 24;
+			}
+		}
+	}
+	sprintf(dev->timestr, "%02d:%02d:%02d:%03d",
+			dev->h, dev->m, dev->s, dev->ms);
+
+	PDEBUG(2, "ov534 fill at %s: Buffer 0x%08lx size=%d",
+			dev->timestr, (unsigned long)tmpbuf, size);
+
+	/* Advice that buffer was filled */
+	buf->vb.field_count++;
+	do_gettimeofday(&ts);
+	buf->vb.ts = ts;
+	buf->vb.state = VIDEOBUF_DONE;
+}
+
+
+static void ov534_thread_tick(struct ov534_fh *fh)
+{
+	struct ov534_buffer *buf;
+	struct ov534_dev *dev = fh->dev;
+	struct ov534_dmaqueue *dma_q = &dev->vidq;
+
+	unsigned long flags = 0;
+
+	PDEBUG(3, "Thread tick");
+
+	spin_lock_irqsave(&dev->slock, flags);
+	if (list_empty(&dma_q->active)) {
+		PDEBUG(1, "No active queue to serve");
+		goto unlock;
+	}
+
+	buf = list_entry(dma_q->active.next,
+			 struct ov534_buffer, vb.queue);
+
+	/* Nobody is waiting on this buffer, return */
+	if (!waitqueue_active(&buf->vb.done))
+		goto unlock;
+
+	list_del(&buf->vb.queue);
+
+	do_gettimeofday(&buf->vb.ts);
+
+	/* Fill buffer */
+	ov534_fillbuff(dev, buf);
+	PDEBUG(2, "filled buffer %p", buf);
+
+	wake_up(&buf->vb.done);
+	PDEBUG(2, "[%p/%d] wakeup", buf, buf->vb. i);
+unlock:
+	spin_unlock_irqrestore(&dev->slock, flags);
+	return;
+}
+
+#define frames_to_ms(frames)					\
+	((frames * WAKE_NUMERATOR * 1000) / WAKE_DENOMINATOR)
+
+static void ov534_sleep(struct ov534_fh *fh)
+{
+	struct ov534_dev *dev = fh->dev;
+	struct ov534_dmaqueue *dma_q = &dev->vidq;
+	int timeout;
+	DECLARE_WAITQUEUE(wait, current);
+
+	PDEBUG(2, "dma_q=0x%08lx\n", (unsigned long)dma_q);
+
+	add_wait_queue(&dma_q->wq, &wait);
+	if (kthread_should_stop())
+		goto stop_task;
+
+	/* Calculate time to wake up */
+	timeout = msecs_to_jiffies(frames_to_ms(1));
+
+	ov534_thread_tick(fh);
+
+	schedule_timeout_interruptible(timeout);
+
+stop_task:
+	remove_wait_queue(&dma_q->wq, &wait);
+	try_to_freeze();
+}
+
+static int ov534_thread(void *data)
+{
+	struct ov534_fh  *fh = data;
+
+	PDEBUG(3, "thread started\n");
+
+	set_freezable();
+
+	for (;;) {
+		ov534_sleep(fh);
+
+		if (kthread_should_stop())
+			break;
+	}
+	PDEBUG(3, "thread: exit\n");
+	return 0;
+}
+
+static int ov534_start_thread(struct ov534_fh *fh)
+{
+	struct ov534_dev *dev = fh->dev;
+	struct ov534_dmaqueue *dma_q = &dev->vidq;
+
+	dma_q->frame = 0;
+	dma_q->ini_jiffies = jiffies;
+
+	PDEBUG(3, "begin");
+
+	dma_q->kthread = kthread_run(ov534_thread, fh, "ov534");
+
+	if (IS_ERR(dma_q->kthread)) {
+		printk(KERN_ERR "ov534: kernel_thread() failed\n");
+		return PTR_ERR(dma_q->kthread);
+	}
+	/* Wakes thread */
+	wake_up_interruptible(&dma_q->wq);
+
+	PDEBUG(3, "end");
+	return 0;
+}
+
+static void ov534_stop_thread(struct ov534_dmaqueue  *dma_q)
+{
+	PDEBUG(3, "begin");
+	/* shutdown control thread */
+	if (dma_q->kthread) {
+		kthread_stop(dma_q->kthread);
+		dma_q->kthread = NULL;
+	}
+	PDEBUG(3, "end");
+}
+
+/* ------------------------------------------------------------------
+	Videobuf operations
+   ------------------------------------------------------------------*/
+
+static int buffer_setup(struct videobuf_queue *vq, unsigned int *count,
+			unsigned int *size)
+{
+	struct ov534_fh *fh = vq->priv_data;
+
+	*size = (fh->height * fh->width * fh->fmt->depth) >> 3;
+
+	if (*count == 0)
+		*count = 32;
+
+	while (*size * *count > vid_limit * 1024 * 1024)
+		(*count)--;
+
+	PDEBUG(2, "count=%d, size=%d", *count, *size);
+
+	return 0;
+}
+
+static void free_buffer(struct videobuf_queue *vq, struct ov534_buffer *buf)
+{
+	PDEBUG(3, "begin");
+	PDEBUG(2, "state=%i", buf->vb.state);
+
+	if (in_interrupt())
+		BUG();
+
+	videobuf_vmalloc_free(&buf->vb);
+	PDEBUG(2, "freed");
+	buf->vb.state = VIDEOBUF_NEEDS_INIT;
+
+	PDEBUG(3, "end");
+}
+
+static int buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
+				enum v4l2_field field)
+{
+	struct ov534_fh     *fh  = vq->priv_data;
+	struct ov534_buffer *buf = container_of(vb,struct ov534_buffer,vb);
+	int rc, init_buffer = 0;
+
+	PDEBUG(2, "field=%d", field);
+	BUG_ON(NULL == fh->fmt);
+
+	if (fh->width != 640 || fh->height != 480)
+		return -EINVAL;
+	buf->vb.size = (fh->height * fh->width * fh->fmt->depth) >> 3;
+
+	if (0 != buf->vb.baddr  &&  buf->vb.bsize < buf->vb.size)
+		return -EINVAL;
+
+	if (buf->fmt       != fh->fmt    ||
+	    buf->vb.width  != fh->width  ||
+	    buf->vb.height != fh->height ||
+	buf->vb.field  != field) {
+		buf->fmt       = fh->fmt;
+		buf->vb.width  = fh->width;
+		buf->vb.height = fh->height;
+		buf->vb.field  = field;
+		init_buffer = 1;
+	}
+
+	if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
+		rc = videobuf_iolock(vq, &buf->vb, NULL);
+		if (rc < 0)
+			goto fail;
+	}
+
+	buf->vb.state = VIDEOBUF_PREPARED;
+
+	return 0;
+
+fail:
+	free_buffer(vq, buf);
+	return rc;
+}
+
+static void
+buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
+{
+	struct ov534_buffer *buf = container_of(vb,struct ov534_buffer,vb);
+	struct ov534_fh *fh = vq->priv_data;
+	struct ov534_dev *dev = fh->dev;
+	struct ov534_dmaqueue *vidq = &dev->vidq;
+
+	PDEBUG(3, "begin");
+
+	buf->vb.state = VIDEOBUF_QUEUED;
+	list_add_tail(&buf->vb.queue, &vidq->active);
+
+	PDEBUG(3, "end");
+}
+
+static void buffer_release(struct videobuf_queue *vq,
+				struct videobuf_buffer *vb)
+{
+	struct ov534_buffer   *buf  = container_of(vb,struct ov534_buffer,vb);
+
+	PDEBUG(3, "begin");
+	free_buffer(vq, buf);
+	PDEBUG(3, "end");
+}
+
+static struct videobuf_queue_ops ov534_video_qops = {
+	.buf_setup      = buffer_setup,
+	.buf_prepare    = buffer_prepare,
+	.buf_queue      = buffer_queue,
+	.buf_release    = buffer_release,
+};
+
+
+/* ------------------------------------------------------------------
+	IOCTL vidioc handling
+   ------------------------------------------------------------------*/
+
+static int vidioc_querycap(struct file *file, void *priv,
+				struct v4l2_capability *cap)
+{
+	strcpy(cap->driver, OV534_MODULE_NAME);
+	cap->version = OV534_VERSION;
+	cap->capabilities =	V4L2_CAP_VIDEO_CAPTURE	|
+				V4L2_CAP_STREAMING	|
+				V4L2_CAP_READWRITE;
+	return 0;
+}
+
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
+					struct v4l2_fmtdesc *f)
+{
+	if (f->index >= (sizeof(format) / sizeof(struct ov534_fmt)))
+		return -EINVAL;
+
+	strlcpy(f->description,format[f->index].name,sizeof(f->description));
+	f->pixelformat = format[f->index].fourcc;
+	return 0;
+}
+
+static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
+					struct v4l2_format *f)
+{
+	struct ov534_fh	*fh = priv;
+
+	f->fmt.pix.width	= fh->width;
+	f->fmt.pix.height	= fh->height;
+	f->fmt.pix.field	= fh->vb_vidq.field;
+	f->fmt.pix.pixelformat	= fh->fmt->fourcc;
+	f->fmt.pix.bytesperline =
+		(f->fmt.pix.width * fh->fmt->depth) >> 3;
+	f->fmt.pix.sizeimage	=
+		f->fmt.pix.height * f->fmt.pix.bytesperline;
+
+	return 0;
+}
+
+static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
+					struct v4l2_format *f)
+{
+	struct ov534_fmt *fmt = NULL;
+	int len = sizeof(format) / sizeof(struct ov534_fmt);
+	int i = 0;
+
+	for (i = 0; i < len; i++) {
+		if (format[i].fourcc == f->fmt.pix.pixelformat)
+			fmt = &format[i];
+	}
+
+	if (fmt == NULL) {
+		PDEBUG(2, "Fourcc format (0x%08x) invalid",
+		       f->fmt.pix.pixelformat);
+		return -EINVAL;
+	}
+
+	if (f->fmt.pix.field != fmt->field &&
+	    f->fmt.pix.field != V4L2_FIELD_ANY) {
+		PDEBUG(1,"Field type invalid.");
+		return -EINVAL;
+	}
+
+	f->fmt.pix.pixelformat = fmt->fourcc;
+	f->fmt.pix.field = fmt->field;
+	f->fmt.pix.width = 640;
+	f->fmt.pix.height = 480;
+	f->fmt.pix.bytesperline =
+		(f->fmt.pix.width * fmt->depth) >> 3;
+	f->fmt.pix.sizeimage =
+		f->fmt.pix.height * f->fmt.pix.bytesperline;
+
+	return 0;
+}
+
+static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
+					struct v4l2_format *f)
+{
+	struct ov534_fh		*fh = priv;
+	struct videobuf_queue *q = &fh->vb_vidq;
+	int len = sizeof(format) / sizeof(struct ov534_fmt);
+	int i = 0;
+
+	int ret = vidioc_try_fmt_vid_cap(file, fh, f);
+	if (ret < 0)
+		return (ret);
+
+	mutex_lock(&q->vb_lock);
+
+	if (videobuf_queue_is_busy(&fh->vb_vidq)) {
+		PDEBUG(1, "queue busy");
+		ret = -EBUSY;
+		goto out;
+	}
+
+	for (i = 0; i < len; i++) {
+		if (format[i].fourcc == f->fmt.pix.pixelformat)
+			fh->fmt = &format[i];
+	}
+
+	fh->width		= f->fmt.pix.width;
+	fh->height		= f->fmt.pix.height;
+	fh->vb_vidq.field	= f->fmt.pix.field;
+	fh->type		= f->type;
+
+	ret = 0;
+out:
+	mutex_unlock(&q->vb_lock);
+
+	return (ret);
+}
+
+static int vidioc_reqbufs(struct file *file, void *priv,
+				struct v4l2_requestbuffers *p)
+{
+	struct ov534_fh  *fh = priv;
+
+	return (videobuf_reqbufs(&fh->vb_vidq, p));
+}
+
+static int vidioc_querybuf(struct file *file, void *priv,
+				struct v4l2_buffer *p)
+{
+	struct ov534_fh  *fh = priv;
+
+	return (videobuf_querybuf(&fh->vb_vidq, p));
+}
+
+static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+	struct ov534_fh  *fh = priv;
+
+	return (videobuf_qbuf(&fh->vb_vidq, p));
+}
+
+static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+	struct ov534_fh  *fh = priv;
+
+	return (videobuf_dqbuf(&fh->vb_vidq, p,
+				file->f_flags & O_NONBLOCK));
+}
+
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
+{
+	struct ov534_fh  *fh = priv;
+
+	return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
+}
+#endif
+
+static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
+{
+	struct video_device *vdf = video_devdata(file);
+	struct ov534_dev *dev;
+	struct ov534_fh  *fh = priv;
+
+	if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+	if (i != fh->type)
+		return -EINVAL;
+
+	if (vdf == NULL)
+		return -ENODEV;
+	dev = video_get_drvdata(vdf);
+
+	ov534_set_led(dev->udev, 1);
+
+	return videobuf_streamon(&fh->vb_vidq);
+}
+
+static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
+{
+	struct video_device *vdf = video_devdata(file);
+	struct ov534_dev *dev;
+	struct ov534_fh  *fh = priv;
+
+	if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+	if (i != fh->type)
+		return -EINVAL;
+
+	if (vdf == NULL)
+		return -ENODEV;
+	dev = video_get_drvdata(vdf);
+
+	ov534_set_led(dev->udev, 0);
+
+	return videobuf_streamoff(&fh->vb_vidq);
+}
+
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
+{
+	return 0;
+}
+
+/* only one input */
+static int vidioc_enum_input(struct file *file, void *priv,
+				struct v4l2_input *inp)
+{
+	if (inp->index != 0)
+		return -EINVAL;
+
+	inp->type = V4L2_INPUT_TYPE_CAMERA;
+	inp->std = V4L2_STD_525_60;
+	strcpy(inp->name, "Camera");
+
+	return (0);
+}
+
+static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
+{
+	*i = 0;
+
+	return (0);
+}
+
+static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
+{
+	if (i > 0)
+		return -EINVAL;
+
+	return (0);
+}
+
+static int vidioc_queryctrl(struct file *file, void *priv,
+				struct v4l2_queryctrl *qc)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ov534_qctrl); i++)
+		if (qc->id && qc->id == ov534_qctrl[i].id) {
+			memcpy(qc, &(ov534_qctrl[i]),
+				sizeof(*qc));
+			return (0);
+		}
+
+	return -EINVAL;
+}
+
+static int vidioc_g_ctrl(struct file *file, void *priv,
+				struct v4l2_control *ctrl)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ov534_qctrl); i++)
+		if (ctrl->id == ov534_qctrl[i].id) {
+			ctrl->value = qctl_regs[i];
+			return (0);
+		}
+
+	return -EINVAL;
+}
+
+static int vidioc_s_ctrl(struct file *file, void *priv,
+				struct v4l2_control *ctrl)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ov534_qctrl); i++)
+		if (ctrl->id == ov534_qctrl[i].id) {
+			if (ctrl->value <
+				ov534_qctrl[i].minimum
+				|| ctrl->value >
+				ov534_qctrl[i].maximum) {
+					return (-ERANGE);
+				}
+			qctl_regs[i] = ctrl->value;
+			return (0);
+		}
+	return -EINVAL;
+}
+
+static const struct v4l2_ioctl_ops ov534_ioctl_ops = {
+	.vidioc_querycap	= vidioc_querycap,
+	.vidioc_enum_fmt_vid_cap	= vidioc_enum_fmt_vid_cap,
+	.vidioc_g_fmt_vid_cap		= vidioc_g_fmt_vid_cap,
+	.vidioc_try_fmt_vid_cap		= vidioc_try_fmt_vid_cap,
+	.vidioc_s_fmt_vid_cap		= vidioc_s_fmt_vid_cap,
+	.vidioc_reqbufs		= vidioc_reqbufs,
+	.vidioc_querybuf	= vidioc_querybuf,
+	.vidioc_qbuf		= vidioc_qbuf,
+	.vidioc_dqbuf		= vidioc_dqbuf,
+	.vidioc_s_std		= vidioc_s_std,
+	.vidioc_enum_input	= vidioc_enum_input,
+	.vidioc_g_input		= vidioc_g_input,
+	.vidioc_s_input		= vidioc_s_input,
+	.vidioc_queryctrl	= vidioc_queryctrl,
+	.vidioc_g_ctrl		= vidioc_g_ctrl,
+	.vidioc_s_ctrl		= vidioc_s_ctrl,
+	.vidioc_streamon	= vidioc_streamon,
+	.vidioc_streamoff	= vidioc_streamoff,
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+	.vidiocgmbuf		= vidiocgmbuf,
+#endif
+};
+
+
+/* ------------------------------------------------------------------
+	File operations for the device
+   ------------------------------------------------------------------*/
+
+static int ov534_open(struct inode *inode, struct file *file)
+{
+	int minor = iminor(inode);
+	struct ov534_dev *dev;
+	struct ov534_fh *fh = NULL;
+	int i;
+	int retval = 0;
+
+	printk(KERN_DEBUG "ov534: open called (minor=%d)\n", minor);
+
+	lock_kernel();
+	list_for_each_entry(dev, &ov534_devlist, ov534_devlist)
+		if (dev->vfd->minor == minor)
+			goto found;
+	unlock_kernel();
+	return -ENODEV;
+
+found:
+	mutex_lock(&dev->mutex);
+	dev->users++;
+
+	if (dev->users > 1) {
+		dev->users--;
+		retval = -EBUSY;
+		goto unlock;
+	}
+
+	PDEBUG(2, "open minor=%d type=%s users=%d\n", minor,
+		v4l2_type_names[V4L2_BUF_TYPE_VIDEO_CAPTURE], dev->users);
+
+	/* allocate + initialize per filehandle data */
+	fh = kzalloc(sizeof(*fh), GFP_KERNEL);
+	if (NULL == fh) {
+		dev->users--;
+		retval = -ENOMEM;
+		goto unlock;
+	}
+unlock:
+	mutex_unlock(&dev->mutex);
+	if (retval) {
+		unlock_kernel();
+		return retval;
+	}
+
+	file->private_data = fh;
+	fh->dev      = dev;
+
+	fh->type     = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+	fh->fmt      = &format[0];
+	fh->width    = 640;
+	fh->height   = 480;
+
+	/* Put all controls at a sane state */
+	for (i = 0; i < ARRAY_SIZE(ov534_qctrl); i++)
+		qctl_regs[i] = ov534_qctrl[i].default_value;
+
+	/* Resets frame counters */
+	dev->h = 0;
+	dev->m = 0;
+	dev->s = 0;
+	dev->ms = 0;
+	dev->jiffies = jiffies;
+
+	sprintf(dev->timestr,"%02d:%02d:%02d:%03d",
+			dev->h, dev->m, dev->s, dev->ms);
+
+	videobuf_queue_vmalloc_init(&fh->vb_vidq, &ov534_video_qops,
+			NULL, &dev->slock, fh->type, fh->fmt->field,
+			sizeof(struct ov534_buffer), fh);
+
+	ov534_start_thread(fh);
+	unlock_kernel();
+
+	return 0;
+}
+
+static ssize_t
+ov534_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
+{
+	struct ov534_fh        *fh = file->private_data;
+
+	if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+		return videobuf_read_stream(&fh->vb_vidq, data, count, ppos, 0,
+					file->f_flags & O_NONBLOCK);
+	}
+	return 0;
+}
+
+static unsigned int
+ov534_poll(struct file *file, struct poll_table_struct *wait)
+{
+	struct ov534_fh        *fh = file->private_data;
+	struct videobuf_queue *q = &fh->vb_vidq;
+
+	if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
+		return POLLERR;
+
+	return videobuf_poll_stream(file, q, wait);
+}
+
+static int ov534_close(struct inode *inode, struct file *file)
+{
+	struct ov534_fh         *fh = file->private_data;
+	struct ov534_dev *dev       = fh->dev;
+	struct ov534_dmaqueue *vidq = &dev->vidq;
+
+	int minor = iminor(inode);
+
+	ov534_stop_thread(vidq);
+	videobuf_stop(&fh->vb_vidq);
+	videobuf_mmap_free(&fh->vb_vidq);
+
+	kfree(fh);
+
+	mutex_lock(&dev->mutex);
+	dev->users--;
+	mutex_unlock(&dev->mutex);
+
+	PDEBUG(2, "ov534: close called (minor=%d, users=%d)", minor,dev->users);
+
+	return 0;
+}
+
+static int ov534_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	struct ov534_fh        *fh = file->private_data;
+	int ret;
+
+	PDEBUG (2, "mmap called, vma=0x%08lx\n", (unsigned long)vma);
+
+	ret = videobuf_mmap_mapper(&fh->vb_vidq, vma);
+
+	PDEBUG (2, "vma start=0x%08lx, size=%ld, ret=%d\n",
+		(unsigned long)vma->vm_start,
+		(unsigned long)vma->vm_end-(unsigned long)vma->vm_start,
+		ret);
+
+	return ret;
+}
+
+static struct file_operations ov534_fops = {
+	.owner		= THIS_MODULE,
+	.open		= ov534_open,
+	.release	= ov534_close,
+	.read		= ov534_read,
+	.poll		= ov534_poll,
+	.mmap		= ov534_mmap,
+	.ioctl		= video_ioctl2,
+	.compat_ioctl	= v4l_compat_ioctl32,
+	.llseek		= no_llseek,
+};
+
+
+static struct video_device ov534_template = {
+	.name		= OV534_MODULE_NAME,
+	.fops		= &ov534_fops,
+	.ioctl_ops 	= &ov534_ioctl_ops,
+	.minor		= -1,
+	.release	= video_device_release,
+
+	.tvnorms		= V4L2_STD_525_60,
+	.current_norm		= V4L2_STD_NTSC_M,
+};
+
+
+/*******************/
+/* USB integration */
+/*******************/
+
+static int ov534_probe(struct usb_interface *intf,
+			 const struct usb_device_id *id)
+{
+	struct usb_device *udev = interface_to_usbdev(intf);
+	struct ov534_dev *dev;
+	char *desc;
+	int err;
+
+	info(OV534_MODULE_DESC " compatible webcam detected");
+
+	switch (udev->descriptor.idVendor) {
+	case 0x06f8:
+		switch (udev->descriptor.idProduct) {
+		case 0x3002:
+			desc = "Hercules Blog Webcam";
+			break;
+		case 0x3003:
+			desc = "Hercules Dualpix HD Webcam";
+			break;
+		default:
+			return -ENODEV;
+		}
+		break;
+	case 0x1415:
+		switch (udev->descriptor.idProduct) {
+		case 0x2000:
+			desc = "Sony HD Eye for PS3 (SLEH 00201)";
+			break;
+		default:
+			return -ENODEV;
+		}
+		break;
+	default:
+		return -ENODEV;
+	}
+	info("%04x:%04x %s found", udev->descriptor.idVendor,
+		udev->descriptor.idProduct, desc);
+
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	if (dev == NULL)
+		return -ENOMEM;
+
+	list_add_tail(&dev->ov534_devlist,&ov534_devlist);
+
+	/* init video dma queues */
+	INIT_LIST_HEAD(&dev->vidq.active);
+	init_waitqueue_head(&dev->vidq.wq);
+
+	/* init locks */
+	spin_lock_init(&dev->slock);
+	mutex_init(&dev->mutex);
+
+	dev->vfd = video_device_alloc();
+	if (dev->vfd == NULL) {
+		kfree(dev);
+		return -ENOMEM;
+	}
+	memcpy(dev->vfd, &ov534_template, sizeof(ov534_template));
+
+	video_set_drvdata(dev->vfd, dev);
+	if (ov534.debug > 3)
+		dev->vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
+
+	dev->udev = udev;
+
+	err = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr);
+
+	if (err) {
+		info("video_register_device failed");
+		video_device_release(dev->vfd);
+		kfree(dev->vfd);
+		kfree(dev);
+		return err;
+	}
+
+	usb_set_intfdata(intf, dev);
+
+	ov534_setup(udev);	
+
+	info(OV534_MODULE_NAME " controlling video device %d", dev->vfd->minor);
+	return 0;
+}
+
+static void ov534_disconnect(struct usb_interface *intf)
+{
+	struct ov534_dev *dev = usb_get_intfdata(intf);
+
+	list_del(&dev->ov534_devlist);
+
+	usb_set_intfdata(intf, NULL);
+	dev_set_drvdata(&intf->dev, NULL);
+
+	info(OV534_MODULE_NAME " webcam unplugged");
+	if (dev->vfd) {
+		if (-1 != dev->vfd->minor) {
+			video_unregister_device(dev->vfd);
+			printk(KERN_INFO "%s: /dev/video%d unregistered.\n",
+				OV534_MODULE_NAME, dev->vfd->minor);
+		} else {
+			video_device_release(dev->vfd);
+			printk(KERN_INFO "%s: /dev/video%d released.\n",
+				OV534_MODULE_NAME, dev->vfd->minor);
+		}
+	}
+
+	dev->vfd = NULL;
+
+	kfree(dev);
+}
+
+
+/**********************/
+/* Module integration */
+/**********************/
+
+static struct usb_driver ov534_driver = {
+	.name = "ov534",
+	.probe = ov534_probe,
+	.disconnect = ov534_disconnect,
+	.id_table = device_table
+};
+
+
+static int __init ov534_init(void)
+{
+	int retval;
+	retval = usb_register(&ov534_driver);
+	if (retval)
+		info("usb_register failed!");
+	else
+		info("%s v%d.%d.%d module loaded",
+			OV534_MODULE_NAME,
+			OV534_MAJOR_VERSION,
+			OV534_MINOR_VERSION,
+			OV534_RELEASE);
+	return retval;
+}
+
+
+static void __exit ov534_exit(void)
+{
+	info(OV534_MODULE_NAME " module unloaded");
+	usb_deregister(&ov534_driver);
+}
+
+
+module_init(ov534_init);
+module_exit(ov534_exit);
+
+MODULE_AUTHOR(OV534_AUTHOR);
+MODULE_DESCRIPTION(OV534_MODULE_DESC);
+MODULE_LICENSE("GPL");

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16  5:00 [PATCH] Add support for OmniVision OV534 based USB cameras majortrips
@ 2008-08-16  6:58 ` Hans de Goede
  2008-08-16  7:46   ` Mark Ferrell
  2008-08-16 11:36 ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 29+ messages in thread
From: Hans de Goede @ 2008-08-16  6:58 UTC (permalink / raw)
  To: majortrips; +Cc: video4linux-list

majortrips@gmail.com wrote:
> Adds suport for OmniVision OV534 based cameras:
>  - Hercules Blog Webcam
>  - Hercules Dualpix HD Webcam
>  - Sony HD PS3 Eye (SLEH 00201)
> 
> Currently only supports 640x480 YUYV non-interlaced output.
> 
> Signed-off-by: Mark Ferrell <majortrips@gmail.com>

Hi Mark,

Have you taken a look at the ov519 driver which is currently in gspca, which is 
  in 2.6.27rc1 and more general (latest version) available here:
http://linuxtv.org/hg/~jfrancois/gspca/

That driver does do jpeg, maybe it can give some clues. gspca is a webcam 
driver framework. Would you consider porting your driver to gspca, I (we ?) 
really want to see all usb webcam drivers start using the gspca framework to 
share as much code as possible.

> +The ov534 outputs frames in YUYV format, non-interlaced, at 640x480. This
> +format does not yet have wide support among user-land applications.  Though at
> +the time of this writing xawtv was known to work correctly.
> +

This (custom cam formats) was a big problem with gspca too, for this I've 
written libv4l, which is a library which does format conversion from many cam 
specific formats to more general formats in userspace. A joined effort between 
Debian, Suse and Fedora is currently working on making all v4l apps use libv4l, 
patches have already been written for gstreamer (cheese), pwlib (ekiga) and xawtv.

For more on libv4l see:
http://hansdegoede.livejournal.com/3636.html
http://linuxtv.org/v4lwiki/index.php/Libv4l_Progress

Maybe you can write a patch to add YUYV input support to libv4l, if you do that 
please base your work on the latest version which is available here:
http://linuxtv.org/hg/~hgoede/v4l-dvb

Regards,

Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16  6:58 ` Hans de Goede
@ 2008-08-16  7:46   ` Mark Ferrell
  2008-08-16  8:03     ` Hans de Goede
  0 siblings, 1 reply; 29+ messages in thread
From: Mark Ferrell @ 2008-08-16  7:46 UTC (permalink / raw)
  To: video4linux-list

On Sat, Aug 16, 2008 at 08:58:21AM +0200, Hans de Goede wrote:
> majortrips@gmail.com wrote:
>> Adds suport for OmniVision OV534 based cameras:
>>  - Hercules Blog Webcam
>>  - Hercules Dualpix HD Webcam
>>  - Sony HD PS3 Eye (SLEH 00201)
>> Currently only supports 640x480 YUYV non-interlaced output.
>> Signed-off-by: Mark Ferrell <majortrips@gmail.com>
>
> Hi Mark,
>
> Have you taken a look at the ov519 driver which is currently in gspca,
> which is  in 2.6.27rc1 and more general (latest version) available here:
> http://linuxtv.org/hg/~jfrancois/gspca/
>
> That driver does do jpeg, maybe it can give some clues. gspca is a webcam
> driver framework. Would you consider porting your driver to gspca, I (we ?)
> really want to see all usb webcam drivers start using the gspca framework
> to share as much code as possible.

I would definitely be willing to merge the code into an existing driver,
though I was under the impression that the gspca core was for ISOC based
USB devices.  The ov534's imagine end-point is bulk transfer, with the
audio endpoints being isoc.

>> +The ov534 outputs frames in YUYV format, non-interlaced, at 640x480. This
>> +format does not yet have wide support among user-land applications.
>> Though at
>> +the time of this writing xawtv was known to work correctly.
>> +
>
> This (custom cam formats) was a big problem with gspca too, for this I've
> written libv4l, which is a library which does format conversion from many
> cam specific formats to more general formats in userspace. A joined effort
> between Debian, Suse and Fedora is currently working on making all v4l apps
> use libv4l, patches have already been written for gstreamer (cheese), pwlib
> (ekiga) and xawtv.
>
> For more on libv4l see:
> http://hansdegoede.livejournal.com/3636.html
> http://linuxtv.org/v4lwiki/index.php/Libv4l_Progress
>
> Maybe you can write a patch to add YUYV input support to libv4l, if you do
> that please base your work on the latest version which is available here:
> http://linuxtv.org/hg/~hgoede/v4l-dvb

Thanks, will take a look.


-- Mark Ferrell

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16  7:46   ` Mark Ferrell
@ 2008-08-16  8:03     ` Hans de Goede
  2008-08-16 11:47       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 29+ messages in thread
From: Hans de Goede @ 2008-08-16  8:03 UTC (permalink / raw)
  To: Mark Ferrell; +Cc: video4linux-list, Mauro Carvalho Chehab

Mark Ferrell wrote:
> On Sat, Aug 16, 2008 at 08:58:21AM +0200, Hans de Goede wrote:
>> majortrips@gmail.com wrote:
>>> Adds suport for OmniVision OV534 based cameras:
>>>  - Hercules Blog Webcam
>>>  - Hercules Dualpix HD Webcam
>>>  - Sony HD PS3 Eye (SLEH 00201)
>>> Currently only supports 640x480 YUYV non-interlaced output.
>>> Signed-off-by: Mark Ferrell <majortrips@gmail.com>
>> Hi Mark,
>>
>> Have you taken a look at the ov519 driver which is currently in gspca,
>> which is  in 2.6.27rc1 and more general (latest version) available here:
>> http://linuxtv.org/hg/~jfrancois/gspca/
>>
>> That driver does do jpeg, maybe it can give some clues. gspca is a webcam
>> driver framework. Would you consider porting your driver to gspca, I (we ?)
>> really want to see all usb webcam drivers start using the gspca framework
>> to share as much code as possible.
> 
> I would definitely be willing to merge the code into an existing driver,
> though I was under the impression that the gspca core was for ISOC based
> USB devices.  The ov534's imagine end-point is bulk transfer, with the
> audio endpoints being isoc.
> 

Ah yes it is I didn't know non isoc cams existed, so thats why your driver is 
so small I already was sorta missing the isoc setup stufff :)

In that case its fine as is. Mauro as this is a new driver and looks clean (and 
uses videobuf) any chance this can get merged for 2.6.27 ?

I'll work together with Mark on getting YUYV support added to libv4l so that 
userspace support is taken care of.

>>> +The ov534 outputs frames in YUYV format, non-interlaced, at 640x480. This
>>> +format does not yet have wide support among user-land applications.
>>> Though at
>>> +the time of this writing xawtv was known to work correctly.
>>> +
>> This (custom cam formats) was a big problem with gspca too, for this I've
>> written libv4l, which is a library which does format conversion from many
>> cam specific formats to more general formats in userspace. A joined effort
>> between Debian, Suse and Fedora is currently working on making all v4l apps
>> use libv4l, patches have already been written for gstreamer (cheese), pwlib
>> (ekiga) and xawtv.
>>
>> For more on libv4l see:
>> http://hansdegoede.livejournal.com/3636.html
>> http://linuxtv.org/v4lwiki/index.php/Libv4l_Progress
>>
>> Maybe you can write a patch to add YUYV input support to libv4l, if you do
>> that please base your work on the latest version which is available here:
>> http://linuxtv.org/hg/~hgoede/v4l-dvb
> 
> Thanks, will take a look.
> 

Let me know how it goes. I'll gladly help where I can, but I prefer people with 
hardware to test to write the actual code. All you need todo is add support for 
YUYV to libv4lconvert/libv4lconvert.c and add a file under libv4lconvert with 
the actual conversion routines. Also take a good look at libv4lconvert/rgbyuv.c 
for some good inspiration for the YUV->RGB conversion routines.

Regards,

Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16  5:00 [PATCH] Add support for OmniVision OV534 based USB cameras majortrips
  2008-08-16  6:58 ` Hans de Goede
@ 2008-08-16 11:36 ` Mauro Carvalho Chehab
  2008-08-16 12:13   ` Mark Ferrell
  1 sibling, 1 reply; 29+ messages in thread
From: Mauro Carvalho Chehab @ 2008-08-16 11:36 UTC (permalink / raw)
  To: majortrips; +Cc: video4linux-list

Hi Mark,

First of all, please review your patch with checkpatch.pl. I've seen a few
non-compliances. 

If you're using -hg tree, this is as simple as doing: make
checkpatch. Otherwise, you can use v4l/scripts/checkpatch.pl <my patch>

I have also a few other comments:

> +		switch (data & 0xFF) {

The better is that all hexadecimal values to be on lowercase.
> +static void ov534_setup(struct usb_device *udev)
> +{
> +	ov534_reg_verify_write(udev, 0xe7, 0x3a);
> +
> +	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
> +	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
> +	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);

	Hmm... three times the same write?

> +	ov534_reg_write(udev, OV534_REG_ADDRESS, 0x42);
> +
> +	ov534_reg_verify_write(udev, 0xc2,0x0c);
	...
> +	ov534_reg_verify_write(udev, 0xe7,0x3e);

It is generally better and smaller to have a table instead of those long init sequences.


> +static void ov534_fillbuff(struct ov534_dev *dev, struct ov534_buffer *buf)
> +{

> +	tmpbuf = kmalloc(size + 4, GFP_ATOMIC);
> +	if (!tmpbuf)
> +		return;

It would be better if you allocate the buffer at videobuf prep routines, instead of doing this for every buffer fill. Is there any reason why you just don't use vbuf instead of doing double buffering?

> +	/* Updates stream time */
> +
> +	dev->ms += jiffies_to_msecs(jiffies-dev->jiffies);
> +	dev->jiffies = jiffies;
> +	if (dev->ms >= 1000) {
> +		dev->ms -= 1000;
> +		dev->s++;
> +		if (dev->s >= 60) {
> +			dev->s -= 60;
> +			dev->m++;
> +			if (dev->m > 60) {
> +				dev->m -= 60;
> +				dev->h++;
> +				if (dev->h > 24)
> +					dev->h -= 24;
> +			}
> +		}
> +	}
> +	sprintf(dev->timestr, "%02d:%02d:%02d:%03d",
> +			dev->h, dev->m, dev->s, dev->ms);

You don't need the above. This is at vivi just because we want to print a
timestamp at the video. Just remove it and timestr from dev.

I also didn't see any code to provide S1/S3 hibernation. This is probably not
needed at vivi (since there's no hardware registers to be saved/restored - yet
- I never tried to do suspend/resume with vivi working), but for sure this is
needed for real devices ;) I suggest you to take a look, for example, at
cafe_ccic, for its implementation (it is inside #ifdef CONFIG_PM).

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16  8:03     ` Hans de Goede
@ 2008-08-16 11:47       ` Mauro Carvalho Chehab
  2008-08-17  7:03         ` Jean-Francois Moine
  0 siblings, 1 reply; 29+ messages in thread
From: Mauro Carvalho Chehab @ 2008-08-16 11:47 UTC (permalink / raw)
  To: Hans de Goede; +Cc: video4linux-list

On Sat, 16 Aug 2008 10:03:13 +0200
> > I would definitely be willing to merge the code into an existing driver,
> > though I was under the impression that the gspca core was for ISOC based
> > USB devices.  The ov534's imagine end-point is bulk transfer, with the
> > audio endpoints being isoc.
> > 
> 
> Ah yes it is I didn't know non isoc cams existed, so thats why your driver is 
> so small I already was sorta missing the isoc setup stufff :)

The usage of videobuf simplifies a lot the driver logic. That's why it is so small :)

I think it would be good if gspca could also use videobuf in the future.


> In that case its fine as is. Mauro as this is a new driver and looks clean (and 
> uses videobuf) any chance this can get merged for 2.6.27 ?

Maybe. I'll see when I receive Mark updates.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16 11:36 ` Mauro Carvalho Chehab
@ 2008-08-16 12:13   ` Mark Ferrell
  2008-11-05 22:31     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 29+ messages in thread
From: Mark Ferrell @ 2008-08-16 12:13 UTC (permalink / raw)
  To: video4linux-list

On Sat, Aug 16, 2008 at 6:36 AM, Mauro Carvalho Chehab
<mchehab@infradead.org> wrote:
>
> Hi Mark,
>
> First of all, please review your patch with checkpatch.pl. I've seen a few
> non-compliances.
>
> If you're using -hg tree, this is as simple as doing: make
> checkpatch. Otherwise, you can use v4l/scripts/checkpatch.pl <my patch>

Thanks, ran make checkpatch and fixed the issues reported.

> I have also a few other comments:
>
> > +             switch (data & 0xFF) {
>
> The better is that all hexadecimal values to be on lowercase.

Agreed and corrected.

> > +static void ov534_setup(struct usb_device *udev)
> > +{
> > +     ov534_reg_verify_write(udev, 0xe7, 0x3a);
> > +
> > +     ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
> > +     ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
> > +     ov534_reg_write(udev, OV534_REG_ADDRESS, 0x60);
>
>        Hmm... three times the same write?

Supposedly it requires 3 writes of 0x60 followed by a write of 0x42 to
initialize the sensor.  That particularly register sequence at one
point existed as ov534_sccb_init(), but it was only ever called once
and so it got moved into the general init.  It may need to get split
out again once more is known about configuring the camera.  Outside of
initialization all that is known is how to toggle the led and how to
get images from the camera.  Setting up the output modes and
controlling the sensor is still unknown unfortunately.

> > +     ov534_reg_write(udev, OV534_REG_ADDRESS, 0x42);
> > +
> > +     ov534_reg_verify_write(udev, 0xc2,0x0c);
>        ...
> > +     ov534_reg_verify_write(udev, 0xe7,0x3e);
>
> It is generally better and smaller to have a table instead of those long init sequences.

Will do.

> > +static void ov534_fillbuff(struct ov534_dev *dev, struct ov534_buffer *buf)
> > +{
>
> > +     tmpbuf = kmalloc(size + 4, GFP_ATOMIC);
> > +     if (!tmpbuf)
> > +             return;
>
> It would be better if you allocate the buffer at videobuf prep routines, instead of doing this for every buffer fill. Is there any reason why you just don't use vbuf instead of doing double buffering?

Attempting to bulk transfer directly to the vbuf resulted in a
deadlock.  I went back to the tmpbuf until I could figure out a better
solution as I am not partial to the double buffering at all.

> > +     /* Updates stream time */
> > +
> > +     dev->ms += jiffies_to_msecs(jiffies-dev->jiffies);
> > +     dev->jiffies = jiffies;
> > +     if (dev->ms >= 1000) {
> > +             dev->ms -= 1000;
> > +             dev->s++;
> > +             if (dev->s >= 60) {
> > +                     dev->s -= 60;
> > +                     dev->m++;
> > +                     if (dev->m > 60) {
> > +                             dev->m -= 60;
> > +                             dev->h++;
> > +                             if (dev->h > 24)
> > +                                     dev->h -= 24;
> > +                     }
> > +             }
> > +     }
> > +     sprintf(dev->timestr, "%02d:%02d:%02d:%03d",
> > +                     dev->h, dev->m, dev->s, dev->ms);
>
> You don't need the above. This is at vivi just because we want to print a
> timestamp at the video. Just remove it and timestr from dev.

Done

> I also didn't see any code to provide S1/S3 hibernation. This is probably not
> needed at vivi (since there's no hardware registers to be saved/restored - yet
> - I never tried to do suspend/resume with vivi working), but for sure this is
> needed for real devices ;) I suggest you to take a look, for example, at
> cafe_ccic, for its implementation (it is inside #ifdef CONFIG_PM).

Will do

--
Mark

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16 11:47       ` Mauro Carvalho Chehab
@ 2008-08-17  7:03         ` Jean-Francois Moine
  0 siblings, 0 replies; 29+ messages in thread
From: Jean-Francois Moine @ 2008-08-17  7:03 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: video4linux-list

On Sat, 2008-08-16 at 08:47 -0300, Mauro Carvalho Chehab wrote:
> On Sat, 16 Aug 2008 10:03:13 +0200
> > > I would definitely be willing to merge the code into an existing driver,
> > > though I was under the impression that the gspca core was for ISOC based
> > > USB devices.  The ov534's imagine end-point is bulk transfer, with the
> > > audio endpoints being isoc.
> > > 
> > 
> > Ah yes it is I didn't know non isoc cams existed, so thats why your driver is 
> > so small I already was sorta missing the isoc setup stufff :)

Hello Mauro and Hans,

The code for bulk transfer existed in the first versions, but, as no
webcam used it, I removed. It should be easy to put it back.

> The usage of videobuf simplifies a lot the driver logic. That's why it is so small :)
> 
> I think it would be good if gspca could also use videobuf in the future.

I think that videobuf is rather complex for handling usually less than 8
buffers (max = 16 in gspca) and it asks for a mutex at irq level. My
buffer handling also offers a very small memory overhead...

Cheers.

-- 
Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |               http://moinejf.free.fr/


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
@ 2008-08-17 19:48 Theou Jean-Baptiste
  2008-08-17 19:58 ` Theou Jean-Baptiste
  2008-08-18  0:29 ` Mark Ferrell
  0 siblings, 2 replies; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-17 19:48 UTC (permalink / raw)
  To: video4linux-list

Hi. I'm the EasyCam Dev, a ubuntu software who make the webcam install
easier ( I hope )
I use this patch in my software. One user had try this patch, and after
install, he observe in dmesg output :

[21222.334007] usb 1-2: new high speed USB device using ehci_hcd and address
9
[21222.395446] usb 1-2: configuration #1 chosen from 1 choice
[21222.399771] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: OmniVision
OV534 compatible webcam detected
[21222.399778] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: 06f8:3002
Hercules Blog Webcam found
[21222.438333] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: ov534
controlling video device -1

Thanks you very much for your job

Best regards, and sorry for my bad english

-- 
Jean-Baptiste Théou
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-17 19:48 Theou Jean-Baptiste
@ 2008-08-17 19:58 ` Theou Jean-Baptiste
  2008-08-17 20:13   ` Theou Jean-Baptiste
  2008-08-18  0:34   ` Mark Ferrell
  2008-08-18  0:29 ` Mark Ferrell
  1 sibling, 2 replies; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-17 19:58 UTC (permalink / raw)
  To: video4linux-list

One more thing, when he halt in her system, the halt "freeze", and when he
unplugged her webcam, he observe that :

/dev/video-1 released

2008/8/17 Theou Jean-Baptiste <jbtheou@gmail.com>

> Hi. I'm the EasyCam Dev, a ubuntu software who make the webcam install
> easier ( I hope )
> I use this patch in my software. One user had try this patch, and after
> install, he observe in dmesg output :
>
> [21222.334007] usb 1-2: new high speed USB device using ehci_hcd and
> address 9
> [21222.395446] usb 1-2: configuration #1 chosen from 1 choice
> [21222.399771] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: OmniVision
> OV534 compatible webcam detected
> [21222.399778] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: 06f8:3002
> Hercules Blog Webcam found
> [21222.438333] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: ov534
> controlling video device -1
>
> Thanks you very much for your job
>
> Best regards, and sorry for my bad english
>
> --
> Jean-Baptiste Théou
>



-- 
Jean-Baptiste Théou
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-17 19:58 ` Theou Jean-Baptiste
@ 2008-08-17 20:13   ` Theou Jean-Baptiste
  2008-08-18  0:34   ` Mark Ferrell
  1 sibling, 0 replies; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-17 20:13 UTC (permalink / raw)
  To: video4linux-list

One more thing again ......
It seems to be "dev->vfd->minor" (line 1339) who return '-1'
If this info can help you .....

2008/8/17 Theou Jean-Baptiste <jbtheou@gmail.com>

> One more thing, when he halt in her system, the halt "freeze", and when he
> unplugged her webcam, he observe that :
>
> /dev/video-1 released
>
> 2008/8/17 Theou Jean-Baptiste <jbtheou@gmail.com>
>
> Hi. I'm the EasyCam Dev, a ubuntu software who make the webcam install
>> easier ( I hope )
>> I use this patch in my software. One user had try this patch, and after
>> install, he observe in dmesg output :
>>
>> [21222.334007] usb 1-2: new high speed USB device using ehci_hcd and
>> address 9
>> [21222.395446] usb 1-2: configuration #1 chosen from 1 choice
>> [21222.399771] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: OmniVision
>> OV534 compatible webcam detected
>> [21222.399778] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: 06f8:3002
>> Hercules Blog Webcam found
>> [21222.438333] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: ov534
>> controlling video device -1
>>
>> Thanks you very much for your job
>>
>> Best regards, and sorry for my bad english
>>
>> --
>> Jean-Baptiste Théou
>>
>
>
>
> --
> Jean-Baptiste Théou
>



-- 
Jean-Baptiste Théou
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-17 19:48 Theou Jean-Baptiste
  2008-08-17 19:58 ` Theou Jean-Baptiste
@ 2008-08-18  0:29 ` Mark Ferrell
  1 sibling, 0 replies; 29+ messages in thread
From: Mark Ferrell @ 2008-08-18  0:29 UTC (permalink / raw)
  To: video4linux-list

On Sun, Aug 17, 2008 at 09:48:58PM +0200, Theou Jean-Baptiste wrote:
> Hi. I'm the EasyCam Dev, a ubuntu software who make the webcam install
> easier ( I hope )
> I use this patch in my software. One user had try this patch, and after
> install, he observe in dmesg output :
> 
> [21222.334007] usb 1-2: new high speed USB device using ehci_hcd and address
> 9
> [21222.395446] usb 1-2: configuration #1 chosen from 1 choice
> [21222.399771] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: OmniVision
> OV534 compatible webcam detected
> [21222.399778] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: 06f8:3002
> Hercules Blog Webcam found
> [21222.438333] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c: ov534
> controlling video device -1

The -1 is the minor number assigned after video_register_device().
This can set an invalid minor number while still returning success?

> Thanks you very much for your job
> 
> Best regards, and sorry for my bad english
> 
> -- 
> Jean-Baptiste Th?ou
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-17 19:58 ` Theou Jean-Baptiste
  2008-08-17 20:13   ` Theou Jean-Baptiste
@ 2008-08-18  0:34   ` Mark Ferrell
  2008-08-18 12:08     ` Theou Jean-Baptiste
  1 sibling, 1 reply; 29+ messages in thread
From: Mark Ferrell @ 2008-08-18  0:34 UTC (permalink / raw)
  To: video4linux-list

On Sun, Aug 17, 2008 at 09:58:12PM +0200, Theou Jean-Baptiste wrote:
> One more thing, when he halt in her system, the halt "freeze", and when he
> unplugged her webcam, he observe that :

Was the camera running during the halt?  While trying to fix up the
CONFIG_PM code as requested I ran across similar issues while the camera
was running.  Suspending the system and unplugging the camera while an
application is streaming did indeed lock the system.  Working on fixing
these. I have not had a system lock during any shutdown.

> 
> /dev/video-1 released

The device file would still be related to the vfd->minor being -1, which
it shouldn't be.  I have not experienced this with any of the cams I
have here.

-- 
Mark

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-18  0:34   ` Mark Ferrell
@ 2008-08-18 12:08     ` Theou Jean-Baptiste
  2008-08-18 16:24       ` Mark Ferrell
  0 siblings, 1 reply; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-18 12:08 UTC (permalink / raw)
  To: video4linux-list

My user had meet lot of stability problem when her webcam is plug. This
problem was fixed when he unplugged her webcam. And, just after 'sudo
modprobe', the blue led flash 2 sec and it's all

Thanks. If you would other information, no problem
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-18 12:08     ` Theou Jean-Baptiste
@ 2008-08-18 16:24       ` Mark Ferrell
  2008-08-18 16:53         ` Theou Jean-Baptiste
  0 siblings, 1 reply; 29+ messages in thread
From: Mark Ferrell @ 2008-08-18 16:24 UTC (permalink / raw)
  To: video4linux-list

On Mon, Aug 18, 2008 at 02:08:13PM +0200, Theou Jean-Baptiste wrote:
> My user had meet lot of stability problem when her webcam is plug. This
> problem was fixed when he unplugged her webcam. And, just after 'sudo
> modprobe', the blue led flash 2 sec and it's all
> 
> Thanks. If you would other information, no problem

The flashing of the LED happens during the call to ov534_setup().  After
that the cam shouldn't do anything unless it is opened for streaming.
Very verbose debug output can be enabled be loading the module with the
option debug=5.  I would be interested in the logs if possible.

I am almost done with a cleaned up version of the driver to correct
unplugging the camera while it is streaming, and adding support for
power management. Will hopefully have something usable for more diverse
testing later this evening.

--
Mark

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-18 16:24       ` Mark Ferrell
@ 2008-08-18 16:53         ` Theou Jean-Baptiste
  2008-08-20 10:35           ` Theou Jean-Baptiste
  0 siblings, 1 reply; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-18 16:53 UTC (permalink / raw)
  To: video4linux-list

Oh great ! Thanks you ;) I have send the request to my user. With debug=4
option according to modinfo.
I wait the result

2008/8/18 Mark Ferrell <majortrips@gmail.com>

> On Mon, Aug 18, 2008 at 02:08:13PM +0200, Theou Jean-Baptiste wrote:
> > My user had meet lot of stability problem when her webcam is plug. This
> > problem was fixed when he unplugged her webcam. And, just after 'sudo
> > modprobe', the blue led flash 2 sec and it's all
> >
> > Thanks. If you would other information, no problem
>
> The flashing of the LED happens during the call to ov534_setup().  After
> that the cam shouldn't do anything unless it is opened for streaming.
> Very verbose debug output can be enabled be loading the module with the
> option debug=5.  I would be interested in the logs if possible.
>
> I am almost done with a cleaned up version of the driver to correct
> unplugging the camera while it is streaming, and adding support for
> power management. Will hopefully have something usable for more diverse
> testing later this evening.
>
> --
> Mark
>
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list
>



-- 
Jean-Baptiste Théou
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-18 16:53         ` Theou Jean-Baptiste
@ 2008-08-20 10:35           ` Theou Jean-Baptiste
  2008-08-22 11:18             ` Mark Ferrell
  0 siblings, 1 reply; 29+ messages in thread
From: Theou Jean-Baptiste @ 2008-08-20 10:35 UTC (permalink / raw)
  To: video4linux-list

With debug=4 option :


[ 2150.623457] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.623460] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0013, val: 0×00f0
[ 2150.623463] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00013
[ 2150.623579] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=000f0
[ 2150.623704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.623953] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.623957] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.623959]
[ 2150.624079] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.624082] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.624085]
[ 2150.624204] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.624207] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.624211] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×000d, val: 0×0041
[ 2150.624214] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=0000d
[ 2150.624328] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00041
[ 2150.624454] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.624705] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.624709] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.624711]
[ 2150.624830] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.624833] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.624836] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×000f, val: 0×00c5
[ 2150.624840] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=0000f
[ 2150.624953] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=000c5
[ 2150.625079] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.625330] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.625333] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.625336]
[ 2150.625453] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.625457] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.625459]
[ 2150.625578] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.625581] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.625584] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0014, val: 0×0011
[ 2150.625587] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00014
[ 2150.625703] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00011
[ 2150.625829] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.626078] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.626081] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.626083]
[ 2150.626202] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.626206] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.626208]
[ 2150.626327] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.626330] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.626334] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_set_led:266] led status: 1
[ 2150.626453] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×0021, data=0xf8f0
[ 2150.626456] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×0021, val=0f8f0
[ 2150.626705] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×0023, data=0xf802
[ 2150.626709] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×0023, val=0f882
[ 2150.626853] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0022, val: 0×007f
[ 2150.626857] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00022
[ 2150.626953] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=0007f
[ 2150.627100] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.627328] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0003
[ 2150.627473] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.627477] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 2/5
[ 2150.627479]
[ 2150.627578] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.627581] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.627584] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0023, val: 0×0003
[ 2150.627588] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00023
[ 2150.627704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00003
[ 2150.627827] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.628078] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.628081] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.628083]
[ 2150.628206] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.628210] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.628212]
[ 2150.628328] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.628331] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.628335] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0024, val: 0×0040
[ 2150.628338] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00024
[ 2150.628455] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00040
[ 2150.628578] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.628829] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.628833] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.628835]
[ 2150.628978] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.628981] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.628983]
[ 2150.629077] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.629080] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.629083] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0025, val: 0×0030
[ 2150.629086] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00025
[ 2150.629201] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00030
[ 2150.629327] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.629577] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.629581] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.629583]
[ 2150.629702] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.629705] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.629707]
[ 2150.629826] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.629829] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.629832] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0026, val: 0×00a1
[ 2150.629836] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00026
[ 2150.629952] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=000a1
[ 2150.630076] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.630326] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.630330] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.630332]
[ 2150.630452] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.630456] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.630458]
[ 2150.630576] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.630580] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.630583] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×002a, val: 0×0000
[ 2150.630586] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=0002a
[ 2150.630700] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00000
[ 2150.630826] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.631076] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.631079] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.631081]
[ 2150.631201] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.631204] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.631206]
[ 2150.631325] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.631329] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.631332] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×002b, val: 0×0000
[ 2150.631335] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=0002b
[ 2150.631450] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00000
[ 2150.631577] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.631826] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.631829] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.631831]
[ 2150.631950] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.631953] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.631955]
[ 2150.632076] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.632079] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.632083] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×006b, val: 0×00aa
[ 2150.632086] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=0006b
[ 2150.632200] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=000aa
[ 2150.632326] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.632576] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.632579] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.632581]
[ 2150.632701] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.632704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.632707] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0013, val: 0×00ff
[ 2150.632710] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00013
[ 2150.632938] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=000ff
[ 2150.633075] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.633324] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.633328] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.633330]
[ 2150.633449] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.633453] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.633455]
[ 2150.633574] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.633577] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.633580] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_set_led:266] led status: 0
[ 2150.633701] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×0021, data=0xf8f0
[ 2150.633705] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×0021, val=0f8f0
[ 2150.633997] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×0023, data=0xf882
[ 2150.634001] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×0023, val=0f802
[ 2150.634075] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0090, val: 0×0005
[ 2150.634078] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00090
[ 2150.634199] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00005
[ 2150.634323] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.634574] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.634577] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.634579]
[ 2150.634701] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.634704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.634706]
[ 2150.634825] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.634828] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.634831] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0091, val: 0×0001
[ 2150.634835] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00091
[ 2150.634949] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00001
[ 2150.635075] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.635324] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.635327] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.635329]
[ 2150.635449] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.635452] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.635454]
[ 2150.635573] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.635576] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.635580] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0092, val: 0×0003
[ 2150.635583] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00092
[ 2150.635699] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00003
[ 2150.635825] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.636074] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.636078] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.636080]
[ 2150.636199] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.636202] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.636205] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0093, val: 0×0000
[ 2150.636209] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00093
[ 2150.636324] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00000
[ 2150.636449] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.636700] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.636704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.636706]
[ 2150.636823] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.636827] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.636829]
[ 2150.636948] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.636951] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.636954] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0094, val: 0×0060
[ 2150.636957] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00094
[ 2150.637072] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00060
[ 2150.637198] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.637449] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.637452] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.637454]
[ 2150.637573] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.637576] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.637578]
[ 2150.637697] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.637700] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.637704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0095, val: 0×003c
[ 2150.637707] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00095
[ 2150.637822] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=0003c
[ 2150.637947] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.638197] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.638201] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.638203]
[ 2150.638322] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.638325] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.638327]
[ 2150.638447] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.638450] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.638453] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0096, val: 0×0024
[ 2150.638456] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00096
[ 2150.638572] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00024
[ 2150.638698] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.638948] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.638951] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.638953]
[ 2150.639072] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.639075] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.639077]
[ 2150.639197] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.639200] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.639203] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0097, val: 0×001e
[ 2150.639206] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00097
[ 2150.639322] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=0001e
[ 2150.639447] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.639697] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.639700] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.639702]
[ 2150.639822] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.639826] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.639828]
[ 2150.639947] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.639950] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.639954] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0098, val: 0×0062
[ 2150.639957] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00098
[ 2150.640073] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00062
[ 2150.640197] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.640446] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007
[ 2150.640450] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0×07, attempt 1/5
[ 2150.640452]
[ 2150.640571] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf807
[ 2150.640575] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_check_status:294] sccb status 0xf807, attempt 2/5
[ 2150.640577]
[ 2150.640696] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0xf804
[ 2150.640699] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:308] sccb_reg_write failed
[ 2150.640702] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[sccb_reg_write:302] reg: 0×0099, val: 0×0080
[ 2150.640705] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f2, val=00099
[ 2150.640821] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f3, val=00080
[ 2150.640946] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_write:222] reg=0×00f5, val=00037
[ 2150.641197] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
[ov534_reg_read:242] reg=0×00f6, data=0×0007



2008/8/18 Theou Jean-Baptiste <jbtheou@gmail.com>

> Oh great ! Thanks you ;) I have send the request to my user. With debug=4
> option according to modinfo.
> I wait the result
>
> 2008/8/18 Mark Ferrell <majortrips@gmail.com>
>
> On Mon, Aug 18, 2008 at 02:08:13PM +0200, Theou Jean-Baptiste wrote:
>> > My user had meet lot of stability problem when her webcam is plug. This
>> > problem was fixed when he unplugged her webcam. And, just after 'sudo
>> > modprobe', the blue led flash 2 sec and it's all
>> >
>> > Thanks. If you would other information, no problem
>>
>> The flashing of the LED happens during the call to ov534_setup().  After
>> that the cam shouldn't do anything unless it is opened for streaming.
>> Very verbose debug output can be enabled be loading the module with the
>> option debug=5.  I would be interested in the logs if possible.
>>
>> I am almost done with a cleaned up version of the driver to correct
>> unplugging the camera while it is streaming, and adding support for
>> power management. Will hopefully have something usable for more diverse
>> testing later this evening.
>>
>> --
>> Mark
>>
>> --
>> video4linux-list mailing list
>> Unsubscribe mailto:video4linux-list-request@redhat.com
>> ?subject=unsubscribe
>> https://www.redhat.com/mailman/listinfo/video4linux-list
>>
>
>
>
> --
> Jean-Baptiste Théou
>



-- 
Jean-Baptiste Théou
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-20 10:35           ` Theou Jean-Baptiste
@ 2008-08-22 11:18             ` Mark Ferrell
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Ferrell @ 2008-08-22 11:18 UTC (permalink / raw)
  To: Theou Jean-Baptiste; +Cc: video4linux-list

On Wed, Aug 20, 2008 at 5:35 AM, Theou Jean-Baptiste <jbtheou@gmail.com> wrote:
> With debug=4 option :
>
>
> [ 2150.623457] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [sccb_reg_write:308] sccb_reg_write failed
> [ 2150.623460] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [sccb_reg_write:302] reg: 0×0013, val: 0×00f0
> [ 2150.623463] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [ov534_reg_write:222] reg=0×00f2, val=00013
> [ 2150.623579] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [ov534_reg_write:222] reg=0×00f3, val=000f0
> [ 2150.623704] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [ov534_reg_write:222] reg=0×00f5, val=00037
> [ 2150.623953] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [ov534_reg_read:242] reg=0×00f6, data=0×0007
> [ 2150.623957] /usr/share/EasyCam2/drivers/ov534/v4l/ov534.c:
> [sccb_check_status:294] sccb status 0×07, attempt 1/5

It looks like the driver is failing to setup the sensor on the
Hercules Blog Webcam. I will need to see if I can reproduce this on my
end and try to figure out why this is happening.

--
Mark

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-08-16 12:13   ` Mark Ferrell
@ 2008-11-05 22:31     ` Mauro Carvalho Chehab
  2008-11-11 17:42       ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Mauro Carvalho Chehab @ 2008-11-05 22:31 UTC (permalink / raw)
  To: Mark Ferrell; +Cc: video4linux-list

On Sat, 16 Aug 2008 07:13:37 -0500
"Mark Ferrell" <majortrips@gmail.com> wrote:

> Done


Mark,

Any news?

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-05 22:31     ` Mauro Carvalho Chehab
@ 2008-11-11 17:42       ` Antonio Ospite
  2008-11-11 18:15         ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Antonio Ospite @ 2008-11-11 17:42 UTC (permalink / raw)
  To: video4linux-list

On Wed, 5 Nov 2008 20:31:14 -0200
Mauro Carvalho Chehab <mchehab@infradead.org> wrote:

> On Sat, 16 Aug 2008 07:13:37 -0500
> "Mark Ferrell" <majortrips@gmail.com> wrote:
> 
> > Done
> 
> 
> Mark,
> 
> Any news?
> 
> Cheers,
> Mauro
>

Hi,

Actually I've started a port of this driver to gspca as an exercise.
You can find a rough preview here:
http://shell.studenti.unina.it/~ospite/tmp/gspca_ov534-20081111-1733.tar.bz2

I tried to (ab)use gpsca infrastructure for bulk transfers, the driver is
quite essential but it works acceptably well, for now, even if I still
loose fames because of some bug.

The driver needs the attached changes (or any better equivalent)
to gspca bulk transfers code.
Could these changes break other drivers which work with bulk transfers?

Thanks,
   Antonio Ospite


Use gspca itself for usb communication when using bulk transfers.
Let the subdriver define the number of URBs to submit.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index e48fbfc..a909149 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -200,6 +200,7 @@ static void bulk_irq(struct urb *urb
 {
 	struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
 	struct gspca_frame *frame;
+	int st;
 
 	PDEBUG(D_PACK, "bulk irq");
 	if (!gspca_dev->streaming)
@@ -223,6 +224,11 @@ static void bulk_irq(struct urb *urb
 					urb->transfer_buffer,
 					urb->actual_length);
 	}
+	/* resubmit the URB */
+	urb->status = 0;
+	st = usb_submit_urb(urb, GFP_ATOMIC);
+	if (st < 0)
+		PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st);
 }
 
 /*
@@ -520,11 +526,11 @@ static int create_urbs(struct gspca_dev *gspca_dev,
 		nurbs = DEF_NURBS;
 	} else {				/* bulk */
 		npkt = 0;
-		bsize = gspca_dev->cam.	bulk_size;
+		bsize = gspca_dev->cam.bulk_size;
 		if (bsize == 0)
 			bsize = psize;
 		PDEBUG(D_STREAM, "bulk bsize:%d", bsize);
-		nurbs = 1;
+		nurbs = gspca_dev->cam.bulk_nurbs;
 	}
 
 	gspca_dev->nurbs = nurbs;
@@ -607,8 +613,10 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
 		atomic_set(&gspca_dev->nevent, 0);
 
 		/* bulk transfers are started by the subdriver */
+		/* XXX: find a way to esplicitly skip submitting urbs
 		if (gspca_dev->alt == 0)
 			break;
+		*/
 
 		/* submit the URBs */
 		for (n = 0; n < gspca_dev->nurbs; n++) {
@@ -1855,6 +1863,9 @@ int gspca_dev_probe(struct usb_interface *intf,
 	ret = gspca_dev->sd_desc->config(gspca_dev, id);
 	if (ret < 0)
 		goto out;
+	if (!gspca_dev->cam.bulk_nurbs)
+		gspca_dev->cam.bulk_nurbs = 1;
+
 	ret = gspca_dev->sd_desc->init(gspca_dev);
 	if (ret < 0)
 		goto out;
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h
index 1d9dc90..4f42953 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -56,6 +56,7 @@ extern int gspca_debug;
 /* device information - set at probe time */
 struct cam {
 	int bulk_size;		/* buffer size when image transfer by bulk */
+	int bulk_nurbs;		/* number of URBs to use in bulk mode*/
 	struct v4l2_pix_format *cam_mode;	/* size nmodes */
 	char nmodes;
 	__u8 epaddr;

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-11 17:42       ` Antonio Ospite
@ 2008-11-11 18:15         ` Antonio Ospite
  2008-11-11 20:01           ` Hans de Goede
  0 siblings, 1 reply; 29+ messages in thread
From: Antonio Ospite @ 2008-11-11 18:15 UTC (permalink / raw)
  To: video4linux-list

On Tue, 11 Nov 2008 18:42:00 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> 
> Actually I've started a port of this driver to gspca as an exercise.
> You can find a rough preview here:
> http://shell.studenti.unina.it/~ospite/tmp/gspca_ov534-20081111-1733.tar.bz2
>

And here's the direct link to the file, sorry for the tarball:
http://shell.studenti.unina.it/~ospite/tmp/gspca_ov534-20081111-1733/ov534.c

> I tried to (ab)use gpsca infrastructure for bulk transfers, the driver is
> quite essential but it works acceptably well, for now, even if I still
> loose fames because of some bug.
> 
> The driver needs the attached changes (or any better equivalent)
> to gspca bulk transfers code.

I forgot to say that the changes are against linux-2.6.28-rc4 from linus
git tree.

Regards,
   Antonio Ospite

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-11 18:15         ` Antonio Ospite
@ 2008-11-11 20:01           ` Hans de Goede
  2008-11-12 18:17             ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Hans de Goede @ 2008-11-11 20:01 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: video4linux-list

Hi,

I'll the real technical reply-ing to Jean Francois Moine, who knows the gspca 
bulk code a lot better then I do.

Antonio Ospite wrote:
> On Tue, 11 Nov 2008 18:42:00 +0100
> Antonio Ospite <ospite@studenti.unina.it> wrote:
> 
>> Actually I've started a port of this driver to gspca as an exercise.

Thanks, good work! Did this reduce the driver in size, iow do you think it 
makes writing usb webcam driver easy, any improvements we could make?

> And here's the direct link to the file, sorry for the tarball:
> http://shell.studenti.unina.it/~ospite/tmp/gspca_ov534-20081111-1733/ov534.c
> 
>> I tried to (ab)use gpsca infrastructure for bulk transfers, the driver is
>> quite essential but it works acceptably well, for now, even if I still
>> loose fames because of some bug.
>>
>> The driver needs the attached changes (or any better equivalent)
>> to gspca bulk transfers code.
> 
> I forgot to say that the changes are against linux-2.6.28-rc4 from linus
> git tree.
> 

If you do gspca based drivers, you will want to use jfmoine's tree as a base:
http://linuxtv.org/hg/~jfrancois/gspca/

Use "hg clone http://linuxtv.org/hg/~jfrancois/gspca/" to get it. hint if you 
don't have the hg command it is part of mercurial.

Regards,

Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-11 20:01           ` Hans de Goede
@ 2008-11-12 18:17             ` Antonio Ospite
  2008-11-13 11:33               ` Jean-Francois Moine
  0 siblings, 1 reply; 29+ messages in thread
From: Antonio Ospite @ 2008-11-12 18:17 UTC (permalink / raw)
  To: video4linux-list


[-- Attachment #1.1: Type: text/plain, Size: 1745 bytes --]

On Tue, 11 Nov 2008 21:01:02 +0100
Hans de Goede <j.w.r.degoede@hhs.nl> wrote:

> > Antonio Ospite <ospite@studenti.unina.it> wrote:
> > 
> >> Actually I've started a port of this driver to gspca as an exercise.
> 
> Thanks, good work! Did this reduce the driver in size, iow do you think it 
> makes writing usb webcam driver easy, any improvements we could make?
>

Well, with my hacks to gspca.c the ov534 driver has become really
trivial. The source has shrunk from 33K to 13K. But these hacks could
not be accepted though :) But, yes, the opinion on gspca is positive.

The improvement that I always dream to see is to have bridge and sensor
drivers split, so sensor drivers can be shared, a-la soc_camera, I mean.
Bringing that idea to the extreme, one could think even to share sensor
drivers with the soc_camera framework itself, but I only have this
abstract suggestion, no idea at all about how it can be done, sorry.
Could it be a GSoC project for next summer?

> > I forgot to say that the changes are against linux-2.6.28-rc4 from linus
> > git tree.
> > 
> 
> If you do gspca based drivers, you will want to use jfmoine's tree as a base:
> http://linuxtv.org/hg/~jfrancois/gspca/
> 
> Use "hg clone http://linuxtv.org/hg/~jfrancois/gspca/" to get it. hint if you 
> don't have the hg command it is part of mercurial.
> 
> Regards,
> 
> Hans

Thanks, will try that.

Regards,
   Antonio Ospite

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

  Web site: http://www.studenti.unina.it/~ospite
Public key: http://www.studenti.unina.it/~ospite/aopubkey.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-12 18:17             ` Antonio Ospite
@ 2008-11-13 11:33               ` Jean-Francois Moine
  2008-11-13 17:04                 ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Francois Moine @ 2008-11-13 11:33 UTC (permalink / raw)
  To: Video 4 Linux

On Wed, 2008-11-12 at 19:17 +0100, Antonio Ospite wrote:
> Well, with my hacks to gspca.c the ov534 driver has become really
> trivial. The source has shrunk from 33K to 13K. But these hacks could
> not be accepted though :) But, yes, the opinion on gspca is positive.

Hello Antonio,

Thank you for your opinion.

I looked again at your subdriver, and it seems good to me. So forget
about mine which is too buggy.

About your hacks to gspca, there are good and bad ideas. The good idea
is to have the bulk_nurbs parameter. The bad idea is to force it to one
when no set. To preserve the compatibility, the bulk_nurbs may be set to
some value for webcams which accept permanent bulk read, the submit
being done by gspca. For the other webcams, as those in finepix, a null
bulk_nurbs will indicate that the bulk read requests are done by the
subdriver. Is it OK for you?

Also, I saw a little problem in your subdriver: in pkt_scan, you use a
static variable (count). This does not work with many active webcams and
also after stop / restart streaming. Instead, you may know the current
byte count using the frame values data and data_end.

> The improvement that I always dream to see is to have bridge and
> sensor
> drivers split, so sensor drivers can be shared, a-la soc_camera, I
> mean.

There were many threads about this subject, but I could not find many
common values for a same sensor with different bridges in gspca...

> Bringing that idea to the extreme, one could think even to share
> sensor
> drivers with the soc_camera framework itself, but I only have this
> abstract suggestion, no idea at all about how it can be done, sorry.
> Could it be a GSoC project for next summer?

Why not?

-- 
Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |               http://moinejf.free.fr/


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-13 11:33               ` Jean-Francois Moine
@ 2008-11-13 17:04                 ` Antonio Ospite
  2008-11-13 18:30                   ` Jean-Francois Moine
  0 siblings, 1 reply; 29+ messages in thread
From: Antonio Ospite @ 2008-11-13 17:04 UTC (permalink / raw)
  To: video4linux-list


[-- Attachment #1.1: Type: text/plain, Size: 1973 bytes --]

On Thu, 13 Nov 2008 12:33:58 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

> On Wed, 2008-11-12 at 19:17 +0100, Antonio Ospite wrote:
> > Well, with my hacks to gspca.c the ov534 driver has become really
> > trivial. The source has shrunk from 33K to 13K. But these hacks could
> > not be accepted though :) But, yes, the opinion on gspca is positive.
> 
> Hello Antonio,
> 
> Thank you for your opinion.
> 
> I looked again at your subdriver, and it seems good to me. So forget
> about mine which is too buggy.
> 
> About your hacks to gspca, there are good and bad ideas. The good idea
> is to have the bulk_nurbs parameter. The bad idea is to force it to one
> when no set. To preserve the compatibility, the bulk_nurbs may be set to
> some value for webcams which accept permanent bulk read, the submit
> being done by gspca. For the other webcams, as those in finepix, a null
> bulk_nurbs will indicate that the bulk read requests are done by the
> subdriver. Is it OK for you?
>

So (cam->bulk_nurbs == 0) would mean that the subdriver takes care of
usb tranfers, right? That would also imply that bulk_irq() is not set
for these drivers and sd_pkt_scan() is never called which looks fair to
me.

If this is really ok I'll update my changes and send for review.

> Also, I saw a little problem in your subdriver: in pkt_scan, you use a
> static variable (count). This does not work with many active webcams and
> also after stop / restart streaming. Instead, you may know the current
> byte count using the frame values data and data_end.
>

I'll take a look at that too, thanks for the hints.

Regards,
   Antonio Ospite

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

  Web site: http://www.studenti.unina.it/~ospite
Public key: http://www.studenti.unina.it/~ospite/aopubkey.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-13 17:04                 ` Antonio Ospite
@ 2008-11-13 18:30                   ` Jean-Francois Moine
  2008-11-13 22:35                     ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Francois Moine @ 2008-11-13 18:30 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: video4linux-list

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

On Thu, 2008-11-13 at 18:04 +0100, Antonio Ospite wrote:
> So (cam->bulk_nurbs == 0) would mean that the subdriver takes care of
> usb tranfers, right? That would also imply that bulk_irq() is not set
> for these drivers and sd_pkt_scan() is never called which looks fair to
> me.
	[snip]

Yes. In the finepix subdriver, the 'complete' function of the URB is
changed to a local function which does the packet analysis and restarts
the next transfer after a delay.

I attached the patch of the main driver.

Cheers.

-- 
Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |               http://moinejf.free.fr/


[-- Attachment #2: gspca_bulk.patch --]
[-- Type: text/x-patch, Size: 1964 bytes --]

diff -r 417024f56f55 linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c	Tue Nov 11 12:42:56 2008 +0100
+++ b/linux/drivers/media/video/gspca/gspca.c	Thu Nov 13 19:14:42 2008 +0100
@@ -213,6 +213,7 @@
 {
 	struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
 	struct gspca_frame *frame;
+	int st;
 
 	PDEBUG(D_PACK, "bulk irq");
 	if (!gspca_dev->streaming)
@@ -235,6 +236,13 @@
 					frame,
 					urb->transfer_buffer,
 					urb->actual_length);
+	}
+
+	/* resubmit the URB */
+	if (gspca_dev->cam.bulk_nurbs != 0) {
+		st = usb_submit_urb(urb, GFP_ATOMIC);
+		if (st < 0)
+			PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st);
 	}
 }
 
@@ -533,11 +541,14 @@
 		nurbs = DEF_NURBS;
 	} else {				/* bulk */
 		npkt = 0;
-		bsize = gspca_dev->cam.	bulk_size;
+		bsize = gspca_dev->cam.bulk_size;
 		if (bsize == 0)
 			bsize = psize;
 		PDEBUG(D_STREAM, "bulk bsize:%d", bsize);
-		nurbs = 1;
+		if (gspca_dev->cam.bulk_nurbs != 0)
+			nurbs = gspca_dev->cam.bulk_nurbs;
+		else
+			nurbs = 1;
 	}
 
 	gspca_dev->nurbs = nurbs;
@@ -625,8 +636,8 @@
 		gspca_dev->streaming = 1;
 		atomic_set(&gspca_dev->nevent, 0);
 
-		/* bulk transfers are started by the subdriver */
-		if (gspca_dev->alt == 0)
+		/* some bulk transfers are started by the subdriver */
+		if (gspca_dev->alt == 0 && gspca_dev->cam.bulk_nurbs == 0)
 			break;
 
 		/* submit the URBs */
diff -r 417024f56f55 linux/drivers/media/video/gspca/gspca.h
--- a/linux/drivers/media/video/gspca/gspca.h	Tue Nov 11 12:42:56 2008 +0100
+++ b/linux/drivers/media/video/gspca/gspca.h	Thu Nov 13 19:14:42 2008 +0100
@@ -58,6 +58,10 @@
 	int bulk_size;		/* buffer size when image transfer by bulk */
 	struct v4l2_pix_format *cam_mode;	/* size nmodes */
 	char nmodes;
+	__u8 bulk_nurbs;	/* number of URBs in bulk mode
+				 * - cannot be > MAX_NURBS
+				 * - when 0 and bulk_size != 0 means
+				 *   1 URB and submit done by subdriver */
 	__u8 epaddr;
 };
 

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-13 18:30                   ` Jean-Francois Moine
@ 2008-11-13 22:35                     ` Antonio Ospite
  2008-11-14 10:55                       ` Jean-Francois Moine
  0 siblings, 1 reply; 29+ messages in thread
From: Antonio Ospite @ 2008-11-13 22:35 UTC (permalink / raw)
  To: video4linux-list


[-- Attachment #1.1: Type: text/plain, Size: 3846 bytes --]

On Thu, 13 Nov 2008 19:30:59 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

>
> On Thu, 2008-11-13 at 18:04 +0100, Antonio Ospite wrote:
> > So (cam->bulk_nurbs == 0) would mean that the subdriver takes care of
> > usb tranfers, right? That would also imply that bulk_irq() is not set
> > for these drivers and sd_pkt_scan() is never called which looks fair to
> > me.
> 	[snip]
> 
> Yes. In the finepix subdriver, the 'complete' function of the URB is
> changed to a local function which does the packet analysis and restarts
> the next transfer after a delay.
> 
> I attached the patch of the main driver.
>

Many thanks Jean-Francois, any ETA of this change in mainline?
Some comments inlined

Regards,
   Antonio Ospite

> Cheers.
> 
> -- 
> Ken ar c'hentañ |             ** Breizh ha Linux atav! **
> Jef             |               http://moinejf.free.fr/
> 
> 
> 
> [gspca_bulk.patch  text/x-patch (1,9KB)]
> diff -r 417024f56f55 linux/drivers/media/video/gspca/gspca.c
> --- a/linux/drivers/media/video/gspca/gspca.c	Tue Nov 11 12:42:56 2008 +0100
> +++ b/linux/drivers/media/video/gspca/gspca.c	Thu Nov 13 19:14:42 2008 +0100
> @@ -213,6 +213,7 @@
>  {
>  	struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
>  	struct gspca_frame *frame;
> +	int st;
>  
>  	PDEBUG(D_PACK, "bulk irq");
>  	if (!gspca_dev->streaming)
> @@ -235,6 +236,13 @@
>  					frame,
>  					urb->transfer_buffer,
>  					urb->actual_length);
> +	}
> +
> +	/* resubmit the URB */
> +	if (gspca_dev->cam.bulk_nurbs != 0) {

Just to be sure: this check is still needed because bulk_irq() can be
still called even for drivers like finepix, right?
I am not sure I've fully understood the code path here, maybe I should
look better at what the finepix driver does, sorry, does it still uses
the urb initialized in create_urbs(), even if it drives the submission
manually?

> +		st = usb_submit_urb(urb, GFP_ATOMIC);
> +		if (st < 0)
> +			PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st);
>  	}
>  }
>  
> @@ -533,11 +541,14 @@
>  		nurbs = DEF_NURBS;
>  	} else {				/* bulk */
>  		npkt = 0;
> -		bsize = gspca_dev->cam.	bulk_size;
> +		bsize = gspca_dev->cam.bulk_size;
>  		if (bsize == 0)
>  			bsize = psize;
>  		PDEBUG(D_STREAM, "bulk bsize:%d", bsize);
> -		nurbs = 1;
> +		if (gspca_dev->cam.bulk_nurbs != 0)
> +			nurbs = gspca_dev->cam.bulk_nurbs;

should we set this to min(gspca_dev->cam.bulk_nurbs, MAX_NURBS) ?

> +		else
> +			nurbs = 1;
>  	}
>  
>  	gspca_dev->nurbs = nurbs;
> @@ -625,8 +636,8 @@
>  		gspca_dev->streaming = 1;
>  		atomic_set(&gspca_dev->nevent, 0);
>  
> -		/* bulk transfers are started by the subdriver */
> -		if (gspca_dev->alt == 0)
> +		/* some bulk transfers are started by the subdriver */
> +		if (gspca_dev->alt == 0 && gspca_dev->cam.bulk_nurbs == 0)
>  			break;
>  
>  		/* submit the URBs */
> diff -r 417024f56f55 linux/drivers/media/video/gspca/gspca.h
> --- a/linux/drivers/media/video/gspca/gspca.h	Tue Nov 11 12:42:56 2008 +0100
> +++ b/linux/drivers/media/video/gspca/gspca.h	Thu Nov 13 19:14:42 2008 +0100
> @@ -58,6 +58,10 @@
>  	int bulk_size;		/* buffer size when image transfer by bulk */
>  	struct v4l2_pix_format *cam_mode;	/* size nmodes */
>  	char nmodes;
> +	__u8 bulk_nurbs;	/* number of URBs in bulk mode
> +				 * - cannot be > MAX_NURBS
> +				 * - when 0 and bulk_size != 0 means
> +				 *   1 URB and submit done by subdriver */
>  	__u8 epaddr;
>  };
>  
> 


-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

  Web site: http://www.studenti.unina.it/~ospite
Public key: http://www.studenti.unina.it/~ospite/aopubkey.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-13 22:35                     ` Antonio Ospite
@ 2008-11-14 10:55                       ` Jean-Francois Moine
  2008-11-14 14:04                         ` Antonio Ospite
  0 siblings, 1 reply; 29+ messages in thread
From: Jean-Francois Moine @ 2008-11-14 10:55 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: video4linux-list

On Thu, 2008-11-13 at 23:35 +0100, Antonio Ospite wrote:
> > I attached the patch of the main driver.
> 
> Many thanks Jean-Francois, any ETA of this change in mainline?

Sorry, what do you mean by ETA? I uploaded the patch to my repository
with you as the author.

	[snip]
> > +	/* resubmit the URB */
> > +	if (gspca_dev->cam.bulk_nurbs != 0) {
> 
> Just to be sure: this check is still needed because bulk_irq() can be
> still called even for drivers like finepix, right?

Yes, the subdriver may use the bulk_irq or have an other function. This
is the case for finepix which may receive normal(!) URB errors.

> I am not sure I've fully understood the code path here, maybe I should
> look better at what the finepix driver does, sorry, does it still uses
> the urb initialized in create_urbs(), even if it drives the submission
> manually?

Yes. The URB is created and destroyed by the main driver. Only the
submission and optionally the IRQ treatment are done by the subdriver.

	[snip]
> > +		if (gspca_dev->cam.bulk_nurbs != 0)
> > +			nurbs = gspca_dev->cam.bulk_nurbs;
> 
> should we set this to min(gspca_dev->cam.bulk_nurbs, MAX_NURBS) ?

Yes, we should, but, if a greater value is set, the subdriver will crash
at the first development test...

Regards.

-- 
Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |               http://moinejf.free.fr/


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH] Add support for OmniVision OV534 based USB cameras.
  2008-11-14 10:55                       ` Jean-Francois Moine
@ 2008-11-14 14:04                         ` Antonio Ospite
  0 siblings, 0 replies; 29+ messages in thread
From: Antonio Ospite @ 2008-11-14 14:04 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: video4linux-list


[-- Attachment #1.1: Type: text/plain, Size: 1251 bytes --]

On Fri, 14 Nov 2008 11:55:30 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

> On Thu, 2008-11-13 at 23:35 +0100, Antonio Ospite wrote:
> > > I attached the patch of the main driver.
> > 
> > Many thanks Jean-Francois, any ETA of this change in mainline?
> 
> Sorry, what do you mean by ETA? I uploaded the patch to my repository
> with you as the author.
>

ETA: Estimated Time of Arrival.
I wondered if you had an idea about when the change will hit Linus
tree, just that.

> > > +		if (gspca_dev->cam.bulk_nurbs != 0)
> > > +			nurbs = gspca_dev->cam.bulk_nurbs;
> > 
> > should we set this to min(gspca_dev->cam.bulk_nurbs, MAX_NURBS) ?
> 
> Yes, we should, but, if a greater value is set, the subdriver will crash
> at the first development test...
>

Ok, if you think that having subdriver crash during development is ok,
then it is perfectly fine with me too.

Back to ov534 now :)

Regards,
   Antonio Ospite

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

  Web site: http://www.studenti.unina.it/~ospite
Public key: http://www.studenti.unina.it/~ospite/aopubkey.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2008-11-14 14:04 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-16  5:00 [PATCH] Add support for OmniVision OV534 based USB cameras majortrips
2008-08-16  6:58 ` Hans de Goede
2008-08-16  7:46   ` Mark Ferrell
2008-08-16  8:03     ` Hans de Goede
2008-08-16 11:47       ` Mauro Carvalho Chehab
2008-08-17  7:03         ` Jean-Francois Moine
2008-08-16 11:36 ` Mauro Carvalho Chehab
2008-08-16 12:13   ` Mark Ferrell
2008-11-05 22:31     ` Mauro Carvalho Chehab
2008-11-11 17:42       ` Antonio Ospite
2008-11-11 18:15         ` Antonio Ospite
2008-11-11 20:01           ` Hans de Goede
2008-11-12 18:17             ` Antonio Ospite
2008-11-13 11:33               ` Jean-Francois Moine
2008-11-13 17:04                 ` Antonio Ospite
2008-11-13 18:30                   ` Jean-Francois Moine
2008-11-13 22:35                     ` Antonio Ospite
2008-11-14 10:55                       ` Jean-Francois Moine
2008-11-14 14:04                         ` Antonio Ospite
  -- strict thread matches above, loose matches on Subject: below --
2008-08-17 19:48 Theou Jean-Baptiste
2008-08-17 19:58 ` Theou Jean-Baptiste
2008-08-17 20:13   ` Theou Jean-Baptiste
2008-08-18  0:34   ` Mark Ferrell
2008-08-18 12:08     ` Theou Jean-Baptiste
2008-08-18 16:24       ` Mark Ferrell
2008-08-18 16:53         ` Theou Jean-Baptiste
2008-08-20 10:35           ` Theou Jean-Baptiste
2008-08-22 11:18             ` Mark Ferrell
2008-08-18  0:29 ` Mark Ferrell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox