From patchwork Tue Jul 28 13:33:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 6886791 Return-Path: X-Original-To: patchwork-linux-arm@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 4C0CFC05AC for ; Tue, 28 Jul 2015 14:46:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74C9820692 for ; Tue, 28 Jul 2015 14:46:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A261206A7 for ; Tue, 28 Jul 2015 14:46:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZK675-00027c-Tw; Tue, 28 Jul 2015 14:44:15 +0000 Received: from mail-by2on0111.outbound.protection.outlook.com ([207.46.100.111] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZK66U-0001Tk-PE for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2015 14:43:43 +0000 Received: from CO2PR03CA0043.namprd03.prod.outlook.com (10.141.194.170) by BLUPR03MB1361.namprd03.prod.outlook.com (10.163.80.27) with Microsoft SMTP Server (TLS) id 15.1.225.19; Tue, 28 Jul 2015 14:43:16 +0000 Received: from BL2FFO11FD024.protection.gbl (2a01:111:f400:7c09::144) by CO2PR03CA0043.outlook.office365.com (2a01:111:e400:1414::42) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Tue, 28 Jul 2015 14:43:16 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.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 BL2FFO11FD024.mail.protection.outlook.com (10.173.161.103) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Tue, 28 Jul 2015 14:43:15 +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 t6SEh4R8000941; Tue, 28 Jul 2015 07:43:12 -0700 From: Dong Aisheng To: Subject: [PATCH 2/4] clk: imx: add clk api for supporting clk_OPS_PARENT_ON clocks Date: Tue, 28 Jul 2015 21:33:09 +0800 Message-ID: <1438090391-30329-3-git-send-email-aisheng.dong@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438090391-30329-1-git-send-email-aisheng.dong@freescale.com> References: <1438090391-30329-1-git-send-email-aisheng.dong@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD024; 1:+Ux/u3o40CGvEW4TGSVIX99pD9m5JzHq2x/i9gg3Iv/64ZnfAoQe3LJwG8rouS9ad9IbOMq0FOwgLGetdC17w3SteEGorUWsDchQ3ST1LGCK6oC6b+Ic0kpmXLFROrROLA9aui5y3b7k6HMe0+4naCIqWN8Xs20Qu3+1tiHnMWPdAorTwJuOp8ZOZKVoSzw9dhbcSQj0Y71f9mAazqn3S+TJmxaUC8fHTRQuY9ndNF3SQ6oikKtAYyCvJVSrV7yG0eblaNmV4QEtMD0I7xa+v8zChusaCtyqmK5/XNC/gp/ifrIvVUFBUAZ0bcF/g9Mb8ALWssYQ7TF4Bx6MVU/Tjg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(6806004)(62966003)(92566002)(19580405001)(77156002)(189998001)(85426001)(19580395003)(105606002)(46102003)(2950100001)(86362001)(5001920100001)(33646002)(77096005)(106466001)(47776003)(104016003)(87936001)(229853001)(2351001)(107886002)(48376002)(50986999)(110136002)(76176999)(5001960100002)(50226001)(36756003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1361; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1361; 2:MAEL6XUVBoIIExTBl2P3aRM8qeuXeU23FOKZTTnQK1facC2s0nL88/pBkupYINpC4/9nCZb9XHle6XTKthNxiFbX74NknyDw3Jkr12N3bfoJUxR6kotq8U6d+gKDuwSc8bygp9t/rxGI5roQWvHDmwpI966E45+ddW8/QuG8vFc=; 3:JUEyd9KrUpUR2cJwZJyh4dwWF5oudpBJpKq82W68lBiDSTznC0rskyb6PupGiQn3cwvJTD+Vrpq64XoACIvVLQwvhQFzb6TdmDPbL+UxHek+kO3G52SaG0JrpGzqZYmE1cu4giAdXZMFhTpYNoJ9oRVgSRrbzOsjcR2aAViPQFIEUtBv+B15qrDuYBjkPlc3FnwKYPNkZkdkZcvMzZe90AkjqlImpBpdcObhjDpHlLI=; 25:QCwcbXfRn9YzfhltY4Yz7KFCT+b7QIAMmnptFoKRVC6lLFtUkAsPi53KHBGZKqKlpktlvRzSscms3OsZsBtYGVz5/Jfo7RikfRtYyBqUH74Gu4OpM2VwB8IL7T7A/7mj7pNn6IdVlC8H86Mla2UaqENhs1RCZXu61lFSWTKrgNJaB5kfzITxchUf5zVfKAEI+6mypVyJ6uc0x4ZZdX6QesaGGb+z/YOPUv5OLyN49aFyT88Yxu35JgNj1wioTr1xve8BqL+f3Tygkmc07zPjqQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1361; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1361; 20:3HDcYoI6RuEaY3GqjElhj+LfR4ZtDauaLmWZZ//vKewzk5oBpgBrqO/fWkidrgbpUM/vtew5NOxtDyMrgXWtFdj9ZNHDNGqLsblXOIUomI+g14RMlaNqipJN/ZWbnX/KKXdDFVm8W4UL7nAXDMEC/zGP8qkRcWKjXuex3mtcoqv/l/hCjUQhEQT8VKos9roxHPAKpkEuLugkTEB4siDmiff15Qj9saoQsX036lx003sC5L2kdm/Nt+66BjD65lJtY6vI9DcUpHHN2jipyyl+s6ew5X1X5AdnCXj08xRVlX4ZP4trgfaVReYN63jbd4M/MYHwK29jJhDtBADerDzA15KQZVWHkhddoh1ODpEctp8=; 4:hmoyZ7yjXq76+QPVROZMOD7yGN7RSw9ZI35Ck3wutMVFg52iU38Mm/YAFc3MXEtDcgWX23nl3TaE0hobfUob3iuPDZd2TmhEz9JFOp0Cf6Zn2+GneCVffQeR7ePXubHDwBl0jkGVCIOFsXpFA1wKznR1Qh47FU3dNfkMJs0c80ouez+b3RoS3dSomHSE3tiCtaL4+ELUrK7WvisuK6OXnW5c3//8ZmknT+LqMbXh77bq0eaep9oYSn4RGTHuwi0mPkN/xf//Q4Br6bzEHIBO4GYQq0cLBDAOK18rrEOAKo0= BLUPR03MB1361: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR03MB1361; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1361; X-Forefront-PRVS: 06515DA04B X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1361; 23:loVBxYiSNRwDtyOx/8tSnm9rz+FD7dKfjJqY5sNxnxD8UPbwlimKr4spVzeBgJwt656SW+3KYfs6qSo434Csb6T+y1NY4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FrrWdEsbyTw6Zoz15nXuXNzecZvfN+gqPXpLIOyLdViblyxjVDRZQB/zIj4LKt0pz+lKOqZZnQOPjabor8aTkFM=; 20:vv55fTwmgr9nFUTYDHDAZwcULhjnebZMZEReuceKYHzBIJWvYStM2fpm2khujM7Hsv95kdhhGOcc/shGCUQL1A== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2015 14:43:15.4987 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150728_074339_124647_3987AA2A X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ranjani.Vaidyanathan@freescale.com, b20596@freescale.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, r64343@freescale.com, b20788@freescale.com, shawn.guo@linaro.org, b29396@freescale.com, 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Some IMX SoC like i.MX7D requires using clk_OPS_PARENT_ON flags, adding the corresponding clock APIs variants for easy use. Signed-off-by: Dong Aisheng --- drivers/clk/imx/clk.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index cda8756..e579fc0 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -89,6 +89,14 @@ static inline struct clk *imx_clk_divider_flags(const char *name, reg, shift, width, 0, &imx_ccm_lock); } +static inline struct clk *imx_clk_divider2(const char *name, const char *parent, + void __iomem *reg, u8 shift, u8 width) +{ + return clk_register_divider(NULL, name, parent, + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ON, + reg, shift, width, 0, &imx_ccm_lock); +} + static inline struct clk *imx_clk_gate(const char *name, const char *parent, void __iomem *reg, u8 shift) { @@ -118,6 +126,22 @@ static inline struct clk *imx_clk_gate2_shared(const char *name, shift, 0, &imx_ccm_lock, share_count); } +static inline struct clk *imx_clk_gate3(const char *name, const char *parent, + void __iomem *reg, u8 shift) +{ + return clk_register_gate(NULL, name, parent, + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ON, + reg, shift, 0, &imx_ccm_lock); +} + +static inline struct clk *imx_clk_gate4(const char *name, const char *parent, + void __iomem *reg, u8 shift) +{ + return clk_register_gate2(NULL, name, parent, + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ON, + reg, shift, 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) { @@ -126,6 +150,14 @@ static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, width, 0, &imx_ccm_lock); } +static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg, + u8 shift, u8 width, const char **parents, int num_parents) +{ + return clk_register_mux(NULL, name, parents, num_parents, + CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ON, + reg, shift, width, 0, &imx_ccm_lock); +} + static inline struct clk *imx_clk_mux_flags(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, int num_parents, unsigned long flags)