From patchwork Thu Sep 5 20:06:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 825869 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013055.outbound.protection.outlook.com [52.101.67.55]) (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 D7A9718FC92; Thu, 5 Sep 2024 20:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566801; cv=fail; b=rOzqSfIi0SpmJAZ6A9/A1SCzv2K9n/0roYQWcB4Jg4QjxJ6GtCDggqXltvAXXXTNYaZdQCi2zwP7bUDL8vhb21yH85LQWBXbgTfds1dwi2F3wpaOeAROSRx1WMTn8sVhm+slIOdkwUJcyb4mo1YbOAJBGVu9BY6DyTgt5Sv9mO8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566801; c=relaxed/simple; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=bULBiR9pCqDIbP9lexKczOJ8sTWhBCLO8k+rJHtpWEnTHHigV6VY0tEltYQGCb7fW/gooArnKP84Zo9YIZ76oESFNLx2w3XH8eGIAnAfo9JPurfgNMq/blHdJlsIC4aAC/RKvOVn7q1tXtdMkibxxCFcx43K+Y5GgS7aOwp0Auo= 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=ZkBVqt5/; arc=fail smtp.client-ip=52.101.67.55 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="ZkBVqt5/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MguGzlIH86OqN6O21ArpzAMR0hPTdHf14Knm35InYv9pTw+eye1xoU5zY1XHuIyySbQgAFrYv77knOm1T6V+VPpgX7cMTG3fnDJPrau8fWiTVh9PovUnNPgJmCyNxMLUlXw//Fw1S5FciidE3GK/DNwMMOAmr0plCgh1D2n0Mca7qOmf5VA4NMGEremlBZgzY+7YuVXJQTtbdZllFoFrWClmtF4vW8JHu6Upvoty09sh2EHBukv19G2egEakAvJdYIX2yaf7623L5dzjtXiajvjPSeIfKYrtVdk4I0HqdGyvWEa1viJp2GdRjLzD8n+DTrg9Bvon7D8ky7+906xv8g== 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=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=UTq41jIH5diF7JiyOFeDKZ6B5YhY6tyz0ONblJzQns0WoCNXbPCThcg3eAB+PQWs4aSLYNw8QeEt4r5YqLcTDUtVKJVprcWTmFdVQ5Mw+Vy+2Zcud9Y8jfSTDxyMzX64m4d3c2WhlqQ2ERCtEkZBv8rAc7N14zakxIVB8sORYeDzw0ABhlhmfgd3sUPeBbDILaTUgnv1iYk3Uduz9WfidY1+Pd0wtcjtYaE/LlA8qDYGbv/5iYaQxMhTC6RT/kdXgCR66t6qGhzPSse6FDfF2NQjzneNfLQdlOpA71FBgMl13/3lKEhGyO0383EGFh7Zjt8OzuIc/ielCmxdbeNb/A== 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=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=ZkBVqt5/88M/ebaPJ60Vkq1EU0FmCfwgtICUNj4M/7v0wLgtVjTbrRsPtc0gm84opcaHP7MSCq8xEWCUX8BZtKZLy1IkXOlHkIvalUMB5Ya3ksa69YF9ya9zV/h8aLTLXNPe5GSGrU7I80Z8YA9s0ysWn4xU97i4e/bpexLRKLvi9IACH/iW60baEELtKhT7OtOUpM3U13KWTCx1+cbhui7LYCGx69nOhEyqXmzv8+eAs0SHs7xBABOj0OnLav0sqx8wDZ2NacfX6WjLXFTGjM0zdiL6HYcu/MsncSkfOv5OofzckDVOnRwAWx1VE7CbOq9RMwqG6Hg/oCIy95zaiA== 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 AM9PR04MB8423.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 20:06:36 +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.7918.024; Thu, 5 Sep 2024 20:06:36 +0000 From: Frank Li Date: Thu, 05 Sep 2024 16:06:19 -0400 Subject: [PATCH v4 1/3] usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk Message-Id: <20240905-dwc-mp-v4-1-aedaeacf0556@nxp.com> References: <20240905-dwc-mp-v4-0-aedaeacf0556@nxp.com> In-Reply-To: <20240905-dwc-mp-v4-0-aedaeacf0556@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=1725566789; l=1035; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; b=xqSq/7oG089GSJzbz5BztXFenx0U4E7yMdF0beO8t0Quo3K6tigT/LvbOMFZxI7hoNaB+7jjL kbrakPLS7kEDkwM12xMwlDXekar3PP6WxUiwu807jgT87zowT9Lke1Q X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) 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_|AM9PR04MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: 31a3f851-bea2-45fc-7566-08dccde63f3e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|7416014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?R63ZQiitdV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9ZNVWh8C74dU6g?= =?utf-8?q?kQGsmF3CcN9HaBZ+2k2gDCCCRiJXjWExJcv8SViJNUjTE0A3lxYZRI9a+NyC35pH2?= =?utf-8?q?z9AGpAmzBwvg4v3tNypIqybQ4Gp1+tQ3r8DiR2Riho9eKhMIt9AUYf/s+wg0mcsDC?= =?utf-8?q?4RoMVcAmtWT8SfhtHK/bTdFMANqXxUx166cNfk94clY1ZOfeiHu8OtLAJH2i29El3?= =?utf-8?q?ts4AIikAzeRNE+eIOCrjNiNgYxfvD74drAPVkARyREE0N7F6DwpoKu1Vel4tFRF6G?= =?utf-8?q?yH2a+hGH3S3ssjS4T1sX4z6uhIm0bcGzX93oFgzz7aWX6IG+4hAWq0RTf23rJk6u+?= =?utf-8?q?TFEOdtEhB6d1h7Kcaeh2cKBB9f2t8qj3h5yngWLJYs12WOzQCCF9lQZaYSIt1anBG?= =?utf-8?q?+bH+FHuugiKgRs27ixuYyUYRDK1ZIvIwnv4afhIQ9am4u/dQoyXlxOGir2sMM9PCj?= =?utf-8?q?yfUfCues9zdbLkfQRlWjTdbHuJytKmcNRQ=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)(1800799024)(52116014)(376014)(366016)(7416014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LaA7wAD56RUY7QND7PPMMxhxh4jO?= =?utf-8?q?AlHm/mxhBnZhU1mXQn1y67BibClAdUTuKKfMhpyhL4Ia/El33hFA2VYDtUxUo6gIn?= =?utf-8?q?/926NOilWQKOJ7PGh0cKpaAJ1a9+aKxbi5aoEJSYLLabD9/KZPGH4x31N/PeUQzYu?= =?utf-8?q?VMjEWsvUkV1/5Ux5ix2kBzodAw4NZZ3eUxzdK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WyW4fBMu/9E8mOxnUYJSd5P1n?= =?utf-8?q?sMbpHAxOAn9APdEBsyLkGwRCecfn8CihwjEU+0K3r4Kprq/9wwFsq7rEbGQKvWKXX?= =?utf-8?q?NN6YxyASTYXhDj717YMAG1kmKw+p/I+3apU4R5u4dLHb3qf4rgGBGMZAhEirH8A44?= =?utf-8?q?DiNeLXd+sKEjo39MxCPJB2/kCegr1BtMl0KoICh6zW+W9WfvIAw289Jlk/H3R3SRH?= =?utf-8?q?o4nXD/bXx6mRXJ0Nz11VfACl3dz4EOGQYzhi9JR08p7GwMzi8Dbd9hKyl2hNp+rct?= =?utf-8?q?eS2eQWLWOSEvn3VNiXwMHz6h4C7XbVsVpWIs3fZMfVIBWCjg04vL1PiuxB2UxpKYQ?= =?utf-8?q?FchK8ddefXrKa2St5HUVHUl0yURU7oIbdk00jXBjpG/O5T++qWtlfES7mceJ/8oJo?= =?utf-8?q?LRSipfgDwzozNiomAXWuWQ/KH5vNwu43OMYOFGSsfdDRtq5xjtTobRLvt20P4WF8V?= =?utf-8?q?0i71Fn0tFG8e?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31a3f851-bea2-45fc-7566-08dccde63f3e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 20:06:36.7937 (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: MAgqeMukva8U7CZ0atgeM3R8L4R32vjp2oxlG3N3tl6OfLgCtZiLPgSJ5M3JxQebQbci3cbEOO0X/goCI09ESA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8423 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 --- 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 Thu Sep 5 20:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 826906 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013021.outbound.protection.outlook.com [52.101.67.21]) (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 4CB691A01C1; Thu, 5 Sep 2024 20:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566805; cv=fail; b=bi0CDFGJBf6Sbg9RCuq9hZyuFqEMeQcM9+Lz/Az/BSmsX7phi2dd+3vq3GgJGvG0SwQ90w/NyPY7p4gnyo0F2IMVJkaTS3ORt5KaflI3xwSYhdNNYz1XfgUYEW3M1phIqpN87IUsuUKmDk/hvTHzn4XGwhTlhrwk65+e952RbJs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566805; c=relaxed/simple; bh=CnUCYtJpFgxDlRdwMDi1lTVA9hZVdAmvmi8iysk172U=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=qInTgaKQVJ8ictpC98pZvLKYUceOObSpfuhiD98pyCNN6Pqb7WyH2K+GCCoQY0Bf7WiZVbmTHVHbTm8kR9bgcmR+djd5nUqg0SadjyxeKEMjmRJ7Pa0XXoduhTMlHTEz+EYS3vKbsYHxA5ce8OXgCfhgX4p3iONRLVci+LXf7Zs= 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=BAv5aUoX; arc=fail smtp.client-ip=52.101.67.21 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="BAv5aUoX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NfjUWRR/y+m5JXwpksAJ38+0VxQ9nteLUZT6yu/C3OmED7lRRt8/lQeD/zeRiY5UfGPVlm+vtkxxzjzOHJbAI36wZmmVdXwYjZTRByG2rwcy0/w54fWFxeOwNAQoBvEGv1XDMO/0roRQwavmz5ge8AeqTAmI0hFKWswAbbj2eWFB6/+j3340MdgVpH9b3im/vyE+bi5G/isp3yNiUSee7AvN6mu4iihs6d9ZCZVThnQBxUjLMI7vDET5sPBreJA9VgBrvE5dToeJ36/gnsCrkILdQQB3G5CJAsYzOuQ6plFjGa0JuY+k42CkCp4s9SwG3/W+mFt3B+ekhqm49Ws4Dw== 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=h77DnQeqNcdMIKEC1tpJuVU06z31B8AeAik+xegFNg4=; b=jO3HN5IFTC2IDnUpBT60bUotNnP8euGrtJrQphiXsVTghgnm/v0MvoWKruuCC0O0GlHRwOr7ma0dQ6BdUdZYwgbEGaFgM4wD/Tudsy1bCTbZUKLnO4kb+J4Vy0z9UPQZEEOYh0BQT7Emch4xx8Fp59DJN9JLDeBmdnRWI+7gwb9+cMhqs/jVebrSluocW8MJscx8Xkb3OvMEj+gOUnJvEKI3+K3oopwVmhSX8hO2F9PkpX5XpA+d5+QkHWayUH+8RElLyCMLRwTpWafp/sAt2m8BkyGWwrUOZAwCP1F4aR+YQutQ2Wn6NqL5Pg0TrGB5R2yX4Jxi/Xe08DvSnYrgPQ== 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=h77DnQeqNcdMIKEC1tpJuVU06z31B8AeAik+xegFNg4=; b=BAv5aUoX4iSU5a5BknqErVC7MdBXQZxSuEyeZdqX+sFRkALpcQd68BlJzVFn/1CgEDOIZpHL4WWjrV/3oDOTo341Y0dmq07FKo+LlxGojO1FvzPWoBNQ04XvumBecwCUVORU2wKkNqqJ/4zyFlktJgLZV69UZL2z7PggbUek9SK0PkU9GQULkMxOiOFSuHlp5I1xlC2ucm2X6CBkVkngTwvZ/6AL4l4rwj/XNUcQwWkU+kf68f8tmTUFVyjO2yYcsl41AP13OQ+g6cZ/PpekM7aA6gv5bhkcWVfca8lN2j5t6+RbcUZ3gAYfEYEP3L0xCOQvkFHvY9Pn0IyzlK8FCg== 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 AM9PR04MB8423.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 20:06:40 +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.7918.024; Thu, 5 Sep 2024 20:06:40 +0000 From: Frank Li Date: Thu, 05 Sep 2024 16:06:20 -0400 Subject: [PATCH v4 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240905-dwc-mp-v4-2-aedaeacf0556@nxp.com> References: <20240905-dwc-mp-v4-0-aedaeacf0556@nxp.com> In-Reply-To: <20240905-dwc-mp-v4-0-aedaeacf0556@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=1725566789; l=2068; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=CnUCYtJpFgxDlRdwMDi1lTVA9hZVdAmvmi8iysk172U=; b=yglSI41unccvsj7IcMiZ+i3X6/p0CwebkPdlDdNU6ZQ/UbxpapjCQXEnntyB7B8NdHU6zi9ed BDK2mK4YRyUBtxGidLpgB5W17OFuLhQ6zbiVfZmPV3a0efYXtEJusWo X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) 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_|AM9PR04MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: 2141d74b-de21-4e01-d315-08dccde64161 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|7416014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?61qudbLxkjEjm3YJ2e+W33Ynb9DcFrD?= =?utf-8?q?9e7JPvlRIr/WR787CuDYIRIGn8kscbisYa0NPsNcV9ioYLZdqn0YzBQxzCeZaVoCI?= =?utf-8?q?s9bGXgRSbIfkh48d9lsqCXSY8C0tHvBLb47ZCpBdThDzKdyfvQhqTJdxyUui/YCKF?= =?utf-8?q?ZDpOQrQoMK6gZ/yX+wXXkJ2dbsacKAjsaff5uGvFLTNur9D46p+XXj2xajlHnw12q?= =?utf-8?q?T8Zy6s2Waypx8B9pIa9MvXsAvDEiGxe6SmbYeeCwig4GSFrfvs3DqfICszXq+7iFe?= =?utf-8?q?T2fczgkUAu4DFXTNVACyQY3jO1yoaSh0AwqSnMJnrpqMd1NsLxPk1TLo0AAG5o4NY?= =?utf-8?q?0HFZo/p+OYinYzLX4kTqi1SzRpQdSbKekdmRNbRkEfW3lxoHAMBQ8TaFenKcTcrxH?= =?utf-8?q?8jKxHkJO6zkhgwmClk5S7Rlb2yLfGgFtckfOFSi2FwIoWlt3g+OBPEAhekXgNzu3m?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XSp/qc?= =?utf-8?q?dHFhN7PsWPnN9JQnNeSlyyqhAwOaccd5DQ=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)(1800799024)(52116014)(376014)(366016)(7416014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?J7ca0+nTZjIKQ54/OnYLKtysLSj9?= =?utf-8?q?pk5BDcpnffaTZ70B23yGO3svRbdsKY8XhfYbSmIvSPGWe/k9qhfCk04Nxim1Mo4t8?= =?utf-8?q?9n/xCckE/BItonukR41c5ju0GF/uj+jt1g3G7mgF7aHu5eRtk21y0KK1qxR6xPw8u?= =?utf-8?q?QfF6PK50Z+uU3fLlZNpDiuquNwSOb+0e7yPczj6N9xlWBLJVRRmbsywUFPhPKs/ej?= =?utf-8?q?96Zi3doPfQZAqD012B9P+ZxcKliRcE9fmU3rf4k6y8giVp5m8zzASJR7CDB5SBXFW?= =?utf-8?q?UtErjUrGavpuU1+d5r/E3wjDbCZOCOEe56ypcW4jetfPAi7aXY52OnWfqxwvFBJ4L?= =?utf-8?q?3A7KabkhqqLFZfTY7UHgmsmZLf32BsOmfOb5dTUcuH/a5nISswfX99YIqWN9qb8i+?= =?utf-8?q?N8hCo+jcMGcrvKXrVJmiiJLSWzmzkpd7MyWJz7RowcO1qcpV9CJHjuaINpEBZTFFK?= =?utf-8?q?G0mMcRGAstCokYfJXk39j1KePsdRVim8dUK8aoDyU1Qeyk4xRe9w2ZJ0f+AsuUKhd?= =?utf-8?q?CenetHkA6gyruiVBmIwxH3iTw+M1v2WpYsONC0fUYm1On1/EwLqNVi5JEIGZX5GQ2?= =?utf-8?q?vRJtG4bqf3BNVVs3eGrsHcq9R8qUbYwXqOsG7MJhDJ+LxdIS67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f+inGar7VxJUImjGjeE?= =?utf-8?q?ytr4nedIfW6h?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2141d74b-de21-4e01-d315-08dccde64161 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 20:06:40.3948 (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: rzUNMBPZqd/5vdpTLSyYWJVwAndB7LUWAg39hW5aIXZ7LxIpyl1mDKbIM57WSnFC52i2Zw5yFghyyIj0tU8evQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8423 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. Acked-by: Thinh Nguyen Signed-off-by: Frank Li --- 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 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 8b88649b569fe..f62f6f960e501 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,20 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) if (err < 0) goto disable_rpm; + dwc3_np = of_get_compatible_child(node, "snps,dwc3"); + if (!dwc3_np) { + err = -ENODEV; + dev_err(dev, "failed to find dwc3 core child\n"); + 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 Thu Sep 5 20:06:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 825868 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013021.outbound.protection.outlook.com [52.101.67.21]) (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 7A7721A38C6; Thu, 5 Sep 2024 20:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566807; cv=fail; b=F5rrkd0NpTbV9Avwqt3nhAJwH8uE/X7IXoAgRj1t2T1ugHDf05udgS2A6WY8vgVFZP61JHA4LeAyzX5xJx3Yv4PLjrpDVVStSEbsDQVvPuk80FfK/i7Op3VNwFggm7W5gzzJsbcSfj8zM/QY9JvSAEu48mzPLp07EMoIKURFpXI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566807; c=relaxed/simple; bh=6I2paEON9fWdTpUTAomoPNrvduXxYTmjf5EOsVJ+SvM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=noyP4310WygS/ei9aPbhmfWbd/DJGuM0TvdaHeRmWD8wSEmip6XMlZ9yZNOxgHbFi1SYyA3unQ0HnCK1XOqbtPZOZhBwWOaZAcJYad7P+z+Rn/c2/Z+PcNo+m2byM2wZTIYr10vCXeukiupAtNHSXjtWdWGYmRcxTR6s7JAz2ww= 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=C8HGo+jT; arc=fail smtp.client-ip=52.101.67.21 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="C8HGo+jT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CfTCmHu7F6lBUKKZWYTI+26UWRgl1iM2RRpsOIqoh7iJoBX6mBrqjFbkphJJo0GVbhzYrivYkfD+uvqR20vlpoY74LMcUudUD0euPiVW0YodNWK9H+xkQTnhUzNGesMaO1ID1mSTDXkFj0CLEGfOiQtMFH/Cy2FLq9wZ4uNDlMAtDY3zgf2Th00ShoTNSBcXoj+hucdVP44lBp3G4GOxRBlDwcK+QoQhQrJH60W/aYLnO7tf09aZjAAeGFwIQOJhChm1Y9oATq7chkbHHyX/dtQr1ebAFA3SFg744sazpnoAeqB+lhE4O0aGZ4bF/cMWsRuD3UY+Tn1Epy3CWbLz4A== 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=O/PzFrWtGF9hTyrICETmWUx3fh3QeBCjPfvhvO5Lh9g=; b=S/RV2z3aM/jgkUyyWbERwEE5BoiT4nY1TLvUZvbqPUl3DdDVPsp9qIJ0cqdMbMBYM56eoZaiOGOqpVvg/acbktoFpCHmDUW8BlE6vTeuqr6ITgvtTxFZRP9vpnJZfhnR0bxy3VOARRdgLfRxPuMT7+c3MJR6nhyU3dReu52u885doSUQL0L7bdl1IDbXUsAt/dRw3ooN/zYXCkc3NvCkWE2Ag0SvPkzgj5mpmZje4LWlWuDiTeDRUrOchQ55DsIW+0Bsc7wtg3BEawu2h3AGOXuDbEabVfJ8SszRREEmai5NTfUNFZdtrm6cZ2N591RsNBdQs+fefHcmBFEIFptSsg== 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=O/PzFrWtGF9hTyrICETmWUx3fh3QeBCjPfvhvO5Lh9g=; b=C8HGo+jT5rvyu/yQ7PrnMq00Fe04CSnzUqTGiGrrrbdXI29+64evGtUdk8tZjHv/FG3AjT2nHB6vJ3wOCVoGoy8jmt+e6l/9qDGKBlEcedTMVBZamlIFjUEHVDhPlSaK+bo3apfNaUc3jPLgdJc1x6hUkwvKbdG1NRnVgjEHeVW/CTGM2DO1riODbpKMsD3jsR/WZdZ1xDILYy+uP528EwoSb8XUni2gF0+GSnKh3YL9J8zIhkxZl/Di9XsGBWxMBh1BduW8bWGADEVMrpHPlvHWYHgIYb6gB7PVf5JtgeWxhu/lLMIWf+7V7AvUClf1N7d/O1qI2mxCQJx4vd2OTw== 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 AM9PR04MB8423.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 20:06:44 +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.7918.024; Thu, 5 Sep 2024 20:06:44 +0000 From: Frank Li Date: Thu, 05 Sep 2024 16:06:21 -0400 Subject: [PATCH v4 3/3] usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep Message-Id: <20240905-dwc-mp-v4-3-aedaeacf0556@nxp.com> References: <20240905-dwc-mp-v4-0-aedaeacf0556@nxp.com> In-Reply-To: <20240905-dwc-mp-v4-0-aedaeacf0556@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=1725566789; l=2128; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Hs4mq3jmjFdySao7yPW+t4juTxFDV5Z8B1pHbqTlbAg=; b=3satTEOeuofPWVgLaIqoanfIZ1EW/2VQkW/Fp+in5oHDN3mr2/pwWbMz5apHpIqf/SH/HDbCI gBZ5x6HhtkMCf1ABNNFrDk8lDRaDY5tGtM6a1IFPJ7BAkqDBKF7RdAN X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) 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_|AM9PR04MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: 7dd2ac5a-06ce-4654-080a-08dccde64383 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|7416014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?w5APy9Mqez8GoiAfdkXLzm9eLXWp+/p?= =?utf-8?q?UivWbkTFnXfrSAq6z7Lkc4J1f2/FM+jmG8d4DFnpTxiQWxPoYyIcC7qZlc8jNlElc?= =?utf-8?q?xrhTvg0eLArPiVnkhGLMF4Xq2WJK/Zao3WsIL5s5HCJ8t37lJkOln81ec52Vucewx?= =?utf-8?q?YwYRx+esnLBrWCeQGctMOHehowertXadJ3aFjtSoHMBeu9mmJuTrXQxIyhl7AkrdU?= =?utf-8?q?ZSusZdl+5UDYGWAqFjowjrfHoMy94WxFkjxjAdLPO77KKG1681GmYkhmHljND/K9w?= =?utf-8?q?ZLMK3wCKu+oehS4TsPmQNgacOT4ptUeOHwCLFkU0SwuCkqWmV73P/zSPetEFU/6Ox?= =?utf-8?q?rdz+vzx9JZntjyDKDdnCaX2Mu0OCOl+RMoHEXKdjjhPT0yyYLRqsXvZ9UxgjiiOSt?= =?utf-8?q?O9T0TIo12TMGF+ftJf8p1b6eU2c+MS6UAzeXBO72hrIZyn8TCGQMowNmn5LwIBSqE?= =?utf-8?q?so+8QUHvdn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jZmQ=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)(1800799024)(52116014)(376014)(366016)(7416014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nySg0UWJ+j8fTvZExCz2Lgjv5HPE?= =?utf-8?q?HG4w5xebYCz3UvtfRvLsZMp+7aqJ4UykYW3ZsRgNeIbHtA31sGcOjrYBJS0Vx4RNS?= =?utf-8?q?uROAK+zbkFvT1XGGl4JixMqoISO+u5OWeI8hcyueZMqpbpe87VB8TYW6K1ju1Odip?= =?utf-8?q?hdVvLMtFhiebws1r0YVAmFlxunKY+qWW4WcHATf21wtqEkRMF/aAhggRyUvf4VVZa?= =?utf-8?q?e80CLCnk31LWa85iI/7XrPtFecRRhpvNcfs0NScxAO8Fpu1t4rufpLpxIVj3rXPJM?= =?utf-8?q?aABD31pFIugEnqufl2fGV6Kwkv0yna1QtN0GTjmTIg5SLFEea5ghkZcs/b+tP8Ets?= =?utf-8?q?0k9KBV0trbKx7USOv+ec4Dae9Z1qVzVFXMTjzsARuifYWfcFPKyPV/4O1zqOZIOho?= =?utf-8?q?cprTSzNK3RM/itMekqVSUDYeYf5/YM6w/1TYeDAadPSXBZNSQ+AeAMIHemZh6jrmO?= =?utf-8?q?j9wAVmb7kPZGKFhszI2xDZfzXMqqdc3mzuxG3E7vTz5XEZ8+auupbF1gFHQq9PgzV?= =?utf-8?q?smMswxJutT3VGRsIXwWrIj+kMvs64a7c++gpD3qfQaZK7++3LBGG7ALfhan9OLb3h?= =?utf-8?q?cuzR5AqmMkdiatNiTxGGplspNa0eWmvMJBSFX8sT1dbRa9ckqGpvq/kkOLrwWb4Gn?= =?utf-8?q?fzhSAanWd84POH4/3QpLVqufo/CBuW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ange-CrossTenant-Network-Message-Id: 7dd2ac5a-06ce-4654-080a-08dccde64383 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 20:06:43.9623 (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: HyW2ljZA47VOGNP2HxE8HAAwYnR8RD0aQ/gBbpjxwcL0wmh9+36AlGBryZNPyvc0n7EvW4VDms9NoNZlbOL1Xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8423 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 --- 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 f62f6f960e501..4c0aef5792ce2 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); } @@ -284,7 +287,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;