Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6265155ybi; Wed, 29 May 2019 05:29:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0u4dveaMAETw0PgJWCtmDp1OOcWzMASwWDopj0H9FMRmmicEbCQjQ4GwctxkylV2Knew7 X-Received: by 2002:a62:6341:: with SMTP id x62mr149192794pfb.63.1559132975316; Wed, 29 May 2019 05:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559132975; cv=none; d=google.com; s=arc-20160816; b=bnoalOfO312b5TKq8yjCNZfjFyvtIviVuRhVguIE24yiLkZ8+Q73GgRbPAkg1VGNeF Rf19+pIcdvMCLwa1R92yGOOw8RyJ1KCN9CsO56nGkFjbw9A1PahIMDiOdH9uhBtQjuD7 Tdv3oo0EXH9A3LLp0d8W/qJfDEouvfG/AWDwHkmO6C+l1L3cU5MK6oBQBYDqyhGh06F4 awZH4iNIxs8e60d9dv3AT+ydZeMzGVA30iAMhw9Qzk27eiHZhp+oDZloGWlmMpYadB+f 1SIPaJoCM44/QGcBJMNF7rZV5i89X1ciJucQkqJJzk30ZTEsqKFQ3CXSR/7MsijBQVzv fBCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=63elpXaV+M5PoT8qwRfydpHbq8xQrvyvg/OpZ/JHvcM=; b=zUHnTN8QgElE0I4aEu8tvyHShIf9g8Eq8MAnWLyDn4Mg6RLU0MzL+msPPHVLWLG5OZ n6+25CUt6U5UKdRmyem6SSxbSDKXQNmFoR3Z5ckm7bNqiHjZtY+oRSAh2Zh5D+ZlbA19 QafRS/ASL1ab0pmXKCuuTe1BkvixsEpm+FbVz303KuNF7+VPQWTeRNIyOz1cDhMma45g /GsVnmSINnCzEN/pbYGYLiKQjzwoSR6ZdkeEuM/J2lHjJanDz3njqeLhUWKuZapHwobu auQ0BF0meMP+mA2BXNvpS9XuOMR7c9dVGSWiD07FZQ3NuODoE6XNGMAURaK+Y/NgW893 7RHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IgnIgsOw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si2119167pjq.18.2019.05.29.05.29.18; Wed, 29 May 2019 05:29:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IgnIgsOw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbfE2M1f (ORCPT + 99 others); Wed, 29 May 2019 08:27:35 -0400 Received: from mail-eopbgr30051.outbound.protection.outlook.com ([40.107.3.51]:23783 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727019AbfE2M1A (ORCPT ); Wed, 29 May 2019 08:27:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=63elpXaV+M5PoT8qwRfydpHbq8xQrvyvg/OpZ/JHvcM=; b=IgnIgsOwMWJXNleWjBn/j9mwML+6aM0hZfVm3uFljCplBiKn9UWCQHsfKWuOHLsL90tx7g6eIaa3HMqOqSH9UcjgrjjKQcB6tL7VFGg2yPvDqnA2subXJ9xJ0Lz5oSPlnjjnrkCCGG2f4wLACkRXszhWFBxnyX+crSjWaliqDMk= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB6049.eurprd04.prod.outlook.com (20.179.32.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.17; Wed, 29 May 2019 12:26:47 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::c19b:5964:bfcb:96a8]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::c19b:5964:bfcb:96a8%7]) with mapi id 15.20.1922.021; Wed, 29 May 2019 12:26:47 +0000 From: Abel Vesa To: Mike Turquette , Stephen Boyd , Shawn Guo CC: Fabio Estevam , Aisheng Dong , Pengutronix Kernel Team , dl-linux-imx , "linux-clk@vger.kernel.org" , Jacky Bai , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Abel Vesa Subject: [RESEND 12/18] clk: imx: Switch wrappers to clk_hw based API Thread-Topic: [RESEND 12/18] clk: imx: Switch wrappers to clk_hw based API Thread-Index: AQHVFhnHwJFgnmY6/0+WHIL4bEnEtw== Date: Wed, 29 May 2019 12:26:45 +0000 Message-ID: <1559132773-12884-13-git-send-email-abel.vesa@nxp.com> References: <1559132773-12884-1-git-send-email-abel.vesa@nxp.com> In-Reply-To: <1559132773-12884-1-git-send-email-abel.vesa@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-originating-ip: [89.37.124.34] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0b392600-b364-4368-23a0-08d6e430eb37 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:AM0PR04MB6049; x-ms-traffictypediagnostic: AM0PR04MB6049: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(1496009)(396003)(136003)(39860400002)(366004)(346002)(376002)(199004)(189003)(6436002)(476003)(73956011)(53936002)(486006)(11346002)(446003)(76116006)(186003)(5660300002)(102836004)(66446008)(66476007)(66946007)(26005)(44832011)(64756008)(36756003)(91956017)(66556008)(8936002)(316002)(2616005)(66066001)(99286004)(256004)(6116002)(6512007)(3846002)(76176011)(68736007)(305945005)(14444005)(81156014)(81166006)(6486002)(6506007)(54906003)(110136005)(478600001)(2906002)(7736002)(8676002)(14454004)(86362001)(71190400001)(71200400001)(25786009)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB6049;H:AM0PR04MB5779.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: k3jR6NV7In/vzb7Sa2VC0t+um66qWcRDuDELVnqOF4JoJeEqe42Qg8ldNk3EWB+tMlfkMAKkwAyOorDVWvwg/pF1U5AaEpi28Bxbohu9ZMZrYZZjAh/mutkH2KyVZ01lias13OEwhenOLqdGKw8XGnoEnPnz/UzjeWuy9TVLr8WYXpB9b0+1Kkzxzc/5RvA0vhTa52CLusecS6scvB1bT6ekdn0TLzYWGEqW51qGgjerLH2XXKN6G+REIWxRjjhqcvtQXTr7EO4gyTi9vLMmmXkq7GlRDCCJR5TlP4Cv6ZrhGouM5XbWl4lLyZwxwmRkTGgFLAQX3322vdagstaMwXUcf+nZPLBWMZBzDy+mqwKa0jz8qG6TQxOYMFE0j9w3TSBn+3Uyb1+myFj/da5J0PxeFrbi1yRYEBkzWVz4IrU= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <4E0936259FCFFA4AB811FD02EB8509CD@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b392600-b364-4368-23a0-08d6e430eb37 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 12:26:45.1969 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: abel.vesa@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6049 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch all the wrappers to clk_hw based API and rename them to indicate that. Add macros for clk based legacy users. This allows us to move closer to a clear split between consumer and provider clk APIs. Signed-off-by: Abel Vesa --- drivers/clk/imx/clk.h | 91 ++++++++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 65 insertions(+), 26 deletions(-) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 5fa8b7c..d94d9cb 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -79,6 +79,45 @@ struct imx_pll14xx_clk { #define imx_clk_fixup_mux(name, reg, shift, width, parents, num_parents, f= ixup) \ imx_clk_hw_fixup_mux(name, reg, shift, width, parents, num_parents, fixup= )->clk =20 +#define imx_clk_mux_ldb(name, reg, shift, width, parents, num_parents) \ + imx_clk_hw_mux_ldb(name, reg, shift, width, parents, num_parents)->clk + +#define imx_clk_fixed_factor(name, parent, mult, div) \ + imx_clk_hw_fixed_factor(name, parent, mult, div)->clk + +#define imx_clk_divider2(name, parent, reg, shift, width) \ + imx_clk_hw_divider2(name, parent, reg, shift, width)->clk + +#define imx_clk_gate_dis(name, parent, reg, shift) \ + imx_clk_hw_gate_dis(name, parent, reg, shift)->clk + +#define imx_clk_gate_dis_flags(name, parent, reg, shift, flags) \ + imx_clk_hw_gate_dis_flags(name, parent, reg, shift, flags)->clk + +#define imx_clk_gate_flags(name, parent, reg, shift, flags) \ + imx_clk_hw_gate_flags(name, parent, reg, shift, flags)->clk + +#define imx_clk_gate2(name, parent, reg, shift) \ + imx_clk_hw_gate2(name, parent, reg, shift)->clk + +#define imx_clk_gate2_flags(name, parent, reg, shift, flags) \ + imx_clk_hw_gate2_flags(name, parent, reg, shift, flags)->clk + +#define imx_clk_gate2_shared(name, parent, reg, shift, share_count) \ + imx_clk_hw_gate2_shared(name, parent, reg, shift, share_count)->clk + +#define imx_clk_gate2_shared2(name, parent, reg, shift, share_count) \ + imx_clk_hw_gate2_shared2(name, parent, reg, shift, share_count)->clk + +#define imx_clk_gate3(name, parent, reg, shift) \ + imx_clk_hw_gate3(name, parent, reg, shift)->clk + +#define imx_clk_gate4(name, parent, reg, shift) \ + imx_clk_hw_gate4(name, parent, reg, shift)->clk + +#define imx_clk_mux(name, reg, shift, width, parents, num_parents) \ + imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)->clk + struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); =20 @@ -173,19 +212,19 @@ static inline struct clk_hw *imx_clk_hw_fixed(const c= har *name, int rate) return clk_hw_register_fixed_rate(NULL, name, NULL, 0, rate); } =20 -static inline struct clk *imx_clk_mux_ldb(const char *name, void __iomem *= reg, +static inline struct clk_hw *imx_clk_hw_mux_ldb(const char *name, void __i= omem *reg, u8 shift, u8 width, const char * const *parents, int num_parents) { - return clk_register_mux(NULL, name, parents, num_parents, + return clk_hw_register_mux(NULL, name, parents, num_parents, CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, reg, shift, width, CLK_MUX_READ_ONLY, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_fixed_factor(const char *name, +static inline struct clk_hw *imx_clk_hw_fixed_factor(const char *name, const char *parent, unsigned int mult, unsigned int div) { - return clk_register_fixed_factor(NULL, name, parent, + return clk_hw_register_fixed_factor(NULL, name, parent, CLK_SET_RATE_PARENT, mult, div); } =20 @@ -222,10 +261,10 @@ static inline struct clk_hw *imx_clk_hw_divider_flags= (const char *name, reg, shift, width, 0, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_divider2(const char *name, const char *p= arent, +static inline struct clk_hw *imx_clk_hw_divider2(const char *name, const c= har *parent, void __iomem *reg, u8 shift, u8 width) { - return clk_register_divider(NULL, name, parent, + return clk_hw_register_divider(NULL, name, parent, CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, reg, shift, width, 0, &imx_ccm_lock); } @@ -246,10 +285,10 @@ static inline struct clk *imx_clk_gate(const char *na= me, const char *parent, shift, 0, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_gate_flags(const char *name, const char = *parent, +static inline struct clk_hw *imx_clk_hw_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, + return clk_hw_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARE= NT, reg, shift, 0, &imx_ccm_lock); } =20 @@ -260,47 +299,47 @@ static inline struct clk_hw *imx_clk_hw_gate(const ch= ar *name, const char *paren shift, 0, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_gate_dis(const char *name, const char *p= arent, +static inline struct clk_hw *imx_clk_hw_gate_dis(const char *name, const c= har *parent, void __iomem *reg, u8 shift) { - return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + return clk_hw_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg, shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_gate_dis_flags(const char *name, const c= har *parent, +static inline struct clk_hw *imx_clk_hw_gate_dis_flags(const char *name, c= onst char *parent, void __iomem *reg, u8 shift, unsigned long flags) { - return clk_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARENT,= reg, + return clk_hw_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARE= NT, reg, shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_gate2(const char *name, const char *pare= nt, +static inline struct clk_hw *imx_clk_hw_gate2(const char *name, const char= *parent, void __iomem *reg, u8 shift) { - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg= , shift, 0x3, 0, &imx_ccm_lock, NULL); } =20 -static inline struct clk *imx_clk_gate2_flags(const char *name, const char= *parent, +static inline struct clk_hw *imx_clk_hw_gate2_flags(const char *name, cons= t char *parent, void __iomem *reg, u8 shift, unsigned long flags) { - return clk_register_gate2(NULL, name, parent, flags | CLK_SET_RATE_PARENT= , reg, + return clk_hw_register_gate2(NULL, name, parent, flags | CLK_SET_RATE_PAR= ENT, reg, shift, 0x3, 0, &imx_ccm_lock, NULL); } =20 -static inline struct clk *imx_clk_gate2_shared(const char *name, +static inline struct clk_hw *imx_clk_hw_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, + return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg= , shift, 0x3, 0, &imx_ccm_lock, share_count); } =20 -static inline struct clk *imx_clk_gate2_shared2(const char *name, +static inline struct clk_hw *imx_clk_hw_gate2_shared2(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 | + return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, reg, shift, 0x3, 0, &imx_ccm_lock, share_count); } @@ -312,10 +351,10 @@ static inline struct clk *imx_clk_gate2_cgr(const cha= r *name, shift, cgr_val, 0, &imx_ccm_lock, NULL); } =20 -static inline struct clk *imx_clk_gate3(const char *name, const char *pare= nt, +static inline struct clk_hw *imx_clk_hw_gate3(const char *name, const char= *parent, void __iomem *reg, u8 shift) { - return clk_register_gate(NULL, name, parent, + return clk_hw_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, reg, shift, 0, &imx_ccm_lock); } @@ -329,10 +368,10 @@ static inline struct clk *imx_clk_gate3_flags(const c= har *name, reg, shift, 0, &imx_ccm_lock); } =20 -static inline struct clk *imx_clk_gate4(const char *name, const char *pare= nt, +static inline struct clk_hw *imx_clk_hw_gate4(const char *name, const char= *parent, void __iomem *reg, u8 shift) { - return clk_register_gate2(NULL, name, parent, + return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, reg, shift, 0x3, 0, &imx_ccm_lock, NULL); } @@ -346,11 +385,11 @@ static inline struct clk *imx_clk_gate4_flags(const c= har *name, reg, shift, 0x3, 0, &imx_ccm_lock, NULL); } =20 -static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, +static inline struct clk_hw *imx_clk_hw_mux(const char *name, void __iomem= *reg, u8 shift, u8 width, const char * const *parents, int num_parents) { - return clk_register_mux(NULL, name, parents, num_parents, + return clk_hw_register_mux(NULL, name, parents, num_parents, CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0, &imx_ccm_lock); } --=20 2.7.4