From patchwork Fri Jan 14 17:09:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12713855 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 B5B67C4332F for ; Fri, 14 Jan 2022 17:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243751AbiANRJ6 (ORCPT ); Fri, 14 Jan 2022 12:09:58 -0500 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:64900 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243689AbiANRJ5 (ORCPT ); Fri, 14 Jan 2022 12:09:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3Lhq7vCcN+ZQucXZRYGB1vBOeitD/es/SiermN3LlcskcCY1fZhqMzHmrdJivvykfFEjUFGVW/FSDDKTZkoeEcEKS5nWiIBafpDUWmX5fYiFyRXIs3GEDm69vEGpAhrfcKJ2Q+KsB+LahAi+mv5Ylq07GaksXdUGxeF0NUFzI3zhpslPOFpr1+pP4UgNboErheGIkvces4i5l+bxur+8W7r8+GJ9EhSw5TQGzE+PAM1e/m/CbHaoaZoQSPZJkIxc/IkTALZwdxzHdwltD83mMe2VZT88agIwPlf0igeTE9keTOhWey0lQj5VICjrKEPpb49v+WJrUI6jfjuXbmRIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QfVWj9qcIF0ey1QKaMha9e4/KvbTT7TqO+v8yIYBY7s=; b=hTCJB0KOwhoj8w6RPjmfDXaB4fpW0mNFQa1U/ihQRQvd+EN+PHHYl/r5uMwHsWQJzZeDj34AlxZMNql3J4Rc7gqvK8PF3tmTmIMA9wDAZDDJAQfAiEwVaM3mlpMoay0uVgbQq9iKbh0DlrxwKgOqnVrqn8GWURKurPvF+yili1uT4rH5JI1VU2Pb0dL99sqGgHYzONhWDt+B8mEHgUJ1/4DOrOEmWU6ps1vCLNl6tyTlNDEKWUJrk63b+QEp0UMLljulnPJU8PWVsq7V1vnrnFh4TTfwaTp5ZjU7zFjmYY3UHXRXstd0e5FGZCkFE4PyiNfOTIp9yUqxkQZVGqdPDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QfVWj9qcIF0ey1QKaMha9e4/KvbTT7TqO+v8yIYBY7s=; b=Lsp6cZHDzhR1stFp14FfYxv+16Jr4mjzr7Y/gkWKZgkJPXgKTWkfSD9pJLzWiS8g0xySmFbGV3pwtiv/rvYhoDTF0pyCEWPAu3S3Jh2+W5VCQ4TPGM1/ZxrdDtEhw2pObKuoMUEvUcaHCa0cjIyNPnjHdbXkGJjg9XhfaX4Hu5Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) by AM9PR03MB7742.eurprd03.prod.outlook.com (2603:10a6:20b:3dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Fri, 14 Jan 2022 17:09:54 +0000 Received: from AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8]) by AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8%5]) with mapi id 15.20.4888.012; Fri, 14 Jan 2022 17:09:54 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Jarzmik , Felipe Balbi , linux-kernel@vger.kernel.org, Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 1/4] dt-bindings: usb: usb-nop-xceiv: Repurpose vbus-regulator Date: Fri, 14 Jan 2022 12:09:38 -0500 Message-Id: <20220114170941.800068-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114170941.800068-1-sean.anderson@seco.com> References: <20220114170941.800068-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0072.prod.exchangelabs.com (2603:10b6:208:25::49) To AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 801358af-54ba-4b16-dc23-08d9d780af0d X-MS-TrafficTypeDiagnostic: AM9PR03MB7742:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YLgN43/Rig+MChkf+zef6xGPnw6oEz3Vw+F6/ikvbWTD0G8zUz6FGrmmc4S49H3FAPDHUODioV1j2DYc8PI9Vl7PTj2IuMgK4tEb1Th+kEL4wcImFspmOWjOdA1lyw46g6XSRJdQ3/SmMnCWTNQjNh9+qOzuBec8wen0WWPLfV8XYtTPL4QCSjB63aJVbCKi2JP/v/B0uB7Xmpep/LZOC7t4nXDNirNQLYu8HwxXHVZNi7n04Pj3+lcSVWH7AyRbSYnO1L7LnAkBAmvDv9b4zbgUWpcBGTGyVZFoGeqKYOx2EjJjaBOwSAy/2YfhD45c8SRlBmqWW0T3bBXKDZeI7oIzJA9BeJrxhCs6pHVPcj0HBXe4OdET5upquVFnTKgJ2hdDNP5joDQChso8fy7m9uRZkSQHZKartknaZJby2H/S+HzRKSpPkzPmFoFSwEbMpqPiWaNo74+sy9ZPCV00ecKI3DA7VEcxnD0ClDy93QQm1AE40lp6uJcJNLxyV6Iz2oMn2rAzMSdVQVShAqu8hzfO8jlQHN6bmPYluqXfEg8jvds42mobvo+GBUaRIDZBZ9f670GkP0BTN6BhRnaiTMPfQbJqcN+FZYET1sP15P0wC9J7gbfFmwTC0FKy7hsH3KM8C9R4nGsAz22xahre4FBCndYZX5jc26ZNbSeIFjwvE3NobBvUM2vPUYiCen6rSSuK67f2VzuJ1ap3xOUfk1+oNTO1edKhTZdLLMKyDLw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB4514.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(86362001)(316002)(186003)(2906002)(508600001)(26005)(5660300002)(1076003)(2616005)(38100700002)(38350700002)(6512007)(6486002)(4326008)(36756003)(83380400001)(66556008)(66476007)(8936002)(66946007)(6506007)(52116002)(6666004)(54906003)(8676002)(44832011)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JeDXevWF0ex79D1NbGvG+1EnhffrRlmSqhyMprQumixX5LLDQGDG3QliiljfzoPD+d58FOByxa5/l2CfwoohEnhyJNU4DFYsUsJM7LHE/KAft30JbHBYB211I5/hjJqk4cV4YiCYp1OWHhfooxhDUQ6HkIZHIc336KgoTpEMwKi52LY+RKFjiGY+qu1D9Cm9Ri44L0Nk8uKqnMj8ykPbgTYPoIWIDX1+e3AZlKtO3/UjTz+vvUmq9DuJpVe/09LsoGAT6HbqY3coyfNWnfesV/rIIA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ZtZK1LRwkYdWPforC+vj/EseQXLzfIzX3s0a5XgsQIPTdF1U13wAMYKuQzKCjZuNxBO3gZgpdD2FdbQhs09ej/6R6Nw/t/pekUDVrDv3EZBWe/OZdqt0LOehLiSkb2nKC7FNhQQUxPtQrwOpFHYte5aGo2QT4MroqS8c962jX+WacIS7woJ3TanH6wITm4OGJs26uvA4VPC+tjPDTs+oS5MRpTvDJcC2iOHcxXNLD894kCOU74Yi2IRwwFOn1y8LadBNI2cBz+2fWe7qnBSw9ZQ= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 801358af-54ba-4b16-dc23-08d9d780af0d X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4514.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2022 17:09:54.3436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ToeotTfkklNvojH0jcRoTFsFHAqSMOSA+Fn8Bs6WCHmJjolQw3L9vw3aMXQCfxAtkWT16ETO2h937VaoraFsQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7742 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The vbus-regulator property was never actually read from the device tree. Introduce a new property vbus-supply to represent the regulator powering the VBUS when acting as an A-Device. This supply will be enabled and disabled as necessary. Note that this is different from vbus-regulator, which represented the available current available to draw from VBUS in B-Device mode. Because no one was using vbus-regulator, remove it. Signed-off-by: Sean Anderson --- Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml index 2824c17285ee..a79459bb5a4c 100644 --- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml @@ -34,9 +34,9 @@ properties: description: Should specify the GPIO detecting a VBus insertion maxItems: 1 - vbus-regulator: - description: Should specifiy the regulator supplying current drawn from - the VBus line. + vbus-supply: + description: regulator supplying VBUS. It will be enabled and disabled + dynamically in OTG mode. $ref: /schemas/types.yaml#/definitions/phandle required: @@ -57,7 +57,7 @@ examples: vcc-supply = <&hsusb1_vcc_regulator>; reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; vbus-detect-gpio = <&gpio2 13 GPIO_ACTIVE_HIGH>; - vbus-regulator = <&vbus_regulator>; + vbus-supply = <&vbus_regulator>; #phy-cells = <0>; }; From patchwork Fri Jan 14 17:09:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12713856 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 C0EDAC433EF for ; Fri, 14 Jan 2022 17:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243769AbiANRKA (ORCPT ); Fri, 14 Jan 2022 12:10:00 -0500 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:64900 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243679AbiANRJ6 (ORCPT ); Fri, 14 Jan 2022 12:09:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UysCIyCE76wi/IiBPBKJjtHuA7I9BnFLbBAWbYJxu4J9bzN5b2KuLx1E1O4RMmm3KXR7+oOjXrnsveUmt5R8t3755A6BiOmFMWBnCRVJy3NiwsHi7/cS5QSn+WM5rl7MqdFc+tatTOL/1bc0CGRJg+DozLNa+VIbLGDvprPXCD3ILOcpXm8TBoOEv1UzLV3XSJGzPO3kaF4sTD42CdqAjJ8rJSe15E4yTrY0oNY3aMvnyU8Skh0WcuuoRkBbibKqhyfGAGLYYF/dFadT/NN6xvzBfl9sM2DiQO4UoSmzKkjt63kyjlTtSIKakfHaJCmHCt31BBqdEabOlYQg7CTReA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LKmlWWtHG2B6sYVNNa6rqujlUlEHmaeEspvMM1TLB94=; b=V3di6WvawPggapFTqQC2Ywk2wA7oEcLcM4VtU9TdwZx1jJukzjqh2dXob0hTkNsp94vueCJNiwvy+nVs7mfi0HS9u4W/SuCGs68ir7aqBTEWiJep5kEMR4Uol+kW/8gkY4FHlEzpLdSRgI3uQQrltHUnV/cupqSd6b4T2fxfX1nLnC0OUPiJfUL0CUlXnt5PZoZnfXmOOp2mn0QKV6AYzjeIXGpZwPInmN0sOd4lrYqqySgl9ipM6rSn8V0rQZGmZR7EurimaCMgRqHurqJ2lH9m0KdpQGQdTnhTeEl2ATC+UMPYfMzNM3uBolWAJ3P8ILmXqS/WR2XjV9QTEd/DvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LKmlWWtHG2B6sYVNNa6rqujlUlEHmaeEspvMM1TLB94=; b=NTtQo1HFPTSIUGg115ZsMblxi74df4otPY22gMqEOaXCqpX1dvZ5pYR09FkA1mXAbbaRMzpWNx5Q6LWKdWDXm33HI73/1jpfJIUK1Ss1aZmvJEW1x/r2Pipe/4eWxm0b5y5z1o4UgcqrCDRg5uWid/CS9H1Y5BHLINg2qNNR4TQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) by AM9PR03MB7742.eurprd03.prod.outlook.com (2603:10a6:20b:3dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Fri, 14 Jan 2022 17:09:55 +0000 Received: from AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8]) by AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8%5]) with mapi id 15.20.4888.012; Fri, 14 Jan 2022 17:09:55 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Jarzmik , Felipe Balbi , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 2/4] usb: phy: generic: Get the vbus supply Date: Fri, 14 Jan 2022 12:09:39 -0500 Message-Id: <20220114170941.800068-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114170941.800068-1-sean.anderson@seco.com> References: <20220114170941.800068-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0072.prod.exchangelabs.com (2603:10b6:208:25::49) To AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f46a1f22-f7f5-42a6-0b98-08d9d780afc3 X-MS-TrafficTypeDiagnostic: AM9PR03MB7742:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0B+T4tsJGFjl1BYzwCCexhjWbs56M1xmfgl8u/mWpn9Ha4fo4poOU0rS6Cgz+pBI13l62asRfjAAAjydxQ2J3ONwmGXDkuxPCBz+MW3MddEc9r4Qal+iD60ThylLM3rcHfH71WDPX3YzqUypYjm8cJqcMvXLmP6Rvtv5o34EdOlkSZ6k/JMQgzCzHTqpPnnKc6K1p3utbeQAlzd71+lAT+Mgmqv+7sSAvItTRWQmi+jJ+wUBGlYunnrUXmsHxsNMnjE9ke6Nke4gQU+B/iXK9F/Yl6hu9jgg4obcLmPzSqQ0WRUVt0TeCAEeMM9twuFtpABvd9dMVntqQVvnPtNwtPSIzEHe70hyCbbytbFdNe3OKy6v3xXv11W1Yg6Wr3q7x83XP/AnF7O33+xKtH3iEh0jD7tLG32edccP235RBn0DdHcXhljscFKTngWBKNhaSL3ubSJt37wbD2TGzeR2xlAuPOggfnZ0yzTS4Df38QuoRAfMcehRR9B/PpfD974iOEZGMOaCCukwPtCrxVBiaTyV45XaZUM7CdZC2GIPl4kRDMGoG7oeXmev/+KVQexXO6GHSV56VkP6tQJV5aR1OnSKwCJUfxITC9peVdx6JWxd+OOPP7iYIyz6HuJxjptKKAvM+JXVzoQ6+uKIY3zJ25TfwvTze4p4Ap6+OFREvM1B7go4YmhieI0eeYiLLZnHZwxD+OeQ25MlNXIjhRhyyUNJFSHDij+oWnG4UBgclLnXskXmeCYcOtwgv298P/2Yn1SgWTL6rFNvhDvJn/GC9gQGz/9khpd//IRXG6a/Vnw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB4514.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(86362001)(316002)(186003)(2906002)(107886003)(508600001)(26005)(5660300002)(1076003)(2616005)(38100700002)(38350700002)(6512007)(6486002)(4326008)(36756003)(66556008)(66476007)(8936002)(66946007)(6506007)(52116002)(6666004)(54906003)(8676002)(44832011)(41533002)(15583001)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J1ipoEB1cOnCIhFeahSk2bz+7i2egAPJXr72lK1gYsr5JqvWcNaL5pJ5Z8h+7njoQezJB+z3Ju/2IW3dZKjOElaJlOzaDzquOFYU9kb7WciyweRPq+U5MfGSVI4WqnXtp5teJrHP1RBRkW3XwPLi4pR0+ruYhP/gueuMVnPIl0o+ds+VrnXpSrwUxFXmHcLev3jrVT3LRPKF3ZwHI4eCBQcVjiK/YAefVMFzmnL6eXSKf3pA35WrrQn7b90iEvcQJbhkqrjqLKQniCx8p5/LrQowAuY001cZkn39zoZPK/7OGvlIGBnkWum/XKXXZOwSLJZ5qNaeD8RpCnpXngLZ9ammSMa3DNlQkChftXRPHpbUXfgJD2ob+zH4Kb6+aFthmrw1hR9AsaNo/4UMDX1MneW7tk1HGFrYzec0c5bpyVxeK20ex+ihx3azdpUQkN9nOYm8teOGq3lZ4qVOpRGTe0QdPbXmkTDYzIeLM2z7OK/28rxhBu3C9tswi3umsci7AeWF0GzABgDi2qfAzYLAP2fkoByXHQ4QYiWM9CWRs5UQIiZSeXfh563KHuRLwjU1KO4EpeTPdwjO0lvYWiOADnnGrVjbLNWUEN2qfD3a+i++OEDAtJ1+juTBvikcKCbQ/ihPnlf/ETE5zejlMFVrpjdUFoxGhR/PDT+tCkyn9uKsAh6qI32myVV28K6jo0SoyHhegy2BPJN218/+p+QTi5yvpv66Hp2jE1eQZ33sCt4ZFM8GqaU/CjHgj+KlZV8iUSnhQU3U4xcYFeLtZrklhuZZZ1ZJZqPBTXTzrn1Gdb6d/ZzvSB1WZ7ivf3dwAdPq4CffrGxuEP2pfqB3LOoXXXa09pXKaxMve06RBjqqrdY5hwcfULCQTKOeulMw98ZwPvJ231+o1aXrHQycPfDk0hcMxj9/F3Wnzj0dvFZZDDf2HybgV6FCT40TrhAS3XdHclsSIN2RKyVzQlwnYphWmZVo5sOqBBb6XUHpicweV4SPjjw76Lb4Vmoh2pX+c3oinRi2wRa0UsQqZrwYm4OEv+GD2jTmydvQpN7oVxTFLJ0uebQ5bUb63vy6L1KpxPWXSST8OW/nK93RZEs3vJHr3t0yxCjWTCYRdQz1pjYKb8Y3Kcn2ALbxByik65d14O5dj9b7+HqgUe6A731DYIqTAL5cMaA4f3CpwGr9iygX6TnC7IoYjZ6FBQdRKQ7iuBAPFJL6HITKjSIw5n0eaGDtv31Gx+Z0alU3fR0Gq9EeC6YY5jX3gYp6Y0LvY5eDT4tnYr6hK+SVwcTNEblc0iQkAD2gR5GNJEcIEgc4SlX1mm+CElyA8BkwO54EUYdzAsJT2d3lLI9ShC0IKnAWlrr5rDntJOoZxO3T9YXu6YDqZqGxFOzZpl0VrTTM3Jn9IBW6729vqZpgo94zIc9TsoW0p2HajZ36nufYts1ssQg37C45Agg5mYmDcZJVhCV8XGju8LcDkB3HZ1SZjQ2tWSYcxJzrh6BgKJdYEwcVkG56214G98ftISByCUJzxeHp8koBAlIZsaRshxIRuDogTerJLe/UvVa2kPLe2hwTjAs2NKRk4Gw4D5qfQY7Op6bDwUJ7N6lgfx+WrmCXiBk/JFQ4reMXmok/raIV9jh6kUcRPVY= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f46a1f22-f7f5-42a6-0b98-08d9d780afc3 X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4514.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2022 17:09:55.6091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GsdxCffauyYQ6Y/HIpUUay4A8o8Cs+ZcArqbPyBJFZRsyvWI/0rdRizsH/lPzuEY5VCSKSJ0AgFxnjT76QSJww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7742 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org While support for working with a vbus was added, the regulator was never actually gotten (despite what was documented). Fix this by actually getting the supply from the device tree. Fixes: 7acc9973e3c4 ("usb: phy: generic: add vbus support") Signed-off-by: Sean Anderson --- drivers/usb/phy/phy-generic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 661a229c105d..34b9f8140187 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop) return -EPROBE_DEFER; } + nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus"); + if (PTR_ERR(nop->vbus_draw) == -ENODEV) + nop->vbus_draw = NULL; + if (IS_ERR(nop->vbus_draw)) + return dev_err_probe(dev, PTR_ERR(nop->vbus_draw), + "could not get vbus regulator\n"); + nop->dev = dev; nop->phy.dev = nop->dev; nop->phy.label = "nop-xceiv"; From patchwork Fri Jan 14 17:09:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12713857 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 39E8EC433F5 for ; Fri, 14 Jan 2022 17:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243821AbiANRKH (ORCPT ); Fri, 14 Jan 2022 12:10:07 -0500 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:64900 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243767AbiANRKA (ORCPT ); Fri, 14 Jan 2022 12:10:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NwAgcYl9lqFjMyhe4bjXzVcTj7M7bJWAQxHFXGZkWyKWao+nHwF9U40XUkGDHNk58vEJcoiGCi0gluXdOhm8Mb3IRUX1XCoIMuy7L9Yr4EcvZgdbab4B6YkqttBfpKiFlS1wXW26fXdScsCbjFbdpiT24UnbiFWrxBVGuhlwh9ict6gyvdQPhxBGVoP7O9xkhpr0DVlHYgZYsL6eFo+XDaCr+5dWjqAonMcxaRRheFzwuLvho43NcNXcnBuMNUsBVAGS4VvgqqxPuYsHVLTqPhUg1y91Rl6dPpX+mHMKUF8eSg9l4ff+zG20d2FNHn+EVte3PtCHcfyyJ1Vn86tFXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R2SOONQ4qU1CZT1hLzr7RWPQGgDZdVilFPaUTDKM1rY=; b=Y1f9Ngp/vMfAWof2Ayw0/f2IhlAIdzuLf4PLy5Pc/SVUpRR27QjDNt3iPLDPLqbfvdqdG0xGG5RQFsxCIuT3fx1A5rJHnyMrncNVQJkdLjquNxO1DTPwdWxSMR+cPyT6Ox7LP5zFItUVjjLyH9SBVkuxxeESpAf73/enqpXqNfTvzK5hnSF+S6jd9ZIExhWFjMIKF2uAcRifalllfIJd9jfIOnaSOEsdnCg65Sh5xfqb4VkGK16S2fzvwhS3vhtAE47sxz6hsf3OuGYTZQEIXcc2f6zn2nHA3zXUov77a3f/tcbRrw1NDg2quGV7dcn29bGP7swjHHuUBPY1yq5UAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2SOONQ4qU1CZT1hLzr7RWPQGgDZdVilFPaUTDKM1rY=; b=R31IC8DE1hxyfjcewLRnlHapjAPlUm4zXwnMopVTkvC672R7ooqjHBu17cR2lFwH6vhwrdfRMOu09uo7cTH8mP2h5LXicimQEGJahAkQZA6/RFO8QH027XtguAdz1MMXQMgUJy9e5mLGPAvxwfSeTm2+6e4jIrEexDVYUJIocpE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) by AM9PR03MB7742.eurprd03.prod.outlook.com (2603:10a6:20b:3dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Fri, 14 Jan 2022 17:09:56 +0000 Received: from AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8]) by AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8%5]) with mapi id 15.20.4888.012; Fri, 14 Jan 2022 17:09:56 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Jarzmik , Felipe Balbi , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 3/4] usb: phy: generic: Implement otg->set_vbus Date: Fri, 14 Jan 2022 12:09:40 -0500 Message-Id: <20220114170941.800068-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114170941.800068-1-sean.anderson@seco.com> References: <20220114170941.800068-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0072.prod.exchangelabs.com (2603:10b6:208:25::49) To AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65400021-1f2b-41f1-269e-08d9d780b084 X-MS-TrafficTypeDiagnostic: AM9PR03MB7742:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XFgQCUoJ0Z0HajRqLIQsX74chB5ZHquU82y/ovtGKyQtP5k4UeYMa0Eeb38H2vFr12hQGR29TtefE4vR64eS+N8xabSRKI0T3LataPQKRLQkHtpBoUhaIfYC2d8wk19lj2+YCjFGyamQWtwOfawG6WOcMWwkvUmkk4BFcxDi5Vt8tGX2lefqINFRO0FlOJyFaoa/IXP9Zy9THASOH/RRnzV39aYDppgp2TkNqR9+2bgy7+YWsHkam5+o7hWaRvldh/zAVkNNki9GtuVTNxplm+MtweAJryjUHeFIgwmgmOA8oFOWAIrt22wocW48GKp9t1dA1Te7Cd2i7/vLTu3jqaCW2zIsauejhWbsXEh677YJPN+2XDc9sIBPKvWlCiAw8IKj6aOTLF0odCWcbTxGX+I/Zw6V+2+tn+CsJuSkWOfrSRdCgSXTe0ibEOrTyvETFwpw87sgeB1rDMf7lH31JuQRq4u4Zr8MBOwo5cNmbfWUtqiczCfISxR0OtbJ0FRlsibZsVVdSG2duF4Zh4GEgLg7qk1L82nUwtAKK3lSXulo3/0MLUySMt1t7PfqF4b+AMeuUs75zYmhcYzrL7VD1aTA5wyL+/fhdPb23VL9XG3h8FhcX1zxfI5IhYZYqxIISiXWZAJYgictU7d8QXdDSYpyP9fqqxjxKrFIJ4w3OZSuolO0p3O5lTsfUJDdumDyQLND0QwWmDlySDpQi1AeQ8p3NUKwkqQo/7sL5wF10LI5DMpEjRZjMt4zKsXl7sXj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB4514.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(86362001)(316002)(186003)(2906002)(107886003)(508600001)(26005)(5660300002)(1076003)(2616005)(38100700002)(38350700002)(6512007)(6486002)(4326008)(36756003)(83380400001)(66556008)(66476007)(8936002)(66946007)(6506007)(52116002)(6666004)(54906003)(8676002)(44832011)(41533002)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eqbISiizdYG6S+cAJbSM7oEMvM93C4tIKtZfxhKUOc1C0t4xP2w3sdYCns/0ze+OKpu28AFG6tlj615Uc1VkSl8a4J2xoFjkEliFhloV5thnZz5WasmPhHUDam8cV2X93FFhhjtKwXQcvCM99NQhKCJt26FxmxQpuY1fqfckXTtJD682ApH4MyusBKFaXB9RgN6UNJZe/OdLXPegd6lmL3Qc7EjKkhyctbkaTgng9zUZ3U/CMddXuPJhhcFZ9ozO/2YoQtJOgQIIxWEH6ABaMdPvdZ1YAl5o9tpSHrX4CaOJ7czjLeIXQX4z17AfskW5iDQa4NRMUCZjPU0ucbzpmuQeynolbDltN1koA1Wz5oUHiQyQdalIfp11/FptXNY3Dbuly47rAWz+DTvSNkdAUTUfFNVCfcaIekoKuGL9bSLny2TzzJfLJT48+nbaJDZ5oflghNQZppPkP8QNleApsOd8aqQeumzZ/OD/y8RoqjyJ38K5TWj4vEqSIP8vrkf0m+kAKnB7cQxh7ICSk2T1Bd5ZKMcdlEK9pDD9kayf8ZqnQ/lR0OKC3UKaJMenobHY/UOpRjShNG1LM8Yv4hgtNTKiqYAimlHBKetwVMOT6eOe1LLKHhrH8i8DCb9FR9NtzO4jO+uOBjvW56A7QiAWWPMw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Source: AM0PR03MB4514.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2022 17:09:56.7965 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sWq69Gi/mHHHunG5nvGtgXAe8Fvs6jWH4qmAOyx7iTR0/sAD8UriskNBnaug5ECRhsvAJrOC9EMrn2U9B2vNMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7742 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some USB controller drivers call otg_set_vbus when entering host or device mode. Implement this callback so that VBUS can be turned on and off automatically. This is especially useful when there is no property for a VBUS supply in the controller's binding. This results in a change in semantics of the vbus_draw regulator. Whereas before it represented the VBUS supplied by an A-Device when we acted as a B-Device, now it represents an internal VBUS source. Accordingly, we no longer set the current limit or enable/disable the bus from nop_gpio_vbus_thread. Because this supply was never initialized before the previous commit, there should be no change in behavior. Signed-off-by: Sean Anderson --- drivers/usb/phy/phy-generic.c | 45 +++++++++++++---------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 34b9f8140187..2c2553bc9b54 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -68,33 +68,26 @@ static void nop_reset(struct usb_phy_generic *nop) } /* interface to regulator framework */ -static void nop_set_vbus_draw(struct usb_phy_generic *nop, unsigned mA) +static int nop_set_vbus(struct usb_otg *otg, bool enable) { - struct regulator *vbus_draw = nop->vbus_draw; - int enabled; - int ret; + int ret = 0; + struct usb_phy_generic *nop = dev_get_drvdata(otg->usb_phy->dev); - if (!vbus_draw) - return; + if (!nop->vbus_draw) + return 0; - enabled = nop->vbus_draw_enabled; - if (mA) { - regulator_set_current_limit(vbus_draw, 0, 1000 * mA); - if (!enabled) { - ret = regulator_enable(vbus_draw); - if (ret < 0) - return; - nop->vbus_draw_enabled = 1; - } - } else { - if (enabled) { - ret = regulator_disable(vbus_draw); - if (ret < 0) - return; - nop->vbus_draw_enabled = 0; - } + if (enable && !nop->vbus_draw_enabled) { + ret = regulator_enable(nop->vbus_draw); + if (ret) + nop->vbus_draw_enabled = false; + else + nop->vbus_draw_enabled = true; + + } else if (!enable && nop->vbus_draw_enabled) { + ret = regulator_disable(nop->vbus_draw); + nop->vbus_draw_enabled = false; } - nop->mA = mA; + return ret; } @@ -114,14 +107,9 @@ static irqreturn_t nop_gpio_vbus_thread(int irq, void *data) otg->state = OTG_STATE_B_PERIPHERAL; nop->phy.last_event = status; - /* drawing a "unit load" is *always* OK, except for OTG */ - nop_set_vbus_draw(nop, 100); - atomic_notifier_call_chain(&nop->phy.notifier, status, otg->gadget); } else { - nop_set_vbus_draw(nop, 0); - status = USB_EVENT_NONE; otg->state = OTG_STATE_B_IDLE; nop->phy.last_event = status; @@ -285,6 +273,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop) nop->phy.otg->usb_phy = &nop->phy; nop->phy.otg->set_host = nop_set_host; nop->phy.otg->set_peripheral = nop_set_peripheral; + nop->phy.otg->set_vbus = nop_set_vbus; return 0; } From patchwork Fri Jan 14 17:09:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12713858 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 1663DC433EF for ; Fri, 14 Jan 2022 17:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243811AbiANRKN (ORCPT ); Fri, 14 Jan 2022 12:10:13 -0500 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:64900 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243815AbiANRKI (ORCPT ); Fri, 14 Jan 2022 12:10:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lNPb56yimcyWhsGdafwrx/bwgkoVX6qLgaRRsYATz2if0XZ3QyUgp0G2bsuj9u813NNjhlp9iFO+Zwk681/EW8MyPXjUzzDOgVSpHI6+dJsU+WatNCQJi1vTklJtbGWiwa8XNf2lF+wl9lRR2zX7eZ9Yg5L06Ts9GbjEere0PcbeNHR8b739GTeSnG1jAV2f7Oiwvi2dNKwADcUfHlBhQ8xTOmntYVg45zi4gTjU+Nb9Gz26XJwcOfatzrJEeRnWGknlTxRP6NW5RltINSMR3CJuRfz7HRsDlZk+mP+nJyR0OHK7nm0uXmiiU0mUbkeWN8DujX+PeF93Qj/GVA4qgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QJLgY1bmeSNOD6KWu7/eqTHNsxa8oy/EB20i1n5tRJw=; b=eVbls7VD+AKd9qaO+sQoXz2SFv/pREUUwrru+lC2UEUuCPWf3fAnh72zwl3lf34Lw7pNmvWTN95EMsAXy+C64DJ8op0LSW6IU+2I38Mm0UibNa87ogQIOBeW3rBf2TF3un5ks0F83B3buKNdW4eB1s/ADVbuvjKa+p/DfZG3HXSlMl0+rTId21v4DiKNtAhjNsE53kuUZ91RHlKKMDdvEIHQVBOaqmK1MvoioJqFu0ZqcaBbhEnQRRnaD+Mr7uDvsJp/2Sbe/KNEpZfOcOJl+RbI6QmEE7N+w26M7UyIIZWtMmIvE1BHUT7uGi8/FI1XYgPT8hCvQfOuozD2VTpSmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJLgY1bmeSNOD6KWu7/eqTHNsxa8oy/EB20i1n5tRJw=; b=JccCUzu/OWwkB7ZYPhMiO19ZZV624ctaeqUMT6emtV8Uj7XqdWWe/vu2Pqj+PCOzHjKB+eVX+oOzm8I7cXtFroVoYGHaHgbvsj+SgEHmyzM39ik7w7gQe0hh7NmFIFmMakWyYcC9ZNI92onWA9QKIUPKb/6lto7VA/aHMfZ5I1Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) by AM9PR03MB7742.eurprd03.prod.outlook.com (2603:10a6:20b:3dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Fri, 14 Jan 2022 17:09:58 +0000 Received: from AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8]) by AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::6183:d478:82e7:bbe8%5]) with mapi id 15.20.4888.012; Fri, 14 Jan 2022 17:09:58 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Jarzmik , Felipe Balbi , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 4/4] usb: phy: generic: Disable vbus on removal Date: Fri, 14 Jan 2022 12:09:41 -0500 Message-Id: <20220114170941.800068-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220114170941.800068-1-sean.anderson@seco.com> References: <20220114170941.800068-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR0102CA0072.prod.exchangelabs.com (2603:10b6:208:25::49) To AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb456975-0426-4e30-9175-08d9d780b134 X-MS-TrafficTypeDiagnostic: AM9PR03MB7742:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +tJc6wDmG+dTxOLxJ0WpgPO23HJm2zNv++CxCSC9B81mxmVhi0q6Yd6Aa77GCK6jIaEYZE0adbibZANjhMGnAHtvog+dd9+E1wZxVedNBqMeB/FWXA30DEA4Sb10wgDr357Yvrw8m/YoV7WTqCLEZATJcc5vtmYttxoGN8SdZQ9/hEA1osf8oVbeFr0+EaZNj0FANdlQk5Fus0BhuPi49nDAJiHWkuo9GRRWbYsPH9N2nzr6MRL+RQqwdmnb26bOwLAfhpQhuwv4JCIWh8ptAub33TPcOqQ11EjBz/CDPe/hNHbLrWLMWhtGb2jS/IIj5yq7iXvq8W6gwqfTs83OuwadY0L0LQvpV6ygsIoPIRFI+88RraDz4QqjMVoBf3ELk+rwm212ExBDle2gg372enI43TElOhFnPjMABovkV+YKDwLjMKli8CjcuKZE/EmP+lh74uGZMxCrJCgaTNxhv2RotE+WZlHkQoiMTp6s+aODskUbACaA4ZRyDnSoP+s2lAXB9R0KrQI47Zs6rTPsYCzW6GQAu0yj9nCI6GCNlexUn4m14YoE+F7X9Bi95mtMv94EKUFfd690ZdtJ1UZ5YPbiGUVveW2DGHFWx5UP5VYX5nClS+qWqxFDaM+cdb3HBCpcPyqA8lZ5t7hD+Y8zm9s2rVue69HNMQx2hdLHXyIDgudlr/HIxXc1VXsF2dQ0LaP89s6x7L/w18MjfZGIXifTffVb6B20xmgK8b79wrrAIwGTX6gG3l1p3siO0aADVnvlhVVWWsGea71M2vWmcg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB4514.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(86362001)(316002)(186003)(2906002)(107886003)(508600001)(26005)(5660300002)(1076003)(2616005)(38100700002)(38350700002)(4744005)(6512007)(6486002)(4326008)(36756003)(66556008)(66476007)(8936002)(66946007)(6506007)(52116002)(6666004)(54906003)(8676002)(44832011)(41533002)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e/EhR1Y8j28LHX0eCGuZhFc5aIKTCnaJXaJyV3L9+/LCe0G3q5tqe7qnDyfe53UEK9Bjv1HeZMdE6MgY71De84NHhJyaXTuCJShe2Y3RPhRZrpBpOyXIS1zSGP9T57CHpTI5ijKAwEgoIOQ1OEvEbfSyMNoUqGNWs9mjNUMn2iIF8VsAMgm/Efm/XGKrJPkPvbVI+8EC8JH4f9F8l3w9jSkw7Q8t5i5w4gcb6fAyvX5NwiWW8shZceCpEpPBXiSMz13j3qQpVsUIFj3hVoUACvc8/KZRX2Ui29FVkIF2NyoXmO8+tdHcMOIftrHBQv7lh71cI20u13bac5D39+n4id7f5eMLYl/JQjnuRGgpHG0xWGwQ1PvtO5rlu3yoDLFTSFkVayk97vTmnziXdRouOeGiGSY08PG3E84Dv7FPo1Pi186gLL3qh44us6eVthFjmVGLhMtFqxsLuRP/pmnLxEF0q4M5WAlRSOid3ANMi0K11OqibqkA9ul3Py77LNcVY6+1FYihmonB/sq/nXQ0tcgb5SvY3sDy51DXdV5YhLfkeQfSmU05Ci0zxYYCdbcOYivRhtPMEjaNLfduXB9BhWHzd2y8uUQ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fb456975-0426-4e30-9175-08d9d780b134 X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4514.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2022 17:09:58.0308 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Itu2jtuNspANGKT8+bDnQbAPan/yQoEsnz+kLsyPg11PJM8cpWWoGt8no891tr1qiHT+TzA+bBNAiX723onmpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7742 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org If we enabled vbus, we need to balance that with a disable. Signed-off-by: Sean Anderson --- drivers/usb/phy/phy-generic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 2c2553bc9b54..9fc3312d614a 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -328,6 +328,9 @@ static int usb_phy_generic_remove(struct platform_device *pdev) usb_remove_phy(&nop->phy); + if (nop->vbus_draw && nop->vbus_draw_enabled) + regulator_disable(nop->vbus_draw); + return 0; }