From patchwork Mon Apr 25 17:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12825972 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 30EEEC433F5 for ; Mon, 25 Apr 2022 17:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243237AbiDYRRq (ORCPT ); Mon, 25 Apr 2022 13:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243920AbiDYRRk (ORCPT ); Mon, 25 Apr 2022 13:17:40 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130087.outbound.protection.outlook.com [40.107.13.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE681C102; Mon, 25 Apr 2022 10:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V+HA36cFLsto3TVejp9vHgpc4LwZwdLnWUf45hTmnFTObPh9AiyFmAqTNvBWXXdeIxQ7YfWUCljbAiBQ0ydIQUeYxibtMNBt5IZWF7+39x7okmg0Jxqglwo5XQEXKYE8qfo4gd/kiN89vhLsYY2zkzSxH5hxub6DFfO3wazDu0r73kvB9w3407Sjxb4UkMcGqNBt5kAxvygYyMqtvire908yRN2B23miobS4nu3FBYZ0LMm9Tw/xFF8NY3eqU+obAGXzOMmZIAC4LoCmCgWtOisaeOwhkpIfUNDR2cjhAp3uRbDu+/TZKmvPIPStsz8vrW1PNGpRWq3ReAP5uKJ4NA== 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=wXy+j4+Sk3O0bY7L3z82vtUx5yN29NTblCXf0vUzTJ8=; b=J7sk4U53ibqFwzcTm8GfZAXDYKsDzaKuqT0AyhCyla62dwDTcEtjm2neGTNmn5k/GNxwnT5wxWmSyA30oAmGq9/Qx7hMbaIWdyQIDo8Ism5VESY8r8C4W0g6eLN4/70WsIPeKVW08qXqlw4RMGImz0F5p3Avtdravv2GxXusGGE6f8Z3SFtMM67avoCpuFOt42dYN4Tob9Tyomnz1rTRRFbiRKB3KjOCtLpTUzMILqGTKjb/I4zr8eDYf5pQEydzoj7LC3Jmt5W1LmJ4YxuOW80hK5E5P87zns45+XXxQj/0J/ngq7dXNrGrq3BRRBkevZzWRdCOgl3v20HKpLygKw== 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=wXy+j4+Sk3O0bY7L3z82vtUx5yN29NTblCXf0vUzTJ8=; b=nGsZJ8WP5JHvNb85cUhM8FASWRxl/fM+HOyG+69fgDEqptumQwSB/Rm/a0A+dIUUZMaWr0quD7C/V2G6zfJKdbdhf/LerlW2/VeeWIUA2t1mW378jwBiGc6Cme7wewvnAxhrvwYmc7eLt12gD7kEpkL7P1EECYNsiSUrzZHRtCRSlUNuUaO4CrBGcF82nV42i1EaDWq0X2akTUD/yCrznlZcDtDuT7gTZ+uR2UQqhsQ3R3FKeuV+jPhxWdafMH59SdiRcbFPGKmbGdKghO2G6oaqXW/SD21d9qLHs5r6hy/sG/rL+Mog/tIGo3U7Z/K/4GGmwUguBCbbcP1oUkAQ/Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB3736.eurprd03.prod.outlook.com (2603:10a6:209:2d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Mon, 25 Apr 2022 17:14:35 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd%4]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 17:14:35 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Mike Looijmans , Linus Walleij , Jules Maselbas , Felipe Balbi , Jonathan Hunter , linux-kernel@vger.kernel.org, Robert Jarzmik , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: usb: usb-nop-xceiv: Repurpose vbus-regulator Date: Mon, 25 Apr 2022 13:14:08 -0400 Message-Id: <20220425171412.1188485-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220425171412.1188485-1-sean.anderson@seco.com> References: <20220425171412.1188485-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR02CA0133.namprd02.prod.outlook.com (2603:10b6:208:35::38) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f882de1-e9ad-421d-8d4a-08da26df124f X-MS-TrafficTypeDiagnostic: AM6PR03MB3736:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IDv5gn23R3LsWHiGUR4FaFGC/zJdLK2RhxS2zU/47fBpqSkKLVfLZZLSFxzMzeTR3m8xm8kwVUhxOUEq3DeOQLYddP3dExrsJtOagfnkfxiHhpD306bkoJCbQIA0q6ulDBLXd8undsTtLQ5vsL6hKBKutmV0NCpG+tlf44j67oXMsNH0ycbm09jZl3jwE8yVpdfVd3o/d/YdOPLHxePLLUpqggfhtuhuhStNToiR2XomZEPepmAO5WK37RGBHDoilI5PeCyxgX5ygPznPkwwi6Uqw9+T+p18CzIYZeOET43xy/DTw8CA+o73AqODDnAhy5xeuiSfn768esJRiZceCZA1M5Mk0o1J0tj8GhTO+u77GfKUSSj9fFYIOQrpR1hnR+3mCyZiW9cPG6NYTFFo0W3elUBsydRvRXF5R5LouAV9TfrnO3njG+iDwla/V6z1Hfys8RoMetZIx7vhOomrhkHIKYNsGyWvJO3SOZcOPDZCjWLUUXaXJQQBqT0SWTfAmDLTGy11MiFSzQzOF8Cq4Xck01IqZLshDxglikH/kZ1/S/XZrYqHaHvjdopsM99GaH+4ghpNQ8jE/DtsE+ZnVGcZcnKh4lmSJLUEQcUJlJju7hrxV4FzaRII2Bjn3CqoyuikhBqDeyvz1toNLNrk0ONIQUSJmV4q6pChmEcvp0hmfMfCN3ylW4HSqKcfASZgPnerFSTp14YNZ6oQDIfMGSPy3vfBNQ6gJOJ7O9SDT+1sSf3xD5n+zLJRyn45JchI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(54906003)(38350700002)(38100700002)(6666004)(1076003)(186003)(26005)(2616005)(5660300002)(7416002)(316002)(36756003)(44832011)(8676002)(66476007)(4326008)(66946007)(66556008)(8936002)(52116002)(86362001)(6512007)(2906002)(6506007)(508600001)(83380400001)(6486002)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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SMK8x6b22OVEzZpFTTctkSbOEN1Rfu05gQLc/HElkl9bnEemXhrcE7nIpc5EkjEZlXjHOZnqLrbRbD5XGv+Q5wP+aFRxx+NKZoYUHYd9lTI29s0VzOl2sKTwJN65HXEOAzWL33BfHWThWQosxxf24c1knpKZnp44fiVyvWNiSg3+pqoAlVKPuny3XaJniyfeW0Yvp9+HTVJPziok36oyNEY1hFFObSSYOqk4GuC2xtH+EYf6LTxohwUGy/7RTZiXGwWniSSTPu25BgU/t2IAaA7dbmoW3El8jcZEf9kA3IMUqqffl1K4mfSjfFBuYTM9UZx8Uste+b2+6jxG7C1/iNn5G+d+ck7mwb9HHjWFbukZidlCrQVWndM03AvKoRX2cv6p5skDP83loUesk9stJBMyxH4k/3KhtgZOg09uXh8aTItSOJthszenbyq8io8/aK92H71FNF+MzW0ClSHwpyilRS/349xrE9zcaMYqU7gokHsGc7GaS4bSdR2N11eUFeKjcDyuj3KmFZ+fr284amfC+3B38t4Hl3hXQ8jV6ykrRx4oCQEZOcWM10CGLPfBIM/+0/GnT7YaiPfbaM8gXamXI6WK20Zc/xdrjHahch2a+KsxRIn9GqjXZ9alK0OsLSxQH2GAZ/8fXXJAXuT1tO+vaUG6Ye6ciqxBUhcqloI/YUefQpAkoNBcU+HZHP4nnhVqFQK4= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f882de1-e9ad-421d-8d4a-08da26df124f X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 17:14:35.4206 (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: Iy2gxZHomVpwnbGYBAHd7pceDzN3TkO4IXxZMd0319oYIkmVKuCKe+QQYSbe4xQgwjl5SDuTtTlZQHW+D1JhNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3736 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 Reviewed-by: Linus Walleij --- Changes in v2: - Fix dt_binding_check errors Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml index 2824c17285ee..b4517b01616f 100644 --- a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml @@ -34,10 +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. - $ref: /schemas/types.yaml#/definitions/phandle + vbus-supply: + description: regulator supplying VBUS. It will be enabled and disabled + dynamically in OTG mode. required: - compatible @@ -57,7 +56,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 Mon Apr 25 17:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12825974 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 55E00C433F5 for ; Mon, 25 Apr 2022 17:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243803AbiDYRRs (ORCPT ); Mon, 25 Apr 2022 13:17:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243929AbiDYRRo (ORCPT ); Mon, 25 Apr 2022 13:17:44 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20047.outbound.protection.outlook.com [40.107.2.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D4C19C09; Mon, 25 Apr 2022 10:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KY7kkkQ3zFkrwMGOipueLyFvLPQ0ASWcJV/4AoH//MX5Vndb9DNuEcyXCK30CqzVxFvR+pCuHhcjjYm2Basb9cHN4Ea0dHDIabrqjIU23HANmPsvhTabZiNuCJ+yX9yTfnwrkQSdli4VNYEytHkRA8ndVddha7f53lWWIC/8+Tv3OqlH+mWQVewqc2k+iP/t4iCYDGH/yx8hfBEFcgdymc+s0ZgEeuBjv1fSqQmZ2FNZMvdiLYXFna7D2U2G/Dh377pDsYOyl6kGVwfBpwcPNIU6TYiMv+CAAdUZmgge33JEw1MPT/FS0UWtaYMW/HAemOCqU0BpWk5uk2nSsZDlFw== 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=29qaSf0CDGEwAZXoKb/IWRI0rTzDvvVzN1TZyF7dYqI=; b=ZVvCG1FKPB6N/fVQ0oJKsCbYfnOXpiMRZdmUvae8cByU/xCXAOWQhkJCFMW2XW56doDVXdFbFNJRyPm99PCjDhdUbrXvDNmpLRbQ//yKGEQBWcnxpuGzdLf964v+PDB6Y6Dq3oWPt0rSzMpF4fiqYf2cf+AJ0jrUl3AEkkRUVUyWyTDfZBt3IEvinM4Okb6uJQ/n2q91XEpunqavh8MJf3+ZDIvlIhdzUQ6VUjRTBT8DjghP+fteqWldAQLtJ0CrxFSm2EPzkgP84dDM7PAJYoUds9vCxvJY5FEeH28gAoLkhncNm7LXTSwnOFLy+t6DhyFefCJ+BkVMqK2JmYTkkw== 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=29qaSf0CDGEwAZXoKb/IWRI0rTzDvvVzN1TZyF7dYqI=; b=viTDCQDG7rjClZxsxW1MzIiJzc0ZXR/hLd5dlfmC4F5H+ODMr1UNeYRKUOI7HgK5rhTX1J5xhph/XtY3ora7qCEETs2bD6Ur5+Wo7TKTdBqSkFj4Hz1fi5fpDTrDjUCD6U+P6v3iJZGbXg8GZ9HR9e4kysX58MXRFGBN0eN3g+/uGd/jBdFwRyoDR10WnNCd1OjzQdudge4KaKhogr8910A/8ebkRMa53yPteUAvAk+lOcvy/zgFCpybwnHQ9AlXfNU1zTA4WZ4F48IyNLFjX4dZp1g9BSH2050b5jpzyozRks6482TwQ+Kujdnrc/Etzd35Uf/jvtjqEhhdE5cB7A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB3736.eurprd03.prod.outlook.com (2603:10a6:209:2d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Mon, 25 Apr 2022 17:14:38 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd%4]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 17:14:38 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Mike Looijmans , Linus Walleij , Jules Maselbas , Felipe Balbi , Jonathan Hunter , linux-kernel@vger.kernel.org, Robert Jarzmik , Sean Anderson Subject: [PATCH v2 2/4] usb: phy: generic: Get the vbus supply Date: Mon, 25 Apr 2022 13:14:09 -0400 Message-Id: <20220425171412.1188485-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220425171412.1188485-1-sean.anderson@seco.com> References: <20220425171412.1188485-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR02CA0133.namprd02.prod.outlook.com (2603:10b6:208:35::38) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 851f8cc2-2b4e-4d8d-9ca0-08da26df13ca X-MS-TrafficTypeDiagnostic: AM6PR03MB3736:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hMviI2VeM0XDUiFVPCd4f/FFc/UwOPc/sBs+Jk96fwkJLaAMEITcEgHzxGLvA22RDoz5Aa8b2d8kNHFL7QJmP2h7pmr1GCt1RNUyML1um2OXAgrc7fCEn0O41JQ7Smivedy8NhyfNGIQF5FikGKD419JY9HnSxqw9QYLKkt91AKIfL/n3h3SVoc2ORIvGxy2EuZLruSI+hqifd2s/EW7GCPqDzSRfPmuNXqYj16pL9e6cUSo0WFKz8DMNQu3HadoaDO7+Oaf9KeAnnJNqzdYh6Bh+0OVUEQQ+GyjWDtD3t16qgPXMdZR28744SHLSIS6ipBQNe3UoRYCe7z/qtLQ8frsMtkH7xKUWwk1HjrEGOXKuVTm+7gupuVo2RkGa7gKqax0EKHO5E574pLS/aIsec8+mV6cnCCPYut8pJGQsfCuon01IYUuUEMpdPizjpJli+nS5gli4pfnUQPXhFVAZ17du/DUlilEfo/OAnxdrTMtM1GhySDHU4vQfTJFPLOcTOo3oPBFwc2JCQH659nNW+XTf1x79rS21r806MyGGAUlYqSqQZCEzDHxIhCbBliq+TNaH5iIYLC+ds1uzf8Lq1FlQqyPpc+guNF1yS1sAi6mckRXBTBDiIjRTHZq9F5XoBxCtSVSgUMmzIo4Rt1ilB+SuWAMZ+zVwSv0vashxnHkTyEnhlSJ8LBGYxGDyyGOtVYTNdJn1ICBNKW4/BDajCXavxv7s3tSJrVNAi5tRmJaMBjbrmoGz/So8BhvutXrlCmGKSOIsCifgAW4yacUWle8UcZMJQ5AvIy0BLCx5Tc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(107886003)(54906003)(38350700002)(38100700002)(6666004)(1076003)(186003)(26005)(2616005)(5660300002)(316002)(36756003)(44832011)(8676002)(66476007)(4326008)(66946007)(66556008)(8936002)(52116002)(86362001)(6512007)(2906002)(6506007)(508600001)(6486002)(41533002)(15583001)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nWJy5ZivvBUcdcDbgcCLLHBoZS+Ev75O1U/fb+yxlRNsI4pbFoiJ2qMz6H54chNcepSUvn6CVPC55rQuJZtIaYcrdLNAoM+bnao6Bza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0z+L2RktYGvq0ayGSFnwZpAmd5eL8q6zXxW2WO5Ix28AXQ8NHnsfeKYjOwBzIAyyXKhAKFRqzqVJ5E5NJbBjXH6hi9DedeOWHiPTI0Z4SJYJWALj2Mb+fwhfaRwR/IMywl/8FI0bYlQIPKBT800bPvjW8xVqGm41liyQxY5o1wEYEwmDacNb8On745ICQYAPLuyQzrZxkdkYCeLb3oWWqucb0OA0UPjaV4guaAxq88p/z5xDmL5arzioBdbD7EVYGHAzwZx4wIst7LaAeKXQxj2CQqRHNRuI9BJ1zlkyQtaNKLV+W/KoQaQburmV3xKGOrqqdeqIDUbYrj1iXZzgfi2jeGBpOE7JrLHIkn44GlKzskLRa5N23gCg8BHZ2CSNhfNpy4Ye7YHq2zDrNxNe8h/Gu/Ek43ktYhGQn9xU727KueCTCHKYza29ljy4kZ2WUjQQaBi5rI6uhbK+CG2TMuLFtYz1cCxX1JPaXkTMfkTRJEsmzfW+RqxiLKJN2TTjVu0b+/i0XYydRKtvH7CDCESTTbA5DvVjW47ZMx47R93JWTYiTArBUgyaGnYgzBJdiuPllRT4JCFyk2VYg= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 851f8cc2-2b4e-4d8d-9ca0-08da26df13ca X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 17:14:38.0610 (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: V8d7zdRE3xCyXCe/sgUUwsqtNZ4BvhpibKSR/MIBJS8/iqU1j4McqiVcyyYOAi/l/lxXe05bgmA0E4ngS+Sv4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3736 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 --- (no changes since v1) 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 Mon Apr 25 17:14:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12825975 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 A8BB5C433F5 for ; Mon, 25 Apr 2022 17:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243818AbiDYRR5 (ORCPT ); Mon, 25 Apr 2022 13:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243793AbiDYRRr (ORCPT ); Mon, 25 Apr 2022 13:17:47 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20067.outbound.protection.outlook.com [40.107.2.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E99971A3A2; Mon, 25 Apr 2022 10:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lS4Lay10JYxf9zKDHJL14XHJZsfxg96MsaK7yDzHvT0ccoMgB5n55p6J4JrrmKi9QdWWK9dSFaLWvkwyDFPdrNhe8vnAy7D0skK7MM1QXNJ1Kh/WmTQr52iae7lYVYsW5DGG0J1WPREh364X7vvn9HQo7atoY4KHehg8mEqnEqsP9NfabnwsVq4ianPb6uzJ02bp1P6f6vTm916RbZ5Un7PKd9gvYwPG+fIYJuMDwpTG/MLbsCZ34ZWuAdMB3bMhkHLzj5VUyZnI31qzqSTkI3W/9Megxld0fwckXthuSSNZr3NnCjWFQjOHL5fVtclJ+SxdziaUjWVtALt7GfcYag== 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=3yPmNJzrTkAY9MEvoPEVBhCsjl9W2F4ax4LoObojoA0=; b=KZuC7zvVvHwKvLJxVs5pzdofxchzqA4THjcApUZTXkZTfF7NU5r1/5bJy5e09zKGVl2vA6B+6zQxymgdhQEqUvmYSwslcyureqkTEJjoa2pj8MbXRxOO8V+3N9vaONkSVAGUN0KSmkn1sijKSB5s/u1XYH2Ikg9QirZCV4BOwXIfqZKDjqtCGfbeodesubwMHiPD3Sj/aqjBGKsGkZDoxJkOXukBnEHx1RXmBDtFJzpEpMditVugRXcpCerzVcOp0pJpwpXkyj2y8l9Y4Uib33tiMovenPoolS5qKYIqLHM5TQTdSVVOhG72IrS1waI4MNkk0ZwNB9dVVvGdA8OBsA== 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=3yPmNJzrTkAY9MEvoPEVBhCsjl9W2F4ax4LoObojoA0=; b=atxSsdgTuKi+mlsjAmEedKblVqKXIIFt+5BR0khkxi/gzlauQNbPvjHRuoI3h6SgamDghkNZsAalk1Mil2p37lLg34Z9vWItyBWhbxZQZZ3arRQUvwu4G61N+p0o0XoXITbsBILTHmeYJfG4Q59gEg2rxcsGzwCyCbM0980Oyga7js1N2gH+F8/xpwbFMDNLTd/E8N5HmXR8TLM0l9C1pWNAkLLnXFsprhm5onhrARmywVrEPsSGBJyKWTKbfYOr47NOowZORzLv4G8eK4JIlnz4VFTfRIpOaIebl+Ad3spEXFg5W05v9R//ci8E3U6Q+wF8LnQUEIwmy9D9gG3x6w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB3736.eurprd03.prod.outlook.com (2603:10a6:209:2d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Mon, 25 Apr 2022 17:14:40 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd%4]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 17:14:40 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Mike Looijmans , Linus Walleij , Jules Maselbas , Felipe Balbi , Jonathan Hunter , linux-kernel@vger.kernel.org, Robert Jarzmik , Sean Anderson Subject: [PATCH v2 3/4] usb: phy: generic: Implement otg->set_vbus Date: Mon, 25 Apr 2022 13:14:10 -0400 Message-Id: <20220425171412.1188485-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220425171412.1188485-1-sean.anderson@seco.com> References: <20220425171412.1188485-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR02CA0133.namprd02.prod.outlook.com (2603:10b6:208:35::38) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c88f5fb3-e293-4aa9-e556-08da26df155f X-MS-TrafficTypeDiagnostic: AM6PR03MB3736:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xWmjEytUAtXDmtGs2SciPOjHtrJe8y6Z+17/+mnTecpPBEVPmARsQAqqgZVQyfiDgS/t/0mkOOosjsKmikiCzBamJmtIyF0thNp8WonYLAD5ifPu2bxLq9K/Nx7+XLJ2UQHTkOOhuRm9nbA5FFfhRg6RRmLpOFJ2Q1qlloyELgUBS54irjfC0xbbYfzdTFtfJ7tWLuNZFzG7bUP5f4DvD3mweUkCRLxE623z1weHvFMz9VLW8LXrK0RnNwEm495iE/AnKsoTnzJ6ZvsvzIoEFwPBdrEKGFrKNCF/fgHEytNJ6MMqq70JK+I7CjF+H0sgz7Nl/5T+4nS+lZq/Skcq3oY9binAPYXjoydpOB5FfVl6DMIQqkOBW1cB9u4fLke3qkI9Vv3yRPq+TyFu+EtzFtFq8P9oWZY7SUdhTvxCyZWQVj0ZIZXPYV0kGMK2myz8mVMkJ3ZlkVR0Ch/c4K+dg9++VUa+vb7uOt1lMRZW/DY17m6J9YOgUM72lsYD2IHoMaKTcqY/12HaPjbRpaio8Y2JISMW/fGAwpcBIePhyULe1UW6Oh/pJZeM8tGhGn8rv3eHMmDXS3Eq3Z60/5rQjhVGK7tSNSI2uHX4DiCSQlrWWh5dMeMe93nvbwkAkigjFMaCr+AU8taGIYl2rPAOIzNtYJ6ACypxzHjlNBAIQ+0Rgeh06vwIv83VsQ+ddpNOZ/mDLrKdLAllhf3d5XuIWwJHO4lRUdB/QXGX4GS/WL7mEnF52fZ0OxTTYeihHnJTyRgZLohZeVAPCsCuwqPzlw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(107886003)(54906003)(38350700002)(38100700002)(6666004)(1076003)(186003)(26005)(2616005)(5660300002)(316002)(36756003)(44832011)(8676002)(66476007)(4326008)(66946007)(66556008)(8936002)(52116002)(86362001)(6512007)(2906002)(6506007)(508600001)(83380400001)(6486002)(41533002)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AMeqOLPFQDHil03j7cKBvyTVJQXRa3X0zIZ6nZqBgdT/RznHAf6aMBh5wa00ykod9tm/Nq0ZbjHnDEYWa7aw9LFAJ0S9XoqOKrs736gaih5awexlsMTwpnGx6QshynqcWEuIJVYU81YYGkwlFAh2HDzeB2EdMKoF44MuXJdPocRNlFBqmg42yldPz52BbcnsjVOvfJPU0Y5IB2z7weu6tAyXDPe1CtfOM3pI1FTh+u7mJutJgTxgOypoJzOq9EWxQPThCc/Y+UY2gWOLqsqeFOe2N3Pjzz84K0I9YcFZ6OIFzoiwNx4oYR3W1e/MXaKYXvyRpQ3o44UndD05aYVKlH9Zny6VLFCScD77r7VjsQesktRZlfQT/lnxF32qdUSru2zWACs1ROJJlDfOmKzaCq0k9Zv/jkFO1HnAMzqjIiB0zqFmi2wMXCtUhnvz6sbf0WaDwOSOXpHil2jIl6JEkX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cHbU+pdbXPpiTeDPfRM6LlvwjtYaYL48MRMQEIVPgSbIOPbTlw5N5S4cisAGvFJnOoqe0cyUEI7oWQv3CB4lnjZyy5TffHO8SwD2uDIqkcmTQfcIT48dXQnvx3m/AjltvPk4bUW7slWDuTX+5yBxIdvt7RqFUu3s//P1M4g3bFwvb4J7JDtrM7GZ9nIpCqZgTx735fCGqRMIMd710EqOlI8= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c88f5fb3-e293-4aa9-e556-08da26df155f X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 17:14:40.5452 (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: qUvSZjvYSzgZU+UGT5BmaEsGPcYI2kkFhdMkaIAviVjcPRqpzyH6FXZyXZmZcuZfmoslIC+LcMNzPRqA26Lv5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3736 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 --- (no changes since v1) 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 Mon Apr 25 17:14:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12825976 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 41B56C433EF for ; Mon, 25 Apr 2022 17:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243915AbiDYRSL (ORCPT ); Mon, 25 Apr 2022 13:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243846AbiDYRRz (ORCPT ); Mon, 25 Apr 2022 13:17:55 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20056.outbound.protection.outlook.com [40.107.2.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4939D1C93E; Mon, 25 Apr 2022 10:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ruzuwb/EAunndwelvZ8HTPMqWjs0/+Ac5He49JJoT40pNFeZJpgoQk8UnAwRRkhHLNaqAsbS1Me0J7bcPciLxo3VunGbVHGkz10n1uoTpRzREiRwjF5H+yy2nps+iYerYdk1PWCr98Dp8WbQXpKJv3Q2w6vPnmqWMNouPjRoMnUOvGvegQk/u+2wGXkPYa25/fQ9/Fja/CJuK4FxHm/fplGXN/9/i1Cxe7CxdC58luQF5DswrJQTaIcmyjgLQt70kiHxWJ6k28Y5HDPE8px3ImPB9CN/hFPwYeEaaOtf5QRuWr5iVCR0mFA/9mJgp5vFKypanSC/5DFSa0PUDpco4g== 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=2e4MjTHsONdsSnuOk5kuskINOGvsPZUxHxr/imJY0oY=; b=I1sKCCzAlbtPcj0vvhKEWGa0NMxBSjqigjo5p5MV73JiQzpgMd+SFAmVPwzZwjLjHc6PlQ6CyWZxahjmH3tUiRREtuE8MMN2wJo5qjI6mC0AoQtH730ERr2SvohqZKWby9PGHZsqmVV1aCKA1l6J286fJTEgvrMk4u3C2e1u+Tt0SVTi/T2Hu1xIgZ+6TGixF37ED+ifTOo9FXad2NWn3ZJvQUj/f+NYQqMu4E2Di3Ael+OuvvnthEZ533A3aNLRA3vKWyxWK4dBUnQAOw8ia5W2Fm1jmW18bJble8fRlhlai0T9urMGlactauN1aw+6Iu2hPLeBdLFppef/g4cMIw== 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=2e4MjTHsONdsSnuOk5kuskINOGvsPZUxHxr/imJY0oY=; b=hsclYYI/gn4cq3bOwnNdsVupjV28UsNn5r1/2o838cJyYANaEA/7xzWpsOLtADT+Oew1G7ROPt9TBHG42p0bSAKp5N559Z5ppoyJssn82rMHapnWoWgfNx/nlOrxHwz03/L1eBBUqsVnt5dA7laEkgqKydRE16NERHlKhk2VhwLchUApzpUXV+muzR69va0AjZwjUUO6uQbXyZGapUKZ48NdInfBOpLCYAntOd/cXia/0yaKUQhgwryH+YghCxV8x+n/8o4WQaHYwWaYxW6qjNOo0J+Cr/OCBdN3fsix5IVfBNb5YKH1hLG571ODIuk35C4oVzRJrqJlkFDyfUcz9A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB3736.eurprd03.prod.outlook.com (2603:10a6:209:2d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Mon, 25 Apr 2022 17:14:43 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::714d:2b6:a995:51bd%4]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 17:14:43 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Mike Looijmans , Linus Walleij , Jules Maselbas , Felipe Balbi , Jonathan Hunter , linux-kernel@vger.kernel.org, Robert Jarzmik , Sean Anderson Subject: [PATCH v2 4/4] usb: phy: generic: Disable vbus on removal Date: Mon, 25 Apr 2022 13:14:11 -0400 Message-Id: <20220425171412.1188485-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220425171412.1188485-1-sean.anderson@seco.com> References: <20220425171412.1188485-1-sean.anderson@seco.com> X-ClientProxiedBy: BL0PR02CA0133.namprd02.prod.outlook.com (2603:10b6:208:35::38) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 984e2d7c-70a9-4f85-f0ba-08da26df1718 X-MS-TrafficTypeDiagnostic: AM6PR03MB3736:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 28h4qkAM9O14cFsiAwaqaz8PyWaKWwpMqQZIZ4mbPEdmBop80ocQ0YaVh5CTBpB//o8LIA6Ub5MrZ8DjqeI31O1LjUbo5o6UTfYwzKVh0ciXwTr9DOTAArSNaeq12QrxqBs2AgQiRz6w3DMRHMt8DeRcOCxwbMykOBvoz+gWm6e4t5vCylFhDzdAVHZdZztwLM8MudCum7Ls9GK9Ont79ZCCNiclVGnP3uONdmUn/hnyMVRQ4a77d71yvIOoxlTh2j4Q0LTDGGOpq3ksSfcWlxh5FwSCFpSTMJt97b5cFZbJVSgwHl8Tec4Ggobmbm1KoXfetdUi00eYN2jYnIbb0vyr5HnEnVIMA5wBDWHMdeQtpE1FyFe5XuQaNIxFEGb5ipaz+qO1zj7OiY7YZAC6VFGimxK0o6BZJYMnSochSoEmhiUzF9kxqU1vfqSJIgQqLQhvrGu0qT4f8Hth5ONThMJg5RZbz/DRY9CHvRRsnn5ts1I3SqEEKKaSfCqSZcDv8c1vgYvoeefYCN63gofxxGBgZz/U21cK9D2p78S9FjJp6fl5l2UZCutwXwlUB4Q5OcIJJV/d71ddtRVDXIkZANFGQBlFB8MjlIHpIN/udaHHpYjp5EYAU2diVNZO9+imFSE+I8f6K7BdHL+koFJHA3Wwk0uALUPWwXiRnHXnTVY7xbp7KEY2+UDdrWNFcKLzCeEwI3bSWJ+otMiy27NA+BmnVx3KOGlNkO/o4oIX4UX/S6FgPHEwrR/TA26xmexfdIEGPcN+zw/EZyy9cEg9Tw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(107886003)(54906003)(38350700002)(38100700002)(6666004)(4744005)(1076003)(186003)(26005)(2616005)(5660300002)(316002)(36756003)(44832011)(8676002)(66476007)(4326008)(66946007)(66556008)(8936002)(52116002)(86362001)(6512007)(2906002)(6506007)(508600001)(6486002)(41533002)(41080700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exch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D+I182FM06nenwi8VHLBMSzmRBhqDMvuIdocDQNBXHr6Vj6mnhIKql7Sqq430CqqThwf13c9nblmYk6WEiPqZ0Jnhv1vtHHElsQKe4Yksp2aUAzsH4IQEEK1LTDcYyDlHTAkXMC+DnJL16xeTiIZ/phuebqlhpSh2V5WOie3+yXmxv0+i9NNviwDzHChTWC0vHChfS2FpmKMonPaiRRvAYmT+R4ZKKCTCNYONu7HAMa3GRrFbUFYOZ9sU36fuvL5zAx8RnF1Ts0tD0LMvGebsDv8EixK6IX2PQXKksKsIh1U88mR/Rot3DANhFSzCSH5VlrajAjk+N/CANvaWxANRbO5GoEGqiwKJiEeEEfpe0duy6KrG/gk1LmUnyMhLqnJ6E74Ru3CcR1JKo1Oa6wKrZBYO9xXuzbn3iEew2bRmnqzbiTCwO4EzPHydd1RlaGiNPX6NF4UXiwHRRzynHmoEBjXAeFV2xFU/NZL6wtW6trTYRDWCRZSbGysdbveQYwEkP2odi6krTTkbs//KaRgyGg9IPyX8GsuQAS1Or5KxZTdxM4WWvb7CNVwnZbDU9uGzfughD1ESq2XX3SzH177YTPTHIMd+lpLCSu0l8oNvfY8XOcGZUhHQBbGzMdcY0VPemKoVdrvTwBNNVnVrz/yvffXWL+p8g6JM+kzDGNAVFeD77TyFbZjJ7xbGegk= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 984e2d7c-70a9-4f85-f0ba-08da26df1718 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 17:14:43.7325 (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: mHMO+0PN24TqyKGGgbx45rir4MovgX9mD9yiFsuE5UynNJ1PP8l05gzKlLlqQ5mP4T0/FysmK+Pk9B6HRfEsLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3736 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 --- (no changes since v1) 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; }