From patchwork Fri Oct 17 17:09:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38903 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3E8F202DB for ; Fri, 17 Oct 2014 17:10:35 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf796206eek.4 for ; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=bR2ehS9ITgpN9xUIpHd11bNzB2DzaWFjrn3VA2L7aWk=; b=ejyW1JfUYcaqyt43lLmoG5AeYApiJaLmwaOFXyvuOB7oz77spwA/kzGFRs9xNMZNIw +LbzUzAvQgdnWZ6K3Ohzkpsa/lPXKRsKpW+gdsnEvB61GXlDwjlPTI9U3SeOooDYlAKa vEa0LrGp4rY0RC9HMRoeQf4aeZyRBSta7UVDTsdksItX+JISBrgLlAEuPajSdB9ac+Th VCcKVSKxMGzAH6KvP2zsvfNR1ks/MXeoRS+MLvW26xYkMj4NxxxCOCUAWYXgmesnqIDm aqjFxbglFaANyFYEI57mwFu3FjlMRIDbiV4ds0/qe27ihCMcW0p7T90H2I65+aQt6a2e Y2JQ== X-Gm-Message-State: ALoCoQmyaWll+7Fetf+JijDm4p+BwUrwzVvdYN0YWD27SIaT1DXodu/mGfMmpkaB/Uz6/I3Xn8Yo X-Received: by 10.180.90.115 with SMTP id bv19mr49300wib.1.1413565834760; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.225 with SMTP id n1ls74123lan.34.gmail; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) X-Received: by 10.152.45.105 with SMTP id l9mr10229485lam.69.1413565834591; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id l3si2945536laf.89.2014.10.17.10.10.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so1036619lam.22 for ; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr10087022lbc.23.1413565834431; Fri, 17 Oct 2014 10:10:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp266703lbz; Fri, 17 Oct 2014 10:10:33 -0700 (PDT) X-Received: by 10.68.250.131 with SMTP id zc3mr9945821pbc.34.1413565831999; Fri, 17 Oct 2014 10:10:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si1697524pdo.45.2014.10.17.10.10.31 for ; Fri, 17 Oct 2014 10:10:31 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbaJQRK0 (ORCPT + 3 others); Fri, 17 Oct 2014 13:10:26 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55632 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbaJQRKY (ORCPT ); Fri, 17 Oct 2014 13:10:24 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHANwW024879 for ; Fri, 17 Oct 2014 12:10:23 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHANem027766 for ; Fri, 17 Oct 2014 12:10:23 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:10:22 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHAMV9021656; Fri, 17 Oct 2014 12:10:23 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 08/28] usb: gadget: function: uvc: return correct alt-setting Date: Fri, 17 Oct 2014 12:09:44 -0500 Message-ID: <1413565804-13061-9-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413565804-13061-1-git-send-email-balbi@ti.com> References: <1413565804-13061-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If our alternate setting has been selected, we must return that on a subsequent Get Interface request even if we're not streaming. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/f_uvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index e00e8b7..4138ad5 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -279,7 +279,7 @@ uvc_function_get_alt(struct usb_function *f, unsigned interface) else if (interface != uvc->streaming_intf) return -EINVAL; else - return uvc->state == UVC_STATE_STREAMING ? 1 : 0; + return uvc->video.ep->driver_data ? 1 : 0; } static int