From patchwork Fri Sep 6 16:30:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13794446 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013045.outbound.protection.outlook.com [52.101.67.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8898E1D3638; Fri, 6 Sep 2024 16:30:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640258; cv=fail; b=A7oZfs1/7sLQO3HqQLJyCwp05XLmEOWusq/U7tL+VFalSqdUc0v2uQBw2N8h6ALvgt2NLropDyDcC53stlnzDosEACe0w+ExocT2E5NJmgDdC8N6mGXt3F41XdGWaprexAB/lTvfx1Wu5s1plB0rAcvxMs3K+q/GYDHUB1Uebas= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640258; c=relaxed/simple; bh=NubeVKC2JY+Edf4txeZQvlzij+Dl1DAys0Z7etoxmSs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=QrJEe5VPd3Z2DH7ngQ6Fsgl5Rfu1TyIsrVAlLjmvhX1teLBefNA8zgPhGDkbyEU27TH3UgGztdAsJ4SVUdE/K3mzg/wxbDTtqLTft1Kv+WRXeTzJSehyDGkOSTKch0OBODs9QRcf5w0z4Qk1w+3CdBrohD/qtbs6uTaDP6BXSc8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=OTQlKcYZ; arc=fail smtp.client-ip=52.101.67.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="OTQlKcYZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fzIVIhGaMio4iGzqAK890uQ2E6gQgRzKvTBcuo3CyvywsWIQsIYQILEnGJGoFu8RDXaXiixxWdN8WH0eIr34/grEdnSaawfGSsKABEKdn0vhJLLJr6Hml3HVL131HmkeXlMcRgZNA1K/8CD8aO7q/5ArDvlxy+OZZXfzXtpXWSuzanT9alMw2WLRaeAqjaZNCSr4ZkQYAg3PgN4j2GbXFEM2pizcmdWnnV6hqJwdajqewi/osbFkWYF2dqZDwAq40+vJXT9blTwgrFYNUeU8VXhDCYRDJkXd8yPtqYl3V7+DaTEbb6qsEnThPUuroaqUp2RQpTJWPuG7zJWDi5eB6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rzoMalRqkFItVzURXs+rS2zgBOQ+B6Nns8zGt7uifXA=; b=I8e8TXOr8YzsRXlpt5xJ3quRphnWOhveXz0nncq2kqLK1HMpzqnoYYfbV7v+vCtNSiW6zXnRK6YejbCLc2mfjuERlaW67t7RZVXsb43abkvOvXmW9OQFyl+wkAXw1wHq1t4kV4njzN3zanBIezu6cKCPFvcVF7d9MrbP5pUA+8n6x/QjRNMZh/boD9ZtOMN+GboI2fEJfLFssb/3tg/T4XOffm9YweNK0LV89+Sc/iflYYQ8sQdRvm+mciqiDqAZctodRSq4cyI54xN7KDyDJpwvGGn8dltSxmw1XYNH4vfbbeF38/6kz6R84VVd+tfqYgDmnwxBSd6J/Kq6Gk87Yg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rzoMalRqkFItVzURXs+rS2zgBOQ+B6Nns8zGt7uifXA=; b=OTQlKcYZ0Ur9imHV2U+Vzh8vLVG3F9UwZ0BYITLxbHEUExyyHBnZ9gsAs2o+4hE00p7qpd3SxrRmrxLUHHzNC97O2xE+W+MGFHWOgmWV3q9Qwo8xasaDOG9pKiXh3pzwGskwbtjLgPhMxoQ+IpDIDMfpMSwvqmLU/Q1DVqKKp4m6WyLqRuFaojaMlWapYlEwyUgdIw0GTwIy07s63YmYPEODwPgL/7jgOPUXvzPh79ojPPHu7DVcIpncKRNwNjp7PVI6Q27VzR3Y2YtUAnR6zl2Zyoi/0ofQ7EKWEZ+g4W6JeLFnppfNhc095lm3d9pgVFI/UH5Ratj7Kp5t2HSG3Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8405.eurprd04.prod.outlook.com (2603:10a6:102:1c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 16:30:54 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.017; Fri, 6 Sep 2024 16:30:54 +0000 From: Frank Li Date: Fri, 06 Sep 2024 12:30:37 -0400 Subject: [PATCH v5 1/3] usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk Message-Id: <20240906-dwc-mp-v5-1-ea8ec6774e7b@nxp.com> References: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> In-Reply-To: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725640246; l=1070; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=NubeVKC2JY+Edf4txeZQvlzij+Dl1DAys0Z7etoxmSs=; b=qN/04TfyCco+wt8mwN+joQFtEjr37HCYbV15R/2lrou0j8Y9CzA7CphWiZSyPQC2rrukGiVXO 49LePCHk6RSBEDN7TdPaRNyk40UzL3nsrurimTazol/I/ACJiB7620u X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR10CA0016.namprd10.prod.outlook.com (2603:10b6:a03:255::21) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8405:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d37fc07-287c-45c5-3eb2-08dcce914777 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?bsHxZW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IQ0lGNkKod6WllW?= =?utf-8?q?OkRD9mtNnUKffEh5FZhBFvV2rx4J8ofJtbGYGLGAG+q/B26F50k3+kO5bIazBbGAr?= =?utf-8?q?cDvFUWogzVncR5foQgQHPYFbAJaYwbhqFatma+Rq/LUhVqpurSHEcTgzFqYUrzDpu?= =?utf-8?q?57P3iwGCj4Kv0Ql2OpX/qlUaKBEsbqYa2KQHWf1wZqvrMqr4KbIEJpL8Q4tz2e+hj?= =?utf-8?q?NYoFbRjYsqAavWRlFnTioB/PxwkTn8jPJvGqUSDnsm4/yW91jEebBZ4pO+ugbcxza?= =?utf-8?q?ASPTashH5QxHDtd07yJLvyugACtAyd9jMwqoh5E7EHaO67ZAjFjkOoMAEl475ixcr?= =?utf-8?q?WjpSd8dLIyXHy4DCZk0muJMyOwzlhxRmLPrc49kT3uDgkEmrmJwz6JN0ov6ILrCO+?= =?utf-8?q?wUTORwNRG2c8IUxcOqeDrWXaM/Meg0pAl4+6pZd4MSR3HtBJP9WM3lfiiFqudnLAY?= =?utf-8?q?PxXpMCeJrtt21mQIaEHDbsbUDzP6O4utDg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?es6ySRXmBupNaaeQuOrCi6T2r+ce?= =?utf-8?q?9wVfQehQ8rNnpCWz+LnGmcMWwbzBZeNJ1kJzCd8+IRssYWZVaGrH+5ef+o1sV+LfS?= =?utf-8?q?yH8fbYdJzW+1DC1akDVmuiazPjFwsZQon2cm4FTYvojYjSRArzHOYMOmTHD0bT4lY?= =?utf-8?q?Dvy8jSudGxVzHWQL/UTkpxsi5zBwe4X9zw+q/f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P3ZWQX2AuOmAvbpqr?= =?utf-8?q?RPQUwmNX4ZsJZi/NXMia3VGV0sk85wHJsnTCBkvEHtMs1hH12syYP91hHSQqPJ/fA?= =?utf-8?q?vIISN38k1PNmxC+kM6EMi11cBjHCIpRxvOmJxIfZcxDFvOqmyfbV6BMi8bADCJOVo?= =?utf-8?q?25jK20a7gGBkU2nP3boPxdh/hpndjD4snnxI9OTvnh/0UITGfGk3HqsSbc7YeCMvJ?= =?utf-8?q?anZcaD1pYcNvhpGWP+Ey3Kz7vp7Y+PFV1/ZVpQFaOVfOGMyJ5VW/CVDQ2RoVR7HO/?= =?utf-8?q?K1/NIPYyXMXri2u1i1eJz3PaMzDoFH1oexYldMKTFkuGuVBGnV5iMDTRGoR1aOxRt?= =?utf-8?q?j1IZvadpN03JlsxV3oQzhVgo2zHY4LBJPitH0Ggsbscy9FEUu1keOW+MgcI11cOWw?= =?utf-8?q?NpqnJ1yEhdXJxllmlkC+KS/KVHIhQJBBwMKHX9OLP5dHkJ1dcREocS1Pv2erqO+Qo?= =?utf-8?q?/7n93PRZYHGO?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d37fc07-287c-45c5-3eb2-08dcce914777 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 16:30:54.5499 (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: C5AWNFP6sm/kK8Zz6SBcPDECS8GhTb7iHCoDWyT9TeJwofK4zqLRp4YYrOWCqKhDDe5DHb3K5o1163jTwBegrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8405 Parse software managed property 'xhci-skip-phy-init-quirk' and 'xhci-skip-phy-init-quirk' to apply related quirk. It allows usb glue layer driver apply these quirk. Signed-off-by: Frank Li --- change from v1 to v5 - none --- drivers/usb/host/xhci-plat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 31bdfa52eeb25..ecaa75718e592 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -259,6 +259,12 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s if (device_property_read_bool(tmpdev, "write-64-hi-lo-quirk")) xhci->quirks |= XHCI_WRITE_64_HI_LO; + if (device_property_read_bool(tmpdev, "xhci-missing-cas-quirk")) + xhci->quirks |= XHCI_MISSING_CAS; + + if (device_property_read_bool(tmpdev, "xhci-skip-phy-init-quirk")) + xhci->quirks |= XHCI_SKIP_PHY_INIT; + device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); } From patchwork Fri Sep 6 16:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13794447 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011014.outbound.protection.outlook.com [52.101.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E89F11D47B7; Fri, 6 Sep 2024 16:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640263; cv=fail; b=mG9KvBpiyCgpGJ506fYT2XTy84ItQ4ELiBk/z3Mqc96vNA9uiYWfZSUYsRLAgjF2apeWSJpL0heu04uP3q60xWIPUNxRXk11l4JEA/geTivW68AbwNP2nukYs+yKifBtizYSJ7a8fR6oUksad1dw6ojGhTu7Ri84N8xWjkMNmYo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640263; c=relaxed/simple; bh=OqCbEUzuE4T3rIePR+tm5vsCVk9EgAOhr0RnQgNI8YA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=m8bkUMuqo+5GOLuUTc388GrSALiy27d274mOiztv8eabGFJYLms4e8No4MMowBJSt5WufhmirERJv/2/DNJFFy7YrHMVvke0bd/nCEv9EabbOq2e+LMlE+wAWWcicdpKVIGdd+b4n42NfKGCUIZHnIHmkmoaLmyCWwWHDWxrYlE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Th7jbDG5; arc=fail smtp.client-ip=52.101.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Th7jbDG5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O1pMgC+YcZ5EW6g8U6kpo1sDLiOww5dIjm3LMVFCBjANWwfdRKrKJj6KGSAYOWlOUOOwVaD37N+MaXbtoYWPU7dfoJkDAboIej/tuBpJn4H/f/N9TMVymoNUIoJBeZDY8KAFUiRPbI9FcX9Yj+lhQnzhNHaDwCzZPaGQB3CYbBNCGvfqp+KqUJSk66QPa5HCkZO1IGnyOK9KSThenQiGXe4iePwEKUJvpd1rCCpDLFNs7pjSh6yWFlVyQCJoEah76+tJ5alcPvAEwncmND08hHYb14S31tTxglcPZn98IpsxTqIwDryu//6iRIlC9JJye8RNbVHvgOg6RaGzD6QvoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=P1k2OidQaHAXcsu5LAg151l4XuFwaAcxreDyaPLNuRA=; b=O78m+7WuYy4/uwva/RXTIgATt5yutH/8SVWSHCEwyIg5jSVNxDh9KDYU635YRGbBV6Q3Zl7wILDcq8zh/hhgJltAZ4XjTBBnlrAS0UsU9PlQtAHD0yIa9zAGuXSz4eAhePhLaFbnR2Ya+i0aLEtA5dwta4zm/6q7ClxMOXSxTO1T3R0ydmeCnEZpZ14FdB3djsNKBqSOj4cKdHPzwy79lzSsBtUsfLdCQ1+V1IV6CnSKmppih+qLXFbTkSco3cgnvT3RUYbsEG7fdsbAfhR1yhm5bQXBB6TS2b64Q9Pqm8xiX7fwl0HP7RVFLIs7S935oetV8j4S5tXwQJPqziaGJg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P1k2OidQaHAXcsu5LAg151l4XuFwaAcxreDyaPLNuRA=; b=Th7jbDG5AzrBcoEqDhDm6GX5ad8cvup8g6sBINVI1a4sM4Ijfk4UIDrkPATpOYAL/3PDcT9/Ot61ztdPcuMlnas+X4FVcMX+5GpbLJ8vvOEexCX5EiiqxY2BU0gFRVCOgBnFUqi1mxmJlkTor6STvVSZzYL9pIjnxcvkIdyHDhs8U8blAX0uPzLbmqTdqP39uy1kwOfWC8XISTD7hdbKVPIDfPl0tUvdGqt2trnku3P5TtwRKqT+c3y6kBp4Uuu95wHeDbtdiWTX6fnWeFgE5S/E1/jYZKFIXUytmk9c/C4aGEVqOi/i7L8zM4lrh58t+jr6ELWRR77OZItdjB2wyg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8405.eurprd04.prod.outlook.com (2603:10a6:102:1c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 16:30:58 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.017; Fri, 6 Sep 2024 16:30:58 +0000 From: Frank Li Date: Fri, 06 Sep 2024 12:30:38 -0400 Subject: [PATCH v5 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240906-dwc-mp-v5-2-ea8ec6774e7b@nxp.com> References: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> In-Reply-To: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725640246; l=1944; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=OqCbEUzuE4T3rIePR+tm5vsCVk9EgAOhr0RnQgNI8YA=; b=/UYymoHjkfEXSwUAe+RXX8a+NNWppPVHgmvE6TAXrbKIm2xqTkIejh2UyPOXpaAfqNdGVKyWZ uAYzf6P+lhFBybZJIgQQdT4qaGcA3aEpjRMCMEO+lDB7hPA6dI3s+3u X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR10CA0016.namprd10.prod.outlook.com (2603:10b6:a03:255::21) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8405:EE_ X-MS-Office365-Filtering-Correlation-Id: c339bb61-14a5-4cfd-9d80-08dcce914984 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cy+91VVRbs0lcSiVcyvuGUkdjKBHoaK?= =?utf-8?q?IzsnaXq3UZTqprJeGS8J3A6awxne/Ky5OrwNGE9pF7UOWtIUDbTbxKhbMYfvcMIMj?= =?utf-8?q?r28ibCcAFrDZlG+zKnj3YNQI7k+waw96iUKbdZLlECxLVgstVKHoChYi6Zml1qe1c?= =?utf-8?q?q/Mq5IO7etI8p4ovH4/jx17Qrq4TDO3cPuRhWjYITNeZH5IWTotSOPgqSM8FIq/b2?= =?utf-8?q?DE6Csat89H/34TWiG5UuHRLOxZ9/rn2g23illz5iBPyPPh2upxmyb6TIPPYXXVDGA?= =?utf-8?q?It9XKJ2Z/GwISVufzeLokvV2DGy3s5ZkEcloEh8LGllXR9fuFpt3IEil3AwFIdeBC?= =?utf-8?q?Xq+OBfTfD0ZDn7g0fYrmVw2w3+BEYd10cOhxR5o60W6cMbVJr6DVf51K7qmiiyjtJ?= =?utf-8?q?Lvr9dtE3+35Q4H+RE3KV0Js2OQ02wHE1oa2qY5ORVuKdKFPNRC2QRW0C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kp5zZUX7Dlo?= =?utf-8?q?DuQUlAk6+OAHxTuJmRSm1/XQWheuTvItMg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?im2A08bB7BSO8c2wEEv8irnGHdjv?= =?utf-8?q?7DpptdoRa0sGm9CyjjeOJfpokj9In2plbqiYTpeA+QEyYg+ZZeQy/ti2lDAtp2ipl?= =?utf-8?q?gINfsPS053lfFFgo87GPlaY5C+zgV24HPCKTGBzahb4WtrE4C1UsQ3CvUkymSR1/f?= =?utf-8?q?pR0j+PAyOBUP0bsFjXuBvevVGEcNrhv9jDeUYmy75/E4YjJh8ivoH76M7uL0s1/E0?= =?utf-8?q?xJw9ERsGWP+I3oPe6OLvZqgg9UN7rZX96MV0TAI+uJ4CvRhHSetuBdhd513tU4p1m?= =?utf-8?q?cWCqmxmicNAls7xyvF2R38QvQDG41a0DP7gmwkf0Xgw/znO7FS+MMx3oUqmpKEL8+?= =?utf-8?q?q6jGxANK/4A5uIGGEzedR64GKRe3qZEFv4miS49DStDc3ow/7QDeAvXAE8QuvkWa/?= =?utf-8?q?seY4Mj6nHuqeNQ2DZ/mNAbL59BsXEk74xjHenrM+ssuT5Ikp5/aXb4atwAhd32/vs?= =?utf-8?q?B/HwZZAYb+zL3k1nsNScuTooykxO8n4aVW7eNufRbqTDHHrHTRptZjq1g0R7juLco?= =?utf-8?q?h087kGraG4fEAPQOD1uN4vj0JflqCvzjeVrG6YDVVQ67390BKNEoxLmsqfPQdTFmP?= =?utf-8?q?ZJ/EDS8VWqUFbslJbmcRdpvnbvA+ufr2H9S1kwIe2ALuPsFGobgC+z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ERr3OVkfS4jr?= =?utf-8?q?S2yciphA7I/y?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c339bb61-14a5-4cfd-9d80-08dcce914984 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 16:30:57.9955 (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: CfRVrV+cfT+OrcVwJHixo2yqqNFUO2Fbr+7EYbVOTdVc3t2xZeFlJMUTZ4OUBYy8hk8+S0gjoYyNHiK8n6jINg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8405 Add 2 software manage quirk properties (xhci-missing-cas-quirk and xhci-skip-phy-init-quirk) for xhci host. dwc3 driver have PHY management to cover both device and host mode, so add xhci-skip-phy-init-quirk to skip PHY management from HCD core. Cold Attach Status (CAS) bit can't be set at i.MX8MP after resume from suspend state. So set xhci-missing-cas-quirk. Signed-off-by: Frank Li Acked-by: Thinh Nguyen --- Change from v4 to v5 - fix the wrong when rebase - drop Thinh ack Change from v3 to v4 - rebase usb-next Change from v2 to v3 - rework commit message to descript why need set quirk. Change from v1 to v2 - use {0} --- drivers/usb/dwc3/dwc3-imx8mp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 8b88649b569fe..cfb59f6bf5dde 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -145,6 +145,17 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx) return IRQ_HANDLED; } +static int dwc3_imx8mp_set_software_node(struct device *dev) +{ + struct property_entry props[3] = { 0 }; + int prop_idx = 0; + + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk"); + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk"); + + return device_create_managed_software_node(dev, props, NULL); +} + static int dwc3_imx8mp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -207,6 +218,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) if (err < 0) goto disable_rpm; + err = dwc3_imx8mp_set_software_node(dev); + if (err) { + err = -ENODEV; + dev_err(dev, "failed to create software node\n"); + goto disable_rpm; + } + err = of_platform_populate(node, NULL, NULL, dev); if (err) { dev_err(&pdev->dev, "failed to create dwc3 core\n"); From patchwork Fri Sep 6 16:30:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13794448 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011014.outbound.protection.outlook.com [52.101.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E9401D47D6; Fri, 6 Sep 2024 16:31:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640265; cv=fail; b=EmKHpC/g3ndPTBiv18GpabYxW8EUWUtWB6UJw4na4jEWT7x4gTi3Y6uSH7TYys0YwqefsREV6DjDpLNWvnSwhW+YNXJi9SoHCjwf6bLyP+lDSfUQkeCqIX8JWftA4I0zxpjHwJuhCutEZm89GQywImvXj/MSmJTBF/sPvu8CY4g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640265; c=relaxed/simple; bh=2LsMdszPxs7nPZ3WODzvRciDtq3lNGIKklis/0adT+Q=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=odLD9nv1tP2xaDuLjUEB0CCvoYKjOpHMS5Xv6fDM0c3VZtbd2FDV9Y1vfL3baG7q49eBG6aMxseqoQJiNrSWQWr97xBhYe3/QJWGZjNoGZWOmt5pkaqtuQRrcmemFmdlYQiW06KUh4KDFmZJLdF/4EXeo9b8MaoM1aRd4ikEvV0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=CE3s6ofY; arc=fail smtp.client-ip=52.101.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="CE3s6ofY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Cn6wi+7FmVwlyLgQy7KI3p6Eg2et1hRPMz4ekKUF8M7U8E7T8PsYrBpOhizrAdN64CDeBi/a4pICTG60mp+1kfgzJgJxpSuVUXDz1QZdGRAaJysAyM5IcZTgt2Zm8np4phbSCsKzkhCA/2i+rzV1NaDJn41clDQG0dN2eO+075KYO5bD4UkgPRyP3qY/ylPK0l3Cpx9K4uAPtRFhrGGXusIw4cgxZnkHMCjjeJP3VVq2SISiKXq1gDHirFP5M8TmT/VDRUCL75+6lEUZB7101azi38jULCOjXSpVbvLnOSl4YMYLIP93HPiG4hEYdknf/ASJ6usIawZT5zpIjReDQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rqy4TY/wNLiJPUHnBtGAWyth+ass9f0B7FvzsQmw1tg=; b=w3/2Uq72hfhCgZWD+on+jQ9fO0WcM6vZckC4KVjBBEZyHvkF+5YVaczFbGVKoQQcGka29xezx/Jc02rbDU91BKGUdg569fdnG7JIE2Tar52O8I5kEzbsEe0ESeb2FgTsgiOu3vJJbKr6kMv2h2ZE3bL1zeNTQtJ1HCaLhWitrb3aVdvVqNoBY5RG5mcyvf4cJPpnSU46wYXeq+pClH+S35J13fpA7/ha0EWgf7XpSctUMMyGAkmO6Ri3qSzwn/4W4T5RsEMeMBQjGi8ZkuRT2jJFCakJ9X7nmddo9f6vPCpq6/y0xKiNZnrCweWPVKUpBr3f1xFl4V76RV+WexFzIw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rqy4TY/wNLiJPUHnBtGAWyth+ass9f0B7FvzsQmw1tg=; b=CE3s6ofYTtA2OCDcphA6IuvE9+N2etE3I0ddO94yycSSyQeY4y9GccY/xxu2Ve2nnRL8Sk6VBeX6BhNdXGRaki3AZrOwfy/gVTOZEoufLztlHFUrfOxmW06mCMjqQe9yX9qxLyUWUup1W/xB+VsflPb3iWbGUUEGTszh3RdSzQgOp50iAkFN7AdvB81bqdLCzovKOH+B0rKtouzlwPInOU2Uch6iylmZ5syuBjFV7TsYvu0UHoi5OMkr+Y6iPWos4qH5bcBKIFJ4PtKkBp2xCdRhZVdu/Sy4L7+QCYPZlxirg3PwfU0A+YiRvsV6HUm9h7MXHBgWkcgEPhtNgzWeSg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8405.eurprd04.prod.outlook.com (2603:10a6:102:1c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 16:31:01 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.017; Fri, 6 Sep 2024 16:31:01 +0000 From: Frank Li Date: Fri, 06 Sep 2024 12:30:39 -0400 Subject: [PATCH v5 3/3] usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep Message-Id: <20240906-dwc-mp-v5-3-ea8ec6774e7b@nxp.com> References: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> In-Reply-To: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li , Xu Yang X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725640246; l=2163; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=gC7JEGlw6JQv9GgnXx7tvm51p7QIxUVIu7LJn/D3a5E=; b=RyeG6f3hVtlJ8uCO/OpL6DVAaGUdYUFFZvtc5B9lKmrp3esPb1eyVNx4MtPlEh/AGwRGqAJ2S 0coKm/lzkZ1BpHPHxnSH+8J8ArB42RR4PriJL1SgkTdmW/ioY2iMGYf X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR10CA0016.namprd10.prod.outlook.com (2603:10b6:a03:255::21) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8405:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c4bc0a7-65b2-4c75-9545-08dcce914bab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?zCMcyFg8O+MO5SzpJNMzE/ylicxRk6X?= =?utf-8?q?BkghjGdv1tVe3nNVteh0NnOPGV5HUhFjiohjbqrBTVbaAak+hPJTHvmv50KbAMp1v?= =?utf-8?q?y7nED8QNNPu0YesX/7drFWsUwIllGpfgDC1UMTMt5s3Sn/jFOWWCa3mSl++kTKcTm?= =?utf-8?q?Fz1n2cmNTLijj0q3PJ1BzzYL7uANGuxTS6ofWyl9lGz7bwg20DEcQpTM/Va52yxNN?= =?utf-8?q?xg/TeXGSfTlTdTlpQL3V7AXNXxI81MWC2vKo+OutDPOd0e4ACL2av9xHKK45Q+bgy?= =?utf-8?q?fd6BlGB0v5h3nOUzP2b/6yoyTHW9dpm/es+ZVFo98a9C9N64b97baQovQ0uJHbB8G?= =?utf-8?q?ntFOG4qAcdhjPJVkQGk0vFoWMTX3YeUfSG7dhiDsz8yzKNWP72hb/Yga4wZe8PHWN?= =?utf-8?q?3gL+XwHXghWH1GwNOeUIpupjkPPeEPDmOlrjDp+YxMME4TazwkKO5xzcx69/c6Voo?= =?utf-8?q?Al4Sy1KlLWEmkXZ30bXVxrunlGfivPRdLtjb/U/7bAMrcRvGzdxLgDH5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Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qIFwAMHV3IYBrdC0Wdy4DNJU0ybf?= =?utf-8?q?B6O21b18LLAsFmDWsv0oBq9EhEb1wRZ1+eXhN2MCeYyPOlgfYU/HxZCh/ru0PcUl+?= =?utf-8?q?bl4DOBJq+X5svWJj4xO2mBHlURS6icTbj3MhsbEvRfdUA8U6h/6FBA0n0qk/wt+RW?= =?utf-8?q?+GFRUXm5o1qcZz8i50sJ4wUxE7qaCGrOeY0IU1ShOjcG5cMCxjxa3QQI+pxA9iDM5?= =?utf-8?q?z3iIquVpgHfSIXpQRGVBPTZzPPyywiUIh1y3mUvwO4vStOs2+g7aIT7a0pvJZ8mOb?= =?utf-8?q?WhIfYzhEPL++/3qs6y7Ozrz2Vs7Ymb+uC2E4il+9m1Wp/4jtmUdnR4AxV9XAlK/KD?= =?utf-8?q?yWSxAXhVY+NMHaERKtqy8wZFZ+lIt4Z6MQn8pTqUnWgY9Fswj1+gS+qLdX5i/Yizu?= =?utf-8?q?x4fd/bgqjyn508TqQzBi6J0kJgUdwnkXYBeEk5YrYdfiFn6jeNq69LqPQcukawhDP?= =?utf-8?q?PaWEp8Sug7JyCKIGzXSQIYisjDvBqb1ZluNZfyrn1asIaBOXbleBTwwFngTgeUlFX?= =?utf-8?q?PbZwZ+E2AscpLOssql4LmvQI8dO2qEKSJhu+ELUOlJkdqspLEIMaOZzG/e9Rj2ckF?= =?utf-8?q?fNtYvbpBlNQEHmJuYPvt++co1+pXv4vxgh48iB+xbWklvbcaUvA28yzhKBtS1kJV9?= =?utf-8?q?IdviN3dIEbyHujoj/20mBtu+Z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orOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c4bc0a7-65b2-4c75-9545-08dcce914bab X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 16:31:01.5893 (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: f0Al+IsFyMql9IPyl8SkDQ80adUWX38GN1gsmQ6HiSoYvub1g94iwmHN0gN2pGgNKV+IFo3vu4rsWExYSsv9dA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8405 From: Li Jun SS_CON and U3 wakeup need 'ref_clk' on. iMX8MP turn off it while system sleep, So disable these wakeup source and only enable DP/DM wakeup source for host mode. Reviewed-by: Xu Yang Signed-off-by: Li Jun Acked-by: Thinh Nguyen Signed-off-by: Frank Li --- change from v2 to v5 - none --- drivers/usb/dwc3/dwc3-imx8mp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index cfb59f6bf5dde..64c0cd1995aa0 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -97,7 +97,8 @@ static void imx8mp_configure_glue(struct dwc3_imx8mp *dwc3_imx) writel(value, dwc3_imx->glue_base + USB_CTRL1); } -static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) +static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx, + pm_message_t msg) { struct dwc3 *dwc3 = platform_get_drvdata(dwc3_imx->dwc3); u32 val; @@ -107,12 +108,14 @@ static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) val = readl(dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); - if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) - val |= USB_WAKEUP_EN | USB_WAKEUP_SS_CONN | - USB_WAKEUP_U3_EN | USB_WAKEUP_DPDM_EN; - else if (dwc3->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) + if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) { + val |= USB_WAKEUP_EN | USB_WAKEUP_DPDM_EN; + if (PMSG_IS_AUTO(msg)) + val |= USB_WAKEUP_SS_CONN | USB_WAKEUP_U3_EN; + } else { val |= USB_WAKEUP_EN | USB_WAKEUP_VBUS_EN | USB_WAKEUP_VBUS_SRC_SESS_VAL; + } writel(val, dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); } @@ -277,7 +280,7 @@ static int dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx, pm_message_t msg) /* Wakeup enable */ if (PMSG_IS_AUTO(msg) || device_may_wakeup(dwc3_imx->dev)) - dwc3_imx8mp_wakeup_enable(dwc3_imx); + dwc3_imx8mp_wakeup_enable(dwc3_imx, msg); dwc3_imx->pm_suspended = true;