From patchwork Mon May 15 13:59:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9727047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EEF1760380 for ; Mon, 15 May 2017 14:00:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF14528935 for ; Mon, 15 May 2017 14:00:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D39EF28984; Mon, 15 May 2017 14:00:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEE302898C for ; Mon, 15 May 2017 14:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dfUL3TcFreB8Cb2CmsK/smXl8jpUd15Gg86cd3DcpRc=; b=WqC9SEY3yGB6aA Ff/SNVBd+Gs3c9ZEzuahPEx+CwP9qAMLCInYFijwumhyxg8y7vd7Vhhmr1tRsGGLZH+BSiJ1zIP0g GvhA7q+6Wuf50/Srca7dFMbr19jXMv+/tQY/l3gk7E3zmsmsXD1XSA2RieAstOEsOC0CM7XpzfqAw 85e2i7+XdAEBY/FNOALSCkV+gHSE7PftYTFuNKx7RmhfpwtxpArIPH72P3BmDU/bmkDYx+HYL1cId sxTtI4O7S4le9Vpe2vas2/q8Q1ixf1BoVq2TtBkH65eQU6jCeVua+Xm4f3BXdasBuWqBQXhhgZcWJ sjHc9aO3x+kFSC+M7ysg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dAGYN-0007ur-Vp; Mon, 15 May 2017 14:00:52 +0000 Received: from mail-by2nam03on0050.outbound.protection.outlook.com ([104.47.42.50] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dAGXR-0005Nx-Ub for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2017 14:00:03 +0000 Received: from DM5PR03CA0014.namprd03.prod.outlook.com (10.175.104.24) by BLUPR03MB168.namprd03.prod.outlook.com (10.255.212.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Mon, 15 May 2017 13:59:31 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::174) by DM5PR03CA0014.outlook.office365.com (2603:10b6:3:118::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Mon, 15 May 2017 13:59:32 +0000 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; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Mon, 15 May 2017 13:59:31 +0000 Received: from b29396-OptiPlex-7040.ap.freescale.net (b29396-OptiPlex-7040.ap.freescale.net [10.192.242.182]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4FDxEqk015180; Mon, 15 May 2017 06:59:28 -0700 From: Dong Aisheng To: Subject: [PATCH 4/9] clk: imx: add pllv4 support Date: Mon, 15 May 2017 21:59:18 +0800 Message-ID: <1494856763-6543-5-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494856763-6543-1-git-send-email-aisheng.dong@nxp.com> References: <1494856763-6543-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131393303718151977; (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)(39400400002)(39450400003)(39380400002)(39860400002)(39840400002)(39410400002)(39850400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(48376002)(5003940100001)(50466002)(50226002)(6916009)(2950100002)(36756003)(6666003)(8676002)(8936002)(38730400002)(110136004)(81166006)(85426001)(966004)(53936002)(54906002)(6306002)(498600001)(8656002)(86362001)(305945005)(77096006)(68736007)(4326008)(2906002)(47776003)(5660300001)(105606002)(33646002)(356003)(106466001)(2351001)(189998001)(50986999)(76176999)(104016004)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB168; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD018; 1:9KGmpQn6DCEOu23zXRO+omayxef5SHx782wb4USQBVZAYdX+07+32HybzpdUX3FR7vdB3BBMw7I5uzfVZCeDpLfjYWuq7CcvqYnpj39HOWD5IkEvrmsXIX73L2YWZ4NQE1FbAOM6/FJCS43MIAgYEbC6JIAL4ubz5LcP/IWMLNIpBSIDV3hHpJKoy1igpdQaAntDsrVJaXK5+BiXewhuQTr1ZqBkg092nbTedREopgCIA4wgEaROttazqFulbGtn8jAzIXRpNUlbGEPWgOhSSv/6m0/gdzcgUPvqzgwePVDGmF1r8hXMAeoUp4tFnq7V7JGcLBn0kEQT7S/TDnMDJGF0M9uWrxiuCDaENeZMb6BGpM1vmenw4NH3X+E5mawu9Dv9Y50alHnaXpHrSGuUnBbqXZTmy5F/6+7ChRPMCc/FYctrTnxzGyhktDztVsisMaqo8hSjKiZOhwU7bLtVpiKj+pJ+9qikQXUpAvAZDCTzcqjLIHujZXIpR0n5iuJPH0TWgKwXMlOfb6jq6HMmB49qJxtv3gJZeS4VCecCWSjyu7fp0gMcCvEEbcwp7DYeCugR0O2fDuhumBUSkX4Yx1ti5HV0EWC/eFMGlKtmg5iDMQLjAD5Xi04jbWH6xo9HDfYgBxYfS4/CvGQfRmp2SrsQrmGKctS/ewudPXb7EQQpSRDtCH+8xEZW3Au5oow4b0xDh/SQliqCaH2rs3VhR5yX5jwCnxNOhtpWi9st27I= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d313caaf-042f-4a96-4729-08d49b9a9c73 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BLUPR03MB168; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB168; 3:IcHD1o5Tn1/2Y5o9KzjKTutAJWFhk9n4sdB544cIYOjAPhlKnYIMkkJTOkdRualMMzEb1XwmOq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WqCSU0PjeOYJWOJ2s+ssuZi6RZQGF/3zizMElDJfVihlp+EOb91S91+UMcYsqlioR3M4INQDpH07eb4VPMfkUw6g90A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13023025)(13024025)(13018025)(13015025)(5005006)(8121501046)(13017025)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123559100)(20161123563025); SRVR:BLUPR03MB168; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB168; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB168; 4:7m4fYh2ChtwpvzwspHk1madDAQDkP99ZlEcE6FzLYOO?= =?us-ascii?Q?Wlc7Ieb+WqjfdoX2p3d83TlwiJ6aflkCFCtr99c9HGq70hRV7BdkUW/6JfDy?= =?us-ascii?Q?e18zrAUQNM6vLbkLdZpBc5c+UhzECCArD/GiftUn/SRWRjlIPeIP4Afn84gR?= =?us-ascii?Q?esao0LKQJqOrQpw3IBQANnTGNF4LrGtlrN5+mxVxT7F42CSgRMW0YYhy5SSR?= =?us-ascii?Q?pUbmHD3+5du0zrUFzEdHf7y1++Qqzc3hPHunzdP2FoM5kC9tlUL8k2OdvoqQ?= =?us-ascii?Q?9dpINgu6VDJrPS8IxHct9xl8u7uLgTxVJ3KzEi7xciIOPxTDeJ73mMr211h+?= =?us-ascii?Q?HPjDwxQGOhI4S5UgUcYiE7igV/d90+1ajwNBlv5Mut9UbLQ7Om1EU8+gmhOj?= =?us-ascii?Q?Nbn3+tLEhLwNmf3WJuICR/qkbD53Ejd+tVnFkAK0X+TszKGoJbh1Zk2aiuPB?= =?us-ascii?Q?iLXcsOt1QWfLJtQoDnEq+bgwx6BsQMUYMphfN55QcvQJ7uhec6llQhrXUaQW?= =?us-ascii?Q?kEdu66YDJN1oHXHbevM2nTxTnbL1iZU0HFZy1Y1dKUz0ydpu+BMKHICu+zEm?= =?us-ascii?Q?LYilW9pVtoZmbpQMjFwWV4C5cGrX21ubMi+lZShbMJjD7cJAIhItlhn5ZARk?= =?us-ascii?Q?NRUaF29b/fGzXRkpJPJI7MJFo3K6GnHyrHOmSfbyvoZcK3uqy1eL3EbBG6c2?= =?us-ascii?Q?6olI8VomnWEayzqmWXRU/Ktv6yFxrlsovam3GPLmgGLBL6fgq3jqLG0PF0+n?= =?us-ascii?Q?alyQ5SkdadSIsD5fALwaCiJTjLwCwLl0gZOBb0dynGrTf+8iIfQRAJTqDK+W?= =?us-ascii?Q?NyBQWlqyan7ZW0SqSsEpdy7lxHuorj8qxAeDol8Xpcasd/1Qrvyw5yUX8T03?= =?us-ascii?Q?IJ0gJHmt1hgSUIqN85ZMuxs8CEyNNNfGOz6eRm5gjqPzmAQmN7xC5808gTgr?= =?us-ascii?Q?hC6D76pEGDcvZx+KLvOXJFgC4QdbEzNnSqnIC/HKPeErSYjhk3llJTeVpPZw?= =?us-ascii?Q?h1K+5X+/uFhFjOgbZrQ3JsHIXn/at38Q49dk1UnCBVw=3D=3D?= X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB168; 23:etFIf2eKjB1O9Nf2oXFeyo0Tii6W4rIa7ChcoegPJV?= =?us-ascii?Q?X3rNb0vR5fOE7is+Gqe5hR3iSz3hGQzqBfcfVBLCgADn3AwI2LKKKPHQlHJQ?= =?us-ascii?Q?rbeGZpFAD3gb7pvcXVHaWKkxCV1zSWK1GKD+c4z4YBYpSFShf3HsmZzY/IDY?= =?us-ascii?Q?NoP/22eP6G0+mKR8G3ATNyGI1Q77qr1ITqwAs8HorDvB/gM5wlfilB72WG8g?= =?us-ascii?Q?ufnG+PCFejddIgkvIHoBHkjpk2Zb0ujsGS1hOevxY88KySD7Gbkq3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ZGV+TiqcRA3ou8ugzOHbNw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB168; 7:U2jNv2onX1M2ryOlPxSe0THNjz+nZ3TwW+pfGHtIBMx4Ke7l8QWT8g1kQ3dFLdmISFGDxZDpbpbn1bA4vm99dQfRuGvy985Wiwzl8G8PaT1cH3A1PnMIAYEj2w3b+vqDBuLPtFH7TI+aSxk6m7TcEOCBLLTidRNzzU/uJKsg6xE1Nv3ofzOxMpEptBbyHwRrLz30KFdDmzWdkZfMkr7yosMQTKzgyJkLJo7uZ/WxSKLodW5G1FhNPj/5FsRjf9VhLVBpHLRIZeMu/AMILawbZF9LYKed9Lp26aSBx9n6dnmG0IqaNAaquom5ueDP/4bUGYj3Bqq661CS8nbDvFckfQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2017 13:59:31.6435 (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: BLUPR03MB168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170515_065954_353356_1BF5BF7F X-CRM114-Status: GOOD ( 22.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , ping.bai@nxp.com, Anson.Huang@nxp.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, 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-Virus-Scanned: ClamAV using ClamSMTP pllv4 is designed for System Clock Generation (SCG) module observed in IMX ULP SoC series. e.g. i.MX7ULP. The SCG modules generates clock used to derive processor, system, peripheral bus and external memory interface clocks while this patch intends to support the PLL part. Cc: Stephen Boyd Cc: Michael Turquette Cc: Shawn Guo Cc: Anson Huang Cc: Bai Ping Signed-off-by: Dong Aisheng --- drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-pllv4.c | 196 ++++++++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 3 + 3 files changed, 200 insertions(+) create mode 100644 drivers/clk/imx/clk-pllv4.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 1ada68a..1e308e2 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -10,6 +10,7 @@ obj-y += \ clk-pllv1.o \ clk-pllv2.o \ clk-pllv3.o \ + clk-pllv4.o \ clk-pfd.o obj-$(CONFIG_SOC_IMX1) += clk-imx1.o diff --git a/drivers/clk/imx/clk-pllv4.c b/drivers/clk/imx/clk-pllv4.c new file mode 100644 index 0000000..502da64 --- /dev/null +++ b/drivers/clk/imx/clk-pllv4.c @@ -0,0 +1,196 @@ +/* + * 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 +#include + +/* PLL Control Status Register (xPLLCSR) */ +#define PLL_CSR_OFFSET 0x0 +#define PLL_VLD BIT(24) +#define PLL_EN BIT(0) + +/* PLL Configuration Register (xPLLCFG) */ +#define PLL_CFG_OFFSET 0x08 +#define BP_PLL_MULT 16 +#define BM_PLL_MULT (0x7f << 16) + +/* PLL Numerator Register (xPLLNUM) */ +#define PLL_NUM_OFFSET 0x10 + +/* PLL Denominator Register (xPLLDENOM) */ +#define PLL_DENOM_OFFSET 0x14 + +struct clk_pllv4 { + struct clk_hw hw; + void __iomem *base; +}; + +/* Valid PLL MULT Table */ +static const int pllv4_mult_table[] = {33, 27, 22, 20, 17, 16}; + +#define to_clk_pllv4(__hw) container_of(__hw, struct clk_pllv4, hw) + +static int clk_pllv4_wait_lock(struct clk_pllv4 *pll) +{ + unsigned long timeout = jiffies + msecs_to_jiffies(5); + + /* Wait for PLL to lock */ + do { + if (readl_relaxed(pll->base + PLL_CSR_OFFSET) & PLL_VLD) + break; + if (time_after(jiffies, timeout)) + break; + usleep_range(50, 500); + } while (1); + + return readl_relaxed(pll->base + PLL_CSR_OFFSET) & PLL_VLD ? + 0 : -ETIMEDOUT; +} + +static int clk_pllv4_is_enabled(struct clk_hw *hw) +{ + struct clk_pllv4 *pll = to_clk_pllv4(hw); + + if (readl_relaxed(pll->base) & PLL_EN) + return 1; + + return 0; +} + +static unsigned long clk_pllv4_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_pllv4 *pll = to_clk_pllv4(hw); + u32 div; + + div = (readl_relaxed(pll->base + PLL_CFG_OFFSET) + & BM_PLL_MULT) >> BP_PLL_MULT; + + return parent_rate * div; +} + +static long clk_pllv4_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + unsigned long parent_rate = *prate; + unsigned long round_rate, i; + + for (i = 0; i < ARRAY_SIZE(pllv4_mult_table); i++) { + round_rate = parent_rate * pllv4_mult_table[i]; + if (rate >= round_rate) + return round_rate; + } + + return round_rate; +} + +static bool clk_pllv4_is_valid_mult(unsigned int mult) +{ + int i; + + /* check if mult is in valid MULT table */ + for (i = 0; i < ARRAY_SIZE(pllv4_mult_table); i++) { + if (pllv4_mult_table[i] == mult) + return true; + } + + return false; +} + +static int clk_pllv4_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_pllv4 *pll = to_clk_pllv4(hw); + u32 val, mult; + + if (clk_pllv4_is_enabled(hw)) { + WARN(1, "clk_pllv4: can't change rate when pll is enabled"); + return -EINVAL; + } + + mult = rate / parent_rate; + + if (clk_pllv4_is_valid_mult(mult)) + return -EINVAL; + + val = readl_relaxed(pll->base + PLL_CFG_OFFSET); + val &= ~BM_PLL_MULT; + val |= mult << BP_PLL_MULT; + writel_relaxed(val, pll->base + PLL_CFG_OFFSET); + + return 0; +} + +static int clk_pllv4_enable(struct clk_hw *hw) +{ + u32 val; + struct clk_pllv4 *pll = to_clk_pllv4(hw); + + val = readl_relaxed(pll->base); + val |= PLL_EN; + writel_relaxed(val, pll->base); + + return clk_pllv4_wait_lock(pll); +} + +static void clk_pllv4_disable(struct clk_hw *hw) +{ + u32 val; + struct clk_pllv4 *pll = to_clk_pllv4(hw); + + val = readl_relaxed(pll->base); + val &= ~PLL_EN; + writel_relaxed(val, pll->base); +} + +static const struct clk_ops clk_pllv4_ops = { + .recalc_rate = clk_pllv4_recalc_rate, + .round_rate = clk_pllv4_round_rate, + .set_rate = clk_pllv4_set_rate, + .enable = clk_pllv4_enable, + .disable = clk_pllv4_disable, + .is_enabled = clk_pllv4_is_enabled, +}; + +struct clk *imx_clk_pllv4(const char *name, const char *parent_name, + void __iomem *base) +{ + struct clk_pllv4 *pll; + struct clk *clk; + struct clk_init_data init; + + pll = kzalloc(sizeof(*pll), GFP_KERNEL); + if (!pll) + return ERR_PTR(-ENOMEM); + + pll->base = base; + + init.name = name; + init.ops = &clk_pllv4_ops; + init.parent_names = &parent_name; + init.num_parents = 1; + init.flags = CLK_SET_RATE_GATE; + + pll->hw.init = &init; + + clk = clk_register(NULL, &pll->hw); + if (IS_ERR(clk)) + kfree(pll); + + return clk; +} diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index e1f5e42..f599732 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -40,6 +40,9 @@ enum imx_pllv3_type { struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, const char *parent_name, void __iomem *base, u32 div_mask); +struct clk *imx_clk_pllv4(const char *name, const char *parent_name, + void __iomem *base); + struct clk *clk_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 cgr_val,