From patchwork Thu Jun 30 09:31:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9207123 X-Patchwork-Delegate: sboyd@codeaurora.org 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 588286075A for ; Thu, 30 Jun 2016 09:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45C23284DE for ; Thu, 30 Jun 2016 09:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3756F2865A; Thu, 30 Jun 2016 09:40:23 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C163284DE for ; Thu, 30 Jun 2016 09:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932161AbcF3Jj6 (ORCPT ); Thu, 30 Jun 2016 05:39:58 -0400 Received: from mail-by2on0080.outbound.protection.outlook.com ([207.46.100.80]:51392 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751757AbcF3Jij (ORCPT ); Thu, 30 Jun 2016 05:38:39 -0400 Received: from DM2PR03CA0041.namprd03.prod.outlook.com (10.141.96.40) by DM2PR0301MB0864.namprd03.prod.outlook.com (10.160.215.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Thu, 30 Jun 2016 09:38:32 +0000 Received: from BN1BFFO11FD046.protection.gbl (2a01:111:f400:7c10::1:173) by DM2PR03CA0041.outlook.office365.com (2a01:111:e400:2428::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Thu, 30 Jun 2016 09:38:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD046.mail.protection.outlook.com (10.58.145.1) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Thu, 30 Jun 2016 09:38:31 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u5U9cDxJ010090; Thu, 30 Jun 2016 02:38:28 -0700 From: Dong Aisheng To: CC: , , , , , , Subject: [PATCH V3 5/8] clk: imx: re-order and concentrate the same type of clk api Date: Thu, 30 Jun 2016 17:31:15 +0800 Message-ID: <1467279078-2330-6-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467279078-2330-1-git-send-email-aisheng.dong@nxp.com> References: <1467279078-2330-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131117531114890259; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(33646002)(104016004)(47776003)(6806005)(575784001)(87936001)(77096005)(97736004)(86362001)(110136002)(586003)(92566002)(2950100001)(189998001)(2906002)(36756003)(4326007)(19580395003)(356003)(7846002)(50986999)(19580405001)(105606002)(11100500001)(106466001)(48376002)(8666005)(8936002)(50226002)(50466002)(76176999)(85426001)(5003940100001)(8676002)(305945005)(81166006)(81156014)(68736007)(69596002)(229853001)(2351001)(7059030)(169823001)(427584002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0864; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD046; 1:eq0kCXompWeiULQlJtbgwBotfhGbpXUtDYCFNR3hQlFrI6Zahvfn6w5/inQpKl9cFQAjS4wjGqdyZYtlQoHQ+3ln7sDdawS74fUY8w6fcDx96skuKGx8KJZ1rjNpZB4hVPGr0QbkNdwXomTRnLcsHum2e/RRGi/s3eAME0I6g/fJpM7cAfYwVrj2NJhK0VLWGuFfeRIw6/bJyy3ozcibUJQugTgdiF+udSQBuoupTa8xpJMAkMNbzm87ywK4e6pln1Nf5M7bDPPpFrnafkRGHwAQh5wb7m07NOUFHzdoUD+Z4j2qK7eZ2MW+H8noiP4V3Fu5JgB3kQWmq3atJ8q4LNfwn+GbkQZTeZpmdEE1DzbIEAd8v6jAoozjaA0ts2RVZSbshb51L9JmzB5W2b/yrLHbWmxJ1QZ2kA2Pt8Au2jUDBbgMZlX3E/WqXbl6zeRpL/+NhZvaUEZsz8azv73EnBi+oS6airtkKkq6wpV6EGmOyEhNVGzsogiZkKMJXXj3g0t3PeIrh8i5SPed3fw9Zqk5rjrOAUMjuNKkJv9+ph3vEE7rBU7TZ8+dpK2FGtPfJ8UytzGkc9B3GhKJMahM5TAOwt4SrhoC8wQnJmrK7xwuk2KwgEnKcfE7ck6MCa5E8gm73hKjRZZPZIjvDG1c8v+3C+qPE6HkQgRkwY0UPlUyKTo3gWdqm8Wt442DIJrdvvpF0qlM45kKrpyOK142QYWqkfowuPRPXuNwV0jSwJG31D+j/1FYOtI/LVNCwvKf MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7f73afcf-cf03-4b0f-77bc-08d3a0ca4c4f X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0864; 2:znPcq9T+UKAVPrnYzVsdCJW/EZkdwObSDfHvD3+srHA2RyQeURyJDDPzHM8yIBhIfYVlQk4VlmJU4pIhnLANBPYMfj1+ue3AvFiyRf4HQAqezYkyKaz38G2Ypme0kvdAIG15CFGUvKJbsa9mMVPGzqw98Fju1/HrDO2+IiahxydVLV7RZBIQ272TqoUUediP; 3:giP29fZivJHPwmQKM8U7PuEnqqDEEvCuxcLWbPevCNMczsVwhQ8dOUT8ycHdu3vdPAiidXoukbpeyPOj4zio4hREci/L8ys8wx1W18lpleuR2DSqKBBWctVNZDILSShnwxs8ZJbt573WR698WPGXOX6DKBN7Mk53c0wFw5w6Hmohw326fibTCAVQBUQeGXqa0YZvaODOcJST+pSMuUtJ2RAIvQK0izzp5PhWH1UC9cQ=; 25:c5AKyxR3+5qcY/6BeF1oWxt0fbnpN0YrWVQqbq4Xnu3mRUuubbaOXMZwg3UHpitplNhp1QM0FOlIMePXgO2K25tt7WXkHNK6OiyjPpGELND+Ggj50KC2POHr0X1ww+CuJAyfo5eNLLw5BpVl1GWP/16b+Z1qNstI30RNjKNLMfMiBdW5i8o8IcOR5I/oyDBTw8t/HHWGbCU13Jo/ohjQ4M6gbmkY2rSaQl0VLeqwMyCyoRsZy6LW8tGfBPhQSitRZ6lRQKb3TNCybuKPTV12GH7u/hR6JYwI9aKci0wprZEpI54I149Ee/zlWQM5ZSEFBx0Gx3rrPY/pOAE2423Qle48PDHSUlyi9Bd9FWe0txenmSZOCONPH9q4Zf8QjD+Pfj4iUBvz3J9A/WUZyqFcVozsZNIRHvVpBEJFmWGeUlU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0864; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13017025)(13018025)(13024025)(5005006)(8121501046)(13023025)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0864; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0864; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0864; 4:oxPu7PuqozvC0s+Swh+Z+HNbjUU0IjhiwzGOkn77RMuP31zzfuxAZzCcU3MDoEdIBHZ5F/N/LQj2aL0bTJu8bI0WRVJDHgT6/76WCpdUzBWWQcRLGfzGODsix7PMnZVtZxmXY+Boh+tAiv3PsKK7NlCbbYDegagNe18YQrFuVQD+xDo9xFdbyMTWvWwGyRJz1r+rcYULIM5HgSSDDxLNWB5UBbX6/E7s++aX5+Dsuk3aqoNlqdQ95wqnJw4EfnO55AqtlCHjZXVrTlUVVlVxMQfOysB7SLKfE4AEn0bHQyVbznloDf7Jx4w82Rr3971w3iFEnB0fGaGOkA1C8J6o5Lb+B/Vu1AD2XCx1e4qv9rBwA2DbEiwBeViGYDK0YSDVOQNNjvSRhH3/ryH2wKmSyWE15FY+jKbf1X4XGNIWApP+yrutBS36fXPvh4YF6wdAsGPoHH4b+yxKXQ1klvgDbWJoNjP+k27lsiROQzE46tMl4rpO5nlKwOiU5EewW3rMfLo273NkJXKj2U3jzx+N5A== X-Forefront-PRVS: 0989A7979C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0864; 23:F3CO48PSM7DTOVEzambNKYY3VQtVs8Spr+kXJES?= =?us-ascii?Q?2NVQwY75Nmb1ploGbNRYFX034aYXq0X+GEB63fPL6Rl++WLXvZ+TQeCEnFjn?= =?us-ascii?Q?cKhSHe6Lo9ykcfx4rpoXYQ0yHJBT9+CASFJ3uxsHmmyJ8gKFCFaPkhXqS8qx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y8QoCW5FMm5/p9ihtjRRQtxl3rg2nWOMP/UdhcvrW4Dqr3iuu85jGR9RWs+Ls3VkRWApo9GhJkh1BdWKOxZ6goA+4gHucXSxup8javmnUNz3SZAGZEMzq9UKOw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 09:38:31.1302 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0864 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Re-order and concentrate the same type of clk api for better code maintenance. Cc: Shawn Guo Signed-off-by: Dong Aisheng --- drivers/clk/imx/clk.h | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 508d0fad84cf..936e235f7c04 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -51,28 +51,6 @@ struct clk * imx_obtain_fixed_clock( struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, void __iomem *reg, u8 shift, u32 exclusive_mask); -static inline struct clk *imx_clk_gate2(const char *name, const char *parent, - void __iomem *reg, u8 shift) -{ - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, - shift, 0x3, 0, &imx_ccm_lock, NULL); -} - -static inline struct clk *imx_clk_gate2_shared(const char *name, - const char *parent, void __iomem *reg, u8 shift, - unsigned int *share_count) -{ - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, - shift, 0x3, 0, &imx_ccm_lock, share_count); -} - -static inline struct clk *imx_clk_gate2_cgr(const char *name, const char *parent, - void __iomem *reg, u8 shift, u8 cgr_val) -{ - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, - shift, cgr_val, 0, &imx_ccm_lock, NULL); -} - struct clk *imx_clk_pfd(const char *name, const char *parent_name, void __iomem *reg, u8 idx); @@ -97,6 +75,13 @@ static inline struct clk *imx_clk_fixed(const char *name, int rate) return clk_register_fixed_rate(NULL, name, NULL, 0, rate); } +static inline struct clk *imx_clk_fixed_factor(const char *name, + const char *parent, unsigned int mult, unsigned int div) +{ + return clk_register_fixed_factor(NULL, name, parent, + CLK_SET_RATE_PARENT, mult, div); +} + static inline struct clk *imx_clk_divider(const char *name, const char *parent, void __iomem *reg, u8 shift, u8 width) { @@ -126,6 +111,28 @@ static inline struct clk *imx_clk_gate_dis(const char *name, const char *parent, shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock); } +static inline struct clk *imx_clk_gate2(const char *name, const char *parent, + void __iomem *reg, u8 shift) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + shift, 0x3, 0, &imx_ccm_lock, NULL); +} + +static inline struct clk *imx_clk_gate2_shared(const char *name, + const char *parent, void __iomem *reg, u8 shift, + unsigned int *share_count) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + shift, 0x3, 0, &imx_ccm_lock, share_count); +} + +static inline struct clk *imx_clk_gate2_cgr(const char *name, + const char *parent, void __iomem *reg, u8 shift, u8 cgr_val) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + shift, cgr_val, 0, &imx_ccm_lock, NULL); +} + static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, int num_parents) { @@ -143,13 +150,6 @@ static inline struct clk *imx_clk_mux_flags(const char *name, &imx_ccm_lock); } -static inline struct clk *imx_clk_fixed_factor(const char *name, - const char *parent, unsigned int mult, unsigned int div) -{ - return clk_register_fixed_factor(NULL, name, parent, - CLK_SET_RATE_PARENT, mult, div); -} - struct clk *imx_clk_cpu(const char *name, const char *parent_name, struct clk *div, struct clk *mux, struct clk *pll, struct clk *step);