From patchwork Fri Feb 12 14:38:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas schorpp X-Patchwork-Id: 78899 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1CEcGBY027255 for ; Fri, 12 Feb 2010 14:38:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755953Ab0BLOiP (ORCPT ); Fri, 12 Feb 2010 09:38:15 -0500 Received: from mail-bw0-f212.google.com ([209.85.218.212]:63786 "EHLO mail-bw0-f212.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754358Ab0BLOiN (ORCPT ); Fri, 12 Feb 2010 09:38:13 -0500 Received: by bwz4 with SMTP id 4so2826821bwz.2 for ; Fri, 12 Feb 2010 06:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=rNfZDZoJQ5wawKLkAvXxk+/LrE1YOVJW1QwXlx0TQoo=; b=NLKopIDl0PXnMTo1cahYzHYCSX0wr+3E+G/kDvnZ5epYdaTbejgpcV1mnb9GSd0Lsl Np9FfL9gdiQDi0iTPyIP3kGXzVT6uhH1ID//crG9oDKkFckPpWJqPO00gcy6w0Lff0Q/ DFZ0zDQkEdvW5yZ7IuXHheNkI8SQOgbk9fPG4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=sCkHnrs3Z6spqwqOpXeEQwQhD60nlAeDosZ9OVPEUr2ipbMBhYbSy6phH5+KqUaF+e 7zxPBSl8l3ZEz484X3vraoWWH9YljrRQdO46MrRiSGQFid7PAucuusq5NY3H0Uo3/Wce FDcWwkUwUZrQUWAzQY7ISyTt2Kp2YytgTdtDs= Received: by 10.103.85.28 with SMTP id n28mr983001mul.121.1265985488441; Fri, 12 Feb 2010 06:38:08 -0800 (PST) Received: from ?192.168.0.100? (krlh-4d03632b.pool.mediaWays.net [77.3.99.43]) by mx.google.com with ESMTPS id 23sm18972786mun.38.2010.02.12.06.38.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 12 Feb 2010 06:38:06 -0800 (PST) Message-ID: <4B7567CB.20609@gmail.com> Date: Fri, 12 Feb 2010 15:38:03 +0100 From: thomas schorpp Reply-To: thomas.schorpp@gmail.com User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: linux-media@vger.kernel.org CC: Antoine Jacquet Subject: Re: zr364xx: Aiptek DV8800 (neo): 08ca:2062: Fails on subsequent zr364xx_open() References: <4B73C792.3060907@gmail.com> <4B741C47.1090905@zerezo.com> In-Reply-To: <4B741C47.1090905@zerezo.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Feb 2010 14:38:17 +0000 (UTC) --- drivers/media/video/zr364xx.c.orig 2009-12-18 23:27:07.000000000 +0100 +++ drivers/media/video/zr364xx.c 2010-02-12 12:57:54.000000000 +0100 @@ -205,40 +205,41 @@ struct zr364xx_buffer { /* common v4l buffer stuff -- must be first */ struct videobuf_buffer vb; const struct zr364xx_fmt *fmt; }; /* function used to send initialisation commands to the camera */ static int send_control_msg(struct usb_device *udev, u8 request, u16 value, u16 index, unsigned char *cp, u16 size) { int status; unsigned char *transfer_buffer = kmalloc(size, GFP_KERNEL); if (!transfer_buffer) { dev_err(&udev->dev, "kmalloc(%d) failed\n", size); return -ENOMEM; } memcpy(transfer_buffer, cp, size); + mdelay(300); status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), request, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, index, transfer_buffer, size, CTRL_TIMEOUT); kfree(transfer_buffer); if (status < 0) dev_err(&udev->dev, "Failed sending control message, error %d.\n", status); return status; } /* Control messages sent to the camera to initialize it * and launch the capture */ typedef struct { @@ -1248,40 +1249,41 @@ /* open the camera */ static int zr364xx_open(struct file *file) { struct video_device *vdev = video_devdata(file); struct zr364xx_camera *cam = video_drvdata(file); struct usb_device *udev = cam->udev; int i, err; DBG("%s\n", __func__); mutex_lock(&cam->open_lock); if (cam->users) { err = -EBUSY; goto out; } for (i = 0; init[cam->method][i].size != -1; i++) { +// if (i == 6) mdelay(1000); err = send_control_msg(udev, 1, init[cam->method][i].value, 0, init[cam->method][i].bytes, init[cam->method][i].size); if (err < 0) { dev_err(&cam->udev->dev, "error during open sequence: %d\n", i); goto out; } } cam->skip = 2; cam->users++; file->private_data = vdev; cam->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; cam->fmt = formats; videobuf_queue_vmalloc_init(&cam->vb_vidq, &zr364xx_video_qops, NULL, &cam->slock, cam->type,