Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1742295pxb; Sat, 14 Nov 2020 00:16:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1zE1nLU5CCpxfO2S4bZwBxzHvomxcL/lKMJbvBAYDwagP1Akq9M4u+4AkIKh6JE/CQQd3 X-Received: by 2002:a17:906:2708:: with SMTP id z8mr5941891ejc.428.1605341807655; Sat, 14 Nov 2020 00:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605341807; cv=none; d=google.com; s=arc-20160816; b=Vf99RTJnhAw5hi1tMk2Sndp3O09sYt8ebWywVNqLIAu51wSwlwjcsB3I2UkcRVuU2A s7UJK2O/JT7DpFiwMlPm6vzOE0l7+tKAZzjoxVC3mvO2VO9GVf4k0GHi0tejs+Wrqgqe 5gOpx8TfrHlvpU77pFgAQuHFXEqQ+38WKHBGVM1ehaq24iw6ZSB8ydyVrJvOegHTNEUx jrcXCvAnmLAoMxs4IyJSfnG4xVCRjLQysvPnSEgnDfAk3DdgwCyHa4Ro0l59lIe4Muh6 /WDesxnBNvNkQfEW8HkQAgFKJ/waxK96xPd+93oYkxhmi57dXGDTi5x/IMrn5ecfyex8 UM4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=EcGr7jPbsIV016J8qpPWQhkLnpm44nvrJJGdYGx4j2I=; b=DQXmP3j+VgvyDKgLceQiV8u7+jVfVOGqtpKqkmt6Dvh6YpWovuGXE9ks7ZosuCHzKu 5dyjkCRn+EqTEw82RU2YeB24gTDKavSI22sQCW5Z8X7zwQRJuRuUcHTLLxJWOlhvZGhh Hn2JVkVOHtCd0nz2+ta/eE80dTLFyKxhZRExY3VlPTQ/04qT53aUCFrmKOWAsyxFnpYa YEVFEUcI0jaLDXPdNreBHKmr2shxxaL3nDZKm8h3+BW6Ghhxiv4bHsUuNdVikOlSzzEA rHbQtGsvFfLnkrJ3n7ql56d01LEOBqm/YRjhNC0J34zYKckNQ6grzeuJFSiQkwDJobhC h+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=tUC+OKlp; 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 i12si7991511edr.244.2020.11.14.00.16.24; Sat, 14 Nov 2020 00:16:47 -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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=tUC+OKlp; 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 S1726632AbgKNINC (ORCPT + 99 others); Sat, 14 Nov 2020 03:13:02 -0500 Received: from z5.mailgun.us ([104.130.96.5]:53953 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbgKNINC (ORCPT ); Sat, 14 Nov 2020 03:13:02 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1605341581; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=EcGr7jPbsIV016J8qpPWQhkLnpm44nvrJJGdYGx4j2I=; b=tUC+OKlpfuagRwbb7XxpGaK+adQ4bzvTM+6s2rPvzbphUDwaMfzuO2SQGW/BsJI7DfvVuuUJ F4besLpzNRIuz8fT0s5VY3+cZMYWGYJRn1Wvetubkoe411WS+gwHfpN65SprAngkHlFr82jB N4K6FRHSb5LzIl+zjtFa3w7lc1g= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 5faf9184e9dd187f531564c1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 14 Nov 2020 08:12:52 GMT Sender: wcheng=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C9005C433FF; Sat, 14 Nov 2020 08:12:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from wcheng-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wcheng) by smtp.codeaurora.org (Postfix) with ESMTPSA id D80CCC433C6; Sat, 14 Nov 2020 08:12:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D80CCC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=wcheng@codeaurora.org From: Wesley Cheng To: balbi@kernel.org, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, jackp@codeaurora.org, Wesley Cheng Subject: [PATCH 0/3] Add vbus draw support to DWC3 Date: Sat, 14 Nov 2020 00:12:44 -0800 Message-Id: <20201114081247.25063-1-wcheng@codeaurora.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some devices are connected to standard downstream ports (SDP) and draw current from them. The current rates are defined in the BC1.2 specification, and highlights the different charge rates depending on the device state. The DWC3 gadget does not currently have a mechanism to notify external drivers about how much current can be drawn. The current rates are notified by the USB gadget layer, and the DWC3 gadget will propagate this potentially to external charger drivers. Also, the USB gadget needs to be fixed to only allow 100mA current draw when receiving a bus reset from the host, as the BC1.2 specification states that this is the max current draw possible when in the connected and unconfigured state. Wesley Cheng (3): usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback usb: gadget: composite: Split composite reset and disconnect usb: gadget: configfs: Add a specific configFS reset callback drivers/usb/dwc3/gadget.c | 11 +++++++++++ drivers/usb/gadget/composite.c | 21 +++++++++++++++++++-- drivers/usb/gadget/configfs.c | 24 +++++++++++++++++++++++- include/linux/usb/composite.h | 2 ++ 4 files changed, 55 insertions(+), 3 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project