From patchwork Fri Nov 5 22:08:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 4802 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Fri, 05 Nov 2010 22:26:19 -0400 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PEYTz-0003Js-FQ for mchehab@gaivota; Fri, 05 Nov 2010 22:26:19 -0400 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 05 Nov 2010 22:26:19 -0400 (EDT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PEUTC-0003zy-Sr; Fri, 05 Nov 2010 22:09:15 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753672Ab0KEWJL (ORCPT + 1 other); Fri, 5 Nov 2010 18:09:11 -0400 Received: from smtp206.alice.it ([82.57.200.102]:50266 "EHLO smtp206.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476Ab0KEWJK (ORCPT ); Fri, 5 Nov 2010 18:09:10 -0400 Received: from jcn (87.1.14.101) by smtp206.alice.it (8.5.124.08) id 4C1A268C094E96D4; Fri, 5 Nov 2010 23:08:50 +0100 Received: from ao2 by jcn with local (Exim 4.72) (envelope-from ) id 1PEUSn-0001kH-6U; Fri, 05 Nov 2010 23:08:49 +0100 From: Antonio Ospite To: stable@kernel.org Cc: Antonio Ospite , =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH] [media] gspca - main: Fix a regression with the PS3 Eye webcam Date: Fri, 5 Nov 2010 23:08:12 +0100 Message-Id: <1288994892-6681-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.2.3 MIME-Version: 1.0 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= commit f43402fa55bf5e7e190c176343015122f694857c upstream. When audio is present, some alternate settings were skipped. This prevented some webcams to work, especially when bulk transfer was used. This patch permits to use the last or only alternate setting. Reported-by: Antonio Ospite Tested-by: Antonio Ospite Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- This is to be applied to 2.6.36 only, as the regression was introduced there. I don't know how many distributors are shipping 2.6.36 and how urgent this can be, but FYI without this change video capture on the Playstation Eye (gspca ov534 driver) does not work at all. Regards, Antonio drivers/media/video/gspca/gspca.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 0fb48c0..c64299d 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -652,7 +652,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) : USB_ENDPOINT_XFER_ISOC; i = gspca_dev->alt; /* previous alt setting */ if (gspca_dev->cam.reverse_alts) { - if (gspca_dev->audio) + if (gspca_dev->audio && i < gspca_dev->nbalt - 2) i++; while (++i < gspca_dev->nbalt) { ep = alt_xfer(&intf->altsetting[i], xfer); @@ -660,7 +660,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) break; } } else { - if (gspca_dev->audio) + if (gspca_dev->audio && i > 1) i--; while (--i >= 0) { ep = alt_xfer(&intf->altsetting[i], xfer);