Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6265323ybi; Wed, 29 May 2019 05:29:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8T70W41nQoVHbKC4LXgrrg+aaRkbTTN6iMg7v8lg+X092Pre+W5hAImZci/CLbDJNVwNz X-Received: by 2002:a17:902:2bc9:: with SMTP id l67mr106793474plb.171.1559132984793; Wed, 29 May 2019 05:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559132984; cv=none; d=google.com; s=arc-20160816; b=M6mDYIyoHxNMd5z0kRAkZg0OpJ/iJ1kM/6pGAWiWvEn6XbavXNmfgd1kAMvjCcqViy y2Yb2S2UTr3QnNY9fC3tWiS6okQQNpYOBAx27qOvm8seVDsjN0RVjso3wXm4L3X5O8yd ezpSbzCitRsogTCSoVsIIem3ijnVpG+9OGZqQiL01cu4Be7Nii9Ef4J/D8jmv4PZD8yI CjUBWYInj4fPxXqWh5E8Sqsj35MdXK4m9Hsu+glTwarWIY4FQ8pcxdFZb8qtdQB0yDnX db+9mSlRYi4lWMjnU+DzDxR0noSgBjtklpVw/2C2VmxbTei2WrbanVHKvAaYx69zQLGg Vkig== 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=hLbpXdunSi7M2PQJawiliaDpmLbkuSrqoEAZsaPquhc=; b=zsA8mMYNbY32vxh+VCj0fbrFYHWIVbZAckZvvg6ttyaJmAkpZEwbaFOfByrGr4ycqm 7Zr09RSiKJ0457vZ9zhR3YjBl9GV98I9LwXyHj8cg8ych4YbIjdasJGkmp/Gj5A+vbv9 sD8sewmDXzw7J3VrI26evf5DlDZvv1ojzRxs0T9rxNuzbG50tWOxpRIwHrNVzvpDCklx LfDKxlBaPzr1CroEARwr2XJXI45vnuYDnGQ66UjA/BOQlY+5Gg+/6bB5/mJe4+NGrG6s maYp1Ypwq82JrdUw+qbDf5Uv5slJ1DP++H3cEJ0PyB+TjReB5KCsNNz5U4IllvH2E1BG yp6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="gJj/66qm"; 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 cg12si19593272plb.19.2019.05.29.05.29.29; Wed, 29 May 2019 05:29:44 -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="gJj/66qm"; 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 S1727145AbfE2M0z (ORCPT + 99 others); Wed, 29 May 2019 08:26:55 -0400 Received: from mail-eopbgr70079.outbound.protection.outlook.com ([40.107.7.79]:5830 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727106AbfE2M0x (ORCPT ); Wed, 29 May 2019 08:26:53 -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=hLbpXdunSi7M2PQJawiliaDpmLbkuSrqoEAZsaPquhc=; b=gJj/66qmJ1Mczm/GkeRu6aLJL/jzF2inQxtl0/CGkAzSRQZI8PJnOjAQzu37Mal9B+CiblTt3sP63l8gb0/rttcKYiNxYe3aeb04ctFaoXwEnH2J+6fJ79RxE7gm+sQwxXYC6RWcBAbxhg8T9Y7Y1fv3JcEjSkIRqgWLURTDC0c= 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:44 +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:44 +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 07/18] clk: imx: clk-pllv3: Switch to clk_hw based API Thread-Topic: [RESEND 07/18] clk: imx: clk-pllv3: Switch to clk_hw based API Thread-Index: AQHVFhnGEsdfs+pU1Uuqkbzjv0pyIg== Date: Wed, 29 May 2019 12:26:43 +0000 Message-ID: <1559132773-12884-8-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: cc91ed79-8f07-4527-9f54-08d6e430e932 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)(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: XNkJe/Wbl0nnJYHO4MVlwDimJFa850oQTz8RB2zK/7iPxv27rgN/aK8WgAyOlwg/4tn2G/N9OG4rQ9JjcSeEcXNvcnOhH0Cu5L+oEJ+k5j/xay9T0ygpXZk0jtrRseClo4YVaVuXoijW8nZ+tZTvDPgeNbqdT7Gi4waO66DwOU49cizsDeqAyhgHKXcjdUO6p2xGgA206nwVF1uw66YZQ4NL73rw98dCZTqeEd3SGWfnUzKAunUXWJddWcpY1hxr1Sw6qx+F4Pds1a0Em5T7wokYXro0UFf4iyUiJml2LA8P3hVUXdpSchtUjF0xRXayxZ/mbUIgKXzAB4xW70k66MIS+hh75W12bqVlghsf1IwRzdDdYmnyY+Xk6MB1pQ8GZWlF74xSErdwdGi2R+g5DEnI+MMc3ETPnmpXUCcgkuQ= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <792EE3B0587FB548AE139830902ADB57@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc91ed79-8f07-4527-9f54-08d6e430e932 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 12:26:43.2900 (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_hw_pllv3 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-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 4110e71..23aebca0 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -416,14 +416,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) @@ -484,10 +485,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 9c5e20c..8aadc92 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -64,6 +64,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 @@ -96,7 +99,7 @@ enum imx_pllv3_type { IMX_PLLV3_AV_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