Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbdGMLtQ (ORCPT ); Thu, 13 Jul 2017 07:49:16 -0400 Received: from mail-by2nam03on0087.outbound.protection.outlook.com ([104.47.42.87]:49616 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752028AbdGMLrq (ORCPT ); Thu, 13 Jul 2017 07:47:46 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Dong Aisheng To: CC: , , , , , , , , Subject: [PATCH V2 05/10] clk: imx: add pfdv2 support Date: Thu, 13 Jul 2017 19:47:10 +0800 Message-ID: <1499946435-7177-6-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499946435-7177-1-git-send-email-aisheng.dong@nxp.com> References: <1499946435-7177-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131444200589512648;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39410400002)(39450400003)(39850400002)(39860400002)(39840400002)(39380400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(189002)(54534003)(199003)(9170700003)(81166006)(6666003)(8656002)(77096006)(6306002)(104016004)(2950100002)(50986999)(6916009)(54906002)(76176999)(305945005)(86362001)(50226002)(8936002)(53936002)(110136004)(356003)(5003940100001)(8676002)(39060400002)(38730400002)(2906002)(68736007)(7416002)(105606002)(626005)(36756003)(2351001)(5660300001)(106466001)(33646002)(189998001)(47776003)(4326008)(966005)(50466002)(498600001)(48376002)(85426001)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR0301MB0598;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2FFO11OLC005;1:GwdfhpSW5zhqA7nwFWj3t3vHXNfOKY6UZJtqataW1?= =?us-ascii?Q?Kx8EflHFDcnQKuQsA+yr2eT0g2jad3ArGRcWZ2ouv1xxT5K22AV9kIr/TrUv?= =?us-ascii?Q?Yryt6y1NbfYZfvdBeM7RPm9jOVBrXW5BsYs//wcDuB8iBj6s7BF3qAgvihEU?= =?us-ascii?Q?DSNj8QS9x/8WRHpqUYuKcAomEh8SLvVUALz2N54UA7GIm8GFOd38xze50t3N?= =?us-ascii?Q?JlS8mgC4nuH3MLM8Jxx9xX1vURKzp8MFvR1+Tn/pa+ivUBoNcv52zb7QQe+2?= =?us-ascii?Q?2BJI4YWsrkh3g59h/d/xxp3rGrKvQ4eMQ/Nxok1vxEwBgIq5SGLioIVOgi0G?= =?us-ascii?Q?q359LoPZiwCsNxPpVSsWyLeAyd/l3jtGRbOC8VEHLPwT8xmXq7WUzyIWEqwc?= =?us-ascii?Q?zytxsuSn+o/Ui0tNsg7d88n96mV5LLTuD/HHyGht/KKZgRuQWc1lBLLZ0gO4?= =?us-ascii?Q?drBlWf6ehDEJU+aGp/4nUnEK75sfSkmDV4IPjW/NcsefwGvJifhhB6AipQSa?= =?us-ascii?Q?x5j225jL2EVmeSTAXiyOiv1DZ9GG3Na4ZCDfKpeCPBDdqoDr8zY2G0gYI1lJ?= =?us-ascii?Q?UdKxS0fENJMbjiM6uDRv5/j1xNhAcvbQYB3BclrHzKDXgH3bPqp51mD2ZirY?= =?us-ascii?Q?UvBe3FwBM+18a5FXqt6BprKiFfN/2GTYp5WOBncxYHSF66D9ALkgGXGA+BA4?= =?us-ascii?Q?9iR39CZTrvQ2LyM4vORKK8xjj3y1x+DySwh2W9iSnWQIzrchejs9IXUdb05+?= =?us-ascii?Q?ttYrg7K6zSWPjg+UN+klDOrsuTBV2gnUILVMSwFd/8wVzkskGJv4KGg8L3tU?= =?us-ascii?Q?E4YG7yI2pSwE+lzqFaFMrMDAUUEzGnvyszmCFSvDSoMOAUBVgt6pkAKXiA/k?= =?us-ascii?Q?x34Ko20UjN6i9b40L0LvmsSo17ZpQn7e49+zeVV5Le0bimXzNihpzF0XJEH3?= =?us-ascii?Q?exc3o53Nn4sfqju9CSd0555tnO6rkGHFI1yfyAc1ztK0ee0oJUl/nxV5D5jr?= =?us-ascii?Q?/Vv3iZrqZdCoub34JakRTFuc7D4FHeFoAMtimmVCF7oXQ=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3b964fc-a5a1-48c3-ee6e-08d4c9e4f660 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR0301MB0598; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0598;3:TjzzBgfcfAOwYvCbTEOFr3BKKyiPABZPli838IcxH4Jb4woWES4TDf7M52g2rc61e2oGxOH9D4Xkm9WAau37J83DRbganVb3tWaLt+qNS+Qg1BiphcR77fboNdvBpRmwguWKFMUEHvCaADjDepCviSkWN1KCUtqXb5/HhpKZeke2ShnX9l9AFYnVdc6nSc9jsB2gysQyZyPrRDxD7iCdfGWgeSAGmnb/Sbvj4xvIqT+kldSJ/9/lbfmQLo/ArNXx+aIjd0YlUb1zj5R7PbS2vNnXJfLxGf1dynfJBUfBmbh0qj7cz8GcQfedro3dEDZSFo7l4J0Ckr1Yyv+LfLYcdCT6LGJDkC5Qln/2R9tAgN2vJqjhLwMZElond/tUlpb3DVbKLP8uQhp8bE5ZZa7F5+pubdbBB/7DJOKbE4/X7O8P2NiV5y4eZ4M8JAEzECwrV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VubV+MzfY/efy+Hjgg6uAa8/7vKFxHwHJ8PKslmlMMklOEzmzW0XyATvNNv5DqVRhvYRrTNQ== X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(133145235818549)(22074186197030)(236129657087228)(185117386973197)(48057245064654)(148574349560750); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(2017060910075)(5005006)(13016025)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123561025)(20161123559100)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR0301MB0598;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR0301MB0598; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR0301MB0598;4:DUUK14n3LfRaumGRVkE5pTPJSnySx4qC7rv6kr2T?= =?us-ascii?Q?129Qi+jyoO23gtgF/H/PdCFkkiDI4SbrJyrkdMZdXzkYNb2X2I/OW63z0mwI?= =?us-ascii?Q?+faJLBg6/XB/NhLVX/DjigTnK8PQE78pIUejP3PSiv1cHxCZ2nCwYtVUDVr1?= =?us-ascii?Q?I+FggLVafivzz6yOSmxjoQC/K8QdTOC2rx4KV5nmqZcFtDerSnelx1l6evZ5?= =?us-ascii?Q?YiE3VO01y7xrpcnPqm+6E42AP+guUNbMsJb6OyMbOIsC3T96ahfO0PTSX5mL?= =?us-ascii?Q?QWTXj7Oqy/hhpNdYByel1Dx642FAqWHiNIaztwSMpQ+nZwlxHhfuxIymD8dJ?= =?us-ascii?Q?re/vpsjbH6uVFYttglU1Q86Ni8qfbeWQRnqfHE5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pIUBLY7qj+n1tI1636QZejmN53hxiHTIITL4h++xd?= =?us-ascii?Q?w4c5UCdghLGZD10Uof7LC6m03ZYG9mRTipoYcXQI5lvUdTUkjjQEBH5h2zFH?= =?us-ascii?Q?2OnpdcTKGndzBdtugqRamAxN3/paPcePNJOVnh/4kyjpFsC2TK+hA47KHQhR?= =?us-ascii?Q?LcW0wRqUvK0NXcMkQvRqFW8WbghQLiLmzX+7cFqqrtrCRILgfs1odqEeQaqY?= =?us-ascii?Q?bIBrurBt2EcUbEU9wrxXJp+ULwrSfJIZy3t3wjjLs1lTp5999nlaj9kxtrYv?= =?us-ascii?Q?onERozWZD1A+PNeZgFYWQGEAYSm8JOshwQALPSUqpBkSZxcb314w+19k7Ovq?= =?us-ascii?Q?EY9QwwvOd6NSdB/49qmNNKMf0gQrZLV3qaE8b1RKTA2LcslrT8Xxn7yGJDHO?= =?us-ascii?Q?VHn6SldhtT2wuQ9DLLSKmobiiu5PF5K8hqU9FQgHjTgkdYrelWP5OiJcxtQ0?= =?us-ascii?Q?LaHCapqgtwTGlSAdXDOtFZ6EO1RhB5TpxAzfvDhyzLVThYtED11YWhND6edW?= =?us-ascii?Q?F/hN8EM1NxTlF544zKDyGnRzYsIKG4vgZ9JR4FaWlwU9sRz4eMleRicDj0Fu?= =?us-ascii?Q?3XZPbsrbG4AMsgeE6Udw+jjQFOzAfQZIjsYEwZHyG85LBOrwByvedaq5l2NF?= =?us-ascii?Q?v7klBK5p8VY3KC+eSOlCoasmsMBpEaIuAyE47jsIknswr5t3OrZ//V3cOAGl?= =?us-ascii?Q?so1pj6hOCEODX/7Jj/2AhiRd7YuJnf4Lk0pf5UlGy3yDk2DBDVSgiWXdtHmu?= =?us-ascii?Q?gSeO50SjkNsX0Cfg9OAtGb3d5o6+B8on++p/ZteUSdtRZRCk+uThZ0qnp2Jw?= =?us-ascii?Q?dNtN2hgwZuWEeDum8GBsqAvD6E58eLTfHrN8r45hKX/oTJvkG?= X-Microsoft-Exchange-Diagnostics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GorOd+fkPzWeGlsLWiLQVPUCS539/TIa?= =?us-ascii?Q?MhWI86JloAz3ECifnDmKQqd8s+iU1cONaSNkDnpDvdfla0HNFSUuzZWnZaxk?= =?us-ascii?Q?JsQrKLmxQGSujC4SSDV36i1IcjtiUxVcaDIGZQ1EAg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0598;5:wZglGXk5pgLJ2YOCzPdJ0GzPNebjYP28Hr4Vh0ta5ZG482ZE7WkFsHa+g3Td6sh0wsDtOCbPw1a8QhueRgwyKUAahD+e4r5vV86Awo6tojCn8qH/MsjNqAXjdXCG2S3Ni+ksVWA6kkDVMQKpCJYC+V8cQADT1+OaxAtOEqKB6cbpmex+PABc59e/tgzNcJ50w7j39lxAIV0LdP1441lIzm7tqwgNMtPv0a6mCHSATDFhH7HgrCSo2nUQd95oX+PdMfzt7RspuAc5VQfiZaB1iyMKoNSdjIAQBcFIkwO8FBFryRsleCT0tpliNwqAlg1/kOrAM3woRNjhDMYomn2qghKjKDral4gXMZpxxTEmFaWx/JcEjMI8CRaW3wSyrfeFDnEWmJ24vBpN9cXjrl5oWBXKEqM1zl4CY3luiB1FKMOzVxcmVduiTvF77buMQpHGyTKxwMQVlQaNRcFcSmG0JVNcBAxKtlcArtJpIciTTKkPybEDgxrOuNmrfwbidf0Cj/LTdKjzCfNW5STsF7shDg==;24:kQweFlfhjSpSaRjntutOd782JStSLE7PQjtWi+KwfEMSmD6Ye80E6EvrcrFHRMQSOh/CRfMr26ilLrXUiuHRVbu7obodPZDUd+DmRFHsgJI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0598;7:hkGrhkhgZJdNGivFxL/JxcahivPyupmsS4vK6EJWVPa1kIPsSxSumEVqoaHJ5v6IJBT7JTnIWXIL+tPdF15K2FaqbcquR/N5dwm1Dhdq09qYldgrKDI0I6NUSp5Xe5/qvs6aPrlPjXdcBAS2TmSOQV6/+kXg+UK1PwDCZ1VVcJ871/eimYt8SFr+wOVZSOqbRkWQX7kjRaTDKFkZWSwNDLxSBBJcG/PN5KQAUThXBT3ivrrmephtaWJ1GkGFLrQ3MbwEhC0w6c8wj1+7QUvjHLQtZfsRcwY3pJu3m7D+AEPRo6jJggxhoONocCyzLUq6bkZ5Sey96nBGTyvDoISCbhcEKcGU6xOzZH0gqOXL9BB7/MaDPZ6AxVgdrxZeJf53Zwva17SLUkv+quCl0PwWXwaI9WOJzSapi1yq4EOICX2d6+r/WAVKvl0coZF2Tnsivf+BT7JbpKbvZ/Oa14NgL3FU8qS5LADOKdFHPQft19m867kLKIjD5kZlN7kHw9nOiZa2ThWuuo14nzVimafms0ASXQ8PAO4/Pr6Yv/5fnJB8eEIEFIMg/M7Ux8RWtNXb8uTQ/K9I+Qm9Wcg9kQx05zX57Nq4GKrS1sAbJtwhZlTlM9r8Nls8WRYBs0V97ug404d7hOOcO0njLFBUNFBn6XdaWYC7Boft4ouVPUdPERfjoNoXFydMlOAJDPHUYEWDe6qekU7y2S5iL4c+FKt0nN2vrKvCCTdTPEbnI7tlAJFwc0lZjvHDDTp5TH39MXu4mScHiwJJqW8aAMiQvuZl/ZnmVWFwVVruZqNSVAJKaH0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 11:47:38.7796 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0598 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6564 Lines: 269 The pfdv2 is designed for PLL Fractional Divide (PFD) observed in System Clock Generation (SCG) module in IMX ULP SoC series. e.g. i.MX7ULP. NOTE pfdv2 can only be operated when clk is gated. Cc: Stephen Boyd Cc: Michael Turquette Cc: Shawn Guo Cc: Anson Huang Cc: Bai Ping Signed-off-by: Dong Aisheng --- ChangeLog: v1->v2: * change to readl_poll_timeout * add pfd lock to protect share reg access between rate and enable/disable operations and multiple pfd instances. * use clk_hw_register --- drivers/clk/imx/Makefile | 3 +- drivers/clk/imx/clk-pfdv2.c | 207 ++++++++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 3 + 3 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/imx/clk-pfdv2.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 1e308e2..ea4ef27 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -11,7 +11,8 @@ obj-y += \ clk-pllv2.o \ clk-pllv3.o \ clk-pllv4.o \ - clk-pfd.o + clk-pfd.o \ + clk-pfdv2.o obj-$(CONFIG_SOC_IMX1) += clk-imx1.o obj-$(CONFIG_SOC_IMX21) += clk-imx21.o diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c new file mode 100644 index 0000000..5421bdf --- /dev/null +++ b/drivers/clk/imx/clk-pfdv2.c @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP + * + * Author: Dong Aisheng + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +#include +#include +#include +#include + +/** + * struct clk_pfdv2 - IMX PFD clock + * @clk_hw: clock source + * @reg: PFD register address + * @gate_bit: Gate bit offset + * @vld_bit: Valid bit offset + * @frac_off: PLL Fractional Divider offset + */ + +struct clk_pfdv2 { + struct clk_hw hw; + void __iomem *reg; + u8 gate_bit; + u8 vld_bit; + u8 frac_off; +}; + +#define to_clk_pfdv2(_hw) container_of(_hw, struct clk_pfdv2, hw) + +#define CLK_PFDV2_FRAC_MASK 0x3f + +#define LOCK_TIMEOUT_US USEC_PER_MSEC + +static DEFINE_SPINLOCK(pfd_lock); + +static int clk_pfdv2_wait(struct clk_pfdv2 *pfd) +{ + u32 val; + + return readl_poll_timeout(pfd->reg, val, val & pfd->vld_bit, + 0, LOCK_TIMEOUT_US); +} + +static int clk_pfdv2_enable(struct clk_hw *hw) +{ + struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); + unsigned long flags; + u32 val; + + spin_lock_irqsave(&pfd_lock, flags); + val = readl_relaxed(pfd->reg); + val &= ~pfd->gate_bit; + writel_relaxed(val, pfd->reg); + spin_unlock_irqrestore(&pfd_lock, flags); + + return clk_pfdv2_wait(pfd); +} + +static void clk_pfdv2_disable(struct clk_hw *hw) +{ + struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); + unsigned long flags; + u32 val; + + spin_lock_irqsave(&pfd_lock, flags); + val = readl_relaxed(pfd->reg); + val |= pfd->gate_bit; + writel_relaxed(val, pfd->reg); + spin_unlock_irqrestore(&pfd_lock, flags); +} + +static unsigned long clk_pfdv2_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); + u64 tmp = parent_rate; + u8 frac; + + frac = (readl_relaxed(pfd->reg) >> pfd->frac_off) + & CLK_PFDV2_FRAC_MASK; + + if (!frac) { + pr_debug("clk_pfdv2: %s invalid pfd frac value 0\n", + clk_hw_get_name(hw)); + return 0; + } + + tmp *= 18; + do_div(tmp, frac); + + return tmp; +} + +static long clk_pfdv2_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + u64 tmp = *prate; + u8 frac; + + tmp = tmp * 18 + rate / 2; + do_div(tmp, rate); + frac = tmp; + + if (frac < 12) + frac = 12; + else if (frac > 35) + frac = 35; + + tmp = *prate; + tmp *= 18; + do_div(tmp, frac); + + return tmp; +} + +static int clk_pfdv2_is_enabled(struct clk_hw *hw) +{ + struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); + + if (readl_relaxed(pfd->reg) & pfd->gate_bit) + return 0; + + return 1; +} + +static int clk_pfdv2_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); + unsigned long flags; + u64 tmp = parent_rate; + u32 val; + u8 frac; + + tmp = tmp * 18 + rate / 2; + do_div(tmp, rate); + frac = tmp; + if (frac < 12) + frac = 12; + else if (frac > 35) + frac = 35; + + spin_lock_irqsave(&pfd_lock, flags); + val = readl_relaxed(pfd->reg); + val &= ~(CLK_PFDV2_FRAC_MASK << pfd->frac_off); + val |= frac << pfd->frac_off; + writel_relaxed(val, pfd->reg); + spin_unlock_irqrestore(&pfd_lock, flags); + + return 0; +} + +static const struct clk_ops clk_pfdv2_ops = { + .enable = clk_pfdv2_enable, + .disable = clk_pfdv2_disable, + .recalc_rate = clk_pfdv2_recalc_rate, + .round_rate = clk_pfdv2_round_rate, + .set_rate = clk_pfdv2_set_rate, + .is_enabled = clk_pfdv2_is_enabled, +}; + +struct clk_hw *imx_clk_pfdv2(const char *name, const char *parent_name, + void __iomem *reg, u8 idx) +{ + struct clk_init_data init; + struct clk_pfdv2 *pfd; + struct clk_hw *hw; + int ret; + + WARN_ON(idx > 3); + + pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); + if (!pfd) + return ERR_PTR(-ENOMEM); + + pfd->reg = reg; + pfd->gate_bit = 1 << ((idx + 1) * 8 - 1); + pfd->vld_bit = pfd->gate_bit - 1; + pfd->frac_off = idx * 8; + + init.name = name; + init.ops = &clk_pfdv2_ops; + init.parent_names = &parent_name; + init.num_parents = 1; + init.flags = CLK_SET_RATE_GATE; + + pfd->hw.init = &init; + + hw = &pfd->hw; + ret = clk_hw_register(NULL, hw); + if (ret) { + kfree(pfd); + hw = ERR_PTR(ret); + } + + return hw; +} diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 132c89f..cf3ea92 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -59,6 +59,9 @@ struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, struct clk *imx_clk_pfd(const char *name, const char *parent_name, void __iomem *reg, u8 idx); +struct clk_hw *imx_clk_pfdv2(const char *name, const char *parent_name, + void __iomem *reg, u8 idx); + struct clk *imx_clk_busy_divider(const char *name, const char *parent_name, void __iomem *reg, u8 shift, u8 width, void __iomem *busy_reg, u8 busy_shift); -- 2.7.4