From patchwork Wed Apr 20 09:34:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8887731 Return-Path: X-Original-To: patchwork-linux-clk@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 DE4A5BF440 for ; Wed, 20 Apr 2016 09:57:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7AA12024D for ; Wed, 20 Apr 2016 09:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B63E6201F2 for ; Wed, 20 Apr 2016 09:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933182AbcDTJ5k (ORCPT ); Wed, 20 Apr 2016 05:57:40 -0400 Received: from mail-bl2on0055.outbound.protection.outlook.com ([65.55.169.55]:8288 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932446AbcDTJ5i (ORCPT ); Wed, 20 Apr 2016 05:57:38 -0400 Received: from BN3PR0301CA0067.namprd03.prod.outlook.com (10.160.152.163) by BY1PR0301MB1221.namprd03.prod.outlook.com (10.161.203.17) with Microsoft SMTP Server (TLS) id 15.1.466.19; Wed, 20 Apr 2016 09:42:19 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::113) by BN3PR0301CA0067.outlook.office365.com (2a01:111:e400:401e::35) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Wed, 20 Apr 2016 09:42:19 +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=none 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 BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Wed, 20 Apr 2016 09:42:18 +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 u3K9g0iU016915; Wed, 20 Apr 2016 02:42:16 -0700 From: Dong Aisheng To: CC: , , , , , , Subject: [RESEND PATCH 5/8] clk: imx: re-order and concentrate the same type of clk api Date: Wed, 20 Apr 2016 17:34:37 +0800 Message-ID: <1461144880-8724-6-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461144880-8724-1-git-send-email-aisheng.dong@nxp.com> References: <1461144880-8724-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131056189389245880; (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)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(104016004)(19580405001)(19580395003)(92566002)(6806005)(77096005)(50226001)(2950100001)(11100500001)(85426001)(5008740100001)(50466002)(5003940100001)(48376002)(105606002)(106466001)(2351001)(229853001)(575784001)(86362001)(87936001)(36756003)(110136002)(50986999)(76176999)(33646002)(189998001)(4326007)(81166005)(586003)(1096002)(1220700001)(2906002)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB1221; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD019; 1:1wil1K0Ma4pPW+FgKcw16CwCrMqsQUtwnUvSS4DOnvTKlLlZqKR0jpv/6z53GtrJ/X1ISZe/7gigyPbxmqI6LIbBR/eu/sf2FTcpvTQNsLygMOt6ZnoqJL6OxYJbxd9xlozTYyIoQyqaDOoo57UY89/AnxvkaPHXP59cskEmUxCCwJ2mxPEzTYiolK2hDWpq+TveV2XJfaVxjvM2iYmsJtFh8kzv/92KnrpsfFS0of5emVYfdTlgPS0QQoD+7iP7Qd1ncJYmJXrK82+5VmV0hgDYpd26PkkFBQief1PKNh68R7MiozAAGBuHWyJ/ODJQcK20sI+zCujZfvcnABMkJ4e9o540n8JOlrUQp2xl56VQMzlVD71PiDIHb4P5+gDIC6CkVZgBDEMgJq0bsVe944cVafAMp1N6HejLuP1DK2b5vCS5/1j0Z6Mwp/thfEPGV9RUffjpsm9PsjdPRMgFYbIIooII9yNjZNiqSZmEUWtOgsK8AmfUPahCIryutqEbbV5W+mwhZWkdMmqsPaQnCI4ZDiza4dptEvKHxPus4Ujvqms/vVmmJa5Vfh4E3zMHjCFA/0pH/eirNUVDBS4g0uQRBs/5e+RIJcv1U7y5n44c7SagKIVsIA5W6l4q05PA4Q75RhZcOD7fzqiZabbOMB86xOPIBr0GiGsvPw7sLX7Okc5ITM6ZFBW20nQetFI8 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c3e5d419-7199-452e-2c5f-08d36900109e X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1221; 2:2hGP3GefWQgJ1X68LP0n9unRXCBqxtGLj/rhmh2z1Kf3ddY8oDGZgyhKB2cBzSqc0gaUTaVxMo7ask41i+eQ2IEzVs12aXIoZoXt78mkjikNPCzNVLPostReWNSdXwuj238YO2YUYZdlKq12WZrlAAa4ezsYJzU7gba0Otvu+1cbDa2/Xq5ETvqjZT8BOZzr; 3:VYoN80aEExGT0WTauC6tdrmoxhcOctIvWY258h00gx2KMoDYNlDsRYsESIMjZ0/lP825OuXf6NqORQAjyWAdTknpyfKnKjT7sXYDlBCyLtZujYcNtbhZJJ6ED1+6bi5zUPuvErvoIWOyrAL40hDe3WoMc1elRFCfT+nkQxuBu79m44EeICnVAJ6PVa2Eqxbk9uv3Bq1flYSWDfpfXij7N75apcGbauBBs2eLKhcmaA4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1221; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1221; 25:vNmEFUoS2WwH0LjKVW7FsfRty9gcITFPSVDJV3b7G4WTVy9SwdeQ5EmgS7G1lgLLZkBLNJSeTUo4kvVz/g11U/76yc8FQBxFJwXlpyn8Tzf8u30n6AK/MFsoQ2DOjoSpNYytXNvYr1JZ17M0rXBAJDVXh0yY+gzN1z4U0JTi1DGTyrjbBAdcH0ogEsnUfgEnyWzwmFYr3kQD8AHFlYD+f3rvcW/an59wXiEOwWZvKZyrra4pCQIcun5LXES8L3v2AlA5zFg/h6NtI88ZeSaDB3j8ypZAL6aEzzEv54kAO6rRnUjjaLnnwjb+FqgXXZGOnHt8LoBPywcIAEGeWoL847Jp0CImQzzmrhyTnraVYee3/rNe2xPDvTT1V0oL8P6E4CcZbS1u1tjpUrblpQPhwr/V3Lvk5TGmEtWct+aLsEa8yRaW1pk+HVisxYaTYzpRImIo/ihf12Gtpzzs4HJdtX/tgHuqe4zrCmkBfymW8RihhiIq3z3QlT+136Rwf1pHLCHSYgHC1FUIrftgJb6kc73wOA4WWZTGwOzn1OEUhZ2AoSiunBAmKaw6BbxZSr5b/WxR+eegFI435kkBJ+YjqFaQAGQReYmaYCa/s1k8ZymdMuep9GZejFOy1pJkzwCOQ5m6GYxNF8IN0hUc79tzyVp1OtMpOVFB669LHfMEdlo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(13015025)(13024025)(13023025)(8121501046)(3002001)(10201501046)(6055026); SRVR:BY1PR0301MB1221; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR0301MB1221; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1221; 4:mMKXsMn+O8D6CIPJWoG6wfuJRgszGo2B5swTK+gZ/XBxxa97zpSJDyMt21lfCHz8QxbOhXJ27VfAw9FvJkinq8PJffU897Z/YtvtCEhh6rJSmFOSN0VkjlrtI8nRMpgyRuYg3wLOJtDXQeVfKv8W5fOsI+WIU5THn8PUADxD0uW4RcHJwVNYOqPZ7816nF3by+7KL8X97jLqRzh3OPUQT7jjTKeEZplFvRdCMW44FhLyLHMZDdXq2ko55IFcoC0iJl30Ld9h/xWd6AJWwe/h3zpkxzoX7umTlvmXRnbblDSNk11Bqss7Wydo0J+qA8ooULIuAVYENyZHKYUYCB+zoc4udI5Q8tFVPbV9VmpS+OOSUoyT2SLBRW/p8/fPczenPZHcKCG1CKQjsdnZ/Pkr2XlG9b4fS9kRR8uMwiORg1DzWSQzWJKBp2TYnPQ0QmamGimoe/sLHNgx7AWmIRWh4QamaO+EpwyyOqbnR/A2scc= X-Forefront-PRVS: 0918748D70 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB1221; 23:XiCqyov7tAhXKU57cNG/B5MSVzA474EudP8wHpm?= =?us-ascii?Q?NkQOxDgWzhgvxV0yPhRYAJ9vxrk/78wIs1/y8Ng/JpbJQep3hyzGCpTg9oY4?= =?us-ascii?Q?fJq1CTZRl3sCxOTEbYHAKrzLuOLTSyVVc2xc8ZYjOpT13vXRKWRidHnzOJnN?= =?us-ascii?Q?3E5rUX0ao818ObVqM3AMwJqldu/r7o63WhIE4qPzlOTDnR5+UbFCkJSbq3BY?= =?us-ascii?Q?ca3jgMOqBa7pv9/BV+WsHnRFOxkr+CMzClx3uD5YUQ0r8hEoueTVTOSRX7ZK?= =?us-ascii?Q?ShaVhFgnByrH6XJtTvGnDmbZNSuzOWVEDeT7ee6bAB1joEhwy7mam4C3gDaJ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VOWCZ0I69vrRN292OjnWx+sBsnP/KUPOX4wRKjUbGT4OIY0UL1D510c/v7tJoLJzKUnPhRzv12Zb5p/mldbidQ18k5H0+ZPXLvz9xKJHmMVyDceSf0ZhAVqLW1FCIFyWJUdN8MvgrRdAQCNzQ==; 24:ZlYJk6Onw9If7XwBW0lf/UKwdN5h7P653BRR1AY5c8W4JlhhEP5nBYWTFxgoq9qd3ExFLKEN1xTR/irB8sdC27d+p268bxmGzLfFExxYOgM=; 7:ATZLqXDo8A2qaE4eBqvi5+vOmAKPCRFhuf7U7ZiQ58MLjUMqeh7X4ZpIeEXTuilv+ySlx0yppvcQ4GMTY/cjzZbXfBQpCbchlA2B3N3627r92HoOP8AG/185cTJ3mRH/nLTrz3xrz4Z1/9CIkPZQyNnjLCmP+pbhwE1wbWml8Hm1ntsYIK7Fkv5JoDDGW2RjLP0EgHataWc4wzz8hBF6cgc/Ei4VF2ypKTW4xofdqSA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 09:42:18.7373 (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: BY1PR0301MB1221 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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 508d0fa..df87d88 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);