From patchwork Mon Jun 8 07:10:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 214938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 791F6C433E0 for ; Mon, 8 Jun 2020 07:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 505962076C for ; Mon, 8 Jun 2020 07:10:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ocJC0IaL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728964AbgFHHKr (ORCPT ); Mon, 8 Jun 2020 03:10:47 -0400 Received: from mail-eopbgr40046.outbound.protection.outlook.com ([40.107.4.46]:14272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728885AbgFHHKq (ORCPT ); Mon, 8 Jun 2020 03:10:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V32/bOxdYGY64oIDDg57IjKdlrc/vJ3b1Q2vKMr7Id9WkfT8JL/y6dAAyW2LmjloG+bbxREW6jPW36Tn2c54U7yK9+pC9D/o0cvOnK9nvzfOosJqjUZG96vY5yILn/EjlB7rji3zbaz6XKHlQ+m8YbHelKnVu8mx+qGXhOnsmtNWuKMu/6P47rX29sz0PCL0AW+WPGf7qCENd77kpAfTk5D50Ql7goZq9GV9GpsRKsdja65EzX6+LAVSvx5GFFtTmX05FzJC7y0ozXYbfnrT7s48Gjv9GZfCch/EDLdYKIoa1gtRjFf2raqc37MdZFu8rBXoCqjsLRkg+89SjMcnGg== 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-SenderADCheck; bh=8iBh9S1En+jgXFDcmC1n8n5luYN3vZHkUBV6VM5gTpg=; b=HaFJiI3+Q9pBtpHTIxLSHrAQ7K8hI4tH/jIKAdbKT253GlrJyryZhVwyzDkuj5s+w0CeF7hiNtL7zONxoUnblvar+UEpfoYZ/AFglBY+XWgilJfcK46KPbCeOPz+DM5SY4xgiMMC8niSr2i4r81ZDYQ7kiLA/CZBuQtn51yaEgCJYUAwnLOPoRSUEfoe98W83q4HxmRwMOI1t90MnIpjLC/Y6pBIAsmCJDtXLQE3SIuU3p5urv4v97YP/1HVnwYzHpbWZ7+M/D1sWRRGZ6HDXSpkkR1OSCnizRpmZGLKg+z3PgD+W2srSzKOEeQvZ4vWOlSXGgGMt2bJjsNr6ox8rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8iBh9S1En+jgXFDcmC1n8n5luYN3vZHkUBV6VM5gTpg=; b=ocJC0IaLNl6J85SeJhGDP+ufJLt2XtHv4q0dDw19NDDODhe/0lNSykT50loc/7r5YhmGG0elK4yb/W1jcv+Kq4EcuFgxCDu8RcZxqAApbbJbKEZd/YKP5zlXgFx5hbtex9ogHU0e4IkcaRJZFxcJ/w9erpa0TGf1ubk3cOmr2HE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 07:10:42 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a%3]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:10:42 +0000 From: Peter Chen To: balbi@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com, Peter Chen Subject: [PATCH v3 1/9] usb: cdns3: introduce cdns3_set_phy_power API Date: Mon, 8 Jun 2020 15:10:44 +0800 Message-Id: <20200608071052.8929-2-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608071052.8929-1-peter.chen@nxp.com> References: <20200608071052.8929-1-peter.chen@nxp.com> X-ClientProxiedBy: SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Mon, 8 Jun 2020 07:10:40 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d488a2ef-c7e8-4edf-ec1c-08d80b7b0e93 X-MS-TrafficTypeDiagnostic: AM7PR04MB6870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 042857DBB5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S5IYHUtVYrbPe3RLI01q7/yszbkKO06IgsY1LiEzlcy51DQmgGvQRuZTc3EQNQ3PDNSwucL94LPLiGIT3K4A7LlzBfAsEdwSjJhWSsWaNQbd4NtHI6lJP4JWWb0rX9pfDn9YKEbsQR4xH0mlMLgDha1fzK4SI5licJFqXLD+8Rk8Zj3aViLTp2S1NupBAXbaay5LIkLhD56ckr6A5cm3bARiGdTatCIPe99OQp4pY6kfLDRZe+78VqoUkTIWPTh6e7xf1XqNsWak8SuXkoQ2jFUqCXraLNhZbJssIEMqjR3C8Wadf96SBEVNp83c0Gi9/WGSkBN5+jyKFFduaXU5Rg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7157.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(1076003)(6512007)(66946007)(44832011)(5660300002)(8936002)(66476007)(66556008)(8676002)(16526019)(186003)(956004)(2616005)(26005)(6506007)(86362001)(6486002)(316002)(2906002)(83380400001)(4326008)(478600001)(36756003)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: sQLuIJ4+dA3ugzj90ghsokGNWBZSJFw/He/ejmuDN23e+zYSkmgDG3BFvAlYBXhroelIs7SSlAIJtssV/PonF7lxxxj5U9EXc21FU9vfJlh/JaD81oeuqT9DGRYyR0lT/1YBh0o5O8MwSHfHYGBd4DNkzMoLyPbUL0TwogaTcwpwsSAVwvFM0KOWt8XufWBRJJcsbqh7dRbFQSGeIcVgKqOQU4E6AfH6c2+AVXFv0UXcMFzyMXV3FWScIwNQzkPUObbKAis9LQkunPYxstbTR1uFrnVeFRH7cuwXN9r95YLzsntIsopRUPTYtXa/JK0AO69tdI8Flc1QUHyrumbUNW8zGb2o/JrfZgKloM68o8rX0u9GyNUwN553DBTtjaD9nDPldrMMWtSTe4ZELztgA3kCuETf3cWPwlORkRoMbmekfStnCO1wqYJyCJqZWlJPBii3egveJ7QZ7w1bUZcX+YGv/lL6f8+jQyCp7Rp21RY= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d488a2ef-c7e8-4edf-ec1c-08d80b7b0e93 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2020 07:10:42.8723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OTyX+uyWD1zU6n+sWqMZ/0UVnmYmFIm9SNw7Yr/145hbQCYn7AZyVVjNxd3qfOSc340519Q+5C7hIvOq0Vcm1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Since we have both USB2 and USB3 PHYs for cdns3 controller, it is better we have a unity API to handle both USB2 and USB3's power, it could simplify code for error handling and further power management implementation. Reviewed-by: Jun Li Signed-off-by: Peter Chen --- drivers/usb/cdns3/core.c | 44 ++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 19bbb5b7e6b6..bfd09aa98c12 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -384,6 +384,28 @@ static int cdns3_role_set(struct usb_role_switch *sw, enum usb_role role) return ret; } +static int cdns3_set_phy_power(struct cdns3 *cdns, bool on) +{ + int ret = 0; + + if (on) { + ret = phy_power_on(cdns->usb2_phy); + if (ret) + return ret; + + ret = phy_power_on(cdns->usb3_phy); + if (ret) { + phy_power_off(cdns->usb2_phy); + return ret; + } + } else { + phy_power_off(cdns->usb3_phy); + phy_power_off(cdns->usb2_phy); + } + + return 0; +} + /** * cdns3_probe - probe for cdns3 core device * @pdev: Pointer to cdns3 core platform device @@ -477,14 +499,10 @@ static int cdns3_probe(struct platform_device *pdev) if (ret) goto err1; - ret = phy_power_on(cdns->usb2_phy); + ret = cdns3_set_phy_power(cdns, true); if (ret) goto err2; - ret = phy_power_on(cdns->usb3_phy); - if (ret) - goto err3; - sw_desc.set = cdns3_role_set; sw_desc.get = cdns3_role_get; sw_desc.allow_userspace_control = true; @@ -496,16 +514,16 @@ static int cdns3_probe(struct platform_device *pdev) if (IS_ERR(cdns->role_sw)) { ret = PTR_ERR(cdns->role_sw); dev_warn(dev, "Unable to register Role Switch\n"); - goto err4; + goto err3; } ret = cdns3_drd_init(cdns); if (ret) - goto err5; + goto err4; ret = cdns3_core_init_role(cdns); if (ret) - goto err5; + goto err4; device_set_wakeup_capable(dev, true); pm_runtime_set_active(dev); @@ -522,14 +540,11 @@ static int cdns3_probe(struct platform_device *pdev) dev_dbg(dev, "Cadence USB3 core: probe succeed\n"); return 0; -err5: +err4: cdns3_drd_exit(cdns); usb_role_switch_unregister(cdns->role_sw); -err4: - phy_power_off(cdns->usb3_phy); - err3: - phy_power_off(cdns->usb2_phy); + cdns3_set_phy_power(cdns, false); err2: phy_exit(cdns->usb3_phy); err1: @@ -553,8 +568,7 @@ static int cdns3_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); cdns3_exit_roles(cdns); usb_role_switch_unregister(cdns->role_sw); - phy_power_off(cdns->usb2_phy); - phy_power_off(cdns->usb3_phy); + cdns3_set_phy_power(cdns, false); phy_exit(cdns->usb2_phy); phy_exit(cdns->usb3_phy); return 0; From patchwork Mon Jun 8 07:10:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 214937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7536DC433DF for ; Mon, 8 Jun 2020 07:10:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E062204EF for ; Mon, 8 Jun 2020 07:10:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Wkmc496x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729044AbgFHHKz (ORCPT ); Mon, 8 Jun 2020 03:10:55 -0400 Received: from mail-eopbgr40046.outbound.protection.outlook.com ([40.107.4.46]:14272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727966AbgFHHKy (ORCPT ); Mon, 8 Jun 2020 03:10:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ix4Lsr5R/0feKtl3QB0Z5efkROELBFLOKU6yhR/PI6Jy8IK5LeUodT8H9NdnwCyv9Hndypbp7tQRZqIkU0eTYDoekaIMHGTNP/loYY5Fw3DUDNAgaXu2c50QW/faXV3MObo93xcNz4hXtrVI1UjPcwnR1pJtySWi/S9RA55hvrdthTSHy0fgzCMQXqZPT45dcQ5S9ssAmqlzqO0A9gFVrkreOejNg4XXT1xmKQg91MqzcimCglpLGFqdXgkS+HokSaddoIGr4NUlfw6vwZ8t8syKXoJOg+66tsaLK5aNaJ6R97DN7IewKOI/IUWd0eP0HTAIaj1USnH6H8GGDgKBiw== 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-SenderADCheck; bh=Pfopa1v1fnnUtpGsiG083yfjDSGs0U3uA4nA+vuXne4=; b=n4e9k+ncKy0AX4XZ165S9g2gJnb08zepBD4hc+lRgYzsHpwsTG5/UZnGQ4OBiPSaEb/zgxLxBUOMuITL6rFc0vYgEYbMWdPfm5ZSS+6UUpdEThhSkpQm+y+umYNZbTyaf+9GCxFR6fTNF8yGPKde6Tj0L6DjiUHcF+r6MgmGa+mK3NyqZPVxucLuX7nsrPePo0SbWt5/6KwKTH6ygc2Hkn+WOYRiuF+WzSuBRv/fddtEWsHLkLXVDn3UuUcw+yZOytSM5YBRtFjug7PgaAz905w04TIHQ1r+wtkOQ1iesTOsuWzYXoNGzbXaD7lUHra4WFhunuwEJ2xsdFMB9xteCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pfopa1v1fnnUtpGsiG083yfjDSGs0U3uA4nA+vuXne4=; b=Wkmc496xPseHDib5166p0NqSTtzDFe0tr3+t2rnL2bNCreJNZL1d/mOD1EGWOLWjq7DhgwZH671PtqeHMZyMc50qLbKOoCZb1X7LxJsMBhbM76YR3g23sdLjNZC/1Elaamwo2Z5TLtLiG1G/fpwrKpQYujomZVMgNfAM+HngnBE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 07:10:49 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a%3]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:10:49 +0000 From: Peter Chen To: balbi@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com, Peter Chen Subject: [PATCH v3 3/9] usb: cdns3: imx: add glue layer runtime pm implementation Date: Mon, 8 Jun 2020 15:10:46 +0800 Message-Id: <20200608071052.8929-4-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608071052.8929-1-peter.chen@nxp.com> References: <20200608071052.8929-1-peter.chen@nxp.com> X-ClientProxiedBy: SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Mon, 8 Jun 2020 07:10:46 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 21b4e3ad-69eb-4cc9-682b-08d80b7b1257 X-MS-TrafficTypeDiagnostic: AM7PR04MB6870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 042857DBB5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U0boCvMweCJiDCJ3CCkOmSb9W+NeICzprFhz0N2lRWIp7AYqs6ypHoT8R/rIzqIZ0GmOh40BoZ1+UJet7o4hX9qbjfcsDUoRRD+cBAVld24uVSN0vaVAzEwN3ziR6kJvlvLJHNwKuoZR5K/ua9BjuDQBXlju3H2/OZuCvvfh0ZdaXDhKe4rJKSgYcirMSejkFc/JlhshvIBXmeT7TZnI6eDRIM0I3LSF244SpDoiiTdasFj0nSPEyRr0kUVQs+86rwJtxmKh0OfLjXC3zQgytZhnyDdPS/oEMOMUHzA6xFPG94+BLH4ODJNxYS0+wLm7ggW9fuU/bm2KiuALrF3MYg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7157.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(1076003)(6512007)(66946007)(44832011)(5660300002)(8936002)(66476007)(66556008)(8676002)(16526019)(186003)(956004)(2616005)(26005)(6506007)(86362001)(6486002)(316002)(2906002)(83380400001)(4326008)(478600001)(36756003)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 02Yv31RHl40Vxetbaa5kvSwpcEC+GKnCZuCR10KMvsnotn1ax6m2OeuaAacr1W4JFQ+7klno41jGceJ8wqWP69c3wwiOOlSroGG2gfZP/AXdBAvimVj3N/0IOzBCByAg66C2kLjysUNR8PU6MIj8FLsIC6HrcxY11+gtYngc5rL/m52jL/5a319hpC7HfPxDeHeXmlUeQbcvt5aYxBkRniaujr2vDbOl4WCEbtFat7OhZ8/XCoX+WVSkWv4Cbwd+UR8T2QIl/jfFArT1lBBydyVoThAAr8/MzfCdAFK5WRxNoAr9S9SH5AfApTZ/SDZeK8YLqP8smi4RS0NIGVBIgLM+q52BQPkseF6o4hQHRwgxBFC2V0Sx7Sq1r3is2rlfypP3HmU1CREQsPS+JBiBfimDYQH8fswJ5bN91Sm7Pyxb5wMv/0H0uvEpd1mjnZFZyuSRUgWuOJWSWkfx9/6OaL7TXiHxas/7dtUIHXEYkJk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21b4e3ad-69eb-4cc9-682b-08d80b7b1257 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2020 07:10:49.1457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U/bgNRpnwUSL7clfcEdfECVqZenYs8DQN7vcU3sDG4ynUQrxXHFq2Zw3NZcNi81vqZRqJL1PvMiubMhT8KqRfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add imx glue layer runtime pm implementation, and the runtime pm is default off. Signed-off-by: Peter Chen --- drivers/usb/cdns3/cdns3-imx.c | 203 ++++++++++++++++++++++++++++++++-- 1 file changed, 192 insertions(+), 11 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c index aba988e71958..3a7e9bf7a294 100644 --- a/drivers/usb/cdns3/cdns3-imx.c +++ b/drivers/usb/cdns3/cdns3-imx.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include "core.h" #define USB3_CORE_CTRL1 0x00 #define USB3_CORE_CTRL2 0x04 @@ -32,7 +34,7 @@ /* Register bits definition */ /* USB3_CORE_CTRL1 */ -#define SW_RESET_MASK (0x3f << 26) +#define SW_RESET_MASK GENMASK(31, 26) #define PWR_SW_RESET BIT(31) #define APB_SW_RESET BIT(30) #define AXI_SW_RESET BIT(29) @@ -44,17 +46,17 @@ #define OC_DISABLE BIT(9) #define MDCTRL_CLK_SEL BIT(7) #define MODE_STRAP_MASK (0x7) -#define DEV_MODE (1 << 2) -#define HOST_MODE (1 << 1) -#define OTG_MODE (1 << 0) +#define DEV_MODE BIT(2) +#define HOST_MODE BIT(1) +#define OTG_MODE BIT(0) /* USB3_INT_REG */ #define CLK_125_REQ BIT(29) #define LPM_CLK_REQ BIT(28) #define DEVU3_WAEKUP_EN BIT(14) #define OTG_WAKEUP_EN BIT(12) -#define DEV_INT_EN (3 << 8) /* DEV INT b9:8 */ -#define HOST_INT1_EN (1 << 0) /* HOST INT b7:0 */ +#define DEV_INT_EN GENMASK(9, 8) /* DEV INT b9:8 */ +#define HOST_INT1_EN BIT(0) /* HOST INT b7:0 */ /* USB3_CORE_STATUS */ #define MDCTRL_CLK_STATUS BIT(15) @@ -62,15 +64,34 @@ #define HOST_POWER_ON_READY BIT(12) /* USB3_SSPHY_STATUS */ -#define CLK_VALID_MASK (0x3f << 26) -#define CLK_VALID_COMPARE_BITS (0xf << 28) -#define PHY_REFCLK_REQ (1 << 0) +#define CLK_VALID_MASK GENMASK(31, 26) +#define CLK_VALID_COMPARE_BITS GENMASK(31, 28) +#define PHY_REFCLK_REQ BIT(0) + +/* OTG registers definition */ +#define OTGSTS 0x4 +/* OTGSTS */ +#define OTG_NRDY BIT(11) + +/* xHCI registers definition */ +#define XECP_PM_PMCSR 0x8018 +#define XECP_AUX_CTRL_REG1 0x8120 + +/* Register bits definition */ +/* XECP_AUX_CTRL_REG1 */ +#define CFG_RXDET_P3_EN BIT(15) + +/* XECP_PM_PMCSR */ +#define PS_MASK GENMASK(1, 0) +#define PS_D0 0 +#define PS_D1 1 struct cdns_imx { struct device *dev; void __iomem *noncore; struct clk_bulk_data *clks; int num_clks; + struct platform_device *cdns3_pdev; }; static inline u32 cdns_imx_readl(struct cdns_imx *data, u32 offset) @@ -126,6 +147,20 @@ static int cdns_imx_noncore_init(struct cdns_imx *data) return ret; } +static int cdns_imx_platform_suspend(struct device *dev, + bool suspend, bool wakeup); +static struct cdns3_platform_data cdns_imx_pdata = { + .platform_suspend = cdns_imx_platform_suspend, +}; + +static struct of_dev_auxdata cdns_imx_auxdata[] = { + { + .compatible = "cdns,usb3", + .platform_data = &cdns_imx_pdata, + }, + {}, +}; + static int cdns_imx_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -162,14 +197,18 @@ static int cdns_imx_probe(struct platform_device *pdev) if (ret) goto err; - ret = of_platform_populate(node, NULL, NULL, dev); + ret = of_platform_populate(node, NULL, cdns_imx_auxdata, dev); if (ret) { dev_err(dev, "failed to create children: %d\n", ret); goto err; } - return ret; + device_set_wakeup_capable(dev, true); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + pm_runtime_forbid(dev); + return ret; err: clk_bulk_disable_unprepare(data->num_clks, data->clks); return ret; @@ -194,6 +233,147 @@ static int cdns_imx_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM +static void cdns3_set_wakeup(struct cdns_imx *data, bool enable) +{ + u32 value; + + value = cdns_imx_readl(data, USB3_INT_REG); + if (enable) + value |= OTG_WAKEUP_EN | DEVU3_WAEKUP_EN; + else + value &= ~(OTG_WAKEUP_EN | DEVU3_WAEKUP_EN); + + cdns_imx_writel(data, USB3_INT_REG, value); +} + +static int cdns_imx_platform_suspend(struct device *dev, + bool suspend, bool wakeup) +{ + struct cdns3 *cdns = dev_get_drvdata(dev); + struct device *parent = dev->parent; + struct cdns_imx *data = dev_get_drvdata(parent); + void __iomem *otg_regs = cdns->otg_regs; + void __iomem *xhci_regs = cdns->xhci_regs; + u32 value; + int ret = 0; + + if (cdns->role != USB_ROLE_HOST) + return 0; + + if (suspend) { + /* SW request low power when all usb ports allow to it ??? */ + value = readl(xhci_regs + XECP_PM_PMCSR); + value &= ~PS_MASK; + value |= PS_D1; + writel(value, xhci_regs + XECP_PM_PMCSR); + + /* mdctrl_clk_sel */ + value = cdns_imx_readl(data, USB3_CORE_CTRL1); + value |= MDCTRL_CLK_SEL; + cdns_imx_writel(data, USB3_CORE_CTRL1, value); + + /* wait for mdctrl_clk_status */ + value = cdns_imx_readl(data, USB3_CORE_STATUS); + ret = readl_poll_timeout_atomic(data->noncore + USB3_CORE_STATUS, value, + (value & MDCTRL_CLK_STATUS) == MDCTRL_CLK_STATUS, + 10, 100000); + if (ret) + dev_warn(parent, "wait mdctrl_clk_status timeout\n"); + + /* wait lpm_clk_req to be 0 */ + value = cdns_imx_readl(data, USB3_INT_REG); + ret = readl_poll_timeout_atomic(data->noncore + USB3_INT_REG, value, + (value & LPM_CLK_REQ) != LPM_CLK_REQ, + 10, 100000); + if (ret) + dev_warn(parent, "wait lpm_clk_req timeout\n"); + + /* wait phy_refclk_req to be 0 */ + value = cdns_imx_readl(data, USB3_SSPHY_STATUS); + ret = readl_poll_timeout_atomic(data->noncore + USB3_SSPHY_STATUS, value, + (value & PHY_REFCLK_REQ) != PHY_REFCLK_REQ, + 10, 100000); + if (ret) + dev_warn(parent, "wait phy_refclk_req timeout\n"); + + cdns3_set_wakeup(data, wakeup); + } else { + /* wait CLK_125_REQ to be 1 */ + value = cdns_imx_readl(data, USB3_INT_REG); + ret = readl_poll_timeout_atomic(data->noncore + USB3_INT_REG, value, + (value & CLK_125_REQ) != CLK_125_REQ, + 10, 100000); + if (ret) + dev_warn(parent, "wait CLK_125_REQ timeout\n"); + + cdns3_set_wakeup(data, false); + + /* SW request D0 */ + value = readl(xhci_regs + XECP_PM_PMCSR); + value &= ~PS_MASK; + value |= PS_D0; + writel(value, xhci_regs + XECP_PM_PMCSR); + + /* clr CFG_RXDET_P3_EN */ + value = readl(xhci_regs + XECP_AUX_CTRL_REG1); + value &= ~CFG_RXDET_P3_EN; + writel(value, xhci_regs + XECP_AUX_CTRL_REG1); + + /* clear mdctrl_clk_sel */ + value = cdns_imx_readl(data, USB3_CORE_CTRL1); + value &= ~MDCTRL_CLK_SEL; + cdns_imx_writel(data, USB3_CORE_CTRL1, value); + + /* wait for mdctrl_clk_status is cleared */ + value = cdns_imx_readl(data, USB3_CORE_STATUS); + ret = readl_poll_timeout_atomic(data->noncore + USB3_CORE_STATUS, value, + (value & MDCTRL_CLK_STATUS) != MDCTRL_CLK_STATUS, + 10, 100000); + if (ret) + dev_warn(parent, "wait mdctrl_clk_status cleared timeout\n"); + + /* Wait until OTG_NRDY is 0 */ + value = readl(otg_regs + OTGSTS); + ret = readl_poll_timeout_atomic(otg_regs + OTGSTS, value, + (value & OTG_NRDY) != OTG_NRDY, + 10, 100000); + if (ret) + dev_warn(parent, "wait OTG ready timeout\n"); + } + + return ret; + +} + +static int cdns_imx_resume(struct device *dev) +{ + struct cdns_imx *data = dev_get_drvdata(dev); + + return clk_bulk_prepare_enable(data->num_clks, data->clks); +} + +static int cdns_imx_suspend(struct device *dev) +{ + struct cdns_imx *data = dev_get_drvdata(dev); + + clk_bulk_disable_unprepare(data->num_clks, data->clks); + + return 0; +} +#else +static int cdns_imx_platform_suspend(struct device *dev, + bool suspend, bool wakeup) +{ + return 0; +} + +#endif /* CONFIG_PM */ + +static const struct dev_pm_ops cdns_imx_pm_ops = { + SET_RUNTIME_PM_OPS(cdns_imx_suspend, cdns_imx_resume, NULL) +}; + static const struct of_device_id cdns_imx_of_match[] = { { .compatible = "fsl,imx8qm-usb3", }, {}, @@ -206,6 +386,7 @@ static struct platform_driver cdns_imx_driver = { .driver = { .name = "cdns3-imx", .of_match_table = cdns_imx_of_match, + .pm = &cdns_imx_pm_ops, }, }; module_platform_driver(cdns_imx_driver); From patchwork Mon Jun 8 07:10:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 214936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CC51C433E0 for ; Mon, 8 Jun 2020 07:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E043204EF for ; Mon, 8 Jun 2020 07:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oQ0/b8in" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729027AbgFHHLC (ORCPT ); Mon, 8 Jun 2020 03:11:02 -0400 Received: from mail-eopbgr40046.outbound.protection.outlook.com ([40.107.4.46]:14272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728953AbgFHHK7 (ORCPT ); Mon, 8 Jun 2020 03:10:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AoErsFnpttPfxgFXCedaxpbIuOWv7kp3ruizkvzRMjwD2jsbcXwWlnILit+LRaq24iEh5wDDdYmZZ6c3t9XTUnwSHvIb15xh1rbP8aqvxtafoG8leW7+iqifHsCe9ROaYgVAM2UaVJzTqET/xDdR0fwbaIcVtxEyph/GHOR3gqRKocuUQKKEHq2lE2+mINl8M3XtuVDWFlJcVlYhoA7zS9INfvxirxg155xL5e0WyYqDldIzGm9X7Y9nvxqZAtvEfaeuTvu+6Vnojvlu+mKVpoq/9RRCLYepxSY0JjbdpRu4aGuuPdWG+iDn6OZ8Dms84UioGXdITFQg1Badc1YisQ== 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-SenderADCheck; bh=RPegifVYigfyV9eq/X/+i3y5OBIGQwhBw/jxdrmMHjk=; b=Sg0Op22HODpmJ298rQomwN/mlVk22cBeYwr8v5UQbqww1j+CueZrmcTz08Vf629wk+8NzEfY/dOc+e9SM8KJVqmyWZVP2KKixhbCvCWKWIiCaMkLef/agc8DmdKzCJzOlKart6D78kKa7oMvUA0LMVLqwyh+zZoK3FhFNcTSRTNG1kBCDaWtDHRbD0qfOVEshcuyOrrqi47qhhL4x5PmBWvtimZ/34XXojyro7yPOBk61rKcWs5vCyx2Hgc7XbPsStQtlcu36ODX4dvvkFAz6X4aCyc+58SB6WNeQ1XeilInK5uMp3sIi8xRxtGAJBFGWMYiBWYpZn6tc3TtGb/srw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RPegifVYigfyV9eq/X/+i3y5OBIGQwhBw/jxdrmMHjk=; b=oQ0/b8inD0UnDt2RT1JKlvYvXZ0CDvQ2Z74TxvJUbPAMU6EkFzersnNNgeF9BujXs5IULik34O2tJkn+BMRql9dgpT6JTsRlMk/Z7E73+8gUd/lmPhzRcAl5SP5ezMk23WYorPj0Cr231b0j1UUgaBH6S8EMJubT+mMhnkNOmoE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 07:10:55 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a%3]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:10:55 +0000 From: Peter Chen To: balbi@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com, Peter Chen Subject: [PATCH v3 5/9] usb: host: xhci-plat: add .suspend_quirk for struct xhci_plat_priv Date: Mon, 8 Jun 2020 15:10:48 +0800 Message-Id: <20200608071052.8929-6-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608071052.8929-1-peter.chen@nxp.com> References: <20200608071052.8929-1-peter.chen@nxp.com> X-ClientProxiedBy: SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Mon, 8 Jun 2020 07:10:52 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e461cf5-c463-464c-6f91-08d80b7b161a X-MS-TrafficTypeDiagnostic: AM7PR04MB6870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 042857DBB5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iLdWNfTMJGQUFNFrorjaKDpuaIqcbDY9yvpq2H2Iq8YQDMqKywyNYYKVi2uW5QV3MKNULabz6RnGSYae41Qq5sxvLMtOs5LWnD+k5S22PquRIhXZGg25gr7hNjoy91/ZZ8hLLiW65YeeuzBu403/3qdb7h2Ty90GCfAdP+FSPjdDpHKTcqcjtC2zpxlfEY4bkoG272OyAN3/bM6AQPI47cVK7HTez579dM8K6wBMYio+Ue/OtCSq/O/c+WXNjwRxS53VBkGwzBDNu2tucSa/f5RgInBW9beNlanxyDq8ZrfvNaBrjJFZzd/JLkSF8tmSW+mibUCmmt0CUXkyDUQFkFd7DTox2wdJXXiLrkWl5ixiZMsx41BuIEDcPAZXQaG0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7157.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(1076003)(6512007)(66946007)(44832011)(5660300002)(8936002)(66476007)(66556008)(8676002)(16526019)(186003)(956004)(2616005)(26005)(6506007)(86362001)(6486002)(316002)(2906002)(83380400001)(15650500001)(4326008)(478600001)(36756003)(52116002)(6666004)(142923001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WBfUQvuvAW8znKqjiH3802YqRK5vgpTXjUlHX1rLVGaiPH5OOynQ7EyTH1VHACbcJE6GKkDt1mrb/kmyQwjfIxMsysEYYwRNN5/XGDgxV5YIxXuspZb7VrCt0lFwHCWVd9xCZdBSYyNNq4i8JPR/nilrcPU66zrvFXImd4gv+BgfqkOrEv017zIJNdONyAkQLt7E1LoGwvwKxA0amAnbQvAB5TVLf08RqUgJz1uuARwkaHdSrQR+LHN1lJ84Eys/oEOMYA0uWDDe+Nmf/wsaA4Hbd2Kyv4EhhBQ/KxWsJ6588q4BI5m9UDD8ToJYiuNkw/HZ40TFPcCZ1E35H2ZetAi+Gkq/v3Cza5hnKRgRwlN74OTiO3yzx20osY8CvBlUfjVdHe5+urE89ss3G0WBXGKWIiur6RF6owb3KzTfGD8S1M2UiKFoa+oK1BUjMxui3ho0RFFUJJE59fpnuE1hQhY7Mme+QJ09ZTyE0zy1zb0= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e461cf5-c463-464c-6f91-08d80b7b161a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2020 07:10:55.4899 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7cg6yLsBOBlFobui5743GW0Rz5r4V7lE2/eN8spx4wH/dBd4szxMC6uTsY/Ah67cq4CRwoR03AC4gkhe0U8A3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some platforms (eg cdns3) may have special sequences between xhci_bus_suspend and xhci_suspend, add .suspend_quick for it. Acked-by: Mathias Nyman Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 19 +++++++++++++++++++ drivers/usb/host/xhci-plat.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index e00efd84ea1a..ca02e7f36238 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -54,6 +54,16 @@ static int xhci_priv_init_quirk(struct usb_hcd *hcd) return priv->init_quirk(hcd); } +static int xhci_priv_suspend_quirk(struct usb_hcd *hcd) +{ + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); + + if (!priv->suspend_quirk) + return 0; + + return priv->suspend_quirk(hcd); +} + static int xhci_priv_resume_quirk(struct usb_hcd *hcd) { struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); @@ -396,7 +406,11 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + int ret; + ret = xhci_priv_suspend_quirk(hcd); + if (ret) + return ret; /* * xhci_suspend() needs `do_wakeup` to know whether host is allowed * to do wakeup during suspend. Since xhci_plat_suspend is currently @@ -425,6 +439,11 @@ static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + int ret; + + ret = xhci_priv_suspend_quirk(hcd); + if (ret) + return ret; return xhci_suspend(xhci, true); } diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h index 5681723fc9cd..9338a4f946d0 100644 --- a/drivers/usb/host/xhci-plat.h +++ b/drivers/usb/host/xhci-plat.h @@ -15,6 +15,7 @@ struct xhci_plat_priv { unsigned long long quirks; void (*plat_start)(struct usb_hcd *); int (*init_quirk)(struct usb_hcd *); + int (*suspend_quirk)(struct usb_hcd *); int (*resume_quirk)(struct usb_hcd *); }; From patchwork Mon Jun 8 07:10:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 214935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D31EFC433E0 for ; Mon, 8 Jun 2020 07:11:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5A8B204EF for ; Mon, 8 Jun 2020 07:11:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZQNhTTAT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729005AbgFHHLI (ORCPT ); Mon, 8 Jun 2020 03:11:08 -0400 Received: from mail-eopbgr40046.outbound.protection.outlook.com ([40.107.4.46]:14272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728953AbgFHHLG (ORCPT ); Mon, 8 Jun 2020 03:11:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BzV/bOaS8BdUIxv2W8SK5JYYv/n4lct9sT5FdSbs5ObG0pv0SliLLMSjjfaLYy1bQUcXLJncuMfm1s12u7Z7l6S5bzN6RI1GYcr1t6WsI4SvoXOedLodVhi7HRkeJxEoEjwgSzkhi5Ty0rhYOuLHgkP2zv1ziem86mQ7BTMuuHtZYW3m6k11Naq8djpn7AWvo8twiMOWgLuXLa4ggSDPk/7wE8SiLhUZaT883e5MeJCzhS6pIwU/gHg3QVpJnlTPzdf18DFYn57NuybAagGutuQVFKp5NdCYbV61CRl2t3+HhvF0nnmH5OyZhyAKQjFGo0hhwyF/VY6ktjY69lQhFg== 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-SenderADCheck; bh=iPlSGX8/gUtmNQA831z4sLaWRywj/xvNP/68gpsfqFk=; b=TbZEArsXdqFLXXdTWwxF8AyWE73soX6VOvCKNbIXBP3R/WlgFxpwUW7vPLtecMH6LfEHMtxDJaneMWJbzABuJLH+530BxNxLLOpTLg5HiWvkVt809T+JYq+6pZv84+JvwAgYtdZyfNPRqb9rB9MNMw6bvbZxnklypazzuoRg4Y9eQ+JTnPNeZc79w3OcNARhEseNSy2p44r9T1CoQHivF2x553bm5Jh2cfTs6FW8DT1L+W+ureh5pTF5BFXfWdI7LOMtiY3w3o0EZ0AJ0yYq7QE8a4623r6bf0Wa6UmRzjLHAkM1B2Yy1hGZD2wHANdyK7+2w6fvP8ASNynF/XaS0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iPlSGX8/gUtmNQA831z4sLaWRywj/xvNP/68gpsfqFk=; b=ZQNhTTATzJ1m0juR9+BPdmKVsyQz/vVI8VD/+x2cF7uO/bpaXmvgrHJB41YjM9d23BVtEss9YnfhDs+WekrVQt3Zkh+3dU8pFHwsITat/qsAukt0/Z/lUg5901eFfdRh3kf/e0Q7Y1Z59LNUE4Au0av3e+h4E4NWG5jCwIQ2up8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 07:11:02 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a%3]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:11:02 +0000 From: Peter Chen To: balbi@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com, Peter Chen Subject: [PATCH v3 7/9] usb: host: xhci-plat: add priv quirk for skip PHY initialization Date: Mon, 8 Jun 2020 15:10:50 +0800 Message-Id: <20200608071052.8929-8-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608071052.8929-1-peter.chen@nxp.com> References: <20200608071052.8929-1-peter.chen@nxp.com> X-ClientProxiedBy: SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Mon, 8 Jun 2020 07:10:59 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4831dc91-1360-4741-3430-08d80b7b1a53 X-MS-TrafficTypeDiagnostic: AM7PR04MB6870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 042857DBB5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CymmbohsjSVWt6yaVVeiHqF6UgpomsgDMcvT0PoGFucTkatdK6UwSGLDM8O2pUrvhU9BmSnY6KcoEApWIXi+gD3zJoZfN9EFY0eLeJtQ09r9DncnDF8nzMHdrmYrmLVHun4lAC6bG6uXErX81YBCtfBQG5g2qFpOo+yEuSqRJ6nAYxLdj8b0sMHpFqJtMSeos3XhR2ogpPloeKbyrq8jcvC1HYcEL/QEfsJXjqc6BkSHI/vj3inAPD0Co5s6VfNgVSRF4ekTw8dcAel4zT2aK976iBXW634mnVMT/oyimYZpPaJ5Iy4y5ywG5qWWd+IDp+ekGF+TFlNcqndMNwzH1w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7157.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(1076003)(6512007)(66946007)(44832011)(5660300002)(8936002)(66476007)(66556008)(8676002)(16526019)(186003)(956004)(2616005)(26005)(6506007)(86362001)(6486002)(316002)(2906002)(83380400001)(4326008)(478600001)(36756003)(52116002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: FsSdOhWxXgK+ZRBMMHkM7WYpwyj8sM8KkbhdDvu4pJhku3VgK33igsGGTlnjQdKAClDfpYgMywRkNMV+ypWjYcBWgQTa+vw6MHPynXd8FoXK/BCWbLvE5VZpkKvemX6UPPsN51M1z+v2sM9a5E619NXuxZNFpAfJNJsaj8toqJnql/ZU2SysmeT+12d4ni0M3qODDs2MDvS+KuEa+ijj1e5l/mdpnWwgwE7EGAfRioq5tb87eDkkGabtKcV3nQb3lj2aNeSoJjLnOsGHURF5S9N7oYZw7C7IyqnUgUbnpFRQK6em9huV0x6bBzP09kdBVoYy6ysCKSnQCyJcL5CzowM14HItnGpX9DklAtd2JuC1IBRbMRleULQ+t7q900EdjLiCqd51wi4GJUeowdS96wIsNt35PampZv3UltFjV2RKlWKjA42zP4BeQAmzCj2+ROnS75oLCPVc3P7DWif75hU/zqQ3quiHkEDAQFThbOY= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4831dc91-1360-4741-3430-08d80b7b1a53 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2020 07:11:02.5559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DDWkA9wA3YSeoz9uonoYIKycksCj9Uvgix5WLv7soyUEyMOqnjN+h9iRyeH3InZGsduQp29RjILXJyeCMfgRgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some DRD controllers (eg, dwc3 & cdns3) have PHY management at their own driver to cover both device and host mode, so add one priv quirk for such users to skip PHY management from HCD core. Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 8 ++++++-- drivers/usb/host/xhci.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index a45c7ec33ed6..6b8a193bd012 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -173,6 +173,8 @@ static int xhci_plat_probe(struct platform_device *pdev) struct usb_hcd *hcd; int ret; int irq; + struct xhci_plat_priv *priv = NULL; + if (usb_disabled()) return -ENODEV; @@ -271,8 +273,7 @@ static int xhci_plat_probe(struct platform_device *pdev) priv_match = dev_get_platdata(&pdev->dev); if (priv_match) { - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); - + priv = hcd_to_xhci_priv(hcd); /* Just copy data for now */ *priv = *priv_match; } @@ -324,6 +325,9 @@ static int xhci_plat_probe(struct platform_device *pdev) hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); xhci->shared_hcd->tpl_support = hcd->tpl_support; + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) + hcd->skip_phy_initialization = 1; + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto disable_usb_phy; diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 54a08bd31e46..b19169fd8a85 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1873,6 +1873,7 @@ struct xhci_hcd { #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) #define XHCI_CDNS_HOST BIT_ULL(36) +#define XHCI_SKIP_PHY_INIT BIT_ULL(37) unsigned int num_active_eps; unsigned int limit_active_eps; From patchwork Mon Jun 8 07:10:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 214934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B336BC433E0 for ; Mon, 8 Jun 2020 07:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9371B2076A for ; Mon, 8 Jun 2020 07:11:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Skuf1tjw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729058AbgFHHLO (ORCPT ); Mon, 8 Jun 2020 03:11:14 -0400 Received: from mail-eopbgr40046.outbound.protection.outlook.com ([40.107.4.46]:14272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728953AbgFHHLN (ORCPT ); Mon, 8 Jun 2020 03:11:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGDi89MUR6RN9Th1JJAImQrqPO/PiHxzTAQ2fzMQKQnG4clC3UKfQDgG+xAiYJSWcvJtqUXvob8ZfTeiBktgd54CM5PFDuMqp0V7X+RcLK8P/8zrWo4anluhgF2Z9N6yIR8LV9f4aoslN66RoVZaGY5nKDiZR0FEpy9ecBhs9wJE+OUEqKRkzFYjVmoXhi2qLvcl7tZxu3KdLpdsGw30BVHciyBoc2flBFlz6QfTf6L2OnoKYPJ6JuH4vJK0gOh9mVZjIRtJNUZVDpfwwrA5A15Pb6hLxr0KMTHJVw5da1bLkqnWuOazd/c0/XZoGRpKS/WPWqTjSH0yNOUP+iHNIQ== 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-SenderADCheck; bh=PSSvEBE+KCAkB94M/t9GdktCL2AaLc3cRFmrEspB10s=; b=IOevk5X8ZwnFmU+WU0iPF7QzlidB8i6pcsIfsSEJRFG5CcAlCKBo/+UdpkOIrDBAILUQLTRO57MwZKF3GPw11kq6HuzvI+IS95eZhDr8ApXEAZb4qaFLAUj5Q/bqXVh+gb2bSTsW8GojE0rXHJQijGP/CFyNkHHi6e4h9acJr7Gz1Kie/HX74m6jkaRhH1MGybRcz6C/2aT5RRM5U4ueRImUiZYMw4Z6pyfPboz69GJj9vfB0uoDQej8zKgx3BLW+/nsvK2StEfNdsdTXgrIb7luCSeQNHeRTHkoL64K0rRZteu6V1W6dxQ5iRlIlmPSY5gY9B8ZuIqe6atJSLOrLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PSSvEBE+KCAkB94M/t9GdktCL2AaLc3cRFmrEspB10s=; b=Skuf1tjwI5fiZ33ZnRLd7WcL4b15lcUdT9lyacsfH4Dcy33LNYWiXU/nuhcX/G4O8ahG/KU+UpoZdMqGTj6ka+Bhptf2xrVgVzPwDSSF+eIDxe5KIXw4O7AgHZaZNK5ImoDfikpF53k3jHMHgoyTknQfvg9NnjiXcsioOu9ZDVo= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM7PR04MB6870.eurprd04.prod.outlook.com (2603:10a6:20b:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 07:11:09 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1101:adaa:ee89:af2a%3]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 07:11:09 +0000 From: Peter Chen To: balbi@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com, rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com, Peter Chen Subject: [PATCH v3 9/9] usb: cdns3: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT Date: Mon, 8 Jun 2020 15:10:52 +0800 Message-Id: <20200608071052.8929-10-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608071052.8929-1-peter.chen@nxp.com> References: <20200608071052.8929-1-peter.chen@nxp.com> X-ClientProxiedBy: SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by SGAP274CA0002.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Mon, 8 Jun 2020 07:11:05 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e3f66d73-3cd4-4a53-1444-08d80b7b1e0a X-MS-TrafficTypeDiagnostic: AM7PR04MB6870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:626; X-Forefront-PRVS: 042857DBB5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HDovy9/1A3r/gx8MAVLUnFxB99npZINae2OMMSNa9NdtDuXGdrlsJPyQXscDbc4W0iXlIufvyANVFbHEgFM3VZ0+0nSsRQqT1drcKL7JBWONtdR6YKxgP/XMl73NJhjyiLIWjxoM1jwqsTaqOgXcZKnm21N1wu57t+ZDObj/7rB9tyL+zHPl9SS61mPjKnYa+iGIStDMY30sfvB8ok8WoHDWs1Yaw5BA3+ETGEWo56kK02AKJ2OIWSnxKndi1C58OnYQtnOlZnKUEFYXSHZf5Q7OHtizW+fHYhYzAoCkpiSEvzkY8LNmm/qgSpx+BorqjI0UEJUW7Bwb8736eMEHRg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7157.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(1076003)(6512007)(4744005)(66946007)(44832011)(5660300002)(8936002)(66476007)(66556008)(8676002)(16526019)(186003)(956004)(2616005)(26005)(6506007)(86362001)(6486002)(316002)(2906002)(83380400001)(4326008)(478600001)(36756003)(52116002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oK3IBMSK6gEC7x/cWEfj0Vo/Mn8zrzUcTelp4dTa9pGPUxcdRJwBW1RenbilikB4jVa3ka+8jJ4UKlr6I7OssUvVsteK4eatd/BM+AnFmDKnCQaBikd4dc/ch7jrGRs4/WlJfamcU8FPwLc6zk5OqR9eXe++U/ANnNEm1KjqOYgZ8xvMr3SkKCKL0VqFoNsZxoiDaHRaG4WkmQPQfPWe1W4QhDLGmR7zsV/2WICdrqhbojenIrydcpJ2rPHqUOy5urVy1vqqSUtyYddTCDwRcagtcT8nZvbI87jL3BvTZ4Ne23Q4mUAGtdDDcMw4NaT8MtDSTklL82AUze8wR6oo2OkGqpuENAhRVCXqH3juk86QMm0BFJlhcLDxDpbMOOA6/6CJnmxH+ZaPhxPs2t4AF4yri+2pVp0ROTc8JPsFkrr2nai7pmFZqNLeBXEQnpNM1G4/HxPgdSWvrujDr87wAMqjqj5ckEhtDwheuTctbmw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3f66d73-3cd4-4a53-1444-08d80b7b1e0a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2020 07:11:08.9449 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d6h+uvg9EvqyUkvvmo5jtBzGJdwXUmicEmB+D3hR+GjBc1cE7WCIMPaOOWTrqrZre7A0+WtOUS2aVyd3+Y3fBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6870 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org cdns3 manages PHY by own DRD driver, so skip the management by HCD core. Signed-off-by: Peter Chen --- drivers/usb/cdns3/host.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index 030d6421abd3..1dfbe23fa089 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -24,6 +24,7 @@ #define LPM_2_STB_SWITCH_EN (1 << 25) static const struct xhci_plat_priv xhci_plat_cdns3_xhci = { + .quirks = XHCI_SKIP_PHY_INIT, .suspend_quirk = xhci_cdns3_suspend_quirk, };