Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp312039ybl; Wed, 11 Dec 2019 19:00:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwj8aR0jGdNUZnkU5UVr5u1HNZ9jYip6r40rwcNN6CQx3eGzjhdOH4F3A7plYuTMjbz9uhN X-Received: by 2002:a9d:4f0f:: with SMTP id d15mr5659063otl.179.1576119640604; Wed, 11 Dec 2019 19:00:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1576119640; cv=pass; d=google.com; s=arc-20160816; b=LCxK+j1MEPhCJ3adgwImp8g7SD2y3ptCW2Ncoku90ixXjhy9z6bu8gUnzmibTrIuO5 AIH8/h/7y62GoKDZQUk860F0Q1/UpfJbVVq6Wysn94hvh8Q6NoyPFM+iGWbZ+9xGoQiP dDJ2N+rNli4ME5UiLRR2ivlIMvlcsNNyITJ85yY7NXOlHcu2sOGUEM0j6lqdQARJJJUc HbVi1APCMACt0LhgAl4OtJ6Kc9TUEjjBtq4pOMJflN1LGGCy/OQw3D94FzamKNv+Uw9m b6f47UmyJXXX1DdhZRvGJXSjNakcJsmEmk8zLckhob7n/VWYhWGvAaeM0VVpAge30LOg q05A== 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=vpl+Dx5soGUTxlTaBpLYsaowwaezpsTRUzF190iSDm8=; b=LYfumcmFaJfPKenpzOheg4YS4VqLAmg0wTbbFpjQn2bRQaQuPLi+d+5v+nRzcUllvo zmxl8VRxxLTtaia4ct+mKWUumyUFfnSyISiE0le+6iBZC3kZOtrI6R70UQ5mg8XdPLlW o+p/q2rvo7ta+CrRPsQHXo6cgdh0w+pNNPHBSCnTLIOL3ZJjfxlntmqzPE9og2gXYgWt jxu12q8VJ+WcHhuCfolPBXH6C9YhXvV4zAc95TQndwSfUH/JvZDCXTLBbj/dYBNjF7PM W37K8H4QQCoYmJP+EQX6y048yhWGP86dkSvnQtpWRzgB7A/++wXA9H1yZfv0wG1xUe3q UkHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="NW/I11Sn"; 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 n8si2338498otr.102.2019.12.11.19.00.28; Wed, 11 Dec 2019 19:00:40 -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="NW/I11Sn"; 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 S1727884AbfLLC7d (ORCPT + 99 others); Wed, 11 Dec 2019 21:59:33 -0500 Received: from mail-eopbgr70082.outbound.protection.outlook.com ([40.107.7.82]:54337 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726841AbfLLC7b (ORCPT ); Wed, 11 Dec 2019 21:59:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hDXbUtLxjQzHAGofWFh3VERvuvnNnoXtLZgvry992TNNNsQYx7p0kVp4pS8JNzEG1QdKO0bhelY0dhhHpEO4ZfALrGVU/nC0oTwOEmtYj11ogjTkes4GXraCV8eF6f2TtCXRjYsWE3ktBWCpuiC9enuGzPqjZzA4TEErmjZDz90aFKkqDN0dJ/YbgEvsm6OLT8HzRqx/3+JAS+NRA/3F2dSShBUy2Vba4Vy/LAIC+crCtXPndxJmkHDMQKsNXtSwnW2Di+CtdpkA3d4aRQdt10L9O0Y63Y+4ZIOg7OdG8h9glftBRme5xFOcAPvoBxLSA60OsJWNRhxKUkMb8ulTUQ== 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=vpl+Dx5soGUTxlTaBpLYsaowwaezpsTRUzF190iSDm8=; b=OnD9IaVtnY8rZW6Qc6FihUI4szYGHwKo0NRJ4ea6BG/UmshtmrVgVOUmjltXmX4Lh1ZHgjoqPSklwixQ/fTjHVy7Q0RBxl9F2xMYwcdMnHZQi+oqrM8DGW1y30sneiGUwE7XWLCEYBvJV9QLKqV6hDgaqoS+SumBlX6hJWy0A5dEit7dKAd8H39w8dzqQ1aTnHqg3otjK7vTA4K74/gnSoBRBhNI2M2m5R0RdQ7tTDVqDI9d7OttOCc4yfG/4vptiwe/Yq+6NxZyji2QAP17Dk1SZD5nFEwlnHYLqhVxcHH0C0aSauAOkQFEw/8qOPMaFqciW8NT7ACrAyI8qfd9fg== 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=vpl+Dx5soGUTxlTaBpLYsaowwaezpsTRUzF190iSDm8=; b=NW/I11SnYaWhkkHUQE1wQ8varOrNxZ/Ok4Yk///5dU91cgQlWWzrSxOaZRRVEq/Fs+7UOLYz54C/Nm+Jkqld9sU1YWsa/lFkwWDMvYnV/7Vt0yOhlZlqly4Z26KPkylleR5ynGaTN7cqa7I1r8Yut7/wqovB4v+fNfac7H5AxLc= 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:48 +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:48 +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 2/9] clk: imx: clk-composite-8m: Switch to clk_hw based API Thread-Topic: [PATCH V2 2/9] clk: imx: clk-composite-8m: Switch to clk_hw based API Thread-Index: AQHVsJgTdY4qYDarhkq5MjuDwQda7w== Date: Thu, 12 Dec 2019 02:58:48 +0000 Message-ID: <1576119353-26679-3-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: 21ca3453-2c2f-45fa-142e-08d77eaf35e8 x-ms-traffictypediagnostic: AM0PR04MB6196:|AM0PR04MB6196: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; 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: YxlRVIjaK4vsGTwqwEaSEZQ802eMVL9ucPmnGRgK+Cq+OVmP3eteXhnczH7D/qn+OCygXqr3pFaq9OeYgRfIVPC5S6s5ER+SqfO87Uj9LedUCWQdi1eDvZ6+9xLE2yI0kN2oD4k2VghCHYSrlw+ilKchIaVsa54t4XoYgf9HMKJ8l/Kc15SWA6m2jxbQtY0U9VsNQ4sqPFWV/P1j56VbG1dI+pKP3Dk2PWJFZ+fSFHmZyRykmVtUI9HsMjyy9HToelStmBQFEN3Zthh2HJhsN0rLl3qBw9Izq/EdvzIN/ysZo2auhZ/x2F17kQnRtmYI7eoBRWUlFYR/PH4xwB0N9zbSIBDptZNjk+0iOeW4S0lpif7iI0QrCBzBQ2/dhN/sC4Zuy0isLaiLEQXLYRTbvXJjdrYxIf8z7ccM86hQES4u5iJj2gsfJzAuRVURbY02 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: 21ca3453-2c2f-45fa-142e-08d77eaf35e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2019 02:58:48.6921 (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: 4g+oRr9sf19X/MjdLioxf6oC7oBKuSF/uubUV1+MXa2fs2qFaTZKwV1DV4KeduQcXurldvxT1fJLBGSsb9nAmQ== 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 imx8m_clk_hw_composite_flags 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-composite-8m.c | 4 ++-- drivers/clk/imx/clk.h | 29 ++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-compo= site-8m.c index d3486ee79ab5..20f7c91c03d2 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -123,7 +123,7 @@ static const struct clk_ops imx8m_clk_composite_divider= _ops =3D { .set_rate =3D imx8m_clk_composite_divider_set_rate, }; =20 -struct clk *imx8m_clk_composite_flags(const char *name, +struct clk_hw *imx8m_clk_hw_composite_flags(const char *name, const char * const *parent_names, int num_parents, void __iomem *reg, unsigned long flags) @@ -171,7 +171,7 @@ struct clk *imx8m_clk_composite_flags(const char *name, if (IS_ERR(hw)) goto fail; =20 - return hw->clk; + return hw; =20 fail: kfree(gate); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index caee661664c1..46cbac4d89a5 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -460,19 +460,34 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const= char *parent_name, struct clk *div, struct clk *mux, struct clk *pll, struct clk *step); =20 -struct clk *imx8m_clk_composite_flags(const char *name, - const char * const *parent_names, - int num_parents, void __iomem *reg, - unsigned long flags); - -#define __imx8m_clk_composite(name, parent_names, reg, flags) \ - imx8m_clk_composite_flags(name, parent_names, \ +struct clk_hw *imx8m_clk_hw_composite_flags(const char *name, + const char * const *parent_names, + int num_parents, + void __iomem *reg, + unsigned long flags); + +#define imx8m_clk_composite_flags(name, parent_names, num_parents, reg, \ + flags) \ + to_clk(imx8m_clk_hw_composite_flags(name, parent_names, \ + num_parents, reg, flags)) + +#define __imx8m_clk_hw_composite(name, parent_names, reg, flags) \ + imx8m_clk_hw_composite_flags(name, parent_names, \ ARRAY_SIZE(parent_names), reg, \ flags | CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE) =20 +#define __imx8m_clk_composite(name, parent_names, reg, flags) \ + to_clk(__imx8m_clk_hw_composite(name, parent_names, reg, flags)) + +#define imx8m_clk_hw_composite(name, parent_names, reg) \ + __imx8m_clk_hw_composite(name, parent_names, reg, 0) + #define imx8m_clk_composite(name, parent_names, reg) \ __imx8m_clk_composite(name, parent_names, reg, 0) =20 +#define imx8m_clk_hw_composite_critical(name, parent_names, reg) \ + __imx8m_clk_hw_composite(name, parent_names, reg, CLK_IS_CRITICAL) + #define imx8m_clk_composite_critical(name, parent_names, reg) \ __imx8m_clk_composite(name, parent_names, reg, CLK_IS_CRITICAL) =20 --=20 2.16.4