Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp17144pja; Fri, 22 Nov 2019 02:52:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxmxTelbkzPKNRUqAjD6eJvVgx385ldVGT1DB9XA6K4RYvqKmKWP3DYfr1LLW7wEb/WNi+k X-Received: by 2002:a17:906:7812:: with SMTP id u18mr21115390ejm.6.1574419931813; Fri, 22 Nov 2019 02:52:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1574419931; cv=pass; d=google.com; s=arc-20160816; b=za0VYsK+n1umCcnBSybrBzPQTVQocEjXp9Q3GP+w/XWO6x4RbmZly4inQ5/K295HPC psPog+1E0pdK4SodMAB2V5AsYkEcNrVGGnXvYTKlu0NQVloewQUlveLz7ZUP1ErujsS5 mjngk0tSl0MhW6LovOHnylEsorps10e6NOzxQ2dvg1CKu6rDB+7DycOrXm3b1ns4DPtj 8xeOkO9A3KffsPsXOgIKXPC3VKnNj99R2IjimfWbYkkT2ojInq+PbJ3lt7dftGD+BR0d C/igdlsU83p/raVNtGmFcSKzuFwA+PxLPoWlxDL2GUuNUQZQmC+y/enogUjbQ1Kw+HdD MEXQ== ARC-Message-Signature: i=2; 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=qjpNt3BKobqblXOtBaq8pdvK3XqmVPORcjlWWWAh5Rc=; b=zTTbxN4nNKowUmUKDQj0kwrfAUuWhBE8rA73p9t6PHnc+FA/ER/VmPooe59alyiifL 0QYDzjZ/odOCjeFand6agQ5WCZyC92nNEC1Wa2qc065pBoJP5wFngdkdWtfi9k5fYVVW A61108Vn2t80BXZY67zmFgxJ4JvifqmB0SPgSG1VuRl4BJsGd6O9eFYal9195b8oUbse LkNl3yiJuKb6wJHM4PvnnVAjNLFwHkctAtAI1gLJ973blln4I/8SyNZzG+LN/vfhJRMu HyDDXotE3aRKsoCN6InoejWqgEqsmMo2HyWExw/ygxNzcO6VxJcgfUbDhl4pauxttIq/ cXNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="B26G/BPX"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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 y3si4118040edv.423.2019.11.22.02.51.47; Fri, 22 Nov 2019 02:52:11 -0800 (PST) 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="B26G/BPX"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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 S1729959AbfKVKsc (ORCPT + 99 others); Fri, 22 Nov 2019 05:48:32 -0500 Received: from mail-eopbgr20045.outbound.protection.outlook.com ([40.107.2.45]:34373 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729922AbfKVKs1 (ORCPT ); Fri, 22 Nov 2019 05:48:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N+alRPxoEcGqA5Vo00h5dyJbvBQZqPA392MDwoVMgIh+kao9YUM/gJU0QOfo910kfihhZLVQdLSZoIGTKJwEXALtheaKlHuBV0Ojtq1XFLGgkh6kxJtK9MC4u1ULPuEti+gdn4iXsPY6hHXCx01EhehxrGGJ04buLTNGyyoV4jSUpWapYMNGiy1E2orOpdGqORLONVhagu5eeuu0C8Ee7n1yr8ecVUx71CxGJW1GKyH+UmSyAY7zwgqZELz1LJ/mT7whjuG7I9J2hT+DAKcfDSm7VkXKoT/M4SkZFunP/WZl/WQoG7/R5WPNPwtGv2MC7VUawIXH/9mD7+xTPvaiLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qjpNt3BKobqblXOtBaq8pdvK3XqmVPORcjlWWWAh5Rc=; b=iKoc3e8j8GJj7Viw8A/XsmVfaNTyg9e0gTFiFuNWlNPkF0DaRBOEM/E6ar1W/A9/qSLLanhaC0p6WNya8ED1GSSAclS+xRxEDE7s9zc665xzckTEYvqro+Ovw3vXptp6Cys85+PZ8LP0MfclWesOYemuYHo+pRD/mpHQH0Wo65CYZuD/gmymURbDIel8ogQtYBfDh/zO942SIRKKfyjPx7g5RB1wl44TSb4cyg5k8RW7oR8MuQ9Y2hzwpSh47VjmP4iTHnVtC4pSQ8bKK9kuew6+m2LUATJLD4xrYlrpJp/dtMb8nMh8d5JsoViDPo4XO4P2H0vEv8KRbHA8M98tFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none 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=qjpNt3BKobqblXOtBaq8pdvK3XqmVPORcjlWWWAh5Rc=; b=B26G/BPX47IXXMNpFTNiea5/Gt057Kn5G3j6KarvgMIeF/ITqffjw4Jdmyk0IzbMNlvYGUAoavNvxixZziar9hjidhAFuKbPOji15Y+ytPjOGXKpgWoFaNfdjdAIcmbenGmdBkDhKP9oF6o2+hu7TQwKI5TZ0XwXIOe4qpfPoOY= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5074.eurprd04.prod.outlook.com (20.177.42.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.19; Fri, 22 Nov 2019 10:48:14 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::fd44:1b14:587c:9fde]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::fd44:1b14:587c:9fde%7]) with mapi id 15.20.2474.019; Fri, 22 Nov 2019 10:48:14 +0000 From: Abel Vesa To: Aisheng Dong , Shawn Guo , Leonard Crestez , Stephen Boyd , Sascha Hauer , Jacky Bai CC: Peng Fan , dl-linux-imx , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Abel Vesa Subject: [PATCH v2 04/11] clk: imx: pllv1: Switch to clk_hw based API Thread-Topic: [PATCH v2 04/11] clk: imx: pllv1: Switch to clk_hw based API Thread-Index: AQHVoSJXY0stcOmqOE+UvoibgGHUaQ== Date: Fri, 22 Nov 2019 10:48:13 +0000 Message-ID: <1574419679-3813-5-git-send-email-abel.vesa@nxp.com> References: <1574419679-3813-1-git-send-email-abel.vesa@nxp.com> In-Reply-To: <1574419679-3813-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: AM0PR0402CA0020.eurprd04.prod.outlook.com (2603:10a6:208:15::33) To AM0PR04MB5779.eurprd04.prod.outlook.com (2603:10a6:208:131::23) x-originating-ip: [89.37.124.34] x-mailer: git-send-email 2.7.4 authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 982772e9-97d8-4925-07d6-08d76f39797c x-ms-traffictypediagnostic: AM0PR04MB5074:|AM0PR04MB5074: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 02296943FF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(366004)(346002)(376002)(396003)(136003)(189003)(199004)(478600001)(256004)(6506007)(54906003)(7736002)(305945005)(316002)(71200400001)(5660300002)(110136005)(102836004)(186003)(86362001)(66066001)(71190400001)(2906002)(4326008)(76176011)(99286004)(36756003)(26005)(52116002)(386003)(8936002)(3846002)(2616005)(446003)(44832011)(11346002)(66556008)(66476007)(66446008)(64756008)(6486002)(66946007)(6436002)(81166006)(8676002)(81156014)(6636002)(6512007)(25786009)(14454004)(50226002)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5074;H:AM0PR04MB5779.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lPdSnzOEUo3of75HJggUUlW4XnpK87N49wpoZsy/A5c1eNY2z5cLzllU9E5pBfN0XNDW2i6f/vBDCwWiWDfxLphsTYAdUGYeRdaz1PkqocPk3wsxVfSBQ1k8BVNJ+eJkx18tMd8/s2BrDP9ZBOQ9jFxrXUslkbsLVmk5YPGDLK7AU/xZS+sjYpJq4iw90dHqKnK/S0z8RhYNhvXGIXOOG+GtUXtij/gIZC3CeFUFHaXzyIGF73av3SN6PA+4sYS9+gjGjoED9+9ToqGlND2zY6kUKgg23ogde4s3sM8kzlyPG2dB/TrF16Nyf62HG1dBqXaCdbGOj7yd7lhQrdENDIfikKYG7LpAY0lyP670o3+BcfO0H+Ui5dPyjEfUTyW2nkc5DRzhD3dKqIjCSLyJ4INH14YhuxQZLNjBk09XJs9zRFKeZdPPVW96t36PPNCD 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: 982772e9-97d8-4925-07d6-08d76f39797c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2019 10:48:13.9604 (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: 7hMArpO0L/3Vh+x+H0DkTw5iWlDJ4pKn6gWt70uiwPocKOvk7j3GBhFpIKMpVxt5529s+cxg+xLfuHBSIWxirg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5074 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch the imx_clk_pllv1 register 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 Reviewed-by: Peng Fan --- drivers/clk/imx/clk-pllv1.c | 14 +++++++++----- drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-pllv1.c b/drivers/clk/imx/clk-pllv1.c index 4ba9973..de4f8a4 100644 --- a/drivers/clk/imx/clk-pllv1.c +++ b/drivers/clk/imx/clk-pllv1.c @@ -111,12 +111,13 @@ static const struct clk_ops clk_pllv1_ops =3D { .recalc_rate =3D clk_pllv1_recalc_rate, }; =20 -struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name= , const char *parent, void __iomem *base) { struct clk_pllv1 *pll; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; =20 pll =3D kmalloc(sizeof(*pll), GFP_KERNEL); if (!pll) @@ -132,10 +133,13 @@ struct clk *imx_clk_pllv1(enum imx_pllv1_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 3ed17a1..bd6a592 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -109,10 +109,13 @@ extern struct imx_pll14xx_clk imx_1443x_pll; #define imx_clk_mux(name, reg, shift, width, parents, num_parents) \ to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)) =20 +#define imx_clk_pllv1(type, name, parent, base) \ + to_clk(imx_clk_hw_pllv1(type, name, parent, base)) + struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); =20 -struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name= , const char *parent, void __iomem *base); =20 struct clk *imx_clk_pllv2(const char *name, const char *parent, --=20 2.7.4