Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp586645ybc; Tue, 19 Nov 2019 06:13:16 -0800 (PST) X-Google-Smtp-Source: APXvYqx+HCbUoMeDymv5dQyIPAnu80VX+zBaacpV045zGAujcmdzmb6LqKmumRrTHKtCQl6fJBUa X-Received: by 2002:a17:906:8548:: with SMTP id h8mr35086414ejy.290.1574172795959; Tue, 19 Nov 2019 06:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1574172795; cv=pass; d=google.com; s=arc-20160816; b=kYxjEGy1zTX4C2MAgJtyOJ+sZ+YbuEWsQdAz+yklHKhIeSyFxuJa5UDMzEZ2GFSmBw b3viKUL59YzRN6L3NLORfYJ5HkyCeWO7kHlYOzn5zbGE1320kx9VemV3WMgT4iTNnT92 f4su/far2gzrWY7MV2onXxzpV8l70pV82ij5EDNEfmIKw2n3yQYSWoZ+Dh2OOghyKXRS yRfTjz7Hfv8tMsGSq3S3Apqhg2eFijL2wTFJkQbsWoysFM+AO4yPq6lHu0avEQWs23nh 39HfVIte7m2vqAIU9nplP9dOqvyZu+Z3UbMD3iQEVUspc4EI3S6pVP2g9be0nbD4sLq9 qYHg== 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=s9o9cq9TzC6cC27ZBSd5J5BJyLR4OaDIdjpiH84qvtE=; b=y/qXh6lYMWyFCTV7LfpBHsFsEmQziOewkGk1xNH2vx0dn/41ZuF6OGtF2B95rMhM1f CTBQfZFW44bffKEYWs3rkuwoOajKpXXm0bkSoKuAz/Y2QuBKy6ERfYK4VkHGQOQU9TUc LRhOZelIsip5oiy8U2LoGa7YgCRubpW5HCqpIFXpEE00GSEh1oBn+iZYqPbcPY7Fqzkd MFOWB5mewuQyhe2UAoh0KiTNlijtvBXIVZxgcgqGHNXIQZKMiFfMz3vfuep4w/rZ6Bop 7VCm6BFEEUq/Qt6fhPG99P7cZJosHVE1dE8cDQ1XgrP+V0HZwCqU0ZdUH1nJWS8ScZD0 3b4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IidN1p51; 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 rp9si14256986ejb.40.2019.11.19.06.12.50; Tue, 19 Nov 2019 06:13:15 -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=IidN1p51; 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 S1727958AbfKSOIp (ORCPT + 99 others); Tue, 19 Nov 2019 09:08:45 -0500 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:9830 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726369AbfKSOIp (ORCPT ); Tue, 19 Nov 2019 09:08:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GN/tDrGZO+wQlNuj6At81mxKr3o0wBRCtqWdSWhkehw350NHMFXg37BuE++Mq0kwKrehtPXMNZdizZSNyWZNnuWXlZ8w0wlPDuf7S6oG7jNfe/WmVE1WK7CQPwmJCWZQYr8lyvF6PGTSZrdcKEErXwP4TmhNtLm94l1uDPp4N3js06cI94LWbXj9Dmd+Gmrs8uGqQ5tweQ6Gkqfq09KGz/N+I/VJ4siVqehEsqEo6xSdPB50OByOduHTc99seaj1vxdBf4WL1hEBxwvDCncUeCbFml+NvLwJLT472DZOmWE7QMvujTDdYT0767pmmlbLWPGUywQu2ly2byFmyu697Q== 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=s9o9cq9TzC6cC27ZBSd5J5BJyLR4OaDIdjpiH84qvtE=; b=JV6WboQfxTrxtiw9dE1hIO8LOl0boBdSF9zi8z8xTm0uyl9IpIiuDbkBvnqPuCO5fjf8+P+iX5b/wit0q3r701YslgRwkn0LTOcz2BsJioBgdmE7s6kgU+EM6G3jjBK13HNe6JL/y9mQCQB+F5+E4EgsqL+QCHzWEyaDBNOsx3My6NdZiwIvTXvGBP3i0KEEIbTBdpI+VpJvJ549eCsnFnOt/fLl+Ren2Ozg5A0NbqhkutjGFp0bzFynywhC/yfizOVZqP3bytSrquHzvuxs5GGBJmtloQ4wHAPWEXEdGpMtctj+XG+EnVy3ejBFCaOEP+q2A8LEkKrI/vvzZPjAcA== 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=s9o9cq9TzC6cC27ZBSd5J5BJyLR4OaDIdjpiH84qvtE=; b=IidN1p51Ym+TvBBnfjlo6Ek5bxxbSk5pOrC+iYZd9kqx/t0b95/UvOIMpTZqrBXf/GQLHVv7k0F9Is+wbKKqG0abLwW7XnRmMh6/YN63eiSPa1cfNVusvETDCnmgIKKvScjXmd8Wx0J5QRhmWposq/CkHqJ7dwD52ICbpCcGb6I= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5428.eurprd04.prod.outlook.com (20.178.113.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Tue, 19 Nov 2019 14:08:40 +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.2451.029; Tue, 19 Nov 2019 14:08:40 +0000 From: Abel Vesa To: Aisheng Dong , Shawn Guo , 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 2/9] clk: imx: pllv1: Switch to clk_hw based API Thread-Topic: [PATCH 2/9] clk: imx: pllv1: Switch to clk_hw based API Thread-Index: AQHVnuLXtPo0oM/VL0SGxgLMTYi0hQ== Date: Tue, 19 Nov 2019 14:08:39 +0000 Message-ID: <1574172496-12987-3-git-send-email-abel.vesa@nxp.com> References: <1574172496-12987-1-git-send-email-abel.vesa@nxp.com> In-Reply-To: <1574172496-12987-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: AM0PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:208:122::39) 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: b6b15f31-06a7-470b-b712-08d76cf9fa41 x-ms-traffictypediagnostic: AM0PR04MB5428:|AM0PR04MB5428: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 022649CC2C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(396003)(39860400002)(376002)(136003)(346002)(189003)(199004)(110136005)(256004)(86362001)(316002)(66446008)(66556008)(66476007)(64756008)(66946007)(36756003)(446003)(7736002)(305945005)(186003)(3846002)(6116002)(26005)(5660300002)(478600001)(52116002)(76176011)(99286004)(2616005)(66066001)(54906003)(2906002)(11346002)(6506007)(476003)(44832011)(386003)(6636002)(486006)(6486002)(102836004)(25786009)(8936002)(71200400001)(81156014)(81166006)(71190400001)(50226002)(6512007)(4326008)(6436002)(8676002)(14454004);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5428;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: ciYASkefnzprbcD6oVVyMiMGEgBdvvw26ktRZXMfhR9tUml/qVUwNohlW0h3noqdrzY245Vj4dd+KizEsRAmhEXkK9+cfT9V8W7xP7m6WroHwZFQQ0R2YKZJWCDWh6ZpA5bQpvq5vCeXfSomwdzorY3gmBOOExKqtgvk8d468aG6EAWs+l4LRS4xDytbWMLINodg+lfHe4kYXBZhSb5KEme5St2Rd+BGyFxD+yAjgBoweDYXttnsYuBQD17eKhlD+KZcQ4KTs0DoSdF34lUclStOyj57z7wbW3MzHRAqcD8krwYFoXIAkZMd8GZ4T8D8gq+4zd8C0ONMa0X39Z6RpSI+K1v5sk0I2kf2wP02b5Gv2pcx+qHcBWis4yAjXW/lzx8CVoxS6PMx6/TOlFnn+s8v6puEPK93etUx5Xe/Iub8R2GME3lGbBJc2cMg6gA8 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: b6b15f31-06a7-470b-b712-08d76cf9fa41 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2019 14:08:39.9420 (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: 8AIrRhsJCtUHaS2zGkmL2YVlRTnekPAsYIHccdANAbuHDveptecXFJ5M7MhRirVO5XFmxrfeeyoZ81+v/R1GNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5428 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 --- 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 945ce4d..af69fc1 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_fixed(name, rate) \ imx_clk_hw_fixed(name, rate)->clk =20 +#define imx_clk_pllv1(type, name, parent, base) \ + imx_clk_hw_pllv1(type, name, parent, base)->clk + 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