From patchwork Wed Jun 29 14:59:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9205615 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 B2B2E6089F for ; Wed, 29 Jun 2016 15:09:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2E1D2866D for ; Wed, 29 Jun 2016 15:09:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 975D928659; Wed, 29 Jun 2016 15:09:03 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 50A662861D for ; Wed, 29 Jun 2016 15:09:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIH5S-0007jL-PS; Wed, 29 Jun 2016 15:07:34 +0000 Received: from mail-by2on0058.outbound.protection.outlook.com ([207.46.100.58] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIH4e-0007I9-N6 for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2016 15:06:45 +0000 Received: from DM2PR03CA0050.namprd03.prod.outlook.com (10.141.96.49) by BY2PR03MB1928.namprd03.prod.outlook.com (10.164.114.32) with Microsoft SMTP Server (TLS) id 15.1.447.15; Wed, 29 Jun 2016 15:06:25 +0000 Received: from BN1AFFO11FD026.protection.gbl (2a01:111:f400:7c10::138) by DM2PR03CA0050.outlook.office365.com (2a01:111:e400:2428::49) 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; Wed, 29 Jun 2016 15:06:25 +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 BN1AFFO11FD026.mail.protection.outlook.com (10.58.52.86) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Wed, 29 Jun 2016 15:06:25 +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 u5TF65Ja021502; Wed, 29 Jun 2016 08:06:22 -0700 From: Dong Aisheng To: Subject: [PATCH V2 6/8] clk: imx: add clk api for supporting CLK_OPS_PARENT_ENABLE clocks Date: Wed, 29 Jun 2016 22:59:09 +0800 Message-ID: <1467212351-16626-7-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467212351-16626-1-git-send-email-aisheng.dong@nxp.com> References: <1467212351-16626-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131116863857971591; (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)(1110001)(1109001)(339900001)(189002)(199003)(7846002)(5003940100001)(110136002)(87936001)(76176999)(8676002)(19580395003)(19580405001)(81156014)(2906002)(8666005)(105606002)(77096005)(92566002)(50986999)(4326007)(81166006)(50466002)(47776003)(69596002)(2950100001)(2351001)(8936002)(48376002)(106466001)(86362001)(36756003)(104016004)(6806005)(33646002)(97736004)(356003)(189998001)(50226002)(11100500001)(68736007)(305945005)(85426001)(229853001)(586003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1928; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD026; 1:mxZdaehoDuzJ8WmqE2UG00mxPK7mf/HFCvsujB3kikR40XvlW3kS/f0pM3R6BAg2UB3cgvMt7Xd774+x1k0bLIqk1wckpA+NilAPrdTUU52EfwxxF1fo+ES51hL1EyQtR5E7ph4zopzYUVOcJArjW2mKWqyrhdVrngpW3n28A6F6jJF1ua/95bvJJwnlcz5VlF114PSJDnTRvtqTIHgo84MAKdPiOZRRY7YXl9mJHtPT3teV9QFj3UQguGwmKNSu1yRnMIQzYO7t/pH35vOm8UeqCd59WgCip+b2jeOpf8DOBuZciHlYjOx7wqO4zkMcT289qxuRf33NBSvfIxHQjhvgXM6ZFZEfA7ahHVoCTu0K3EfmsBpk8yzaQrVRsxpLaPtzo6CUfT2gFDsWY8/owPicJ+s+uUmQfllZWbMIVaqahOLhS9omi9jqe4t7xY6r35a6UH2B41lEvgH58Jc6/3NYIotCYGSyRVHEPDhXvj5i2i+EA6JRlDSsC/JQLtQtf2SsvGoukaH5QJh0Gxk/k9X7eEHB3cEet+UXijeg0H+pVNgSpW+ryKhXCMQ2flIQcmx6TnhX9w/qwwOQN5OiSjPsWAkFl8UHQRalmf+4eDPJIgnBfrzcZpXtyyHhrlGelsEt+bBW7VauaLOtK3mPBN3V1cGOmw9OT5cIbmpK80vg5mbugzGxc5Y2L92Tt8SWTSClERQBGDO30xmtDUH84tHWmIsXBPdntwf79i1rqXA= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 33157ff3-1486-4d80-8ec5-08d3a02ef0c3 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1928; 2:XRo9nUlZ6yYysI02Uw/yGBU+xVEp329ZxL0yY89mrl8a+W+4bjdijqcRsCvs24r7jvH0moaG6MQ6qSZBV6bNuVzgvo8iJ5uGIaq56eRjBiDluizWAGhg7C2iJsS3aBNtT4nHe5S0cvMnBMlR0o8roQchN/8Sf+ZsBM6uNqicoQwoKKvB/sHtVCub6vxE5/X+; 3:gUtI9/pVZvBjGpJHtyeFX1ktBcwpINw3PXXbDD3P5eEmb0mfexKUCkNXTsV9TuGAqCoUm8xfWGKEu+b8kcbtg6/nuT+XKEdRQVg4fj3Om40XUx1DxPtnWWqxfsQSfDrep6ISef7gsfS61IzhnnRISaUsBnEt0IhTETUIZOZGElUEJPbXnHNh856kx5IQABqnF6TSfB1qnSQlVj4F2pF0LjjiLbbkNgfQnji03gwHU6s= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB1928; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1928; 25:6W9uQHS8lPIIJbd7XuJ8FZiQLwBE8rTJrHIsIrzrqvhW2sFa6AdvBxHpa2JdStjWy+DVT1qmBpelpFNdUB9i/xWoJ9YxCubDe9QOgQdQ02KhJ+OMtA3BEdTN97F/uy7Fr7u1PjgUuwSxlT0KNcC72Yq8IDARHUn81IL5kyMLiV9mKM+Q5vKHjh/+FmSoyvUO2Q6Qt1EyYDfrzJ8Kz3CtTMQi7v9skH0geikhnrK3tgctfI5FEb4ypGTXGpKbbuaUg5BqBtHMiRb+VSQebgtYjYb7i/BJ2c++c5rLnHpEbeIkIQD0VjR4ZOqz3wow2TlXZv46XrRPYRs9c2PCqkXdEa3XlQza2xzLx1P+Ephiy7De6Okc6v7jXOo6yYWuDKBIrEhCSWneZ/zKJrefWJUaaEvC0p3iSM9p3A8nZFyASxVHDpbtqGpeuS2DErdzA/Q5BorVPKFxhsc3tlRBzrovAxeNbfNuyiL1Op3+FU9YpJ9mQ8d/6AfjLduqkq7IeNf840Zp4SRdWL4X/WuDJ/+dzT8MVs/Og7kFYQKt0AjvonuqbulbTs9O+xxvjLicEvVCBjt98X5mzCcrCzPYPoEZqw== 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)(5005006)(13023025)(13017025)(8121501046)(13024025)(13018025)(3002001)(10201501046)(6055026); SRVR:BY2PR03MB1928; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB1928; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1928; 4:0xNm7lXkUlUrNm/kkVLkGkX+ajo2Frw6I7TBDKz/iQTgqye7ses2PfU+POArJrRSvhjN+ua2t8Q+BTE0qCqIg4h8/YDkP/GnS0Cje0fxtapPf9zD/ql/KewaKppomm+GacTpGiPXPRdkRLA93tee2ZjcCQGHW3ygr2ED03dd1xYfgsPn7MTxmVfqYJ7BjyaunGcXKOMDVufEjN7ccfQt8nxWuOLWsAHN4BhPmZI+7JrQ5ma0nT3sq4elwAadOGoceF4DETlM6dzSZky+zJ3r6SRNvchowW1ivUAsBT2f+sdc5ebi3Tqm+tkPm9M+PWzO73Ou+PclaH26DERz/cSL5+4RXMQTSGZTFM0WB7mXu+KZsFZ5L5QCHz4+VLJRDjdnh4nmM2t97A6GF0eP9AjZW2/KjOgaqVAnlgb6wqXOB6cx9QBMVfeMkHBE7u9+lRW9k7QsPZsMRWz/dM6bPtrNJHZaCqKBytvF2wfadVCgLxA7qtVhL5QymyG3ujCXZTfLg3dD93g53/MtobYlBIon+g== X-Forefront-PRVS: 09888BC01D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB1928; 23:XmRr1M6he7kxAUY3qhN0Iqd1K9rp0DzJl4oNrv20L?= =?us-ascii?Q?tRXmgg95E20joS/zWFuxtdrx9uVni4xvLVDRGLoR2VpPDZD8WZtjlwMay0h7?= =?us-ascii?Q?a/DujwvIo89DsvZyl0szY7I2/Cu8JKyTJxO9nRwdluseD2ci3cp/aO6r8TUq?= =?us-ascii?Q?ou38njarTL0+Pg3OlbMlyRosrwRpQW8gddDXYY7zG04VjO0M5p6Wg31ghti/?= =?us-ascii?Q?oW7DrvTcKGQq1SHPOfKd4TeK9ZyCvtNuN0G0jWZn4JRfywzcdMOsXCu4UAtp?= =?us-ascii?Q?DVGvWtRC8yOl5pJox3flZpFsg2sO3wassxK0YSGDI0pvODEachOkKNl6bCju?= =?us-ascii?Q?30coDXGnt7uRENJvRN/H1Gid7o2LsK3V2DwPakzsrQa/hAbp3dAYplfCG0IM?= =?us-ascii?Q?geykoxgaWy2s++W7WqJhACmmEokmJa14XLnhV4z5kCPZ7yPzCCudNUbIewYC?= =?us-ascii?Q?KX09koNBztzhaKihInmSDuSzdVz6to6gOQQMEyjzaKSv+VmzYgbYVxbPKsrk?= =?us-ascii?Q?n9Le+uy6E/AWb251fWEcD/sw6+0cRFlSoVn1UCC1/M0RdWRLpYmJ8Qnp+B1S?= =?us-ascii?Q?ao8p6HAcxko7aTmZpSJvgJZk2DHg0krBDCu+/S2rgCq6L3+c7PJwbjccFfx+?= =?us-ascii?Q?FW0njG4ms81Em6IryTi9hlG+esBfXo2f2dG76chhCdtH0Qu6rPHIGnEFYWOJ?= =?us-ascii?Q?sDWpYYDaw27hz09jrXUpAhs8hbNPQEXquz43mfDEQH1cBZTbutHMgutVNp7/?= =?us-ascii?Q?eYtqsL4UCevuoeLn12uEAkzvK0wc5xUIFn+NZw/NRFTAcy9iwP+2f1pnz5+A?= =?us-ascii?Q?DLUOX4eIb0cTahkfI6rliExi1mL5EacEXQGO6COLnfTrMNgQRiC7WYKILEFl?= =?us-ascii?Q?p/fAs1IREksj4VGwRvdgSYm1Yf60TTOpU2mcdkHBdNtGoW8P5NPvT/CoVyDz?= =?us-ascii?Q?9T5XtOQQj+nREtyjKV5uC6xU39Wrf58VXJjKBSMiCX9O3vS2ACdCeSpTS+3S?= =?us-ascii?Q?mXhg1lwKI/d8TDlaDhY+Pcz85FoMa9dftz15wbz5p242vU9P+5DAR56wnf84?= =?us-ascii?Q?U4tWa30+PPe/nbnYV30nIijZrHB3tiZZDBPx/9BBquy/lLiMznKkPtuThHts?= =?us-ascii?Q?d0mZOfTt9vpSpL6v8DEmYZnwoDX2GQi81owSIRaDYF5B1VOXkgleyDkgUWT+?= =?us-ascii?Q?fZcArhE0VSaD4ygmFjN/kLVFekgDuiwbmT1?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1928; 5:dItsxOvdxBDm4nKSRrn2JisKKNJzjfNr6jnG2C5EncSL6aF52ruaAftQ8aXVLExWIkxDs1rpD64TLkKK96w9xRAz0GiSO2s5yOGSJOJNlMZz0y8hJT3fFLWmr/eQEoCFJR3XC90MPVFfTRkNcVJCAnRNpHm/ldssHvbtoULiLTc=; 24:ODSg+cLDj4p45LSctHdzbPiqsV1p+wotMxAOt4Jb0UoZJ4V2HWpmpg/qp528oS7eq8EBezymVbjRSTQF54E/LlcAr96uhCJkYDOKw2N4dYg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2016 15:06:25.5007 (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: BY2PR03MB1928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_080644_854951_AAAEAC4D X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. 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: aisheng.dong@nxp.com, anson.huang@nxp.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, 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-Virus-Scanned: ClamAV using ClamSMTP IMX SoCs like i.MX7D requires using CLK_OPS_PARENT_ENABLE 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 df87d8888d80..6736e858b8f0 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)