Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp793143img; Fri, 22 Mar 2019 08:40:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaH9+y6+pBfefUdfXwUgUy4nps75lssRldD2d0tOKi5+fTdzjx6H+/foG1boN5A0DxbWjF X-Received: by 2002:a63:5b64:: with SMTP id l36mr9770055pgm.182.1553269210616; Fri, 22 Mar 2019 08:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269210; cv=none; d=google.com; s=arc-20160816; b=eXNpAEViaVbesOsEQV6af45ftY5IvHh0fJCxZKSnHC/zA8zdNkuvF5b8E7/VZg0Coi 3f1/njVxBYcXGXvkzAFddSMNbMyz0u2+K7JU0pfdAAp4jqRkJcGsOEFevIT3VYqHAIKJ 5a9vnHvRc9zUucApuDvGDv1dSX6dxn2Nu0Fm+IIc1KpmoQHbgEbtNQ2gPNE5JIwer87q RvVsFtjaFwM/+H4/130IZHhdi6Vsn7nka18DTFwH3nj3IvIQPFhGjV3A+gWP2vKouaB4 UW+gNQHfR9pHHU6nXRo1cmBZs/ObTGxlGMf0AKgMzqLZSiwZiWmCPC4Kjj/q7ofP4dmw S7OA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=lAAbScIIhBgg6XhslhvlfCd/geYV5i3HnPBBczZYy8w=; b=KBjWnXyMnqxFATrUKoolIcHDkDxDoBKZgdrKidfbmQzk8x56UT91hvD0G1XlcAJ9Nq aOXnN8gyRY2BpGd3BFqYb92+lsQTTYma1foQEk/VWGAJ3c/tFVuIvgOmosomH9Lwtaa5 6+VC91b0ymktDZsH7lIJoyizqd8hlmdXtMpjHfm5vUKmSDgWWnhmqg1O57na8FLP1fTM R1FrH/7KmkhfnjoalRNzOBwdSpPk4jxcugj8AxzbDG7sUn8mdjH1C89c0g0IicqIeeiZ 92gC7GaPTeReUro3xR6/w9R5Op/XNpfHOj+sNr1Vy1cywBv1K95omC0w3jRg3HmL8QTQ epUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=W2ohBsek; 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 f4si7001478pgo.257.2019.03.22.08.39.52; Fri, 22 Mar 2019 08:40:10 -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=selector1 header.b=W2ohBsek; 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 S1727899AbfCVPiV (ORCPT + 99 others); Fri, 22 Mar 2019 11:38:21 -0400 Received: from mail-eopbgr50074.outbound.protection.outlook.com ([40.107.5.74]:56385 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727651AbfCVPhR (ORCPT ); Fri, 22 Mar 2019 11:37:17 -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:X-MS-Exchange-SenderADCheck; bh=lAAbScIIhBgg6XhslhvlfCd/geYV5i3HnPBBczZYy8w=; b=W2ohBsekTLI5L0K6/gQ46c9PKV3d0PCBMQ5TIl72uLf/IB1O3bp5zraNt1/S//b64RSOzsJxL0ha+oJ1+NGUDF7fVzK8G/7LjronhgqgiK7CNjsv4CfUaQfOIo/JmfvWx7cKpdsipo06OsodFL/LADzudSHjo1qCuTA3iqqcw8A= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5636.eurprd04.prod.outlook.com (20.178.202.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Fri, 22 Mar 2019 15:37:07 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769%2]) with mapi id 15.20.1709.017; Fri, 22 Mar 2019 15:37:07 +0000 From: Abel Vesa To: Stephen Boyd , Shawn Guo , Fabio Estevam , Aisheng Dong , Lucas Stach , Sascha Hauer CC: "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Abel Vesa Subject: [RFC 07/19] clk: imx: clk-gate2: Switch to clk_hw based API Thread-Topic: [RFC 07/19] clk: imx: clk-gate2: Switch to clk_hw based API Thread-Index: AQHU4MUbtgRSWUCsYkC32rXux2vSYQ== Date: Fri, 22 Mar 2019 15:37:07 +0000 Message-ID: <1553269010-15591-8-git-send-email-abel.vesa@nxp.com> References: <1553269010-15591-1-git-send-email-abel.vesa@nxp.com> In-Reply-To: <1553269010-15591-1-git-send-email-abel.vesa@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0170.eurprd08.prod.outlook.com (2603:10a6:800:d1::24) To AM0PR04MB5779.eurprd04.prod.outlook.com (2603:10a6:208:131::23) x-originating-ip: [212.146.100.6] authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e87f5f76-5527-4ed0-3800-08d6aedc3dc3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR04MB5636; x-ms-traffictypediagnostic: AM0PR04MB5636: x-microsoft-antispam-prvs: x-forefront-prvs: 09840A4839 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(366004)(39860400002)(376002)(396003)(136003)(199004)(189003)(106356001)(105586002)(54906003)(110136005)(316002)(52116002)(6512007)(81156014)(97736004)(53936002)(86362001)(81166006)(478600001)(8676002)(2906002)(14454004)(486006)(99286004)(36756003)(7736002)(71200400001)(44832011)(71190400001)(3846002)(5660300002)(386003)(4326008)(6116002)(6486002)(50226002)(14444005)(6506007)(66066001)(256004)(76176011)(446003)(186003)(25786009)(11346002)(68736007)(26005)(476003)(6436002)(2616005)(8936002)(102836004)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5636;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: rhNhOgzQ7TU67VlDSECf8+7ej9R8sZxspc1gaJIsLltM305S5F4M166n2vHHLO/pCPKOzX4E3dhoayLN7xzpi/EalsJ7x4sCumddomnpPG+UGqZ9fI2ZXueeof/5HsFn0TqfaEHkCvSRjvYkG8DOUJ6ERwgPllFebLX+04O3yRC31+gCfX0YBISFOXxHY7jTok75ILhYhr5fUBgJJKKt/ZyeRdaAZIEDbwxMoPJGDDuntioC5Mx9emDQ4jQoDwYNTfM8YkSqP+eKA2MaZcYy5Nigw1Q66kQQr98TaqxunxH3SYzAVP8mG0TXoju/lt+HlerzGVndj6sNlbj+B3Znr/tAH+eN8as8ealL/71O+N1iSWKdaO6xubqJMquuGOvHnXrsaj+6pJZ07akyc43XYmbYjb958flao82LoAk1ecc= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e87f5f76-5527-4ed0-3800-08d6aedc3dc3 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2019 15:37:07.3647 (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-Transport-CrossTenantHeadersStamped: AM0PR04MB5636 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch the clk_register_gate2 function to clk_hw based API, rename accordingly and add a macro for clk based legacy. Signed-off-by: Abel Vesa --- drivers/clk/imx/clk-gate2.c | 14 +++++++++----- drivers/clk/imx/clk.h | 7 ++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c index 60fc9d7..14551fd3 100644 --- a/drivers/clk/imx/clk-gate2.c +++ b/drivers/clk/imx/clk-gate2.c @@ -125,15 +125,16 @@ static const struct clk_ops clk_gate2_ops =3D { .is_enabled =3D clk_gate2_is_enabled, }; =20 -struct clk *clk_register_gate2(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 cgr_val, u8 clk_gate2_flags, spinlock_t *lock, unsigned int *share_count) { struct clk_gate2 *gate; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; =20 gate =3D kzalloc(sizeof(struct clk_gate2), GFP_KERNEL); if (!gate) @@ -154,10 +155,13 @@ struct clk *clk_register_gate2(struct device *dev, co= nst char *name, init.num_parents =3D parent_name ? 1 : 0; =20 gate->hw.init =3D &init; + hw =3D &gate->hw; =20 - clk =3D clk_register(dev, &gate->hw); - if (IS_ERR(clk)) + ret =3D clk_hw_register(NULL, hw); + if (ret) { kfree(gate); + return ERR_PTR(ret); + } =20 - return clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index a7f69ff..cd1a820 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -58,6 +58,11 @@ struct imx_pll14xx_clk { #define imx_clk_cpu(name, parent_name, div, mux, pll, step) \ imx_clk_hw_cpu(name, parent_name, div, mux, pll, step)->clk =20 +#define clk_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ + cgr_val, clk_gate_flags, lock, share_count) \ + clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ + cgr_val, clk_gate_flags, lock, share_count)->clk + struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); =20 @@ -95,7 +100,7 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, cons= t char *name, struct clk_hw *imx_clk_pllv4(const char *name, const char *parent_name, void __iomem *base); =20 -struct clk *clk_register_gate2(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 cgr_val, u8 clk_gate_flags, spinlock_t *lock, --=20 2.7.4