From patchwork Wed Apr 20 09:34:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8887711 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 AD2B3BF29F for ; Wed, 20 Apr 2016 09:57:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A054B2024C for ; Wed, 20 Apr 2016 09:57:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E3582017D for ; Wed, 20 Apr 2016 09:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933602AbcDTJ46 (ORCPT ); Wed, 20 Apr 2016 05:56:58 -0400 Received: from mail-bl2on0069.outbound.protection.outlook.com ([65.55.169.69]:27067 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932446AbcDTJ4z (ORCPT ); Wed, 20 Apr 2016 05:56:55 -0400 Received: from BY2PR03CA006.namprd03.prod.outlook.com (10.255.93.23) by BY2PR0301MB0711.namprd03.prod.outlook.com (10.160.63.153) with Microsoft SMTP Server (TLS) id 15.1.453.26; Wed, 20 Apr 2016 09:42:22 +0000 Received: from BN1AFFO11FD011.protection.gbl (10.255.93.4) by BY2PR03CA006.outlook.office365.com (10.255.93.23) with Microsoft SMTP Server (TLS) id 15.1.453.26 via Frontend Transport; Wed, 20 Apr 2016 09:42:21 +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 BN1AFFO11FD011.mail.protection.outlook.com (10.58.52.71) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Wed, 20 Apr 2016 09:42:21 +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 u3K9g0iV016915; Wed, 20 Apr 2016 02:42:18 -0700 From: Dong Aisheng To: CC: , , , , , , Subject: [RESEND PATCH 6/8] clk: imx: add clk api for supporting clk_OPS_PARENT_ON clocks Date: Wed, 20 Apr 2016 17:34:38 +0800 Message-ID: <1461144880-8724-7-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: 131056189417469498; (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)(1110001)(1109001)(339900001)(189002)(199003)(1096002)(189998001)(586003)(1220700001)(2906002)(105606002)(77096005)(110136002)(5003940100001)(11100500001)(106466001)(50466002)(81166005)(36756003)(2950100001)(50226001)(86362001)(6806005)(33646002)(76176999)(2351001)(229853001)(50986999)(104016004)(48376002)(19580405001)(4326007)(87936001)(5008740100001)(19580395003)(85426001)(92566002)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0711; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD011; 1:zyp/xhJsA1S6iwsAE3SLBbhIfkjb71NaMMhXBtCXN6uA+ux/RlkbTWOH+S+IM9bJgabX7Yxu1bV24Y0zC4bgYmMBoHY9/XcSdAzuS07WBRNBGm950bSuOz9bjsNZcMdElrUgaPUgxk+xpBRsu2p+Y299qANmfkIZSE2AGbjAJGOSJBT04j+shIMeVZEYihKzBNaqwPc0r0shy4UalwIOhxi+wy00jmvH34Cc3CTUskJRrcfZ+M6QlsDMLUj6QGAA3rUQ9HpBD3bvlADIgrDY9JYXCyZwP0Zejv6a15GvP0p1jQXVrAaYJDnWS2ZUptjjoqHnIsAKs2FirxGaQDmZf1AjBlyAbxj71v7v/xB1gWmEvuMqlmSnIf+sTHXUwMG3AkxabGoOyEsUKdZk3ODSAySdAPUu0cH0u6dGbybDuHcEpsGNcK8q38JnOUdSveA1kNYq0gKOouAWpNjXtRdKsdPTMFt5PGkob4JAIs0a8M3v3I8LZHjBDQNxiQeMvgQrQummYflYeY45AkhtK2y48kTKXX3MmqYfZNWZpZ2soldpeRI2TQiU5UqmbVL447zgoi6w2GfBA1ATqmfbZQqvFAkHV+CHKN9OBN8Mtc10n85nLebJ7ZjNaXgeVHafQClcxHJJwps+kaZ4PTCYuLnD+EnaBWjcx82QmAXJB3eUi7IbGtL3LB5emXnwj9G+mJe1 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8daf07a1-1594-4d70-d4da-08d36900124c X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0711; 2:HDO4q1g9fhJlbcYQiUmpAOzoMNQ5ud83N8znKHEi97hP1f3HlbeHGpbp61TwkhIDZtH60WMBAwRix1J28SaJkQnVTrW5qVYG2PENv3ATkGDXf++QjpGv7+SGUB8wEH5ovyFTpzDJ7FiP8mwrQ5/3gCkxDSEzV2AsPb2lKir5Lc2eXzPdqlallRvt5Oo047qP; 3:1h+QFXrIGckuyAGCAQY570YkLeJ+/IczZqcoa+j006qEQfllmPCuTuRS9M4pJ1ycEQRiqGfvNknn8LCkwEx7KpM4Q6wy/08AQYGWLLbvs7kvir7PMUEGzMM0xzlBYNRBT2Jxv1Q6BsBeYuo2rmnGo/aS6APLgq9mQoC2GVvOktfhUyeTqWG3J7cIb+bgXs38FoX2+mSywMDdqF6wyutXTIedSOumB/4i/i/0wndCDP4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0711; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0711; 25:SNkUgsbchO6giAQSdfcIHDDVb9umNjuy9M6GHwc8YNIpiaWepdqlzqdzgtpzKMqQCFKr7MzDe/wbzlYlKjaw2Ffzs+Dou94TNPgAhcJucFcxKKsXVNxKQnpns0+KzCRWUMWRs69Si+IPPih+BOYZzt9u58QKO/Vkgu6fitCBQJUSL19PFWuaqem5zSelJrnE6KYpBw2gxA+/GtVaGEADZ1YvSV2BMHHB/Dilkcs9R3aTPL2MkDrwWbU9FqIluPDMthBTgkSrFBHCmlNmQ6WUG4J7GeR0DcJBXK8r1Nm8yeIFWIU2XVTqGUtXoqc+IvuJrORJQ+a5SrK+0XSV0vKLa4Qk5P14MFgL99NqEP28gvrBU6i4jod1Rb18HgzwVeKGtsB0EJj8sfbLzchCZbH94wRiwfTC1LkqjqGIXXD/D7bDUvQU13PkVN0ByjD/yYTewXakALW8pPgoGotd4dT5a0e+T8pFnSOMUK1Lrv33+I7mUw4W1X2ClxE6WTny2GKbP/Bb9J5C+qwOYX83bqW+dngxRfFydznv7Yd2KcJ4m9I1Ocb9hOxMn+mAoxzV+kuvNBYfkM0+rmzmlk4DTn7kFLzvuuadRmYzcXiBPKqfx6M2QpbG56j5F0qMM5hF7duuvipkBHXczZTNf7jSegMEaQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(8121501046)(5005006)(13017025)(13015025)(13023025)(13024025)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB0711; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0711; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0711; 4:j3vKzulVBnwMfT8vr7C4rXAmelWZ9HUoUM3zLTMBZM6lo/xbvpgbG+Wvz+ImB2UcsAegaQy520Dj6Eqr8VxdKX6D36jiOxLoNHGGj933lyolUtEw6WbllcKt268en6MTgc7MsCQ4lFpmrLbpUl9AyChhCM2hRSbK4zt5T7IOlKksAHjvuznZvB+aHcdrL31lVJ51Tqgc6zHiw69ky16Pn4YJ/yhZSVVNZbFHtZc2sQeqw/Pb1kOLWx6AjNsyJCPnK4WKTZA4F1orH2E6pO5SwUuI98WGzYH24zhEmq8h2vY1aByx5N/lb5P1XTv21+gyjb0yUH8JXIe6vTwpT6j0sPrroEEJITQiatKQGwSB3w5dhpyvjnAwHlRNcG2JJxp5PnOuiaMqBo31y3+zcbSsqQmPU320n3g9wtM+UPelBeMM0RazUB3RsXIudzoSkWOmfgAzBFUN6oUwdSXXWHfGsSXXe2h6P7NZeR5pOdNdEKE= X-Forefront-PRVS: 0918748D70 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0711; 23:99HAYD+g7eZDPDwrQ4JdFNce7aIaOyP4ZnXPWiC?= =?us-ascii?Q?ej+dIgFQw2EC38RYT673eDp4qhD6lf4AvmJJ49sIjz2re2YGMIEsmEvnWWYG?= =?us-ascii?Q?ENsA0tpQPxzZYUnzAM3pBqDTAHAbLiCh7U8nhklnKGZTiApWP+SrENtMHySz?= =?us-ascii?Q?dfqnF88GFBL90HVtAruGk6Ylo/EyLLkICG1Btj8tzh1va+Ey1r4CoDdvsKGs?= =?us-ascii?Q?83aHECMxIxDRmhLgg5jQzsL/BD7Hr3lPHErk2o5tIrbJIVChYMj+1el2dfWB?= =?us-ascii?Q?V7pcxa2ruKnH/W/s7xBNFhvYnGB5wCFfRZzYuCxBxlQ3UpV3vu7qbj41nVgw?= =?us-ascii?Q?U4SPUHuTwBN7r97P0ufYqRbqx3GMnLrC6THau2mGMCjWZyyqfnnqCTu4ri5l?= =?us-ascii?Q?SYl8aSbjaPNm0y1v76UAvUM0HDNI72TVDfFBDMRwMg8ezWGQgcCnhVq8bI6R?= =?us-ascii?Q?y5KiJF++o9PaKrLzV7+IxLeiiQG90/AoBdT4UAVf0a7bBDoXGDucxLRgf5qK?= =?us-ascii?Q?a17TEyiY9nypNog/qO5T2on/JFGFKScz5KiF+aTpMKyl8hXS9hudPAaDrX4Q?= =?us-ascii?Q?FebmAbIklcCvqdfGheY7dLZtZVLyczzSRYGz6ot95W/VM266hiq1W94ummqY?= =?us-ascii?Q?PvVqxfOk8m5lZvg3R9gryz7FzBM+NEV8LHpUef5+yjORyg0kV9yVVWBtttJG?= =?us-ascii?Q?sf8jinbpBoq0X6ThXX837fkjzm2C9IkoDRxu+QM4s1dq21vdWgib3vhXP2ia?= =?us-ascii?Q?J3U1T0Hgp0qTuLsstkBf+VgYI8aIjqkOyNeR3Tq2AHnNJFWJe054RZUADgQt?= =?us-ascii?Q?Y7jLWtKNSorciPD2N9r1fvdxIcFI1Y8iN4r/gU3TI6A8fa5cxlXuwNm2JN7p?= =?us-ascii?Q?X1hfWqgnwenOEjzyUsK3q94TGrzR02lfNg2MEYKQfbW/yXl/+LmX2DD+8+IO?= =?us-ascii?Q?cfhAi8eMLLaUX15MfKSrZ2E2L/NCR4bNywH755GSEIYYbS5O0hO1uPLXg/R7?= =?us-ascii?Q?hBAZs07dvVhoeWXf0sXdX5z/6z11fclzQI5a0gzyROYnnLhBpoFJImoP0Z+U?= =?us-ascii?Q?DYzdZg1U=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0711; 5:+RtN77mm9Sl6VWMfJZqvTu+h56Rh90dPrO101/WP3vKvROOyvAryD5yaoSpCd9AKBX4f15kwWbHxhqAbbavi1/rECTMNpNQDt51K7RkXVZt/vzBUGm9Mmo+Xw3IuzN+jUFirFfIACU7rB7n/i9lkz2usOLWs675viLDq5VRqLsg=; 24:C0Osfl+zszHjIReRj1CflS2CXW2/0x4bWWvSIvp0wkelNz/3M2ZoE9DfapEZHQUMVX0HPSpl8cqgCjXaLdn+TjwxU7jTmtDYwz7L82Q1NYw= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 09:42:21.5441 (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: BY2PR0301MB0711 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 Some IMX SoCs like i.MX7D requires using clk_OPS_PARENT_ON flags, adding the corresponding clock APIs variants for easily to use. Cc: Michael Turquette Cc: Stephen Boyd Cc: Shawn Guo 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 df87d88..6736e85 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -97,6 +97,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) { @@ -133,6 +141,22 @@ static inline struct clk *imx_clk_gate2_cgr(const char *name, const char *parent shift, cgr_val, 0, &imx_ccm_lock, NULL); } +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, 0x3, 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) { @@ -141,6 +165,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)