Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6265351ybi; Wed, 29 May 2019 05:29:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYCvjnzf5PbJaiLwLLUlPogIBPHctlv6dl1B3MVltCWvWfJNQA3tr7K8ZkrQOpMkbJgdis X-Received: by 2002:a63:d716:: with SMTP id d22mr8841034pgg.244.1559132985841; Wed, 29 May 2019 05:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559132985; cv=none; d=google.com; s=arc-20160816; b=TKlMVjkPtGL7ITppjUIjOL3iSmZx2PYUZ/x4bzxOUNU/U7M02Ea6YOAARbypma9518 cmisqHrqJwY41Bo3XNpud9zTPQl6VDfzt3bf/5sMEkJvs0ldLeRSbJ3S184WPQLblWxt Jx3Vep2ODII3Shpax5FQRqhXb3aLuRt8oz2O+xiInl4L7r7WYtF/g/Tw2PtMs0V0LZ/j 7m1SJgthkDuqDUpANMKLEya1yxPadNhIP14bSa8lE8mo+W0IDLCEQlbY4nHlZt2b/1XU P6FzepepuwC6sRyrqjjFbWzkdNj8pDMmZcN6nUB0HmxbaFm/OdgAvdecf/YodCwijD6v xO1w== 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=WlZjdPJCp1MCmge1PPrAOrbXmogdvICvsR0Bf95MuxI=; b=SkmweUNUW36/arhcPUTIUIRc6OaBFEMYS7nrkfajGNfn0UpUNQ8pBXMU7gB8pm8eAl VecUsDMBGV3Hdjv4ZtdeqirjCSJHLp2C2G/JxTeO+OdBPhM6cQgJW1he95JrRzq+/+G0 7qV6PMB0YX/XNQc2+jgNpgTw3r/NNNeKOpLiUDrIouv8JwBapijlQ5N+wDZhuZFOyaTJ 2Pzt520IyTNQDIr7837j/LpSQb8E4mpMG36FWvg8lW6nYGnOTPkSUkcGHQ24uDHDDDeM Fmzlz92h2iig0O6RPN/70vyCsehJTTlxZLZ2ALGKVpi6GbQc2LPaKsi/FzD6poBJg252 CpxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=SRsMJ20W; 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 g191si28092678pgc.197.2019.05.29.05.29.29; Wed, 29 May 2019 05:29:45 -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=SRsMJ20W; 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 S1727325AbfE2M1r (ORCPT + 99 others); Wed, 29 May 2019 08:27:47 -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 S1727041AbfE2M04 (ORCPT ); Wed, 29 May 2019 08:26:56 -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=WlZjdPJCp1MCmge1PPrAOrbXmogdvICvsR0Bf95MuxI=; b=SRsMJ20WG7/B1E4flM/ZO2JNiTCKRwgt1MUDoAvey4qTt16N7JrYTMJX840wUrODKQOwICfLcxipVqs34DZ3jS63tP9I+Q5TPW4IBLnzda6VFlekFmwsR1feYLy1VQTs8k5qWiwI89q6Gy9rf3fj/CUP2PjVx+cV0ginwG/yF50= 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:45 +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:45 +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 09/18] clk: imx: clk-gate-exclusive: Switch to clk_hw based API Thread-Topic: [RESEND 09/18] clk: imx: clk-gate-exclusive: Switch to clk_hw based API Thread-Index: AQHVFhnGT3lmZG8wxEOdWY3zvgoVIA== Date: Wed, 29 May 2019 12:26:43 +0000 Message-ID: <1559132773-12884-10-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: cdef34c2-068f-4398-d839-08d6e430e9e1 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:2657; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(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)(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: mks3SNtiZ9jyk4uEbpJSUJJvvmO8JpaMAWCM/hUNDfBs+tLlfq1CriUpt1AL0CX93eu0KF8ZnmHELlKej1+z5jC2arJ6s2jExfFYPpgItrgS3rNvdBlQo/uO/G3gwDzBQQTL7eVjNq8EcCXKc/yHku9NsFbhSgUf1eBz/uyY1caMODiu62Xsi8rXcXl4zJ1QT37lOtH9a3V8icBNKWUWralCDwfdLKSOR+bNmaI+I9CWf8l2C02Swi6eglkcIFcxrd76H3FMh8cBurBaBMxLeAIyr5Upyyio8qJg/QRVXkKlrQITRttN6jnlugCKnp2LItT2V6bBpvsHO3mrpH+HoXisn2JdNZ+FR8pVppQBGTvNIPZ0ZOE0ORj6enES6OVpp2AROkIzaS0Vd7YZQfxvehOvTtboHH5YJnwhO4tJTAo= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <87F380E5A3F9404BA3C8F9B0E29A4C57@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdef34c2-068f-4398-d839-08d6e430e9e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 12:26:44.0326 (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 the imx_clk_gate_exclusive function to clk_hw based API, rename accordingly and add a macro for clk based legacy. 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-gate-exclusive.c | 17 +++++++++++------ drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/clk/imx/clk-gate-exclusive.c b/drivers/clk/imx/clk-gat= e-exclusive.c index 3bd9dee..7bd9f14 100644 --- a/drivers/clk/imx/clk-gate-exclusive.c +++ b/drivers/clk/imx/clk-gate-exclusive.c @@ -58,13 +58,14 @@ static const struct clk_ops clk_gate_exclusive_ops =3D = { .is_enabled =3D clk_gate_exclusive_is_enabled, }; =20 -struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, +struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *par= ent, void __iomem *reg, u8 shift, u32 exclusive_mask) { struct clk_gate_exclusive *exgate; struct clk_gate *gate; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; =20 if (exclusive_mask =3D=3D 0) return ERR_PTR(-EINVAL); @@ -86,9 +87,13 @@ struct clk *imx_clk_gate_exclusive(const char *name, con= st char *parent, gate->hw.init =3D &init; exgate->exclusive_mask =3D exclusive_mask; =20 - clk =3D clk_register(NULL, &gate->hw); - if (IS_ERR(clk)) - kfree(exgate); + hw =3D &gate->hw; =20 - return clk; + ret =3D clk_hw_register(NULL, hw); + if (ret) { + kfree(gate); + return ERR_PTR(ret); + } + + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 87a1a88..1c6300a 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -70,6 +70,9 @@ struct imx_pll14xx_clk { #define imx_clk_pfd(name, parent_name, reg, idx) \ imx_clk_hw_pfd(name, parent_name, reg, idx)->clk =20 +#define imx_clk_gate_exclusive(name, parent, reg, shift, exclusive_mask) \ + imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask)->clk + struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); =20 @@ -123,7 +126,7 @@ struct clk_hw *imx_obtain_fixed_clock_hw( struct clk_hw *imx_obtain_fixed_clk_hw(struct device_node *np, const char *name); =20 -struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, +struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *par= ent, void __iomem *reg, u8 shift, u32 exclusive_mask); =20 struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name, --=20 2.7.4