From patchwork Thu Jul 18 10:26:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 813341 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011044.outbound.protection.outlook.com [52.101.65.44]) (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 AA7F91EA74; Thu, 18 Jul 2024 10:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298391; cv=fail; b=JFKaPcp7K7LTJAi1Iw5CSeT6pvzt2Ma5UtEFd44gm1n4MLxtrwvS6kRJ8CAeq9HnoOqBVArKo4wvLrjtx1sxfJE5tUp8G6YN8v1xT6n9UlBZ8G7SiCgnRby61Y3iXBdYTKW/x91VLhsTqiDGIkKKRoubAt9Q+bg8M/8NydaknLI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298391; c=relaxed/simple; bh=GVyo+j6mLLy6TH3INgYUZRFD4Vt3UHY9ziG4s4lxl+w=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=ChthFru5bKQ5Dxzx+/vC/HZR9Gt6Jy+cycTtgKBAdFRiuYAiF5tS3xtmNOlQTj6HGt2tiWDdqQFCYMsm2EaTvam7Q2Pka2Uk9Ip9gEW/x1s7m4tqZK/ZNpaUA/iMGAntFbkyGDZoqwEDJn3yg0xR7/C1hLCpieWo231xm7awmZU= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=PjCbSg3x; arc=fail smtp.client-ip=52.101.65.44 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="PjCbSg3x" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ey0XvknHvDnmIg/LI7kPR9Q50YdmU6Ex++6AdukdGO6/teK0frrbWqSjamrgQbmpMMEOjM2w0W8fara+yZrFMVgqEVWtvtepN3hEnYSahmOiHNoBIxhbIW9+rETB7MIoGtUO+T9LADeeXsiDCokLdxMu6oOTs5ojfTGdjVNUL5VRnIK2BfvjmHcJ/3+R3PgX/eTZPFskZfMMgan7MS/KYwFg6/vVZOSbuqi1vdTa9fQajZZKHjSKnqbyn0hncJssMXJ9ElzCnHJxq9csvaMJ70lOiNlL0MVxzCrIfft4UiW5v5K12+nlh8wYWmiukQyAZc0VEQKh2P1hTRNPN8kV+w== 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=Ea3q8DGyqZWZT3weIDeXRJreBmnXAssnNCOmfCGdYPo=; b=GW0ySr8IbyiP2ScGzP2hyphQj3RetLy8zIbeM5vNydAOJN7622jFjoIIxbY+90Ayucmi2ycOojRA9N+UUEglPI6tmLIoe22wSNSnkNZ6SaetcbvNBGhozCwlzeGtRdzsCduWjm1nIMvvIahJSsTuf/8sibIjRPQDF/qjj8xa8ZkHjA9U4naa86GRRa8HyIfqxqfbuo5+XIFtx5pXFFa9bXlRJxn1dMr2MHXTIwcT7xr8Rp4SSvBQPQ9+7FK7mk6XwgXHdXJ41MsklJtmgSmjk8ErrefMl+LxHKdABagig9bMypEVDZ/f/LFx0Z4ojoKAXLjYPsNBaqzaIaTLAueZRg== 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=Ea3q8DGyqZWZT3weIDeXRJreBmnXAssnNCOmfCGdYPo=; b=PjCbSg3xWT1ZjFtPU3IEmc1DBtSiIgs9nKAbr6II9BErYCgeVlP/XYqLwBhST+Z5S9tv0xoPU325y0zezbOcWgK+MYAgNaGJE6KZvM1FEKBUq0DLgF28ZJzLP91ardXtqye0bGnGqU0AYoma0DDQN6SpP+TSAfMY2JpHe1MXQaw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by PAWPR04MB9886.eurprd04.prod.outlook.com (2603:10a6:102:37f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18; Thu, 18 Jul 2024 10:26:26 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 10:26:26 +0000 From: Xu Yang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, gregkh@linuxfoundation.org, peter.chen@kernel.org, herve.codina@bootlin.com Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, jun.li@nxp.com Subject: [PATCH 1/6] usb: phy: mxs: Using regulator phy-3p0 Date: Thu, 18 Jul 2024 18:26:32 +0800 Message-Id: <20240718102637.3964232-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR02CA0014.apcprd02.prod.outlook.com (2603:1096:4:194::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) 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: DU2PR04MB8822:EE_|PAWPR04MB9886:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f1f90a5-9c82-40f8-8878-08dca714147b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 926EaJYAJqH0W/eItKhosfCdOzgTm4tJTIB1CufsqggR0Kout6COZvXepVPJUUj45BB7W/dvYtAGUV9tcAotbbJpOcrkKlXGNZjftpY4DoNokOhbgFlZ4bSpjHcj3ZCKYsHiN26D3Ylzad4hwTtTl9q9yJH6SJD2BPcECBdw8/QwvIl2u/ePW2/40wgvFfoRgk2bsy5rffENP+zMkzHEe9VkoPWjEiy7QjOTh2mNsmkX45oSj3cAkKPbbsftmsHOufhFEsaiSEBC99ej+vZ6/wINHQHOUxKx6G87hWhAmIZj6OugrTMH4xzk/xcfDK5GA7v72mR/kAqZvdeHPR5+HM+9XS90+lBt+yxEaeyj8p3V5CxIJXhQJBYuisgmEp8vTEyyfC1zk09y7F0adztJR1kNfRiVBbYhw0oKWZUaSWqDVT+L4PQsRzLyXAkyPpPL0rciZ08FJqf25RcmWQTVsmK5K2wp/IZkxcf3EsSdbT/bfCUUwFCqCsEVzhO3l5Q0NPnPVCjYmI2k5tx87UKqAsx4ADRIYeVFxXk+R3kQKOhruzsIWqEph0RrY6SvVAC7jm870tzS7pF1BkwdcmDHYykPFtMCVJSsgR5GqKM/qS+LME7LtqkbJJ5wKaeLGw/0pbpvfjHhqnQ4rMEbPKFL6I6Mjkq7PNoTd2TCa+XNrBwnA+XJQ1ynBwuuCdupxKRWm97bKrfH2fJLkacjGixDR75M3AKyc6EL+mNQtfCz6dlqT7VtD5lpzOhEZ9PFnba93uTK9Thwql9ca0Gg7Ag7NxNX4xd4Cz2Q0poAjjql7O9iqNYo/h+MStgA72lB1++Bc+Hk5qhb2xHYqETIjqQrS1NJVQ1HZ9imVJcWfy6fgAyQbR+nWYNv19w0+uKl8RVPe4NobRPqwglZNd4X8eJER+4dKSE91Sx0By8S9zFvqkB4qa2RR9geqMLKeJ/1mhQIj3mwvOwwlV2GjflKIjtYDZimuhgDtXrQ+SC2mtu6IuzWpASGJqSXXFl6EM+jfp+KA01B22ZgKc/Nlq9JBB0hj6WPKjwAnJ4vOPrADiouSnwLwL/tjharwdHWKC+/hQQDtzSFbU0jANKkSL5/odbkSD+latMsNAiNXIbsWWOxEaXvlPDqpbpRwug3I1nNdD6YBnye7TbEKKobtQulmTSkTbKbzB+ncFZX4jdUeGbjalrePA9rrlWW0SN78kdLv3vdga3PMTn9TImZZQpTwr0/bTxuJFun1tPQBPhPlPNE7vBlp4PQ+tMTQjiOEBZMHSuwkAUlN3YBEDJQvYsbrgA0oN//0gySqGZkIwRhW6Hsj6b+Em8fMH4gaw3miZ7hLgRkTEA1iVNB9kOjq+vdGyWMl0jBsPmjGBp2NIvul1xYbObgGCzjt+EYvoiCwYXjGRUTAFmuuvkuAKh24yIZ6ag56D6AiiLTUeYkBunIta0p404= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8822.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)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+cutMIlJh2fpp15pZynopStk50ao3YOD+uHBbKh7YAWpeuLaY0u9Kekfd0zFKQffXOOsmfsTBEb26O+8baBcmqF1Go7a1b9oOneL3HpvW0saZeKcFvi4NmNJJGKft/epFoRxc3X9ssN45xCKwIMlq7xh3Uyaxi8VvI9TTcPJoHK8GK9QGzuZ286nFtv61SUdPdnz9lq4seSBfMnrf5UdMv292fOeNBSD2ykCNSvVYVLh+bmsW9D97M9HuJB1dWXzoJaV4zJzlYh4EPf9zntInsOCLA/z6ngVg1GYDOj9a1O+5NVgF0o4QAm6/IDdVfOTOU6ZGE/rxiJW6CbIR5/9DCQoPcK0L6q+DTZ9HBVIYXIUnh+IHCEt0qcki6NdoSYuH2dDnB82+ULX+cot4cUuJHeuabkK2ePm5S+4Po7eGo68nKJlaoUiOtidZ//0oipjMK+BGhPhMNiabKjbPkeONg/+kB5HiPKOP+ihhstFDj4YZz+wvbqxiqj8y3xM30IfBPO0YmjbY9ers1pALw2Tk2rTzB8/NplHNQQzCrt2k3dEO24mNmX75tSGnD27dSWq4GKn97/Z1bGi1k5uGP3xdNE/OpF4F/H67pyPH/pWJR6Cfd X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f1f90a5-9c82-40f8-8878-08dca714147b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 10:26:26.7637 (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: cYY8R/yPk8tyfQ2QWtfoo2TZ/aVjeA+Imzs6E9+5UYZiBIst/rn31m3jE8oIZIK3IG5Gk/ZDQ8DKe2diaD7J/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9886 It is one of PHY's power, and we need to enable it to keep signal quality good, and pass eye diagram test. Signed-off-by: Xu Yang --- drivers/usb/phy/phy-mxs-usb.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 920a32cd094d..42fcc8ad9492 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c @@ -18,6 +18,7 @@ #include #include #include +#include #define DRIVER_NAME "mxs_phy" @@ -204,6 +205,7 @@ struct mxs_phy { int port_id; u32 tx_reg_set; u32 tx_reg_mask; + struct regulator *phy_3p0; }; static inline bool is_imx6q_phy(struct mxs_phy *mxs_phy) @@ -288,6 +290,16 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) if (ret) goto disable_pll; + if (mxs_phy->phy_3p0) { + ret = regulator_enable(mxs_phy->phy_3p0); + if (ret) { + dev_err(mxs_phy->phy.dev, + "Failed to enable 3p0 regulator, ret=%d\n", + ret); + return ret; + } + } + /* Power up the PHY */ writel(0, base + HW_USBPHY_PWD); @@ -448,6 +460,9 @@ static void mxs_phy_shutdown(struct usb_phy *phy) if (is_imx7ulp_phy(mxs_phy)) mxs_phy_pll_enable(phy->io_priv, false); + if (mxs_phy->phy_3p0) + regulator_disable(mxs_phy->phy_3p0); + clk_disable_unprepare(mxs_phy->clk); } @@ -789,6 +804,21 @@ static int mxs_phy_probe(struct platform_device *pdev) mxs_phy->clk = clk; mxs_phy->data = of_device_get_match_data(&pdev->dev); + mxs_phy->phy_3p0 = devm_regulator_get(&pdev->dev, "phy-3p0"); + if (PTR_ERR(mxs_phy->phy_3p0) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (PTR_ERR(mxs_phy->phy_3p0) == -ENODEV) { + /* not exist */ + mxs_phy->phy_3p0 = NULL; + } else if (IS_ERR(mxs_phy->phy_3p0)) { + dev_err(&pdev->dev, "Getting regulator error: %ld\n", + PTR_ERR(mxs_phy->phy_3p0)); + return PTR_ERR(mxs_phy->phy_3p0); + } + + if (mxs_phy->phy_3p0) + regulator_set_voltage(mxs_phy->phy_3p0, 3200000, 3200000); + platform_set_drvdata(pdev, mxs_phy); device_set_wakeup_capable(&pdev->dev, true); From patchwork Thu Jul 18 10:26:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 813340 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011046.outbound.protection.outlook.com [52.101.65.46]) (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 1640712C470; Thu, 18 Jul 2024 10:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298401; cv=fail; b=CF4DkQxGNdqjP1aItjdc4LnnV2pGWRRjSc+nUrdW3Sq2IvMJ59eJkSp4iZBm7nBm3lNam/X5j7PJe5d/71JFlJrEu4w6Msn8BKTJbVbSyitCKTCU9ziAJlThe9uD4iQKglFD7AXuP6OGVrsJ62lxqxgw8oXiAwtY5f3irVzsZ4M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298401; c=relaxed/simple; bh=yFf4wpknYRAdBvAAXgrpsm4UZNEk13Rn36bT/e5naGw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=S4ggMMjD5GQLz5UsC7a/UmCP1iQukSR0gshn3iGze+K144L9tWos4wtBXEcjpsmUkMWyTb+93tpna/AaesX7KIcYtLCtHyRftf0vHE4xYmUyqspVzgsMKHtC3y4lCQcFgVGqIKh4jmOVxh5R+kTmNfItdwG6JWQ7Z0ACSpy/Cf0= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=O7sBbikk; arc=fail smtp.client-ip=52.101.65.46 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="O7sBbikk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hlNze1qr31rjXNg2Dne0NjCNEmJ0EKOAcRdqvNT8b/I25BkOxhfi1t4uLAj4eklyp4aN3NSgECM1zQBIAZprWe8EMey9IUiRkMJvcqON+tGgns/fzk/E9PfNTJNB9U1rvMpGAZgv8N1iwKSs/mqEH7zuJAKbAi0IvadwcGTofDu382nYZZFE7edlnAdLv8e0MoVjTCcswk4dv6taW8QxE06oPXWPCqgmSjyB65w6addiT/BnP39pHUdl3NlNPGPWCkpOk8hGvMXeLZu9m1lv0Dj0ZtUQqe9pGPVD/79Dx9J8U1dgvbh3Ts0Fn7ic0lysCs/x0wUlc2PFdm6sJNxnkA== 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=moImxgU1cnIjGIS623G3ednFYdspClC2J+dAMdHXN6I=; b=yaJ/IJz8W/skEBSGKDqST49CzTIvVxG4oFAfaVrXtdns8t3YCfWxTunRA99xEqw+UzdLrZJ8LdC3IgiZDFIhnSGYXiNkkZ970vHKGpjeSAhuEXdNRnoCnRytiSLInyby/kZIsAnw61UARprI0TBhoHn3IGRN9K9n+9Uc+MCRH/uWFU9Ti5Efhzh+4D6I5FY+Kx5KR2u+9JEAju04yfadJbvf2NeTrnWGUUIvmh0tMCbEun3GGWwfcJARDwk85wH7DocQ82BPdxZ4e9JviMv+qNxc1D/WVLC53yyHdo333IKYsPNEJjBu2FdsuKkEoWKjtp14leZ48rnljhoFQXn2vA== 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=moImxgU1cnIjGIS623G3ednFYdspClC2J+dAMdHXN6I=; b=O7sBbikkgf4KUOwyyFOppPeGo5hDuoSM8Zs6PNL9RKr/NoQCSQ4SNfh88RFgwdzTxq4j9fAguN3l7HukWd6EtKXuqxUwdmrBaQSbGxaJd0txi70g6JNPMXhjsuRQjLidbmY11Fn7QX8G/2KyQXzl3v6KZM+Tz7CCXRL8j/I5WZY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by PAWPR04MB9886.eurprd04.prod.outlook.com (2603:10a6:102:37f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18; Thu, 18 Jul 2024 10:26:37 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 10:26:37 +0000 From: Xu Yang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, gregkh@linuxfoundation.org, peter.chen@kernel.org, herve.codina@bootlin.com Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, jun.li@nxp.com Subject: [PATCH 3/6] dt-bindings: phy: mxs-usb-phy: add nxp,sim property Date: Thu, 18 Jul 2024 18:26:34 +0800 Message-Id: <20240718102637.3964232-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718102637.3964232-1-xu.yang_2@nxp.com> References: <20240718102637.3964232-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0014.apcprd02.prod.outlook.com (2603:1096:4:194::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) 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: DU2PR04MB8822:EE_|PAWPR04MB9886:EE_ X-MS-Office365-Filtering-Correlation-Id: 2594818c-c110-45bc-044e-08dca7141ad3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: tTB10cfERRf1BjlqjwcEh9PfxnfhV6U/JMxOZcPowLvXsxT4/NzEBIY4sbXTfLtG3U37UkXF/oM4Z2v13RIXbzIfRkYactajCWHjXZmBjTUzjKgUSwVE5u0nl2Aoe/MzDlDv5vpifmMfIfqWi8w5kW9Klw6hJtMAc41VwHvLoErd4AWa52rfxB1WIja/72Ovb26+pBffFM1yJ6VaXiXFKbHY2K1e441N20tVL3dq6f+ld+dpTTL+ZlXTNvGjRxN8+bs3Mluml5Lq1IlTeYPF1ARHkwo403ro8zScvotjw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ImaFpyZouEIm6aqAnHqYZ4xG8psw+24UcPybon+F0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8822.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(7416014)(376014)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DWAf6zNsl+M7BqlHhjNFtcbH3yztPh/9mIahuLm4Aj/GMcwg6Yhe7wryje1EkioqSuclpJOnLnq9iOsz6mewCK3mPpSgH160D9jSPcd2rkEp5bAeNCNjXkpaubLoEnfAYoO375sIMLyUIk+WnUMTkXKbH09HwNkaTcT5vavJPEoJEXC8nKqq42zCWe+rUDGIXoGbd8Mo/g5qG8SB5p8CQlhs3dtfZlHUa5LcWDJJ015SvbMUYmomfyfgnLaCOHPubIvH3YtrkFyF2sNMqmVz+2ZUdi8Jrt4T1ECRqMIDvH4dTYfsdeFaABzWR79dVG0TZo6LEv23WIRtxDwvNXJCm5DQat1tge4KQ6ruxYsGWcnzxgSeCWIA1tsFIjaMDLqipvU0mySmrsXsYf+a93U2md2Gm6cGvecTg5f7y4Od0AtSnRgUqf9vs8HfsaPL2hUq3KIMy1vw2K7EUeWiV9ODrdfUHMSRxNzuhq1eqidP2MtzunU7fKJ5I3byfvaWNK4oaVAuRH/klwo0Tn9mYhooXhSE0PGm0lH7wvA5L6+qZerXhkh/O4Bzk/YV2n9FQAmA/VFn1UkchLUGxrPWoInnGYscYKPKSKGb8m7tngpw5UoDfYbVgNkNtCY7KUInS2Lz2IA4Uh9qSmdglXDkyISIDF6h/gnUjOH4SuSlYfizkUZS7+Zrn8kDd0kOeSte3bhB7buI+pUVu4SsclQOP/Idp0mEoCpVDtJxmrUuyQkhIenQvkTWnHTYKjXBUisaMrW9Sj1lKLuO6pBeZjJqdoUFLKjfuVLF40L7//PHy8iakLvqBn6yMmEp009XtL4Cu7n/OxDeOtuL3sgI2S5BvOP0/LGA4Hl2hubJRzZZHvnPmuO5RV4ettfHYZzzUfou5zeIMwNlcGXjoY5nj9ODno81Iwsrrw+cjr0OT4fV40jW/ShaxzVKbFcj4cWlnVA15JW3S5BzerUIKnCJPccF/+xmnf+lDXrVI0ja5dJakbiLsU4KlfRalEKdB4PCNgBP9F5A6ZsUlKSj10ZfBi3TyfyQ3DrkGjI310AAnFFmIZY6L091gi297sXeQ0koV7JFzwVO9vqj4V5+D6Ds3xjkUY6UToFH59csIaZ2//XJ0Q19EwmRSUakEzxu5Zrh+LQNpTeCNGbZ5E1wDoW9uFFcGtYHLgXnwkpeSsSOTfQrAa3E/+xpNka2+Ox9BFMKEED/EC5oOc+GNGpH5hjmXzR6asCTVL+UdwRpBF6dkWlZ8GFtinP+/EQXRjh1TpQEZiJ4JEs0f4EEInQPdwKhRtivJIe/L6U74Zv0Ll6Y0J9m/JieFUo9dbxqPqq5WGt5cW0WTetAj9frCXGES1ISxwSr4xneVkukLSNptrEmzWWblcGRuH1Zb1iJZNndmYMyzp3lr9ejnA8X6QgkdTa3uo4rXZPohd1ont9a3XZIhTRF7ooh08bt0xui8SaBTrcZJLZchgk72JTnmt6p65PA0jWuiiBNP7fBZAYhTIFWv+vHDOOwyDZGialVmotXPXsEFcULRy/f/yj5er3d2B6TSlmKXECkRvrYtnifI8UUgWQ/uyYKXRbDh4H7m6JBOViYtcWe3VEq X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2594818c-c110-45bc-044e-08dca7141ad3 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 10:26:37.4772 (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: epuaBqUzRMZ3bJL371h7El9yT36/VjR19u+XJQP3vGoYkJP2r8TPnOTw4xyy2A9BzrEUJksW2I1B+2+Ragcejg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9886 i.MX7ULP need properly set System Integration Module(SIM) module to make usb wakeup work well. This will add a "nxp,sim" property. Signed-off-by: Xu Yang --- .../devicetree/bindings/phy/fsl,mxs-usbphy.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml index f4b1ca2fb562..2141f271f8f1 100644 --- a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml +++ b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml @@ -87,6 +87,12 @@ properties: maximum: 119 default: 100 + nxp,sim: + description: + The system integration module (SIM) provides system control and chip + configuration registers. + $ref: /schemas/types.yaml#/definitions/phandle + required: - compatible - reg @@ -110,6 +116,14 @@ allOf: required: - fsl,anatop + - if: + properties: + compatible: + const: fsl,imx7ulp-usbphy + then: + required: + - nxp,sim + additionalProperties: false examples: From patchwork Thu Jul 18 10:26:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 813339 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011023.outbound.protection.outlook.com [52.101.70.23]) (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 9B30E78286; Thu, 18 Jul 2024 10:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.23 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298413; cv=fail; b=rt1yUJ2o8rfvmjEvqtAsIsammvErKhKAUfJaFPP8MV7DbdHcJmLLp5VOuxeBNuQwyLkSV5IElNeFvrSSLlS9iNsaqCVgV+74SjfUlqATFPX55zTtW5Lb22MuamVSIAh/dyywnEwadncLlpcXzEErdimKF14DRznnt85Y4Hhk4SU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721298413; c=relaxed/simple; bh=MAnwh5kCwWBieyNtTfP8JOw0x4fYaw/cOkduv8rg8iw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=O74L7hdOj4jdzeaXLzQSLw4emsoD2VNbyiK17ICIhxrIU0sfCJUlgxg8X8502mM1/xFCq+GsSAS9xX3jfeY64AF7RE9kvV+PvPiiYzjh8HVtYc3hZuf8/8G453wajpvML4Iyd+BLq0G5hkbrlAxG+6QNuqD9UkOfKiJYJyR8q6A= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=oucl3LYo; arc=fail smtp.client-ip=52.101.70.23 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oucl3LYo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vo/ZDieAHbxmqAtE7d6HQ5adlGaTVEN09KXqvsTDb2bFiFANOqq5K6vzGPeFbWQQKn1K7QdD5Q0WkhZv7OZGZkJgC1uHKWTLS3+E1UIltzujmVXw+2uoo3v8FriPcpUZDMk4Flvzwlh/uI6fVkz7IcAax4fYIPJZU4QuZJwtYk9ap54BpXkAvHRHDzK0vGi/wWSUD7fNqeRfWHsZwDuLm2LCDh2ZnSefHKTQskTzLUtbtTijZl9sxMN4Dl9O8T3rR5CWFNC9i6PpJaBxc9rxxXrj3nGYOY6z4NoztROkd1keDOUrdTjwbqoVSBLY1A/WLXhCfpwyIavxDu4zN9iODA== 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=eDLChDrm2VhOs40dhdZbGqXup///V8YEJRleLaNpxXc=; b=vcp+25+3+Bw+NMj52y9tsChOSKHsCW4mLG4k4X0zjvv0o+Uc1qWv7rKEUEnjqnAdpKSGg3dUvbb0sHnUaBwaQWkALQZxhBTDawi6S/sQgUWeyFK4k2KHn/IzALaKtQem8fyunsCqFe7+eAN6o4YsfPN4lOqlyVbWgwwwLpkGTj73vbnYtnse+EUQbaNAbsLJiY8UZ2MXDeddXZdC4iybPF7AXm1z46oR9nAAT+NnjcqUK7SDM/7bcnM8OKlM5LeRRheE7hGjq27yqmGFc37yEz1lEFwlHKUuAGQBknZUuhJDrn7wu17PCIe8OLSHqM+DbRFx8ulTTVjDN9GvmbImkQ== 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=eDLChDrm2VhOs40dhdZbGqXup///V8YEJRleLaNpxXc=; b=oucl3LYo9mF556lJofoZIhOaGym3k2oANzLJAI6MpPZBQyvbAw1VvkRNxrm1vvYQyWERuhEjYwViF6EYxns0DbKV60XLB0U/MerVIeVT7M1VhYliSAyGC8IfXEu1CKC0VDIALK/7Xgrkqj3J8bEX/z4gYEvuHXEHgvy8hqe7Vms= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by PAWPR04MB9886.eurprd04.prod.outlook.com (2603:10a6:102:37f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18; Thu, 18 Jul 2024 10:26:48 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%5]) with mapi id 15.20.7784.016; Thu, 18 Jul 2024 10:26:48 +0000 From: Xu Yang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, gregkh@linuxfoundation.org, peter.chen@kernel.org, herve.codina@bootlin.com Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, jun.li@nxp.com Subject: [PATCH 5/6] usb: phy: mxs: enable weak 1p1 regulator for imx6ul during suspend Date: Thu, 18 Jul 2024 18:26:36 +0800 Message-Id: <20240718102637.3964232-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718102637.3964232-1-xu.yang_2@nxp.com> References: <20240718102637.3964232-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0014.apcprd02.prod.outlook.com (2603:1096:4:194::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) 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: DU2PR04MB8822:EE_|PAWPR04MB9886:EE_ X-MS-Office365-Filtering-Correlation-Id: 3462f68c-acc9-4fcf-e83c-08dca71421a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: BLvSONq79Unc1LulgBbGAg3VJN8y1+6FGjyJvJJlEs6lzi2c2MipvBsgAQ/mtu5mZLHtWnDAJmTnjkQp9aDzTXs3fovn2yPSpAGjSzTmV3kuHUMY+jpheOZ1geAyzwME25oHJ1nYtjYu7vHOhPpCrVPrACLgWaVyLreA4Gm/4dY3sCySnSstU9CCI/aSLKjPIclj8JTnxrF9jLWrU58uVD4jgS9R5gEqG+xXAv6SBB0f7UAE61J8gjAU0fbojzIhbh/msBbZjzSagO71+rqmuhJC8Xb6CtHBP9uyvZ3LOkKtuaY5jbaYtpXwKVbEQ/1Y8mnx9+uBSWa2YdRm6PFiXmlLtaVZO7FTNxKKF8rgWlu7HqN1ewf/nSulQ6romXZ/rXNOABPkM3/YKmXGTknWka9sdRBK0bayvwQH7eaj015cnKnQ3NBNOFNEy1rGumu0V/5xejC+f6hrLrrvINpAAp6M+mByz9r4dtEQY8F2WjExfd8PlVJLygE0ChBN7p6wrck+MLXC2bkdSwsHp357zr+so2kxoJ++oKyl5hn3NxeWUP2zm0k+vTJsrMFo91ORKPSpNoInVMBO+g3cmWzYQpzOEzr3LNb6yVRBp89IyIJap9JQhp6bOJD1xMJd57B8h2IR1FX7gGWw98K9avPerayw0hy2PNJgJ0kORca3+wPpz1hYEFVnzC9VgJCJ7bbhlSCg4VdPICxQVzx0nNtT32Q5r/UwsdV3JmCVBQnoHZaGs7wt1tXES8syhSm3R4qek1smsy1ARZuyWVDoNradO3wjkeYlEmKCPvWTWuroESAt7YezJzXyWVSpCnqSZ4WT0vcM7w2KOzLmdPBK0vQ45jQBOfj9gYE8GMCx2AzR8OJNhWXpc3hZ/KLL6miKIpLAzjnP0/h4al02QHA1Lw8DCeRCxL80mVAgBKtLHoCHPLAhAbCs80UVTc1wseH/IHBFIO34P010vxjngcyYWMmTFvccMUEg/xUgEs0zNA2q98EnKXO/mJW3Tpi7+DUHk49rEkXd1xEDsOM5M4v7zA/LxPHZcJwdl6L2oOnQOT9wPWq4AN/MVm3yd+aUUt3mvDg0ZkmMl7hsqHqipB87gstTbDWsQSmYP9BghiL8PwM8kbk+ekBlTBuDrjrkoO6ewD81JDiGvVkI1FFeGKso4+b+IHjmmve95c3DB3LOhVKySoTPZcea/g+HHor8e6WEjLTRn8dMA9UerST08grMHC75hJsZOOuna/yFVMi1dZVByeM5h4/mMyWAbwrMa3JSWOo6EefVal36v2ZdGfdWB54GPD+xLkHPiJIOOZZx+tyGo357cFzx/JLQ4OkX6iAsOD1nIdVZ5lJ5hPccAiCq52T39SpN0D2w40+ePcqYyeIZt3/54s7r95YtTaKAbrBn+k0WfG+Fm5gVdNVXPeb4Ya1cjLFyck+aD4I/Xwl0CRD9Du0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8822.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(7416014)(376014)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1KiAKCTKZv9EtenxH2fzd1as/x3oHCb+D994rDUAlWnvCkuENkX023gHECjGggppsePrvlU1SoxJ2iDDOyxclvufehNdpifJCXh1VkN+KA1gndN6xBZBQ1Ba9Ef29VSG/gh04NEFWW7kE144L35mBfZoQ0dToBatKisPHnQGqXuQ2MHx/TBVNSzeGq4jMoF2ju8Mtvqd/KJ5OiTOEAXSCvbmuJAueFIDcaPJUqW04wW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q2Ikqe99LrSrvSE7FamVmxq6tYRzVjYaSgyv3hvPo3FwxJvwSrlcvbQhq1/98SYSTlGxsvOa8vUuPLU17oDFWVUcRbGVpmAXyG1AY1EYH5xIUNvCxW2KDH8iSoNSIxOtr8mQDR07A6rIE4fiWVD9KiTO/agf8pI0Bq3sJLe6ezyh3HiQ1rn4s8c1749gCAdhr0I7URxc0XuMphnPfNW107F1SRGWRVC4AU1zyouceXKvJIu8RU9Yn0nt4Xjbr2aefp4chkrKXPD1UaYUBliCwjZrm8vkevR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3462f68c-acc9-4fcf-e83c-08dca71421a3 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 10:26:48.6685 (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: hF3oxExlT+zNs+qw0OvqKZoLGRbVWElNrOXhz/cUvk+xaQrc8FK+afiJeN5n8+7WlRX7vfBSFgS4PMdnmDT9vQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9886 For imx6ul PHY, when the system enters suspend, its 1p1 is off by default, that may cause the PHY get inaccurate USB DP/DM value. If the USB wakeup is enabled at this time, the unexpected wakeup may occur when the system enters suspend. In this patch, when the vbus is there, we enable weak 1p1 during the PHY suspend API, in that case, the USB DP/DM will be accurate for USB PHY, then unexpected usb wakeup will not be occurred, especially for the USB charger is connected scenario. The user needs to enable PHY wakeup for USB wakeup function using below setting. echo enabled > /sys/devices/platform/soc/2000000.aips-bus/20c9000.usbphy /power/wakeup Signed-off-by: Xu Yang --- drivers/usb/phy/phy-mxs-usb.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 627733a982d1..dcd032678814 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c @@ -71,6 +71,9 @@ #define BM_USBPHY_PLL_EN_USB_CLKS BIT(6) /* Anatop Registers */ +#define ANADIG_REG_1P1_SET 0x114 +#define ANADIG_REG_1P1_CLR 0x118 + #define ANADIG_ANA_MISC0 0x150 #define ANADIG_ANA_MISC0_SET 0x154 #define ANADIG_ANA_MISC0_CLR 0x158 @@ -123,6 +126,9 @@ #define USB_PHY_VLLS_WAKEUP_EN BIT(0) +#define BM_ANADIG_REG_1P1_ENABLE_WEAK_LINREG BIT(18) +#define BM_ANADIG_REG_1P1_TRACK_VDD_SOC_CAP BIT(19) + #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy) /* Do disconnection between PHY and controller without vbus */ @@ -197,7 +203,8 @@ static const struct mxs_phy_data imx6sx_phy_data = { }; static const struct mxs_phy_data imx6ul_phy_data = { - .flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS, + .flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS | + MXS_PHY_HARDWARE_CONTROL_PHY2_CLK, }; static const struct mxs_phy_data imx7ulp_phy_data = { @@ -243,6 +250,11 @@ static inline bool is_imx7ulp_phy(struct mxs_phy *mxs_phy) return mxs_phy->data == &imx7ulp_phy_data; } +static inline bool is_imx6ul_phy(struct mxs_phy *mxs_phy) +{ + return mxs_phy->data == &imx6ul_phy_data; +} + /* * PHY needs some 32K cycles to switch from 32K clock to * bus (such as AHB/AXI, etc) clock. @@ -891,18 +903,30 @@ static void mxs_phy_wakeup_enable(struct mxs_phy *mxs_phy, bool on) static void mxs_phy_enable_ldo_in_suspend(struct mxs_phy *mxs_phy, bool on) { - unsigned int reg = on ? ANADIG_ANA_MISC0_SET : ANADIG_ANA_MISC0_CLR; + unsigned int reg; + u32 value; /* If the SoCs don't have anatop, quit */ if (!mxs_phy->regmap_anatop) return; - if (is_imx6q_phy(mxs_phy)) + if (is_imx6q_phy(mxs_phy)) { + reg = on ? ANADIG_ANA_MISC0_SET : ANADIG_ANA_MISC0_CLR; regmap_write(mxs_phy->regmap_anatop, reg, BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG); - else if (is_imx6sl_phy(mxs_phy)) + } else if (is_imx6sl_phy(mxs_phy)) { + reg = on ? ANADIG_ANA_MISC0_SET : ANADIG_ANA_MISC0_CLR; regmap_write(mxs_phy->regmap_anatop, reg, BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG_SL); + } else if (is_imx6ul_phy(mxs_phy)) { + reg = on ? ANADIG_REG_1P1_SET : ANADIG_REG_1P1_CLR; + value = BM_ANADIG_REG_1P1_ENABLE_WEAK_LINREG | + BM_ANADIG_REG_1P1_TRACK_VDD_SOC_CAP; + if (mxs_phy_get_vbus_status(mxs_phy) && on) + regmap_write(mxs_phy->regmap_anatop, reg, value); + else if (!on) + regmap_write(mxs_phy->regmap_anatop, reg, value); + } } static int mxs_phy_system_suspend(struct device *dev)