From patchwork Wed Dec 7 13:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 632889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1892C352A1 for ; Wed, 7 Dec 2022 13:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbiLGNTz (ORCPT ); Wed, 7 Dec 2022 08:19:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbiLGNTu (ORCPT ); Wed, 7 Dec 2022 08:19:50 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A870140F7; Wed, 7 Dec 2022 05:19:49 -0800 (PST) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 72C2B24000F; Wed, 7 Dec 2022 13:19:44 +0000 (UTC) From: Quentin Schulz To: Minas Harutyunyan , Greg Kroah-Hartman Cc: Quentin Schulz , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, William Wu , Bin Yang , Frank Wang Subject: [PATCH 3/3] usb: dwc2: prevent core phy initialisation Date: Wed, 7 Dec 2022 14:19:18 +0100 Message-Id: <20221206-dwc2-gadget-dual-role-v1-3-36515e1092cd@theobroma-systems.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com> References: <20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com> MIME-Version: 1.0 X-Mailer: b4 0.10.1 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Quentin Schulz From: Bin Yang The usb phys need to be controlled dynamically on some Rockchip SoCs. So set the new HCD flag which prevents USB core from trying to manage our phys. Signed-off-by: Bin Yang Signed-off-by: Frank Wang Signed-off-by: Quentin Schulz --- drivers/usb/dwc2/hcd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 657f1f659ffaf..757a66fa32fa8 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5315,6 +5315,13 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) if (!IS_ERR_OR_NULL(hsotg->uphy)) otg_set_host(hsotg->uphy->otg, &hcd->self); + /* + * do not manage the PHY state in the HCD core, instead let the driver + * handle this (for example if the PHY can only be turned on after a + * specific event) + */ + hcd->skip_phy_initialization = 1; + /* * Finish generic HCD initialization and start the HCD. This function * allocates the DMA buffer pool, registers the USB bus, requests the