From patchwork Fri May 19 13:49:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9737337 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 36B2E6020B for ; Fri, 19 May 2017 14:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3474E2888B for ; Fri, 19 May 2017 14:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2705928922; Fri, 19 May 2017 14:02:11 +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 5DB532888B for ; Fri, 19 May 2017 14:02:09 +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=NqdRoDrfPAfwzGx0cNTsmWfLIgrYYjC4bjpi4+aFYOA=; b=EX3hwzFDCZa2uq aQTHagTcgh8bBUmv5Dk9TrIef0JYmeN9x+hmM98Eok0iMCeVaYMG8JQ8JxctZ7Z+vSey1HHgvtmhd +X+sdBPp+VBAvJVWFCouLwObd8hntWF1/raIVyMeOAXms932DrIhg8i6Ir1YKA6YZWIvjH1ro5KKm iVSDw1MnU10Uxi+KvN/SPzysl3zf097c1Ce3gTaLM4OyF9htsYc8u6garFUmMVIWAxSdiKmBfWprB s09pxtKzTnd1RG/NZbWI+uiT6QD5kZD2+iIrNtLeflqObTxVQ+l5Q6xXT2/DbE/35NY9DlrD6KFx8 qBwYGMrabi73iMSNqflQ==; 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 1dBiTp-0004tY-0x; Fri, 19 May 2017 14:02:09 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBiIL-0007nc-UC for linux-arm-kernel@bombadil.infradead.org; Fri, 19 May 2017 13:50:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uwWJ1aKLi30way/ebdZV76XyjNTZsZAdON9caXpGiAo=; b=3FoNUMqexRvRNCP6KOIj9XgFH ttkYUPTDfTA0Sx6pRQapMHAaM+FfVa0jBJrHNEoPzoU6UflarTj9Tg6dGcJlLk30er6W/JhxiBFlz Nw8rEHu82G82kiWcsB7fIyzQLVDG31zk8Wp63oDR1zUI6uRE+rZtBVNPbVQvP9/IaqFWb3lK41dsP 0QoWZxAJP3Cnn2W48sDvjn7Ql7SVtUW7HvB5cIyBHUC/7IbVc6rrSrL4hOHFJkt+bEc0hkL42qleY lE0ZuRYa+jXvHx09CddPENJUc2WerNEX/V2hyXsyMoqbyAAq4k0MHnO892zXxZhemfCzhyy614DoQ fydcs837Q==; Received: from mail-by2nam03on0077.outbound.protection.outlook.com ([104.47.42.77] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBiIH-0004E9-J9 for linux-arm-kernel@lists.infradead.org; Fri, 19 May 2017 13:50:17 +0000 Received: from DM2PR03CA0003.namprd03.prod.outlook.com (10.141.96.13) by DM2PR0301MB0911.namprd03.prod.outlook.com (10.160.217.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Fri, 19 May 2017 13:49:26 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:122) by DM2PR03CA0003.outlook.office365.com (2a01:111:e400:2428::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Fri, 19 May 2017 13:49:26 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; arm.linux.org.uk; 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 BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Fri, 19 May 2017 13:49:24 +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 v4JDmtEP032293; Fri, 19 May 2017 06:49:18 -0700 From: Dong Aisheng To: Subject: [PATCH V3 3/3] cpufreq: imx6q: refine clk operations Date: Fri, 19 May 2017 21:49:06 +0800 Message-ID: <1495201746-31841-4-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495201746-31841-1-git-send-email-aisheng.dong@nxp.com> References: <1495201746-31841-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131396753649217254; (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)(39450400003)(39410400002)(39380400002)(39850400002)(39400400002)(39860400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(54534003)(199003)(9170700003)(47776003)(81166006)(356003)(305945005)(104016004)(85426001)(36756003)(86362001)(8676002)(189998001)(5660300001)(6916009)(2950100002)(6666003)(7416002)(53936002)(38730400002)(106466001)(39060400002)(8656002)(4326008)(105606002)(110136004)(5003940100001)(50986999)(77096006)(76176999)(48376002)(50466002)(8936002)(2906002)(2351001)(33646002)(498600001)(50226002)(54906002)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0911; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD017; 1:1G2RBqaYHVTGUrtCTzLDo6Dp4ZQz+foOby4Nza609SlLPE+xrQMKrXR6g1Ra+JJkSWOQsPM3byyALTDGDlZWvAGGLPysA4M9B2WnGw6vL/sl9aq5271L3oAfUuCMBYxk+gnM4DwWAaLqWRDubn3C0b8AF4lpQe+FuAVDGdR80T53KrowgAPN69LZFYXlCDi7d8CNJmBWOuYXlRqWKazs/STiSewg9mRN2O84GPozGipgpojWeN1z3ktR7IW0Hc/pk3APn1Ow/00WE51+BOA23R81/burYoxYEc+Ye6L/kDRq2x1xO+AZz/vLxmtV7ACtQ7yCk3RO8l/gqOsGfqt2KwsWiPm3lW54u6BnM8oIXwww4jEh8g7hT+h/4erB/WchieJUsdj2Bq0SFDGZfW8YKwkgPbAOB4Gl4JYy5LzlqMJDOdM7xl71CfiGPV9bl7sA1bi8O79kr7SoHO2bUEss9OjvOrCwLkJ6m+kYxX7Xy7vs5X9P5zYl49DetH6CXSwEhKvUEqbFqZlO8b9ukP6OOHOfcJiFyJkGS2244/kMNLRwp1kN3FTv0p5S29O8spHWako3iZMFv3A8W4J8aX6MGsIRVrgJ1hFiUVL0XJ4xd7G00PRMcNToewlRv+oR4PUO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0301MB0911: X-MS-Office365-Filtering-Correlation-Id: 20599613-8880-4758-a3fe-08d49ebddc4a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:DM2PR0301MB0911; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0911; 3:FaJZ7YUzEmY29T91qUbOgxHQ1OJr8qJcPSMhZSlMM7jwQD7aRvAUcdGvfOSKScPWcuta9rPdR/LG8mVNNmHXrePBM5kYcK5gTCjxro63oXPGNLNAysotOGSsliOnooYEvTiFoyBbv2SMrkwJG93b2Du2vKs8D6qmwzr5Qortkv6s4jEpR0b8QkDVkU5UP3vIYrD0F3i7c96dtMwGUbZg2BTbmyGNkWfpgW5RqUW3BdH3WNiT8JM5T7xs4X/W+ptpl+FMLvL5sqAy4NrmZopSNflbIqZND3gXiilpIIwAoJdvOEu1TQflI+gIze9pBxfTMKeBDO5octN7hk3H4kB5+ot+Funr77fhMYLK3d0w5pabIDINsB1neo/ZBmBFv/7AAzkdpx2mQSCmHCLUdc6jJ3SivsSD9ToVH1eGVo7LeTluZg/SJqqleX9S57t57rSa; 25:ptyEcyva6wJMwk9iWXGyUwLs4v2Pa2MXbedlxOAWd6fISodG0V226xFHVUKsiJ+m4a6aTxZbIDeTyw8k5XG6WR8UkFRguFoKSFid8UPHuFRSqpGn2bY0JZsjlboml0u7DEvCn6aaRtbuaksexQ8GwKTD0/dXxDPw6ycIXo0GYmOt+YNm9kg1wWGt4KIDRmHE/yezAFZDFi+A36zkNoM/Id7jfmSs39gM5h1GybDWGm7NCL0D0KeBQI71FrvIoIhGx4MePT1E3dci7/F2TT92kWggq1BMT8+DAo6EcQPtSuBSrCT6E8g2wVTQDHUxpsEBygvnU7J3Yb+C5FM+KeWgWRBx48GBlX+WBd4zsTf8gKcvaLyn17+gsxmCog0X443tYvTjwvQCiY/Nn8qOq5pX7SF1INmqKrQggttGye4Lyw5C+0gN6WkmaWK+4Qcz3KvT5qHweCQ9UAuzVQd1Rnk6O2drjwc9KElB5D1E4BsEvHA= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0911; 31:A/iuMp2CzaZwcwlX3cFHKQuDSUXcYPnWUTw/hrI6upbtZBa6LYZTw4WEJCQVuRyOFolX88Pu3OT3ED/3043c2PJGPUK9ZgUluI48BE77pVumlmblld4gZvqYulVhgN+UlJVZPmI+vZmcMltMhqFtvREgyo/SvRAM89EDt7XMNeLXZeHirLq6dx3YCGZxa25YVyrfL7TIbnN1XsKuKGy0k4h7QSzZDxjkipVY6gDqBNj8KgI82K+KiCdE9HZthHBwF/DBmJLKQ5qDKcalQ2rAhA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13023025)(8121501046)(13018025)(13024025)(5005006)(13017025)(13015025)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123561025)(20161123556025)(20161123563025); SRVR:DM2PR0301MB0911; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0911; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0911; 4:qU4PU7dHKXsRPV76wEDown4qs4Fq+XsqsBot4uGs?= =?us-ascii?Q?ipqGAdSWjVbeoq5MzONVJpOIcu/Nd37BhimPhuN1FG4zK87gWbZ6GwNhkLYz?= =?us-ascii?Q?cV0jkkSDDpdUBAHiX+dO5E2eTpfWQQl4hKi3mSvMfg8WU0s5ILVbGEhad3bD?= =?us-ascii?Q?0HAua2GLNsgS0+Mp6/xdl964vtxHJaxP4M6le0ji8fJo3rrOrIqjOrGk5Ehj?= =?us-ascii?Q?OvHLabdA+lyGZG2NG9/ESJBMUdt4jNGRbJjwBynwx+f8v4kj4SDgb239rjQr?= =?us-ascii?Q?/UMixOCMCvJUyJ6o0rlk6JNCUVI9ynglBZpUHZQp9MoWJsfvk3jtOf2Egd7f?= =?us-ascii?Q?DtzuMTeFDCLsDH2iEolzO437yozy1vm/CjQiMfP6DvrFbZwgD53Ul0xjknF0?= =?us-ascii?Q?L+cRTAMpyi/1bte2Cmw85eyTz/ZOnLV5YjInJ/r4CrUpqTcMFzRiShLhWqE+?= =?us-ascii?Q?smv1CjIF9+Ysn4chlxqv0n7ZYDCMUCPzcQ4FtwSpb8XJDy+F1WpOeiNg3doC?= =?us-ascii?Q?wlBzW7tzGy2v56a7MhPt1BPZLNLzdFo8CDBfFliieoqEFgmq7o7QMIOZJLwW?= =?us-ascii?Q?tbxPbdYW3zNZwBidMiEanOvHxz4Y2JPmY7ZPaBrFh7UPzD+OSra/K6VxyidY?= =?us-ascii?Q?eGaJMIQNDRQ+RazkHDJJ6fKggh7jj9WyQKUaSh9MRfvd9n/XQch+YGrBMshW?= =?us-ascii?Q?XuiKIqX+bryFp1Sbiany+9ZMnbFz4ulJUKNGvU8d3sY9ioeGMzXplxNSDCfs?= =?us-ascii?Q?TLnkMh9v4W3cgAmPB1VZMVv9TAAqHbVG3RnriuKL3wh0wV6mEOSAG8Q22SCe?= =?us-ascii?Q?DAfiIjN4BoENi7md+JUtO4YcDL+y73ndFh6uo81jDz8Rov6Vc/o32gapV8JE?= =?us-ascii?Q?aSjD81J10f6bfgMunm5GUwtNG0aOV6g81uHLPkG6UxlAxNS6CULOPdAdF+a4?= =?us-ascii?Q?0j9yW91N7dOd1fTMpIC/AnBt9kQzVAFpt97Ltmsupw=3D=3D?= X-Forefront-PRVS: 031257FE13 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0911; 23:J6po7OdPP0E9SbOPc7majSDF+mlxAthgPpM1nQJ?= =?us-ascii?Q?+yLoq8/Ok4lQqQyQUgzs2CKbcSwbDAVkK8aTxO4gMnXa9uGwq04QXPdDoqgf?= =?us-ascii?Q?wLSJo0T7qN8XJxnMPC0XEZuxrIpKc/yUlGiO7sl6rAxfkGsIlYsD3eLymNED?= =?us-ascii?Q?C3j6iSWAPdE2rk1n3Kkk9f0rnYpb9McV3dGY6bAdUZFpJ1jisOR3LtPRJeaf?= =?us-ascii?Q?tf0BAFTA8B9nEFd31O4M5oBPiyi5yweGc+rBknIHIkpmSIbcIWfdWuJ117GT?= =?us-ascii?Q?9rh5MW17g3POQM5p8m0UYdOwkGBIAvXeyGj5ETPLW1gwZlP8OYiDHGcR+sxj?= =?us-ascii?Q?trzK+QJba2jrknYVlIKnFe1e4bOjjVbK1xQ9kzhkTfdt8tdt6P2rzKGQKQtv?= =?us-ascii?Q?GizL9+HkmLNZPPNVqItsmGQ5ceplFtc7TiQxJNIyUtOcXxtURlO6EWuAPQ0L?= =?us-ascii?Q?uZZ2g9Qb/qD0zN27sEwG3b0rQlVEyCfmCNtQVm8zZJveRJC2Mhx/4DvtOW8p?= =?us-ascii?Q?sT7mxH66hQh5eQQMO2th3+RNmwrGPpNXaXit3RRMvLYaeWwlHpq5yc7Iv4iI?= =?us-ascii?Q?usSJ4BZmO6PYiEe651vjc5TqyerYDz1r/O0qMMtt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dWk63+LQwKdhAq84xnXrEg7r9Ra4qeVQGCHGbfAyA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2017 13:49:24.4069 (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: DM2PR0301MB0911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170519_095013_874092_3169E3F9 X-CRM114-Status: GOOD ( 19.79 ) 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: aisheng.dong@nxp.com, leonard.crestez@nxp.com, Russell King , ping.bai@nxp.com, anson.huang@nxp.com, viresh.kumar@linaro.org, mturquette@baylibre.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, broonie@kernel.org, geert@linux-m68k.org, octavian.purdila@nxp.com, kernel@pengutronix.de, fabio.estevam@nxp.com, f.fainelli@gmail.com, yibin.gong@nxp.com, shawnguo@kernel.org, sboyd@codeaurora.org, linux-arm-kernel@lists.infradead.org, dongas86@gmail.com 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 Use clk_bulk_get to ease the driver clocks handling. Cc: Michael Turquette Cc: Stephen Boyd Cc: Russell King Cc: Geert Uytterhoeven Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: Mark Brown Cc: Shawn Guo Cc: Fabio Estevam Cc: Sascha Hauer Cc: Anson Huang Cc: Robin Gong Cc: Bai Ping Cc: Leonard Crestez Cc: Octavian Purdila Signed-off-by: Dong Aisheng --- ChangeLog: v1->v3: No changes --- drivers/cpufreq/imx6q-cpufreq.c | 119 ++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 66 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 7719b02..6158910 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -24,15 +24,29 @@ static struct regulator *arm_reg; static struct regulator *pu_reg; static struct regulator *soc_reg; -static struct clk *arm_clk; -static struct clk *pll1_sys_clk; -static struct clk *pll1_sw_clk; -static struct clk *step_clk; -static struct clk *pll2_pfd2_396m_clk; - -/* clk used by i.MX6UL */ -static struct clk *pll2_bus_clk; -static struct clk *secondary_sel_clk; +enum IMX6_CPUFREQ_CLKS { + ARM, + PLL1_SYS, + STEP, + PLL1_SW, + PLL2_PFD2_396M, + /* MX6UL requires two more clks */ + PLL2_BUS, + SECONDARY_SEL, +}; +#define IMX6Q_CPUFREQ_CLK_NUM 5 +#define IMX6UL_CPUFREQ_CLK_NUM 7 + +static int num_clks; +static struct clk_bulk_data clks[] = { + { .id = "arm" }, + { .id = "pll1_sys" }, + { .id = "step" }, + { .id = "pll1_sw" }, + { .id = "pll2_pfd2_396m" }, + { .id = "pll2_bus" }, + { .id = "secondary_sel" }, +}; static struct device *cpu_dev; static bool free_opp; @@ -51,7 +65,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) new_freq = freq_table[index].frequency; freq_hz = new_freq * 1000; - old_freq = clk_get_rate(arm_clk) / 1000; + old_freq = clk_get_rate(clks[ARM].clk) / 1000; opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz); if (IS_ERR(opp)) { @@ -109,25 +123,27 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) * voltage of 528MHz, so lower the CPU frequency to one * half before changing CPU frequency. */ - clk_set_rate(arm_clk, (old_freq >> 1) * 1000); - clk_set_parent(pll1_sw_clk, pll1_sys_clk); - if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) - clk_set_parent(secondary_sel_clk, pll2_bus_clk); + clk_set_rate(clks[ARM].clk, (old_freq >> 1) * 1000); + clk_set_parent(clks[PLL1_SW].clk, clks[PLL1_SYS].clk); + if (freq_hz > clk_get_rate(clks[PLL2_PFD2_396M].clk)) + clk_set_parent(clks[SECONDARY_SEL].clk, + clks[PLL2_BUS].clk); else - clk_set_parent(secondary_sel_clk, pll2_pfd2_396m_clk); - clk_set_parent(step_clk, secondary_sel_clk); - clk_set_parent(pll1_sw_clk, step_clk); + clk_set_parent(clks[SECONDARY_SEL].clk, + clks[PLL2_PFD2_396M].clk); + clk_set_parent(clks[STEP].clk, clks[SECONDARY_SEL].clk); + clk_set_parent(clks[PLL1_SW].clk, clks[STEP].clk); } else { - clk_set_parent(step_clk, pll2_pfd2_396m_clk); - clk_set_parent(pll1_sw_clk, step_clk); - if (freq_hz > clk_get_rate(pll2_pfd2_396m_clk)) { - clk_set_rate(pll1_sys_clk, new_freq * 1000); - clk_set_parent(pll1_sw_clk, pll1_sys_clk); + clk_set_parent(clks[STEP].clk, clks[PLL2_PFD2_396M].clk); + clk_set_parent(clks[PLL1_SW].clk, clks[STEP].clk); + if (freq_hz > clk_get_rate(clks[PLL2_PFD2_396M].clk)) { + clk_set_rate(clks[PLL1_SYS].clk, new_freq * 1000); + clk_set_parent(clks[PLL1_SW].clk, clks[PLL1_SYS].clk); } } /* Ensure the arm clock divider is what we expect */ - ret = clk_set_rate(arm_clk, new_freq * 1000); + ret = clk_set_rate(clks[ARM].clk, new_freq * 1000); if (ret) { dev_err(cpu_dev, "failed to set clock rate: %d\n", ret); regulator_set_voltage_tol(arm_reg, volt_old, 0); @@ -161,7 +177,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) static int imx6q_cpufreq_init(struct cpufreq_policy *policy) { - policy->clk = arm_clk; + policy->clk = clks[ARM].clk; return cpufreq_generic_init(policy, freq_table, transition_latency); } @@ -197,27 +213,14 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) return -ENOENT; } - arm_clk = clk_get(cpu_dev, "arm"); - pll1_sys_clk = clk_get(cpu_dev, "pll1_sys"); - pll1_sw_clk = clk_get(cpu_dev, "pll1_sw"); - step_clk = clk_get(cpu_dev, "step"); - pll2_pfd2_396m_clk = clk_get(cpu_dev, "pll2_pfd2_396m"); - if (IS_ERR(arm_clk) || IS_ERR(pll1_sys_clk) || IS_ERR(pll1_sw_clk) || - IS_ERR(step_clk) || IS_ERR(pll2_pfd2_396m_clk)) { - dev_err(cpu_dev, "failed to get clocks\n"); - ret = -ENOENT; - goto put_clk; - } + if (of_machine_is_compatible("fsl,imx6ul")) + num_clks = IMX6UL_CPUFREQ_CLK_NUM; + else + num_clks = IMX6Q_CPUFREQ_CLK_NUM; - if (of_machine_is_compatible("fsl,imx6ul")) { - pll2_bus_clk = clk_get(cpu_dev, "pll2_bus"); - secondary_sel_clk = clk_get(cpu_dev, "secondary_sel"); - if (IS_ERR(pll2_bus_clk) || IS_ERR(secondary_sel_clk)) { - dev_err(cpu_dev, "failed to get clocks specific to imx6ul\n"); - ret = -ENOENT; - goto put_clk; - } - } + ret = clk_bulk_get(cpu_dev, num_clks, clks); + if (ret) + goto put_node; arm_reg = regulator_get(cpu_dev, "arm"); pu_reg = regulator_get_optional(cpu_dev, "pu"); @@ -354,22 +357,11 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) regulator_put(pu_reg); if (!IS_ERR(soc_reg)) regulator_put(soc_reg); -put_clk: - if (!IS_ERR(arm_clk)) - clk_put(arm_clk); - if (!IS_ERR(pll1_sys_clk)) - clk_put(pll1_sys_clk); - if (!IS_ERR(pll1_sw_clk)) - clk_put(pll1_sw_clk); - if (!IS_ERR(step_clk)) - clk_put(step_clk); - if (!IS_ERR(pll2_pfd2_396m_clk)) - clk_put(pll2_pfd2_396m_clk); - if (!IS_ERR(pll2_bus_clk)) - clk_put(pll2_bus_clk); - if (!IS_ERR(secondary_sel_clk)) - clk_put(secondary_sel_clk); + + clk_bulk_put(num_clks, clks); +put_node: of_node_put(np); + return ret; } @@ -383,13 +375,8 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev) if (!IS_ERR(pu_reg)) regulator_put(pu_reg); regulator_put(soc_reg); - clk_put(arm_clk); - clk_put(pll1_sys_clk); - clk_put(pll1_sw_clk); - clk_put(step_clk); - clk_put(pll2_pfd2_396m_clk); - clk_put(pll2_bus_clk); - clk_put(secondary_sel_clk); + + clk_bulk_put(num_clks, clks); return 0; }