From patchwork Mon Mar 12 09:29:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 10275711 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 DED396038F for ; Mon, 12 Mar 2018 09:26:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4A4F28B10 for ; Mon, 12 Mar 2018 09:26:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D92E228CB5; Mon, 12 Mar 2018 09:26:52 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 4943A28B10 for ; Mon, 12 Mar 2018 09:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbeCLJ0v (ORCPT ); Mon, 12 Mar 2018 05:26:51 -0400 Received: from mail-eopbgr10051.outbound.protection.outlook.com ([40.107.1.51]:2657 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751911AbeCLJ0t (ORCPT ); Mon, 12 Mar 2018 05:26:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3/wu97u0YL64pV0tLX2Ur0uxgggjZ3d0naB894YwWKM=; b=bLLDypZmKSsRaB9cHYeC0NKhZdvOmY7yhxmyUM8+CFvPZdL2niTTxcKO6MY4E6VP5rxd3HFSwXq3wRTvafPj32oO3RytL7j4/75DXtACH1BPa1NtUmNNOtKO6HCUQ26heN1usibnThUbEsQJFBUNLNVTCR7n8fhgW5p4bRADDyE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ping.bai@nxp.com; Received: from localhost.localdomain (92.121.68.129) by AM5PR04MB3108.eurprd04.prod.outlook.com (2603:10a6:206:c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 09:26:43 +0000 From: Bai Ping To: sboyd@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, kernel@pengutronix.de Cc: fabio.estevam@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, aisheng.dong@nxp.com, jacky.baip@gmail.com Subject: [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion Date: Mon, 12 Mar 2018 17:29:15 +0800 Message-Id: <1520846957-22348-2-git-send-email-ping.bai@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520846957-22348-1-git-send-email-ping.bai@nxp.com> References: <1520846957-22348-1-git-send-email-ping.bai@nxp.com> MIME-Version: 1.0 X-Originating-IP: [92.121.68.129] X-ClientProxiedBy: HK2PR02CA0189.apcprd02.prod.outlook.com (2603:1096:201:21::25) To AM5PR04MB3108.eurprd04.prod.outlook.com (2603:10a6:206:c::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 94cb59ca-07b6-424e-65a5-08d587fb6097 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM5PR04MB3108; X-Microsoft-Exchange-Diagnost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6oBIpCkuQgxsxblRlPYtOdXdIn29+v4eeDnfmWfRyDPc5Grr4g5hEgEe0a0teLW909jvIdAIwiAhIsoYUZib3EJpDihyEKluE0LOeU0J+XJqxaMlLggAjdVrcj7IQqwNp4DUe0Kjt8BK3KTrpOZzIeQiG84Syg5ITvMar4P12z+gou4OYTzS1nZdZmE0c36GWMOg0V7GZcY0gKKuwmXe+gL535tLv0bmtZoSKoNJOpA5PnPfY1+ip07zECHeZuHywqIlKAGILJxI3KaZK/yQj5BEKIsnfBx2flc3HH+92XxFV0gVZ8u593ikhcM35WJocGYm571tQXz0lFbPDpsFeV5MrsLetJgMkdycv4Sp5hQzNGV+XwT+p; 4:obfdRVUo8NGUSwiiDfxCCMQOCVSnna5u+Edk2MiSO0JJ16dWcF7sFltgddM4suro5+9FWiynkTDpeBjUCqEF8tDG4Cmph3Q1rWPAWNv5MV4HrGEjIjdIz5K6Tm2J/N4iOUheFqmpzuGVQdKkHwff6XtA04f0wIx9K8TxfGUhqbg2B9VTEJmy01neQwA32LsRvYcOn/D3uhHFofDUDtnvbB9+DHpGtOn4A4lxSU1XmdTjtu0xhyHs8J9g8/hrB2Dz+aEzw5po6hbJsoItTvHWSOZ7fWKJFEf/HOxS1mdaRrOp94p8xgxiDFPhQDYs1nZM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:AM5PR04MB3108; BCL:0; PCL:0; RULEID:; SRVR:AM5PR04MB3108; X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39860400002)(376002)(39380400002)(346002)(396003)(366004)(189003)(199004)(105586002)(66066001)(6512007)(26005)(386003)(8936002)(6666003)(39060400002)(53936002)(47776003)(2906002)(51416003)(50226002)(86362001)(52116002)(316002)(6506007)(59450400001)(16526019)(6486002)(97736004)(186003)(2950100002)(76176011)(106356001)(81156014)(7736002)(5660300001)(8676002)(4326008)(16586007)(36756003)(81166006)(25786009)(50466002)(6116002)(478600001)(3846002)(68736007)(305945005)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR04MB3108; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR04MB3108; 23:eWgCDgsyemJcqb8/jBEzUzrR59dJYd5TxKa0exQ25?= =?us-ascii?Q?iAffSBQOBc/LG8897MnfP1m1W2ZqocrROSREABs0SXyHCOn/KdubL5B78t0N?= =?us-ascii?Q?1LcE1EFmdhn/3hoU/KE/Fu/6KzvBaKJ+Y1j3asNFnHjPEIxPbrW2UL2PaZTC?= =?us-ascii?Q?qy6sN4zHWVYhNl7WsXJIZFI7hucRJ3t+77xYOWcV953AMIQEtqgeVEGQoool?= =?us-ascii?Q?4EdmcsySkd/ivuW4YXJmR1gC6s2T/67NL0q/lQ08/bDd0aBybIzY7210iAJC?= =?us-ascii?Q?JFpevD7rZSdnb5mzSSQ3eRAdwp5mZYfDgChoWGbYnVcuVxqueguSQXz84EAX?= =?us-ascii?Q?UB3uRZLu5P1FBnocbRlIy0sde/WRnsHSYO7UoXfSFQh21dK4SYtuVS6MSXYo?= =?us-ascii?Q?IGFW6xmJGulQiFO9Y0vfyochONj0Aqo5F62oJsvUZGRLmYSHxI690WC7WVZn?= =?us-ascii?Q?bds8DAfB/cjKLv+Apw68lQp5nomHELV/zFshk2igBrOzBImkRUOtRrlFLQBO?= =?us-ascii?Q?EK0gyG9JoKwMYFUzDRnIICwLbSoTb9/pQz4eAtS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Trt18JtO7qOfNXYlg1Q2duc98qgXBFdzb6QffsznZ0k4ZlRgY8vjhGECLi6RDYqoYFeG8hZigtbSQtB7bwUmeM9fQ/rxWrHNrOk2eFzDX6cOkpevsmLatXVz/k2koJpx7KtnsJtlH5xqd3jgPdMMJqpk/cJrwwfX0Y3Nou+Y9QMIw8LS26MLEIA9x5sqUsZ82OxNP14a8oGpOyaBZltp+cxEhupsJ+XV8KUSxBipOBw9Gfvc2mE0agV/DJEMzMSWnW3QBmG92djAzvTLXrlOXwcs3ZnNDxhVvMi3ApZLnfaa0+Os=; 5:mWIpAvfbvMKFcrRsLTNvUmFlErppOVHi+5ShP2Hz8IXhqRA5oZRJtn6yWrfNl4KKx4vcpsSRtwBFE5Axa7xalQCO8aLVQ5LSMerR06jv/9s4+Cs6L999db2p4vbAaFTezfEc2l9MiKwcblAOpCxVYq0BpkQ6deV8BlZjb8kgeSQ=; 24:giHm+aRwJAB7bjPZBMhnXbk7spKd4ET9qCJK4IBgQkdXpbS+lcXEK2GauOkkBWBlmLApb+HVtk1aoip3ehZT7/bzQPGCObVIdiTRVsWubyA=; 7:Kc0xDsdtCuvjKeJO/95EPLGZTHchf/SxJ+gnc1JS4QdmRPE7hR3iFYdZVUJsJpCaJNtbyf3+vBPtsHDRpIGcu/sDsCkeKSXCpAFS0PWIbmQVZeRlrbnzSgAhj5090qTINGdWQVn9H7zv9kOWmltka11Y/I7BZBsAkIFu61fLyLE0WbaZnyvclZmV1t4SEUcfoVq/5TgYiWJlPj/R/nHnumgqkt7IVRM3ruMaCgJ6w4JT9pU9baA1pCJ1tgpADGLQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 09:26:43.1743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94cb59ca-07b6-424e-65a5-08d587fb6097 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR04MB3108 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 Add new gate/gate2 wrapper function to register clocks with optional flags. Signed-off-by: Bai Ping --- change from v3->v4: - no change from v4->5: - optimize commit subject --- drivers/clk/imx/clk.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index d69c4bb..8076ec0 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -123,6 +123,13 @@ static inline struct clk *imx_clk_gate(const char *name, const char *parent, shift, 0, &imx_ccm_lock); } +static inline struct clk *imx_clk_gate_flags(const char *name, const char *parent, + void __iomem *reg, u8 shift, unsigned long flags) +{ + return clk_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARENT, reg, + shift, 0, &imx_ccm_lock); +} + static inline struct clk *imx_clk_gate_dis(const char *name, const char *parent, void __iomem *reg, u8 shift) { @@ -137,6 +144,13 @@ static inline struct clk *imx_clk_gate2(const char *name, const char *parent, shift, 0x3, 0, &imx_ccm_lock, NULL); } +static inline struct clk *imx_clk_gate2_flags(const char *name, const char *parent, + void __iomem *reg, u8 shift, unsigned long flags) +{ + return clk_register_gate2(NULL, name, parent, flags | 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)