From patchwork Wed Mar 18 08:35:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 11444759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B92292A for ; Wed, 18 Mar 2020 08:35:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6467A20770 for ; Wed, 18 Mar 2020 08:35:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbgCRIfX (ORCPT ); Wed, 18 Mar 2020 04:35:23 -0400 Received: from comms.puri.sm ([159.203.221.185]:55288 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbgCRIfW (ORCPT ); Wed, 18 Mar 2020 04:35:22 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 33C99DFBC8; Wed, 18 Mar 2020 01:35:22 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nDDoW9hT1CA6; Wed, 18 Mar 2020 01:35:21 -0700 (PDT) From: Martin Kepplinger To: balbi@kernel.org, robh@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH 1/2] usb: dwc3: support continuous runtime PM with dual role Date: Wed, 18 Mar 2020 09:35:07 +0100 Message-Id: <20200318083508.20781-1-martin.kepplinger@puri.sm> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The DRD module calls dwc3_set_mode() on role switches, i.e. when a device is being pugged in. In order to support continuous runtime power management when plugging in / unplugging a cable, we need to call pm_runtime_get() in this path. Signed-off-by: Martin Kepplinger --- drivers/usb/dwc3/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index edc17155cb2b..7743c4de82e9 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -196,11 +196,16 @@ void dwc3_set_mode(struct dwc3 *dwc, u32 mode) { unsigned long flags; + pm_runtime_get(dwc->dev); + spin_lock_irqsave(&dwc->lock, flags); dwc->desired_dr_role = mode; spin_unlock_irqrestore(&dwc->lock, flags); queue_work(system_freezable_wq, &dwc->drd_work); + + pm_runtime_mark_last_busy(dwc->dev); + pm_runtime_put_autosuspend(dwc->dev); } u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type) From patchwork Wed Mar 18 08:35:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 11444761 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7504892A for ; Wed, 18 Mar 2020 08:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E7BA2076F for ; Wed, 18 Mar 2020 08:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbgCRIf0 (ORCPT ); Wed, 18 Mar 2020 04:35:26 -0400 Received: from comms.puri.sm ([159.203.221.185]:55306 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbgCRIf0 (ORCPT ); Wed, 18 Mar 2020 04:35:26 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 8065BDFFBF; Wed, 18 Mar 2020 01:35:26 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M3qdoT-6_6FE; Wed, 18 Mar 2020 01:35:25 -0700 (PDT) From: Martin Kepplinger To: balbi@kernel.org, robh@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH 2/2] dt-bindings: usb: dwc3: add optional extcon description Date: Wed, 18 Mar 2020 09:35:08 +0100 Message-Id: <20200318083508.20781-2-martin.kepplinger@puri.sm> In-Reply-To: <20200318083508.20781-1-martin.kepplinger@puri.sm> References: <20200318083508.20781-1-martin.kepplinger@puri.sm> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org the dwc3 drd module already hooks up an extcon device if described in DT. Signed-off-by: Martin Kepplinger --- Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 9946ff9ba735..9aa0cefbf5f6 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -31,6 +31,8 @@ Exception for clocks: "xlnx,zynqmp-dwc3" Optional properties: + - extcon: phandle for the extcon device dwc3 DRD uses to detect + connect/disconnect events. - usb-phy : array of phandle for the PHY device. The first element in the array is expected to be a handle to the USB2/HS PHY and the second element is expected to be a handle to the USB3/SS PHY