Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1158296pxb; Fri, 22 Jan 2021 08:29:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJx15EfyaWMHBbBg1vhvVU1fKdDMxEZjXHzanOHKtTChWCg+e7hu9vT1/WFMM1Ot2ZBtCzl+ X-Received: by 2002:aa7:c34f:: with SMTP id j15mr196819edr.120.1611332972347; Fri, 22 Jan 2021 08:29:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611332972; cv=none; d=google.com; s=arc-20160816; b=U4x1FZLjy7t4QtssTbSIx9GtAIw4xcNjsTgxTUne+B7C2vTrUFhre4sS0yreuV/Ex/ A3HPWXyB7F7ygcAFUgLmH3RWtzxr5NggudJxQzXP85Ycun42ulFNnRikeobQux8qUJ05 1Q1WpOfszYgUTt2a8DbB/WK1ixEQu2zNAaAub0iVDhwuyhFuGyLlueIaMpHqPEflV8e7 OjD61ifNZpczj2AaeNK32xlGqs7SgHGdjrstIMqRrwmHrHw0vy8Q+bNWsS3hYKg7GKni 4o3sn90i2BfA9W/BPJvozqxs2OEPkp3odh2Atl/oIIGXrxW5okR1y+NquJ3fVbJJpjxs EIpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wDoW0mIcGeasuu/XYMbJCXk81PMItM/PLQkcDJrsmkU=; b=nqeOYD1JSWx3jVtoMHiL6jPPrzFfiVUOoSd1RLHtYynnau+HLCNNupGN6cnrPbKkMa y/N1XwEK27Lnt9XjzN3xBWAqMOYcVDg1wSrSWFzK2Z4F8d6s6RXXMGzUQ83XH17OBU2p 9iR3GJ9hvlkTeDhTJW0Fy7826vZG2bRvmwSNRc3gHcqONE7Qs21tiARsyVGVUaX0wfsG P90Rp5KF7ofQWlZBru3W2pNEN09qIKyABZDhyzlu2c1OppOGy8vs5ve8gVtt1gxOMgiW nwyJC7wXLEuJdVHCWgPKevxMGKznva7+732Um9vVsW1lGukR3FbmYboI9v7Ei7dN8q1P j7aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si3660271edv.507.2021.01.22.08.29.08; Fri, 22 Jan 2021 08:29:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729748AbhAVQ2h (ORCPT + 99 others); Fri, 22 Jan 2021 11:28:37 -0500 Received: from netrider.rowland.org ([192.131.102.5]:60849 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729698AbhAVQZ2 (ORCPT ); Fri, 22 Jan 2021 11:25:28 -0500 Received: (qmail 45724 invoked by uid 1000); 22 Jan 2021 11:24:47 -0500 Date: Fri, 22 Jan 2021 11:24:47 -0500 From: Alan Stern To: Wesley Cheng Cc: balbi@kernel.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter.chen@nxp.com, jackp@codeaurora.org Subject: Re: [PATCH v6 1/4] usb: gadget: udc: core: Introduce check_config to verify USB configuration Message-ID: <20210122162447.GC43566@rowland.harvard.edu> References: <1611288100-31118-1-git-send-email-wcheng@codeaurora.org> <1611288100-31118-2-git-send-email-wcheng@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611288100-31118-2-git-send-email-wcheng@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 08:01:37PM -0800, Wesley Cheng wrote: > Some UDCs may have constraints on how many high bandwidth endpoints it can > support in a certain configuration. This API allows for the composite > driver to pass down the total number of endpoints to the UDC so it can verify > it has the required resources to support the configuration. > > Signed-off-by: Wesley Cheng > --- a/include/linux/usb/gadget.h > +++ b/include/linux/usb/gadget.h > @@ -328,6 +328,7 @@ struct usb_gadget_ops { > struct usb_ep *(*match_ep)(struct usb_gadget *, > struct usb_endpoint_descriptor *, > struct usb_ss_ep_comp_descriptor *); > + int (*check_config)(struct usb_gadget *gadget, unsigned long ep_map); > }; > > /** > @@ -607,6 +608,7 @@ int usb_gadget_connect(struct usb_gadget *gadget); > int usb_gadget_disconnect(struct usb_gadget *gadget); > int usb_gadget_deactivate(struct usb_gadget *gadget); > int usb_gadget_activate(struct usb_gadget *gadget); > +int usb_gadget_check_config(struct usb_gadget *gadget, unsigned long ep_map); > #else > static inline int usb_gadget_frame_number(struct usb_gadget *gadget) > { return 0; } Don't you also need an entry for the case where CONFIG_USB_GADGET isn't enabled? Alan Stern