Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp792341img; Fri, 22 Mar 2019 08:39:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4aQKMwjnzPjFg/ibJwDGWKo8T99YFAewS5pUdJ/5LCev9MLi6iLipn+HTAhjbh+EtmpoY X-Received: by 2002:a17:902:b68b:: with SMTP id c11mr10173888pls.79.1553269150744; Fri, 22 Mar 2019 08:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269150; cv=none; d=google.com; s=arc-20160816; b=Omo8b0+PBe1FeGGiDUaBlVIFQaVZHB6fOas/PoBXnXCdBkdWf2ryC6c0F9bnJaYuda 9TF4zUkNiJq5FyhC74GqdVtJvrXwl6DZscJ8akITELW6/askFO4mBIakqLGNJt+B7TUm fl5pwv88oxHmBdljyKrK1KTG7z6BvFle9zprkWbOwa/ya6g670aIsWVXyX6pEVDlJ8JX vHQAVnhuHVXr4QdsI1YgcoxGPM5eWKbLRdNiLmN11p/EToxkrBnVJon45DoBCEtFJLix bia7KFM9AcPv6fKUPEmKB+veI/0Wk+nnwJ04oVzx00QG2c7GnmVI68352AAJk8bDXQXh oh+A== 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=Je9sTSzzrnVQQtBap+T5b3qB0yALb+e4Qr9zNm+DaN8=; b=EjHrMWNhgrIFEYJS18aRBLW+0wdNiLD81eB1DUYRRXj3l73RVE9zW9MN5jyREum3C3 p/KxXUWdfiif93fA/Gi/X6MPcKUQX0WfH4dpA3P2LHhhxXwW6mkH+eFaeR7ac/yTyRaR tTnHxFQCiy1xDlwLsZWmdo5kr2567TuKDHxjAb35E9cLOinsLq4PqVlTlt1IPaxGLqda IKnM/HDgnxURDCtPywK642xAEI9g3nAD9aDfexOxYbaVMxtlbHMO9FwUGv9b4Ol1feJx PxKIgyQOJWJxN3//sBZ14QTcPs0JxxU3xKMnzS8wGKKVO09JuEI5A7sEqltcdFE12S7q UmJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=iNpQhmpy; 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 u73si7504263pfj.30.2019.03.22.08.38.53; Fri, 22 Mar 2019 08:39: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=iNpQhmpy; 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 S1727766AbfCVPhf (ORCPT + 99 others); Fri, 22 Mar 2019 11:37:35 -0400 Received: from mail-eopbgr60072.outbound.protection.outlook.com ([40.107.6.72]:41091 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727570AbfCVPhS (ORCPT ); Fri, 22 Mar 2019 11:37:18 -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=Je9sTSzzrnVQQtBap+T5b3qB0yALb+e4Qr9zNm+DaN8=; b=iNpQhmpy6yUCNdiBC1EqyKdhhHJw2/0QgXzC/AfMFb8qqfi8IETMNSoIFSdWznKQWtdBpJAKUHCH5gf8B9A7EMLM2yBw0zi035/5UwVCOUKJbmTHUBByotbXT6FTUI+/xQaPNyVwErnrjpD84D0AIWedezSqH3X5HO0ZICn23pA= 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:08 +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:08 +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 08/19] clk: imx: clk-pllv3: Switch to clk_hw based API Thread-Topic: [RFC 08/19] clk: imx: clk-pllv3: Switch to clk_hw based API Thread-Index: AQHU4MUbiN1Iu1FSX0CEo2cszl41DQ== Date: Fri, 22 Mar 2019 15:37:08 +0000 Message-ID: <1553269010-15591-9-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: b99a6b9c-7a94-490b-cfb5-08d6aedc3e4a 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: 9pk3c04XNOp1To2MS9WnFBXbTNSKhkn5qKmq3NO5yGOAfp4f/pvcpqI1FKYQYb7vws/0A3xyoviJWty0/iV21a3JiNQw2xZ5evzYzseSjHyMV5XPOr+jN6aZcxYhmjgf5RUodKZUjr5IpJdMyIc0O8KPUXTNr6FhEYUtf1NAjPcGAwEJ7+ckdG0GEKmg263FnKnGWDgZZM1rMFshFv/AsSbIaKUshrw/E9TYC5dgOv1IgM9MTxPJu1Z+7aO1OAiFsWd0D55XWWby59iiJ1CxCQQc5l5bcA/+myAG+u1J684er2rIO/iNhf56/5gtx6y40yuMAbWiqpxY5QW+iHc+h/Ukr15/mr+u/GkinRXV6Pp8lZdzCnZNdTMFk9ZqkjE7zmdOo1Klt5W5WKN5gG54/uWhRMK6EFe2XZFh+w/mdFg= 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: b99a6b9c-7a94-490b-cfb5-08d6aedc3e4a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2019 15:37:08.3434 (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 imx_clk_hw_pllv3 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-pllv3.c | 14 +++++++++----- drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c index 9af62ee..2e9201a 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -412,14 +412,15 @@ static const struct clk_ops clk_pllv3_enet_ops =3D { .recalc_rate =3D clk_pllv3_enet_recalc_rate, }; =20 -struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name= , const char *parent_name, void __iomem *base, u32 div_mask) { struct clk_pllv3 *pll; const struct clk_ops *ops; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; =20 pll =3D kzalloc(sizeof(*pll), GFP_KERNEL); if (!pll) @@ -469,10 +470,13 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, c= onst char *name, init.num_parents =3D 1; =20 pll->hw.init =3D &init; + hw =3D &pll->hw; =20 - clk =3D clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) + ret =3D clk_hw_register(NULL, hw); + if (ret) { kfree(pll); + return ERR_PTR(ret); + } =20 - return clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index cd1a820..89f1276 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -63,6 +63,9 @@ struct imx_pll14xx_clk { clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ cgr_val, clk_gate_flags, lock, share_count)->clk =20 +#define imx_clk_pllv3(type, name, parent_name, base, div_mask) \ + imx_clk_hw_pllv3(type, name, parent_name, base, div_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 @@ -94,7 +97,7 @@ enum imx_pllv3_type { IMX_PLLV3_DDR_IMX7, }; =20 -struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name= , const char *parent_name, void __iomem *base, u32 div_mask); =20 struct clk_hw *imx_clk_pllv4(const char *name, const char *parent_name, --=20 2.7.4