From patchwork Wed Sep 30 02:25:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 7292341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58FF6BEEA4 for ; Wed, 30 Sep 2015 02:32:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4001320645 for ; Wed, 30 Sep 2015 02:32:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13DAA20642 for ; Wed, 30 Sep 2015 02:32:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zh7Au-0001V4-1Q; Wed, 30 Sep 2015 02:31:20 +0000 Received: from mail-bl2on0133.outbound.protection.outlook.com ([65.55.169.133] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zh76G-0005yz-Eq for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2015 02:26:34 +0000 Received: from BN3PR0301CA0006.namprd03.prod.outlook.com (10.160.180.144) by DM2PR0301MB0863.namprd03.prod.outlook.com (10.160.215.149) with Microsoft SMTP Server (TLS) id 15.1.280.20; Wed, 30 Sep 2015 02:26:10 +0000 Received: from BN1BFFO11FD028.protection.gbl (2a01:111:f400:7c10::1:134) by BN3PR0301CA0006.outlook.office365.com (2a01:111:e400:4000::16) with Microsoft SMTP Server (TLS) id 15.1.286.20 via Frontend Transport; Wed, 30 Sep 2015 02:26:10 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=freescale.com; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD028.mail.protection.outlook.com (10.58.144.91) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Wed, 30 Sep 2015 02:26:09 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t8U2Pq2o017073; Tue, 29 Sep 2015 19:26:06 -0700 From: Peter Chen To: Subject: [RESEND PATCH v3 5/5] usb: chipidea: imx: refine clock operations to adapt for all platforms Date: Wed, 30 Sep 2015 10:25:25 +0800 Message-ID: <1443579925-1330-6-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443579925-1330-1-git-send-email-peter.chen@freescale.com> References: <1443579925-1330-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD028; 1:VPEiZQkeqB+dUZZKz/nMc+hSEYqZM6cBx21stCS6L49BdeAObRQmmV1c5ePKj0iJ68WQDPeqwEqzK3xvAWsuXboZ+9wYHkW0xh7Kk80+yooF27Ayejx3vp8OW5KRLPDc/gC85pKE3nUjq6y4xctjS1Jsx+PBHxljy82gQslYZ8nINqSmlSF3ZKwcsjPS+odR5k7OnVOgGCAaDfgSg9jAbbmdJc5MpB0zBaaGRG3hbPGHGF7U2zofs7785xuUFugZym4t7BNzb1YXatd9fs4dn+k67eMnGj+8fb7f47YE1QlYaUfbm4zZaDaB/g/cobm3fCgioOmSM+8QNjFpF1LDyppLncTchZJzechaeEy9JvcSFKAghu8FzSgZj9wPqSXxRCFhofBittcF7fTIkW/zde3tuea8aeONx+Ay1eP6od8= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(62966003)(189998001)(48376002)(6806005)(50986999)(4001540100001)(76176999)(5003940100001)(105606002)(50466002)(77156002)(85426001)(2351001)(110136002)(68736005)(5001960100002)(106466001)(229853001)(77096005)(46102003)(104016004)(5001860100001)(5001830100001)(36756003)(11100500001)(33646002)(2950100001)(19580405001)(81156007)(97736004)(92566002)(64706001)(50226001)(5007970100001)(86362001)(575784001)(19580395003)(87936001)(5008740100001)(47776003)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0863; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0863; 2:LJRUSCDwGNIaXVGDZbKGl9RGit9Q1E3+0Dk/O7f+ypWNrR40K8Rb4HbqaWM312RLs9RiWiztri+VwY356VytFtBbGNEBdVDe9XZ+IWK6IIxiKgGtdVPVahqLV7yVCtTpgZNdstbljxUu+ReB5b7eRIE3Qg7fFN+vg2miNE35tp4=; 3:sffGUE9OS5payKRoOS4mMtJTaV1Swj/72AH2JHqigdYCg1thiz2v5dxk6bvPlpk4WE5XIbA38CLLNaXPdUMDTA6fb+ZOtrh62/gqpRl0hQVUBcE73/QHk514LVQ1qhJOVQY2YeOurkgEn3UZd2LCvEkT1w8GVFOM8Pc5ON6b6UMHjgXnnuXHyUviCXbMmKMVuk/c2/U57A3O5V0ceCnzlQ0zFYGTE4YHfkeddWfCPGg=; 25:8u5UQ3h1sQJpuMh80jZmziNYiPHm/UnYLa15I6iLPPUHJ00Q9Ei0IxuQRTe7KSF3TJw511TW/8HAe6x2/FGoojzBOUIxXHjUMt8eaWIQ+tGM0bOaFvsqd5z5IKEWi+0jWaOLxOAnVwwgABFog/g7KyyvDpMO6Av4fH05BWY6GhmAD0xhnta8YCLm0LB/NWhEVD0lQOA2ddb/dziSOVXTyzaSMmuHhKLFhzoHr6bMq+VE0cnh9vuvNPPwy6y0b0kCR0j8TfV8l2CFpktQmzW1gg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0863; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0863; 20:pVjNl/PbzMijEhqJ2abCsgZgBdZrATCcPCZj683TkqKbtfckRP35J8Cs9JQVOwT0hH6AnPV7OVjEnww+R4Fd5JKYYd94svB447DKeKFBWivkpwJlnK6Ih0KELjMqYPc6BEu/J0pJosj7pvpDnWyR+GbMbmj3gTvRG7DxlTCj8Qp+oKhDq0d1lQu+ihS95W+cOZ6dHVY2I8/g5Tm1LcoD9k+Hz3oACLaqGYafShuesi/Ap7Ye4sRmn+ktKrz7/YsMuFvugvTXNt14zO7q8gKqXZCetW5rJZLnTUUzGXdB7uKVb+v0nXi13obR0pmUZ4OL+RNa3+FnngpmKjxa87JDsvBO/8q+XkJpFDkWP7/UU3A=; 4:l/aqGs/k7rISJ23sSLQHetn4vXFsmMBZysiATLi8CmMgV2SVWXZKK1/S6LTLnh8QZPINn+ScOFmCtTbXrD6PJ4DScqQRSRKt5xUER5ICU8ZNjCDSuOk6gQLypgoWc91n7TmXxnzTy/aLj97c73OvVsJesKcQ99AXfG0GPPjGMrIdbayA/bPxAswZrrFjyO5RmNT/0iQSlraD0aPXb5FL757h1gi5+BjlbqToA8GqQgVXL9peDi8yLK6EFVPtCMT6mCIYCsls3qrRCl/5iaBJx7fbGbp1QgOdomRYN9we11+AmDDXRwwu7ALsANC3GqskJMsmPMh2oy7TIygv9GyXSt0M4WTEWB122KquhMateKg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001); SRVR:DM2PR0301MB0863; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0863; X-Forefront-PRVS: 071518EF63 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0863; 23:mF4bWdge+Ki9f0NApjBPFOMHmylBgFDhvqzuTq9?= =?us-ascii?Q?31KX2hXuIIwXmTbNi6P05+eYBKUGOtXg3h2kRm9az06r1Lvqz6Q4JdDlEoEn?= =?us-ascii?Q?RbhaTlyaj2Q7wL6keOQbFrQq/9qQJNUSfaoRIvlMGyxhjPm5cjrNr852HIEG?= =?us-ascii?Q?rxwULruDbkJA5ZiVVvGWSjbfQl69rCD9VrzcAXsmSG4zjzMdbdJRaU77R7dl?= =?us-ascii?Q?UgG4LVEZSLRIYUcqpt8NLOVSOrmUtLi+iLXCZpHNmslByU7Vrr/RnXnBvNyi?= =?us-ascii?Q?KnbUUJSwclNmX98EW2gOEI6JJeap1s1dnhMHZGKWjG/6ueFaNXOz5IgC3VzW?= =?us-ascii?Q?TvdJ9RhPjqZ654Du2+TeIA/sxpS7iPOndN0FJP5Aqu/8tKQCmPxqDZ015wNL?= =?us-ascii?Q?pVmgP9+HvsnmymZl0SDdXjZwjFcm4CQk4pKhkUcJ1Etd4N+DHqlzkbYXAkfm?= =?us-ascii?Q?9XnxCl+yRdCA3LzinqEWTc2kUNoSVyexwoVY9JWNbH13jtWh/gCYqHrN/vgg?= =?us-ascii?Q?UJVmY+I+7CQRT3Iu0kB3TCKAbRxn06NATJ14828vtXlqp5WHbzlKNuobX3tB?= =?us-ascii?Q?n9p5JYFp1FOFCcf21az9PTZ208oI1pmjxjY8/pp5Ezjm+xoHSh/jikelFTke?= =?us-ascii?Q?buHyWkNK70lukxC6c+4ximje46JzIwAM/4pN2LV5AjhL2rAqKNjzsuwYYUTV?= =?us-ascii?Q?rsSWb9kevoGrit+uOOIl1HZKhoTOGpvEu1So+VbM2VfXis5nURZ4aANUSDdl?= =?us-ascii?Q?nhVlYgQJsOY0kR4GTQhi26we+/M/jxXUR1YnIwCFLM2bLxev6+/9L8r1d6zV?= =?us-ascii?Q?ZZbFMum4OrQ8McDPMD/CCDCVzpUTSjHAXcOFfPKEtc+KYk0Z9MZEuH+QMMzT?= =?us-ascii?Q?b09kNJqyBYzFXa4YpeCKT9VMRVzA8DaCbmSM6kHdWySZHCslABny/PKz0Pyr?= =?us-ascii?Q?hv5IkIlB5YyNosvcHeMUjmn+Hj3jylVhomCh7LeN3B/7t3/N59tI0N0wucru?= =?us-ascii?Q?S/MsNTP1yH+G3vkg3+/t1DKhfwRiceIJjaIBx2YAINfDYpy6EUx0spFHVFSX?= =?us-ascii?Q?0dEaIAZTwfGTTPT8yDppO9hu/PRbjSI1ti7tyJZFOTTNyUcRWzqZidFL3U+7?= =?us-ascii?Q?OufmMmJ3cUNyGFV0S7Q5lHY8XGWvL1PlJxhSM31G9luWUgRLpRqy5P43D8uq?= =?us-ascii?Q?Ke0FoCBCMeUZra88VSAhJ5OHDmlml91o6oDRUhDbSuJgNIV6u3BXs4d7xzOE?= =?us-ascii?Q?DXKzQNZJ/8QRglgYLaO36hBfcFiYp/QC4DYuJl9jXNhiFbkK0C5yALo+2u0f?= =?us-ascii?Q?wKQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0863; 5:T373alW3cYderO4LKRcvgLez3ryycVyQrx9fyko+C76/Nucm7DNlrrYcD6HO4krZzjzX9UaY8UXljekxi9DVhF6RcvD30hAm4k3ZJbL0/8/+hVqClz6rT8nge8JhKt0hQg0uVNcovpq/3SEeZA5YJw==; 24:hj1AarToQfcdcGQOfqdShBTW58ljXuhvpEgPoq3UUx8RHRWdvb1KsSOFqCzAMWvV34/64g/JaZp6cQm5S+r5tp0HJRWe8Z5yrhM2R3RqFIg=; 20:CGU+R6f+igN9yoJq95lS/ON4ZX2spvHV3GZEi1avL8PNNrRdFzoh2/RPAl7pgJqeR719EnwX41nYE1/+NL1akA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2015 02:26:09.9307 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0863 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150929_192632_808321_19D0317D X-CRM114-Status: GOOD ( 23.66 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, pawel.moll@arm.com, stable@vger.kernel.org, robh+dt@kernel.org, Peter Chen , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some i.mx platforms need three clocks to let controller work, but others only need one, refine clock operation to adapt for all platforms, it fixes a regression found at i.mx27. Signed-off-by: Peter Chen Tested-by: Fabio Estevam Cc: #v4.1+ --- drivers/usb/chipidea/ci_hdrc_imx.c | 156 ++++++++++++++++++++++++++++++++----- 1 file changed, 138 insertions(+), 18 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 6ccbf60..6ec0fbc 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -32,6 +32,10 @@ static const struct ci_hdrc_imx_platform_flag imx27_usb_data = { CI_HDRC_DISABLE_STREAMING, }; +static const struct ci_hdrc_imx_platform_flag imx31_usb_data = { + CI_HDRC_DISABLE_STREAMING, +}; + static const struct ci_hdrc_imx_platform_flag imx28_usb_data = { .flags = CI_HDRC_IMX28_WRITE_FIX | CI_HDRC_TURN_VBUS_EARLY_ON | @@ -68,6 +72,13 @@ static const struct ci_hdrc_imx_platform_flag imx7d_usb_data = { static const struct of_device_id ci_hdrc_imx_dt_ids[] = { { .compatible = "fsl,imx28-usb", .data = &imx28_usb_data}, { .compatible = "fsl,imx27-usb", .data = &imx27_usb_data}, + { .compatible = "fsl,imx25-usb", .data = &imx27_usb_data}, + { .compatible = "fsl,imx35-usb", .data = &imx27_usb_data}, + { .compatible = "fsl,imx23-usb", .data = &imx31_usb_data}, + { .compatible = "fsl,imx31-usb", .data = &imx31_usb_data}, + { .compatible = "fsl,imx50-usb", .data = &imx31_usb_data}, + { .compatible = "fsl,imx51-usb", .data = &imx31_usb_data}, + { .compatible = "fsl,imx53-usb", .data = &imx31_usb_data}, { .compatible = "fsl,imx6q-usb", .data = &imx6q_usb_data}, { .compatible = "fsl,imx6sl-usb", .data = &imx6sl_usb_data}, { .compatible = "fsl,imx6sx-usb", .data = &imx6sx_usb_data}, @@ -77,6 +88,15 @@ static const struct of_device_id ci_hdrc_imx_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids); +static inline bool imx_needs_three_clocks + (const struct ci_hdrc_imx_platform_flag *imx_platform_flag) +{ + if (imx_platform_flag == &imx27_usb_data) + return true; + + return false; +} + struct ci_hdrc_imx_data { struct usb_phy *phy; struct platform_device *ci_pdev; @@ -84,6 +104,12 @@ struct ci_hdrc_imx_data { struct imx_usbmisc_data *usbmisc_data; bool supports_runtime_pm; bool in_lpm; + /* SoC before i.mx6 (except imx23/imx28) needs three clks */ + bool need_three_clks; + struct clk *clk_ipg; + struct clk *clk_ahb; + struct clk *clk_per; + /* --------------------------------- */ }; /* Common functions shared by usbmisc drivers */ @@ -135,6 +161,105 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) } /* End of common functions shared by usbmisc drivers*/ +static int imx_get_clks(struct device *dev) +{ + struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); + int ret = 0; + + if (data->need_three_clks) { + data->clk_ipg = devm_clk_get(dev, "ipg"); + if (IS_ERR(data->clk_ipg)) { + ret = PTR_ERR(data->clk_ipg); + dev_err(dev, + "Failed to get ipg clock, err=%d\n", ret); + return ret; + } + + data->clk_ahb = devm_clk_get(dev, "ahb"); + if (IS_ERR(data->clk_ahb)) { + ret = PTR_ERR(data->clk_ahb); + dev_err(dev, + "Failed to get ahb clock, err=%d\n", ret); + return ret; + } + + data->clk_per = devm_clk_get(dev, "per"); + if (IS_ERR(data->clk_per)) { + ret = PTR_ERR(data->clk_per); + dev_err(dev, + "Failed to get per clock, err=%d\n", ret); + return ret; + } + } else { + data->clk = devm_clk_get(dev, NULL); + if (IS_ERR(data->clk)) { + ret = PTR_ERR(data->clk); + dev_err(dev, + "Failed to get clock, err=%d\n", ret); + return ret; + } + } + + return ret; +} + +static int imx_prepare_enable_clks(struct device *dev) +{ + struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); + int ret = 0; + + if (data->need_three_clks) { + ret = clk_prepare_enable(data->clk_ipg); + if (ret) { + dev_err(dev, + "Failed to prepare/enable ipg clk, err=%d\n", + ret); + return ret; + } + + ret = clk_prepare_enable(data->clk_ahb); + if (ret) { + dev_err(dev, + "Failed to prepare/enable ahb clk, err=%d\n", + ret); + clk_disable_unprepare(data->clk_ipg); + return ret; + } + + ret = clk_prepare_enable(data->clk_per); + if (ret) { + dev_err(dev, + "Failed to prepare/enable per clk, err=%d\n", + ret); + clk_disable_unprepare(data->clk_ahb); + clk_disable_unprepare(data->clk_ipg); + return ret; + } + } else { + ret = clk_prepare_enable(data->clk); + if (ret) { + dev_err(dev, + "Failed to prepare/enable clk, err=%d\n", + ret); + return ret; + } + } + + return ret; +} + +static void imx_disable_unprepare_clks(struct device *dev) +{ + struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); + + if (data->need_three_clks) { + clk_disable_unprepare(data->clk_per); + clk_disable_unprepare(data->clk_ipg); + clk_disable_unprepare(data->clk_ahb); + } else { + clk_disable_unprepare(data->clk); + } +} static int ci_hdrc_imx_probe(struct platform_device *pdev) { @@ -153,23 +278,20 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) if (!data) return -ENOMEM; + platform_set_drvdata(pdev, data); data->usbmisc_data = usbmisc_get_init_data(&pdev->dev); if (IS_ERR(data->usbmisc_data)) return PTR_ERR(data->usbmisc_data); - data->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(data->clk)) { - dev_err(&pdev->dev, - "Failed to get clock, err=%ld\n", PTR_ERR(data->clk)); - return PTR_ERR(data->clk); - } + data->need_three_clks = imx_needs_three_clocks(imx_platform_flag); - ret = clk_prepare_enable(data->clk); - if (ret) { - dev_err(&pdev->dev, - "Failed to prepare or enable clock, err=%d\n", ret); + ret = imx_get_clks(&pdev->dev); + if (ret) + return ret; + + ret = imx_prepare_enable_clks(&pdev->dev); + if (ret) return ret; - } data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0); if (IS_ERR(data->phy)) { @@ -212,8 +334,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) goto disable_device; } - platform_set_drvdata(pdev, data); - if (data->supports_runtime_pm) { pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); @@ -226,7 +346,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) disable_device: ci_hdrc_remove_device(data->ci_pdev); err_clk: - clk_disable_unprepare(data->clk); + imx_disable_unprepare_clks(&pdev->dev); return ret; } @@ -240,7 +360,7 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); } ci_hdrc_remove_device(data->ci_pdev); - clk_disable_unprepare(data->clk); + imx_disable_unprepare_clks(&pdev->dev); return 0; } @@ -252,7 +372,7 @@ static int imx_controller_suspend(struct device *dev) dev_dbg(dev, "at %s\n", __func__); - clk_disable_unprepare(data->clk); + imx_disable_unprepare_clks(dev); data->in_lpm = true; return 0; @@ -270,7 +390,7 @@ static int imx_controller_resume(struct device *dev) return 0; } - ret = clk_prepare_enable(data->clk); + ret = imx_prepare_enable_clks(dev); if (ret) return ret; @@ -285,7 +405,7 @@ static int imx_controller_resume(struct device *dev) return 0; clk_disable: - clk_disable_unprepare(data->clk); + imx_disable_unprepare_clks(dev); return ret; }