From patchwork Wed Aug 19 21:46:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Paris X-Patchwork-Id: 42789 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7JLlboE018958 for ; Wed, 19 Aug 2009 21:47:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753173AbZHSVrP (ORCPT ); Wed, 19 Aug 2009 17:47:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753223AbZHSVrO (ORCPT ); Wed, 19 Aug 2009 17:47:14 -0400 Received: from jim.sh ([75.150.123.25]:54961 "EHLO psychosis.jim.sh" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbZHSVrO (ORCPT ); Wed, 19 Aug 2009 17:47:14 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5) with ESMTP id n7JLkJVA025780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 19 Aug 2009 17:46:19 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id n7JLkIl4025779; Wed, 19 Aug 2009 17:46:18 -0400 From: Jim Paris To: stable@kernel.org Cc: linux-media@vger.kernel.org, Jim Paris Subject: [PATCH] gspca - ov534: Fix ov772x Date: Wed, 19 Aug 2009 17:46:18 -0400 Message-Id: <1250718378-25759-1-git-send-email-jim@jtan.com> X-Mailer: git-send-email 1.5.6.5 X-Virus-Scanned: ClamAV 0.94.2/9721/Wed Aug 19 15:34:26 2009 on psychosis.jim.sh X-Virus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The scan of the image packets of the sensor ov772x was broken when the sensor ov965x was added. [ Based on upstream c874f3aa, modified slightly for v2.6.30.5 ] Signed-off-by: Jim Paris Acked-by: Jean-Francois Moine --- Hi, Commit 84fbdf87ab8eaa4eaefb317a7eb437cd4d3d0ebf: "V4L/DVB (11105): gspca - ov534: Adjust the packet scan function" broke the gspca ov534 driver for the Playstation Eye in 2.6.30. Commit c874f3aa7e66158dccb2b9f3cfc46c65af6c223d: "V4L/DVB (11973): gspca - ov534: Do the ov772x work again." fixed it for 2.6.31. c874f3aa depends on earlier patches, so this is a functionally equivalent version for 2.6.30.x. With this patch, the Playstation Eye camera works again. Please consider for 2.6.30.6. Thanks, -jim drivers/media/video/gspca/ov534.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 19e0bc6..504f849 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c @@ -832,9 +832,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, __u32 this_pts; u16 this_fid; int remaining_len = len; + int payload_len; + payload_len = (sd->sensor == SENSOR_OV772X) ? 2048 : 2040; do { - len = min(remaining_len, 2040); /*fixme: was 2048*/ + len = min(remaining_len, payload_len); /* Payloads are prefixed with a UVC-style header. We consider a frame to start when the FID toggles, or the PTS