From patchwork Tue Dec 7 20:37:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 384022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB7Kc759019186 for ; Tue, 7 Dec 2010 20:38:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754911Ab0LGUha (ORCPT ); Tue, 7 Dec 2010 15:37:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33905 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754896Ab0LGUh3 (ORCPT ); Tue, 7 Dec 2010 15:37:29 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB7KbQWu016272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Dec 2010 15:37:26 -0500 Received: from pedra (vpn-231-36.phx2.redhat.com [10.3.231.36]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB7KbOpj018149; Tue, 7 Dec 2010 15:37:24 -0500 Date: Tue, 7 Dec 2010 18:37:15 -0200 From: Mauro Carvalho Chehab To: Jean-Francois Moine , Brian Johnson , Linux Media Mailing List Subject: [PATCH 3/3] [media] gspca/sn9c20x: Fix regression o SXGA mode Message-ID: <20101207183715.32a36dfc@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 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 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Dec 2010 20:38:07 +0000 (UTC) diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 0a7af73..b74bfa1 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 && i < gspca_dev->nbalt - 2) + if (!gspca_dev->no_audio_hack && 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 && i > 1) + if (!gspca_dev->no_audio_hack && gspca_dev->audio && i > 1) i--; while (--i >= 0) { ep = alt_xfer(&intf->altsetting[i], xfer); diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index d4d210b..8f0fcf2 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h @@ -220,6 +220,7 @@ struct gspca_dev { __u8 alt; /* USB alternate setting */ __u8 nbalt; /* number of USB alternate settings */ u8 audio; /* presence of audio device */ + u8 no_audio_hack; /* Disable audio alternate hack */ }; int gspca_dev_probe(struct usb_interface *intf, diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index e812598..55c7f17 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c @@ -2031,6 +2031,7 @@ static int sd_init(struct gspca_dev *gspca_dev) u8 i2c_init[9] = {0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}; + gspca_dev->no_audio_hack = 1; for (i = 0; i < ARRAY_SIZE(bridge_init); i++) { value = bridge_init[i][1]; if (reg_w(gspca_dev, bridge_init[i][0], &value, 1) < 0) {