Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp311732ybl; Wed, 11 Dec 2019 19:00:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwTnEBefkFgm6Why51LyGQTJMBpSBPRxHQJkSiPGOFmSLl+ZJYzSz+uKkhYeA7v58vDAG+I X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr5086231otq.147.1576119617402; Wed, 11 Dec 2019 19:00:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1576119617; cv=pass; d=google.com; s=arc-20160816; b=Vur7AO25NaEJla1JMFzihohKmUDfiggIeKLXVYMNvXCoSdE6SjozoTNOtM079zikuP 4tZFWsWm7KhDxRc2oTEdH+MAlVtq/xgGvv/SvD2EgHpdLjmcbUEU8OLpoio88XwaO8UV nqQrP+lK3enDuG8lwdx4e+OGvZ3hcG0erkQ6wkwRYzcAXIJVs45qohI5pbMZClSFWs0D x/W+Hq6Wr8+b5lC5mR5g/wG75dUCrAT/ZZI0AZ5skds8PEB1/1GJpNtr6VpR8WtukQyM xEDq7EYp0M8YLEanZ6iTbKRQGI7vjt5/SQZLeV/JzYN7MHeTLB+FXJj1T78s1uK8kBRW GlCg== 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=Gal1Piys1PGylfNZmJEiIuuLptpQRcnIdDp0U9Lza7E=; b=K8aQLAbMLUcd6qhgUuNHk6ZhMz+II5L5BCBNwCXHw/nZLGHNPJNmOwHO69yZBsVvzR Urj5Bq7aIATwh3qQT8Tb/+1jXU8yKBKrzWkHF0C7P1UtXlSzxo1gh+1N/DZWpY6pVMZx attnuFIixw4sWMVShxo8e8OFDs+iOM9FV+q4878QYTJ0VbmrChX3/2bMQIzLRzs0tqcF USJH9mrlmiohxuJ30yWJbcmfs4OLdt6G6IcDd+HIXMcbq2+YyHH4KkVH8KbFR8GZaQl0 yQq1NvpibZztpAlQ+n+C3qkdlOoaZ9HiUlEQpdccKgYllS/bfRFKG1wE7DwUsmg7xA95 cOaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=pR4zSLiJ; 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 v49si2468360otb.253.2019.12.11.19.00.04; Wed, 11 Dec 2019 19:00:17 -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=pR4zSLiJ; 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 S1727801AbfLLC70 (ORCPT + 99 others); Wed, 11 Dec 2019 21:59:26 -0500 Received: from mail-eopbgr60065.outbound.protection.outlook.com ([40.107.6.65]:2682 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726741AbfLLC7Z (ORCPT ); Wed, 11 Dec 2019 21:59:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hb0OvMwOfT0zAKRV8cocsCuRTN0fg64Z++w59egUdBfsFCg889lrYGqNhaxLL/mTX2vUz/ZkbgScna18Ec2kqqo93e62wKNK0aOHiSyipSXMSaoqGmKxZjTuhykeyrFaHor63ZeztgRDofmaibRTpSkrZ1jY66X+kI8UuSO/KqKJh1GzeyMkBiWxfDRQvgV7VO4hJ8I+aKVL20tx87U/8m7Axtn9UfgRFJH0YaW21tyzhLhTqdpVTTaqtiulh8y9gghRjyTUjpTV79OnyNaRYy7jbQmxhwWlJTqzN92oVY0+KNMjNd8G86TS4BFErJYqOcktMKJ9pjVl3RBbxisl4w== 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=Gal1Piys1PGylfNZmJEiIuuLptpQRcnIdDp0U9Lza7E=; b=M6ftBOYATEDukz02J9/jIZZdQ3bzG9p+CZ/vHBDrDIwOCPP3HuGdAORn8G6onparSWAgfTolms+XuaP7KqXhdzAMDIItn+O6IGd97qeLHWXkJHjPCSNi8LFr41u+LjzJZX8qflGDsjf2UjG+aLvQHnL3MSdDU2rvzrmLPdW1WhB0XUl1aBbSC0rTZayJ3IH/3tiU7VtTTL0B6eRDd79PmXGe/NMZu386NyubZ0W+Bo5BLfjqBldzfhaHhOzvD29mW4zuirHaCPJ4N1721obpScpghlnM2dKMWztOSKq5Qx6xKOSNOhLmDVHfDwevSw3UgiP4HxvArD48Zgp7CitMMA== 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=Gal1Piys1PGylfNZmJEiIuuLptpQRcnIdDp0U9Lza7E=; b=pR4zSLiJCX7aFEt6VlZOW+T7JABP+Ah2zOHlO4Cy9iKUos92ucoddMsvfIfY41pzudzMrBQZD2DwaZlIxgXfnVKFMa1NFLTUaNxTtMS7lIFZDMDqnrlPjjqbMCjtQHjT6nY6ftcgYDkogRQGmdEw1DOPyWhpAhN8vLh7F5Wi3Sc= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6196.eurprd04.prod.outlook.com (20.179.34.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Thu, 12 Dec 2019 02:58:42 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::505:87e7:6b49:3d29]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::505:87e7:6b49:3d29%7]) with mapi id 15.20.2538.017; Thu, 12 Dec 2019 02:58:42 +0000 From: Peng Fan To: "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa , Leonard Crestez CC: "kernel@pengutronix.de" , dl-linux-imx , Aisheng Dong , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Anson Huang , Jacky Bai , Peng Fan Subject: [PATCH V2 1/9] clk: imx: clk-pll14xx: Switch to clk_hw based API Thread-Topic: [PATCH V2 1/9] clk: imx: clk-pll14xx: Switch to clk_hw based API Thread-Index: AQHVsJgPEjS6WGPPHEml3WtkGD4THw== Date: Thu, 12 Dec 2019 02:58:42 +0000 Message-ID: <1576119353-26679-2-git-send-email-peng.fan@nxp.com> References: <1576119353-26679-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1576119353-26679-1-git-send-email-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR0401CA0022.apcprd04.prod.outlook.com (2603:1096:202:2::32) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 15891387-901a-4a68-9f64-08d77eaf3254 x-ms-traffictypediagnostic: AM0PR04MB6196:|AM0PR04MB6196: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:270; x-forefront-prvs: 0249EFCB0B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(396003)(136003)(346002)(366004)(39860400002)(376002)(199004)(189003)(81156014)(8936002)(316002)(81166006)(8676002)(36756003)(52116002)(478600001)(6512007)(6486002)(71200400001)(110136005)(54906003)(86362001)(186003)(66476007)(4326008)(5660300002)(2906002)(66446008)(64756008)(44832011)(26005)(6636002)(66946007)(6506007)(2616005)(66556008);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB6196;H:AM0PR04MB4481.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: BCL:0; x-microsoft-antispam-message-info: Iw+0/WqIf/KhIWTO+rXaLCzFRarV1+IeXe8BAwHTMllAe4qoLk6jdMGLzGdj447yPXm3stPGeYKFBxgO9B/jyYXoOfSaaAvajLChBjgKA+7oxJ2PoCvrRdhKR/41rlikj4haiBXgCxOyvxDgdemQ73hiSrIkViaxDOy47ipAOhlrMxST9QbqdWFTu2fLiajOLmyjmnGFQI36YsJRVayebrfWJAfmiijC2Pgz+ZP/EmpajOFaHSjHujICJESDJUSzFfhwApYf47AzXePM2oIc43X6RP6dCjtM4liap1Db4SSBH/Yl3Kjxw2+hJlfOfDz/rGiiRm2hOJ+vieJzj1z9/dwsvtBjk5/KMo/5KLXOmVxnMY51llpHn3knKX0bX1zxznGu/TGxCsyJ58db73t101Br+t9qAQP9q/r9v747sbOPmfiA2/WpSwI9wDIl5Tpn 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: 15891387-901a-4a68-9f64-08d77eaf3254 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2019 02:58:42.7696 (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: 88nPSqhIfjE50oGME9nX64FzT3biiI4uPfystoiUO6ost2s5G4t3/X8cM+JseFtS13Vwppi5BmsJ0Q94MMpb5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6196 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan Switch the imx_clk_pll14xx 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. Reviewed-by: Abel Vesa Signed-off-by: Peng Fan --- drivers/clk/imx/clk-pll14xx.c | 22 +++++++++++++--------- drivers/clk/imx/clk.h | 7 +++++++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index e2384271ed83..5b0519a81a7a 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -376,13 +376,14 @@ static const struct clk_ops clk_pll1443x_ops =3D { .set_rate =3D clk_pll1443x_set_rate, }; =20 -struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, - void __iomem *base, - const struct imx_pll14xx_clk *pll_clk) +struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_nam= e, + void __iomem *base, + const struct imx_pll14xx_clk *pll_clk) { struct clk_pll14xx *pll; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; u32 val; =20 pll =3D kzalloc(sizeof(*pll), GFP_KERNEL); @@ -419,12 +420,15 @@ struct clk *imx_clk_pll14xx(const char *name, const c= har *parent_name, val &=3D ~BYPASS_MASK; writel_relaxed(val, pll->base + GNRL_CTL); =20 - clk =3D clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) { - pr_err("%s: failed to register pll %s %lu\n", - __func__, name, PTR_ERR(clk)); + hw =3D &pll->hw; + + ret =3D clk_hw_register(NULL, hw); + if (ret) { + pr_err("%s: failed to register pll %s %d\n", + __func__, name, 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 afc794714992..caee661664c1 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -127,6 +127,13 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll; struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); =20 +#define imx_clk_pll14xx(name, parent_name, base, pll_clk) \ + to_clk(imx_clk_hw_pll14xx(name, parent_name, base, pll_clk)) + +struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_nam= e, + void __iomem *base, + const struct imx_pll14xx_clk *pll_clk); + struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name= , const char *parent, void __iomem *base); =20 --=20 2.16.4