From patchwork Tue Oct 29 13:40:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35CBF112B for ; Tue, 29 Oct 2019 13:41:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11A2C2086A for ; Tue, 29 Oct 2019 13:41:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KIdmkYws"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZrIhn/XD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11A2C2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8rIgDLZmYZpz2cyg4FZQX7TT+/Ai2JD73Eas5xKfj/A=; b=KIdmkYws4KGQHF 9KoGYCn2GM08Ag3EbqfSByJAYycYbccOjzGjvOkmJCKeIfcn5Anbu7aio5KBiTXLa6yzsnADiMm/r ijeN88dGkoLNAT8UBNgmQoVtjsyCXSfnRt3zrPFBy80rdnnbceWuBDgRg3BDx3TFsfQp0YPmJPo60 5qVEbXFOW0bTnh6nTl2eKU6TS+7vJK5DSBY9YpXWm5H7Pgwf+Ff8l00beJV/ErT2ACkWofCladdBa c6H4UWtpL6KW5SEz88jwiYGs0FFOcS9OWSIYOy+n76pRUptqbxWlV9Z/CoHFoaXcOoJn3GshdUE7F N8d5omfucFWTUCsacqAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkK-0000sQ-20; Tue, 29 Oct 2019 13:41:16 +0000 Received: from mail-vi1eur04on0624.outbound.protection.outlook.com ([2a01:111:f400:fe0e::624] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRk0-0000Yv-Pb for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:40:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+epHnL7HRhw8geFkgBBQTRVTm+Rhfc5YeB89E/y4HIafureSWnukKjjZlOM2+kUgnsZw5Z0300TfdpVDcRyAcQ+UEjAvQUGD/kTii1rWixkWMGRpZqZeAJVt8vp5XOFEFAB0kLPASsjXQw/U/+2e9CV7AoUXNuCVvFv24jW0p6vnhRwVVV9Psy/nsGGYsZeyCCsSwbpXoRevnLhr/uVKVJm3vyw5U3dt2zUarwskjAawS92BTRpXHeEXE9Oi8jjQyYve+DsnBSnE7BT/zjn6Sb4qqefYGyMyKa2xWzB8yrCtSm1uL2qbx57+qJA7nxygIa5mDEun43LmK9mz7BA4Q== 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=E+eVfGsjCWdf4WkfHzYME8GXxw5D7OLLAFA2jT61tdg=; b=KENxGICY8oSKf6iUxtc/Zdx2AAZvlrBCRZkyJs7ws25hk5ibxrTaxVDfMEylc6lzqz2auMrw2l7lY7cRLY1EF6oXUbywgEPTE3zUDJ5m2D+189WnX2pPvAZNLtM3FAv7RbiatFu4BAEcwMhsqgSrbW1Qa0EGEARniQSKM6veO/EkbYhyhE+f2tYKWWbQhALul7qL9ZQrvdfazneD2HwQCBgX/XhMrB+x6pu5PV4x34eKDNtEkoi/Fqo72RHcZXRqL5SutRxlbgsHvc94z94RPSo51ycbfsQwO4a+k2+KEB69kMQ6XKskUZ7X4vxz2ST7PjOZ2eVeFBCpvK9ZDC2aZA== 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=E+eVfGsjCWdf4WkfHzYME8GXxw5D7OLLAFA2jT61tdg=; b=ZrIhn/XDnydjukMOEhOynOs2DrhCaYGces8DuP8s9lBJTMvOvaLO326c41RLgzF3Zr+L2MWhbtrWAox3Zuas4/0Rv3vlmiDmM03L/kLT0OV69Ktl42x0n3YNju26NZ/cy+cCHNnIUqLQzrl/YGRFoc5aFPP7MkVxCFg2Gfq0jmU= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4177.eurprd04.prod.outlook.com (52.134.92.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Tue, 29 Oct 2019 13:40:55 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:40:55 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 1/7] clk: imx: clk-pll14xx: Switch to clk_hw based API Thread-Topic: [PATCH 1/7] clk: imx: clk-pll14xx: Switch to clk_hw based API Thread-Index: AQHVjl58vmyH5lHO9kisrA51FWxJAA== Date: Tue, 29 Oct 2019 13:40:54 +0000 Message-ID: <1572356175-24950-2-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: 1f3aebb3-b9e2-4c0c-e430-08d75c759f22 x-ms-traffictypediagnostic: AM0PR04MB4177:|AM0PR04MB4177: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:270; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(136003)(396003)(39860400002)(376002)(189003)(199004)(2501003)(6436002)(5660300002)(8676002)(25786009)(6116002)(44832011)(486006)(3846002)(81166006)(81156014)(476003)(256004)(71190400001)(6512007)(2201001)(86362001)(71200400001)(6486002)(36756003)(478600001)(14454004)(186003)(8936002)(66556008)(66476007)(66066001)(6636002)(50226002)(316002)(66446008)(64756008)(66946007)(102836004)(6506007)(386003)(110136005)(4326008)(54906003)(305945005)(446003)(11346002)(2616005)(52116002)(99286004)(2906002)(76176011)(7736002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4177; H:AM0PR04MB4481.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: zvjjeECQgQp7vYT08Hvc5Ca7f+Nxd5cRtsRQ+ZmC+jg778hAtz0Tq6XW9WapcYlmArUE8ZMWEAoarOW9F5VbyYMaAbQes4hdA4Ldui7GBpDmOreelTR+LKPJ+GXcVuMelWgN2lObYR7d/U5X3Skq5tu/41QuBlxxHAOFhtr/Rj5ekvdJBAglPRj38+MspEAJJjxAJO7QEhUCT6IK5glOYs2GcICBx+pH4SNx3veGGGXrSbpGFFKG6s+sDz8iFaC14ujyDZdINIpN133xLlXm0RsxNQAV65cyetFNdRpkr5hONnEuCPgEdMM+eIUf+Jw44b0yV2N6OUzT/YnNNEd8cwZwEsWnzsZhMY9IgCzg5XDil9NVCSfKfqS4gcWZWx9rWyGprp8PPV7BX7OGTLLw3ClUZ7R10i1z7nKEgPTb2yz9aY3xqRzSbiam+SR1Utgj MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f3aebb3-b9e2-4c0c-e430-08d75c759f22 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:40:54.9606 (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: MXHDTFeQVFhyxfiEZUh4nmy56RgGAK1U4abueQm+ImZtt+z5RZGonRAUrpLexq0fLCnu4txEB6J6yScGAtcmwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4177 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064056_832313_789B59A4 X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: 0.8 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a01:111:f400:fe0e:0:0:0:624 listed in] [list.dnswl.org] 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 1.0 FORGED_SPF_HELO No description available. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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. Signed-off-by: Peng Fan --- drivers/clk/imx/clk-pll14xx.c | 22 +++++++++++++--------- drivers/clk/imx/clk.h | 8 ++++++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index 5c458199060a..fa76e04251c4 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -369,13 +369,14 @@ static const struct clk_ops clk_pll1443x_ops = { .set_rate = clk_pll1443x_set_rate, }; -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_name, + 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; pll = kzalloc(sizeof(*pll), GFP_KERNEL); @@ -412,12 +413,15 @@ struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, val &= ~BYPASS_MASK; writel_relaxed(val, pll->base + GNRL_CTL); - clk = 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 = &pll->hw; + + ret = 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); } - return clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index bc5bb6ac8636..5038622f1a72 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -97,8 +97,12 @@ extern struct imx_pll14xx_clk imx_1443x_pll; #define imx_clk_mux(name, reg, shift, width, parents, num_parents) \ imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)->clk -struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, - void __iomem *base, const struct imx_pll14xx_clk *pll_clk); +#define imx_clk_pll14xx(name, parent_name, base, pll_clk) \ + imx_clk_hw_pll14xx(name, parent_name, base, pll_clk)->clk + +struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name, + void __iomem *base, + const struct imx_pll14xx_clk *pll_clk); struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, const char *parent, void __iomem *base); From patchwork Tue Oct 29 13:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9C3E14E5 for ; Tue, 29 Oct 2019 13:41:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97E2C2086A for ; Tue, 29 Oct 2019 13:41:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tDo71/a7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="lF4Vnny8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97E2C2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v9UXUemDhKdmbYYDREDa/E3hPv4EVn7P8sYr49+OOmI=; b=tDo71/a7YHDaW8 RWH/HFpwwbXsXXCbxYl+FYncFVnqE/yDFbg9O09PWQwbnDjuEs7iqgnULb/VhIU3ZY02ABmrStorp rAg+9VEcvELJ2QeHtxyxo2fMBtUEsPGqYMEzY9SCsqR6a9Xj6ks4fqAYmmBfJNdTBJdTEp7hOCN9p tc3g41PZ/tRGiWvwI5T0ipWnfOrJI/bpXk6fC9sLSuYiyVeEaJPmLgBQy8k4oQaqr4OBDVLSnuPHo 05RAxzoP4yJfK+sACjDxlXDqQX/7f919aMocrEI7tVWFrBwno/1nBJDKu9JLFVoR5nfZDQVemaXnK AQC9kBEqGWb1utBgZTng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkq-0001Cr-Fr; Tue, 29 Oct 2019 13:41:48 +0000 Received: from mail-eopbgr130052.outbound.protection.outlook.com ([40.107.13.52] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRk9-0000fv-PF for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R5Cx/v/RepUVLb9OAoW/bcSEv45jIb24IwyZ5Iwnhc//0rPjS873wbVIqkPLbhVFQKKsG7cdknfrDgWy3bqztn38hHSR7CI70zJ3B6sWDlsAuf/HjpC2Ln+ZHu0a8M0pNYuOLBoS4BIuDq0FUSyy7PEHHRgzYC8kr4ejq+5LqM2mGPNmmJDe/u15YzVTxpMGi2arF3N5srs/dpUl5hepYCecVxF2yC+o1V13A26RTj2SDdM3OBEpUzDkghH1y87vylMrXMDHERTzOGp39JDmf7o9dJnW1sCo719b0DB3lx8BnQltezsAuSzFvzbQnh7i/uKKwCt1/i0mKt9xgPLnXA== 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=FERQ5JOsBgqrd/FD6A6Wz2tt3T3WGVvqxaHe7Ec/gpY=; b=T0ZFW0fpbXmggO9Lh7hfIrXRmnlhxvNeQyKO1TF0EIFYLulFwifEvu3zhpCgP+0o4hbMJxVaM5SBLYLy38tDmMwgh6st5RplviM410tdr6g9tMnpaYTrPTOS8Slp6a9tvEbkDAaePcKtTXh9njtxjzq9qkMfTF8w3w7Il5R7eh8hn7CJGp/7JPYy9UEOosZolXoceF51tbr0evKHMl96heBOuwy0MRqw/Do5ptLHzmFKkQUKQv/Hjm4PcRREfbIwqmD3PvgNXWk2+NUJklWgZpWyGc995WUR1nWD8tmVYqUXCuFPDfxvrtuFS7kPl9ZuPndAaCmbU1YztfuaNahWUw== 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=FERQ5JOsBgqrd/FD6A6Wz2tt3T3WGVvqxaHe7Ec/gpY=; b=lF4Vnny8/y+wJLA8xDIvuX9qV+u9Aaw8fRdf7DsgHuF+Hvhk7eD3PnlI0ROrMyo8SEXJ4wJ/AlTodvOF7dhtuilC6b3/H4Uap1WYwA+E59ltMhMCQirC1+BecgDkRqSqKM6hxU7EUM/WqEwsB+yyAnuPg7PRh3tqGRbGhTlj7vg= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:00 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:00 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 2/7] clk: imx: clk-composite-8m: Switch to clk_hw based API Thread-Topic: [PATCH 2/7] clk: imx: clk-composite-8m: Switch to clk_hw based API Thread-Index: AQHVjl5/j/spRpTKgUuA1T2shZJKLw== Date: Tue, 29 Oct 2019 13:41:00 +0000 Message-ID: <1572356175-24950-3-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: aca7b2c6-30a2-41ba-90ae-08d75c75a24f x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: z6putwva7H0y+woQWxeX2g+IZioGwkXEGrtFtPYsZhMcHWYYmpIMoC+yAmC34jUJcRpZucTWi6GntA1NqBwfPDx30IYxg2T9k9vOkF/0EdthoYse61mmM2ElyszAxa6ZiP0FYrKmcXX6QTmnTDllZsbVt/f6ZGEDGHztFgHSoIdCoOXqYQH4tnWULnOljJ6q0YZAxKugNTrCi00+Xt0IpOlURN3wBXIlUtw5AdL6ypiVFw5qzB+aj1Rk1MCLoySfIyb4QLYyPZZ4irj7Nm25qiBoliTT71U9xrjx9Gxuom0Bp9mA32CtKJkcX0aoe0G/ZN5SkLFxpcaao6H4inPVVfOhNwNmBHNc/jD1XOaC+ERJ7VDZtlEjv/Ri07fxqZXloDfRj87Hh9AjNP2cGH+TZNy5J/gBXzShCPYrKkYRdAphWkTdOGr88IGgxCgIjfqx MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aca7b2c6-30a2-41ba-90ae-08d75c75a24f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:00.2615 (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: ivqTWe/p5oyU6YWhKFeAClwRBz2SgEfHxoA1oNGYE/bdB9b2Vs5ZX+T1Ow+7yoJUbfFOU39SKpXl4nrkaBqPkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064105_844908_415DED1D X-CRM114-Status: GOOD ( 12.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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. 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-composite-8m.c index 388bdb94f841..e0f25983e80f 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 = { .set_rate = imx8m_clk_composite_divider_set_rate, }; -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) @@ -169,7 +169,7 @@ struct clk *imx8m_clk_composite_flags(const char *name, if (IS_ERR(hw)) goto fail; - return hw->clk; + return hw; fail: kfree(gate); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 5038622f1a72..e67f7d4ab1dd 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -450,19 +450,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); -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) \ + imx8m_clk_hw_composite_flags(name, parent_names, num_parents, \ + reg, flags)->clk + +#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) +#define __imx8m_clk_composite(name, parent_names, reg, flags) \ + __imx8m_clk_hw_composite(name, parent_names, reg, flags)->clk + +#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) +#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) From patchwork Tue Oct 29 13:41:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1A9A14E5 for ; Tue, 29 Oct 2019 13:42:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 779F92086A for ; Tue, 29 Oct 2019 13:42:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AxJonDfj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="rdTj/lno" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 779F92086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e4mjBSmh8ZFzAihOVgukr/B3oAy0kFVFtqeMq6qXkO8=; b=AxJonDfjGXB/c0 i6CjLcwSJfsSqs5DmCLqjuFOKOrNNEYb8Ql1nHj5FcZdnhw/ogpbnU9ND9zIAIwaLgZcOS7KMUZd9 RWNEOcTI3DYSFOO1zqzEndlc5s68sytBRUAc69erKb5GOLnjRxDZQLDKUavxfvRit6GyyBYDsC4w8 oyImgy3jmlDBlAtuZxaxKFjpKfq6VWhvi82N1Oi9ZAZZ2rwBmKH+Ajhc6aEnw1pCrukhQqi4OP+gc O9rXJZYg2A/v/T6rXnMjUGZ8baOlhpIMLQgRu64tqI97YnatLYJIW0kWUkYKKhFFNfPSS3Lp0Aq9/ MRnePUSe7sY5wHIKeaGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRl2-0001Pr-Ts; Tue, 29 Oct 2019 13:42:00 +0000 Received: from mail-eopbgr130052.outbound.protection.outlook.com ([40.107.13.52] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkC-0000fv-Tb for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwXyB4Vs8Bq1ZjiCglG3qSibaGLAqk/IwGXr3n8Sh2KSWpUOW+d9uB6uIH1jxoiZ8goZ9GTHAmMQPk/Z0r0Nchb93r1ar9hd4H0QC2W0JhyQPhKYP29VC4Acd5fzqrb7zppO00Se8D17VUUBL+li8Jts5WWWkE+HlUhoNRO9svO9BC3XlqTUFmDreiqhiAPJnW+5ox3rCOmIVDa65TPHjdTqFS1NihWHDeiFdfDODtsDyM7Mkq5oAEsj7KcWG+RpBcqAPcmvozqFxgklG0y5YBtcQcWqd+rJGJWghv32AevZYoGGD/G1Nxa+HphgtSz7ezp3OF6GmVSzed3BuKWncA== 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=Kr8VloC+mYDuv5cVLFmzjcA/FCSlxCF1LuDIMNtDgmA=; b=HXiTHXsaNIYSr06VJupHdfoelj4X6LURyM4nmGzRliyl1HfONKFzpyyJ5qZD7Ay1Wme9+gNhpaWdGrauFuvdFIDHv6kTJljAmqAUpFPw4dE/cr1FYi4PrF+bEKDm1BBzmZBpzVKiZXnQfgjemI6KVnTXKq13qLlLQB7+MzZNMLiKuChcUCPWmHV6GK7b9vQ+MGiHRToE4rTAmD2NRI70DrijFpScqB8wOFQO+yM+VOvHSzdgBUqRBIh6gUQDbwc2eO4Orz02SbOWxnA2LRHPW5J9HczTgOKRrgTnrjfgzeSZ2diseIP7fY2FHlK8XlZK2CSnc539yhvlwy3SI8k3ZA== 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=Kr8VloC+mYDuv5cVLFmzjcA/FCSlxCF1LuDIMNtDgmA=; b=rdTj/lnoVeJCoP1Wgbk+PaxRuIMNUlcmXv18wBEL+P1lXqQIm2c8OFAGXVhQ1W6ySu4x/0NkJaCBupmwAqmyl4ucxfpXlrSx0wg0WozSo4aUxfxSWPHjPy5PHgWO9IwVHjDs83wy/I05LzkJ695jK7i8f4iczVjRYWQDaGCWGcs= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:05 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:05 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 3/7] clk: imx: add imx_unregister_hw_clocks Thread-Topic: [PATCH 3/7] clk: imx: add imx_unregister_hw_clocks Thread-Index: AQHVjl6DqFkzDZKMjkuaAFJmKDfH7w== Date: Tue, 29 Oct 2019 13:41:05 +0000 Message-ID: <1572356175-24950-4-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: 0af38f9c-b4de-4821-1945-08d75c75a58c x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1002; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: 1YyQKMeP+EQSs53hKPrRzJ203xBODIRoduxM809N9Ugt25RQodV+R+EygwZPdrAU0WQPubSICyh1k1jAajRzzTuPEsZhfHg4PD3FP8xN+NtlJAKlemzD4+qGwtv30oES4KWN/psV77PrrDa7nggQ87gla45iuBbl/TZknq+Isqj6iFB8v47od3A5fgfgC7hlnV/wpVxZT7la3JxKdZIJ7x/jr8id2SuHHjKBt2QL5JZ5Pay4TaWeUHf8uW4HF9JX4B7DsBUJAebSLHMXfN4T0gMqTQEbBg+Zi8J6sPQOnYm8abWQndjf51TFhFmVQUbs8tJ+FB/r+hKp5DJ9NEigb0pPdzuxaUnb4CteoC7Llft6+yl961wItbpm7IHD2g1vQ5a6fAngeICM04wFRKhjZS+0YQoxCdMxKnfJLM/Ff0v+AsqzGhA82UGmv6s025Td MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0af38f9c-b4de-4821-1945-08d75c75a58c X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:05.7024 (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: tCGJmZdpqjVuaTURmm8sUPPImytfTiVTEsfgyQSldhx13Bd47cgpRQfGNcvEIJ8otVRUQLGmbnMGkxe441ccog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064108_978893_8B7A424C X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan There is a non hw API based imx_unregister_clocks to unregister clocks when of_clk_add_provider failed. Add a hw API based imx_unregister_hw_clocks when of_clk_add_hw_provider failed. Signed-off-by: Peng Fan --- drivers/clk/imx/clk.c | 8 ++++++++ drivers/clk/imx/clk.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index cfc05e43c343..d0ce29f2c417 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -22,6 +22,14 @@ void imx_unregister_clocks(struct clk *clks[], unsigned int count) clk_unregister(clks[i]); } +void imx_unregister_hw_clocks(struct clk_hw *hws[], unsigned int count) +{ + unsigned int i; + + for (i = 0; i < count; i++) + clk_hw_unregister(hws[i]); +} + void __init imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn) { diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index e67f7d4ab1dd..7d6157f6dcf9 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -12,6 +12,7 @@ void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count); void imx_register_uart_clocks(struct clk ** const clks[]); void imx_mmdc_mask_handshake(void __iomem *ccm_base, unsigned int chn); void imx_unregister_clocks(struct clk *clks[], unsigned int count); +void imx_unregister_hw_clocks(struct clk_hw *hws[], unsigned int count); extern void imx_cscmr1_fixup(u32 *val); From patchwork Tue Oct 29 13:41:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF127112B for ; Tue, 29 Oct 2019 13:42:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AF012086A for ; Tue, 29 Oct 2019 13:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CBMMLRn4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="QxzcnifI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AF012086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uLzLQliGjvu0nSxsgC9rfRkh5Vxg3PduLrlY3bxU11Y=; b=CBMMLRn4fip+fe b1XIt2der43+Hmiwxd3MgTYGe4u1WiPiUeVXoEKZ0ebeMBvmpl66/GuSpC6QMLSViOphWFSTF/VWZ 1Ofb8SD1zV/un03gPdnHayMNmVYdlqNeRi6pzbSkhKtVwxxD/jj74m+cPQLLPCypVm/p+8TybaScY 1y4MwG/s+uMQR83uK5wCawz4GL4o2Bdu+cG08C6P8Y56Ff2pUFkNAsaILo6kSp2iSGoAx10Jpms/p SwoazEUNW1ocQGIBwvjGfHLVpck+UIp/q3pG7tOkJJTjzlIiidSVf/j40MOW1RwbV28M+laA9L8ie ayEvxQ+omkyl0Rpx5Rvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRlP-0001kx-Oi; Tue, 29 Oct 2019 13:42:23 +0000 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkK-0000rQ-Vv for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDEySlTMA6Ck9g0NpxYBqlE2OPSbVdzb09bkMsh9R9YIY6OmeBIoT8+OrhvzBY9khpls8Vv6FQNKxB4eTLGRTvzCsnWTvMLFmdy7UzALXwyRbXd9c/gsq1bcn4Q782WBZyKNSYxanBk1cyEjodVNkA3U0+7FovvpJVcsnRN4Q+A0dSZjW2iJVZ1twpH0ZDSO4OiWqPc73OXwOxJab1De1fPFXfQEnQSQTzBx8/hFpO6abW7SsCt0UVhUCm8qqfligzeJIdJ1fqH3GL0Mzv2mzSOAgi5irfN4GkwFSEHHkdmWAbkDn505vSThTWR70otb7cFVmiMOwA7a6F6RGxiVaQ== 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=b0ojVvQmDmvqqMgdPmxz3y3KJutZczDR4Aa7mO2J/0I=; b=I/BiCjKQ5T2IiJ1r/JDTSczqxzuFT89mNbgd0kY59iZ+XZF+XJ73RVPM8+5ZjF3fnu9DG73+PAAQ9/4ghVI9EaYzhbSi2lAQ3SG4qVZvMbzqiVfFG1ob7fMrKKsCEwjgvp1xJoFp8ac38ZTBRXbwVYFyRbGQAwoL+as6ywmM1nqXnNDaQBVg/4WcXiHEuGicHujHVsUG4KwzUS8DMODkAP+iFPKVjI3LuvKfSJf0UJep5q2v/dJh1v/KyBZX+u7hh1+EtX7e8AKUqQFe/5vM+DgOauByT0B4Qh5H4+Tj3SkP8QQUh+WbL9m0+O4+5V/Dn7CngiPQEyoc6gNqAcaUOA== 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=b0ojVvQmDmvqqMgdPmxz3y3KJutZczDR4Aa7mO2J/0I=; b=QxzcnifIoegvrAirERz1UfaLtRVrWZ6FVocG8FwykSbS713rIc2DTVZo5fchmSctz0Ou2QxMhY62kL0drMuEI40KTDDZm6ue7JXrsTF3nLyGB5lOMTqSm3Z5NfPHYsSLH5fmTw2i1kh7ZUpmlgmmmrg8+ZsdWu20BDA3R8Jdcx0= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:11 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:11 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 4/7] clk: imx: add hw API imx_clk_hw_mux2_flags Thread-Topic: [PATCH 4/7] clk: imx: add hw API imx_clk_hw_mux2_flags Thread-Index: AQHVjl6GZBndHj4ozUe5Pjr40bMdUw== Date: Tue, 29 Oct 2019 13:41:11 +0000 Message-ID: <1572356175-24950-5-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: ec42eff7-26b7-438f-0acb-08d75c75a8bd x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:386; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(4744005)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(14444005)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: xz0J5xa+KKaDBW4yE01ZvzomDg1kRfr6vIPmL4BD4uoHxk1GtYZl0srnB7IS4HY5Y3C5/F2lHAyUaUg0AZg4DCk8HNiwWafBawN0IuLdQZcXLsPmAuJmdgNngyqBd9wmKXwwvksxFAvG1izvy38zuk6LOqRBLa2KXL2bNPvv7Xy9RGohF3l0uC8K5rg0HIwd6/RMaQThbALbii7136i+mCnT6yQZMLDKLoJ2JxTco/TzynE4BxH853dr9rjiDOTTyg72oBS4eEtd6UpOi7W7hKWDQyUWNXYay/nWjjX9Byq4NGiP8UnmLeRsbrypEUZ5AosTfNMApLbLYZgIb0ZymOD+f83bmCte8MRHZ1EuzVjv0vK/F0fESlHnUXUQDthxWYAfkkZ+mM+/CVzujP7sVwhnnOBEyqEYcokR3kcXwhjQnN1ijlYtcTIutxuWIajB MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec42eff7-26b7-438f-0acb-08d75c75a8bd X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:11.2612 (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: MPZsQdQaTrAkCQfmosZ9zHI0CgiHZFpdP1PKC1awRc22r/DhuzbLYLJqbJArraLP1heIY8aiwFZzMb9XIzmbSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064117_054704_2B181A99 X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Introduce hw based API imx_clk_hw_mux2_flags, then we could convert i.MX8MN clk driver to use hw based APIs. Signed-off-by: Peng Fan --- drivers/clk/imx/clk.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 7d6157f6dcf9..49cbf6e20ad8 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -425,6 +425,16 @@ static inline struct clk *imx_clk_mux_flags(const char *name, &imx_ccm_lock); } +static inline struct clk_hw *imx_clk_hw_mux2_flags(const char *name, + void __iomem *reg, u8 shift, u8 width, + const char * const *parents, + int num_parents, unsigned long flags) +{ + return clk_hw_register_mux(NULL, name, parents, num_parents, + flags | CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE, + reg, shift, width, 0, &imx_ccm_lock); +} + static inline struct clk *imx_clk_mux2_flags(const char *name, void __iomem *reg, u8 shift, u8 width, const char * const *parents, From patchwork Tue Oct 29 13:41:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BD9714E5 for ; Tue, 29 Oct 2019 13:42:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12E482087E for ; Tue, 29 Oct 2019 13:42:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Wr+ywEFQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="OtFXJgsI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12E482087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zEposkoDcYbk/cYQwycwntxlaJl6mtWxDHBGWW8lh/E=; b=Wr+ywEFQX4/6m6 yhY2/+HeAQqM1A/w07k0dNu9nw57ifeGX83oEZhfYMpX7ywBFlCOsawM7+x5NnmUHtfjwQJG9JuMM omZXKkuTRkSKl3AftVtHqhTpkK66dGdz8GGaEQMr5I9VerQeOMWDZ7TTDjytOGbR/11AjZ8DSIHDU Mu/eouuozJKp53Poz3sAh6XctSzIi5Yx2+8zRI3iTFsYxRNMrqaZJxaP5AYGgsoBL335fwxwz3Luf q5vZLsvRWHCv0+Cg7sZ7ayvwOZQsNdr6pM0WvsXFuP28ET550G2k8tE46/t9qTl+ogmEDOZQQSJrq 3xrZYdo7wI7zhwwSrAew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRlf-00020o-OF; Tue, 29 Oct 2019 13:42:39 +0000 Received: from mail-eopbgr130085.outbound.protection.outlook.com ([40.107.13.85] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkS-00010q-Lf for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TnuJX/0zBLxUQiDI+7BjVn/I1hEBmbSXnnmnMYSCaMRBf0z4/Tv/uBsCRTIimqI0Q9eJJ6UKYHIydzmqVpP1UcEICqYaGBTR3m+DAUovYS/a9Zut0e662wWpIbBrJaSzqe/cnm8tM4xp5TA2vz3IRqVuiGnvnuwAEKidgnxR7YUepQTwKwI8kDcqZ7RRpLep5sj1xmdTtPtjK84nEafQ9LbgXgp5K11Mp9sCHfEt6UN7ZozqdO9MunDM2AZGjSF08FK4UO/AIIAA0TOvGMn48DTHOah5Q0NtW6KN85hMq8d6b3s9gx9y07FU+gDZJ9mYuGQDbG6iYU9gb9fJ+YmovA== 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=+N35YA2hGtlaq18HtoQiKoZdlQsPSmE4wBDIDrjkUkA=; b=UPeDVyo0FlSe2iq+U52KfFeWMWo/lt4z6KuisTTYGmoekt9bSLonoDItDLOzhAJOkxwdPlsYYJuifVayaNP8cyqXY+g5tnOkvIK23xmq3CA5V+2bNzcw+dcbka9c2wtWIP43PJhd2hMgLX13nNF8WxheubRvUZE5VChMGIjFFSMxCNnTwk3spHdPG3bj+4/PeTW4aJJLjDxzjvVmAAgLrh+2n2BeFPwdLKSC6tuK1O4fSWCiuO8e1jWbSVs/57Xll4TDg4xH+wwHRmKsmeJQJezdRfP3uKM6rzl8YpJBXdMpXkVdqjky7teWVi0oQ1ksug7bXs5YKeW3uew4SMx+9g== 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=+N35YA2hGtlaq18HtoQiKoZdlQsPSmE4wBDIDrjkUkA=; b=OtFXJgsIhIE3UKBUDMdra3MatkeOdl8LnkYMFbOnoUWXEX2cWD9YhZmlqUuYxtONdYA8jTEgPLa4aOfhxQbqvjRQCxJhyEnJP8Tf5SaGpLKVPJkrQYqz6nJTk+IjJX/cXvJM5C81a8vRRaZyxRTtn+E5tUq6ACJhMkvd+dLPZFQ= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:16 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:16 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 5/7] clk: imx: frac-pll: Switch to clk_hw based API Thread-Topic: [PATCH 5/7] clk: imx: frac-pll: Switch to clk_hw based API Thread-Index: AQHVjl6JCjRvyPL6y024UL55o1NcNA== Date: Tue, 29 Oct 2019 13:41:16 +0000 Message-ID: <1572356175-24950-6-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: 7579d4e4-868f-4e97-9ed0-08d75c75ac0e x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: UIJziiZF6hof3oDCUUV/qLKiI/0qN3+8ZU93u2XVvoS+Cn7jIJ3LrLy++ERAhDweZgzmtzwLj6TMP2Wn41dhdCKLLXY3NzC7IkCpfRstZYM+cNxh2U/rWsGeQZFKFBXmTI9NPhh/x/+qNmR5J0g9q/BtFjzwMveMHvls06YOCcim21rp7OcPUD1We7ZjZc+jWj8Q44mL4arRY2euiAftLpWOVX9SAMFFKfcGPwpxlzTa2KDKBW51kIq4d1KZIcEzdbh1Gh2lhVg8Ph+ID7IWKL5QyVr6bkGvvD8LQqfUYrIma0DoxdKqEupgPzkHdh3Yd/N5ksYqUbLR9HDAaQKdaUnaTuboeyBPdzlvbkfz9UcX4RduUXwVermvl2DU5GWuA/OrjWcCrCX+Bj4SF3Irywpc7xXjv5VUsHf+oCyP1vw8yC8EpFxshPPy8/G2a738 MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7579d4e4-868f-4e97-9ed0-08d75c75ac0e X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:16.5771 (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: P3xd4SlU46KrbuAWkyB2jzXYdwXCIgE/uMWm4x+a7fp8agIxITWPowYMlUSeEAwrJ3Fc4u4pd8Y6IwS7OmTexQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064124_757694_C93E6A69 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.85 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Switch the imx_clk_frac_pll 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: Peng Fan --- drivers/clk/imx/clk-frac-pll.c | 4 ++-- drivers/clk/imx/clk.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-frac-pll.c b/drivers/clk/imx/clk-frac-pll.c index fece503e3610..818ddb35329f 100644 --- a/drivers/clk/imx/clk-frac-pll.c +++ b/drivers/clk/imx/clk-frac-pll.c @@ -201,7 +201,7 @@ static const struct clk_ops clk_frac_pll_ops = { .set_rate = clk_pll_set_rate, }; -struct clk *imx_clk_frac_pll(const char *name, const char *parent_name, +struct clk_hw *imx_clk_hw_frac_pll(const char *name, const char *parent_name, void __iomem *base) { struct clk_init_data init; @@ -230,5 +230,5 @@ struct clk *imx_clk_frac_pll(const char *name, const char *parent_name, return ERR_PTR(ret); } - return hw->clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 49cbf6e20ad8..a260b8dd3256 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -111,8 +111,10 @@ struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, struct clk *imx_clk_pllv2(const char *name, const char *parent, void __iomem *base); -struct clk *imx_clk_frac_pll(const char *name, const char *parent_name, - void __iomem *base); +struct clk_hw *imx_clk_hw_frac_pll(const char *name, const char *parent_name, + void __iomem *base); +#define imx_clk_frac_pll(name, parent_name, base) \ + imx_clk_hw_frac_pll(name, parent_name, base)->clk struct clk *imx_clk_sccg_pll(const char *name, const char * const *parent_names, From patchwork Tue Oct 29 13:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C202F14E5 for ; Tue, 29 Oct 2019 13:42:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5506F2086A for ; Tue, 29 Oct 2019 13:42:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A9C8yHuP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="i1Cw/kHA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5506F2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wiRGki6PKV/3RDOuqtJg8iFJ6f38bj3L+X2ypgZcxmw=; b=A9C8yHuPQNTV5s qKBTJ3hiN5ICooGBRsxT5o8Kr2feUcsRlCBhv4QZDwWxqQxfcRlfhG8zcRIczY+CU40v8YOuyMUQx Apk6BNxCEqLBtrMo6E/h+rRh9IGreJxOmQXB5gqSVrBbMYVk6hCeatA0fB8WDHzytQPNVB4QdQ6Y1 zS9OJizvvopkyhrM7P6kyTRTZZPPOabB2NkcDRdAQ28Ko0xd0yTCKhaGBrVLybY22i8sDfhMEbaNg cL0K/KgjB2R+oCHfauCIOwIJRyjfFO01fmU+MLkcEc2F5ZrdI0X+yCdwkKd5cyVdbbHTWnF9C+T45 wAI6umKYP8EP2XddpS4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRlr-0002F5-Bw; Tue, 29 Oct 2019 13:42:51 +0000 Received: from mail-eopbgr130085.outbound.protection.outlook.com ([40.107.13.85] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkX-00010q-NZ for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpdwvRIpATfusPJcTDCnH9NFlvuemj4jUAJI0ZdJiVSH/IFrdG4J3epyxakFJSNEsmPvGXBPgPKgk6qF1c4DU4Ztgvfqjqe7tONMFY4rBBOjDklaU7n0sNcBRgUpxlIMtFy7behkLBdbTrzt6y+tDcia+MlxhRF2/T+85AKQPLHfJlzI6wUBJaV0Vy9a9BQzPIwQJc4uMCbSHSk85cBpmW04enBFj3pB0L9lGrlPVVNQXhN6Da/ENrDp3eVlYSExZ/WZ1wA8kLUdZhrAWDrYh46zuOM4mRHuoxb6keMXGysoqcxph+MlyQfnhRAD/YUs3sug3UGjb7qn8Nrh1O3dSg== 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=dhvqOkMu2GXckDZf1/zbCsjg5AHZh23AH8C6jad/Dks=; b=BZG4Uth29xZmBB7KVyZAkEsfMTmg7wquiYwtN44I4RK1x/hStUxBopVpsCSbp9y0vbjmXTw/QcGblQREt6dSIQgUm2DlHq5x2lDuJRmsYBZ8O/YKzVFV9Z4zC66ZSXBc96JEol0b4qRL8NENjY17vdbPuC/hLB3IvDhOEStj6Qhl0uIORbQl0lFPYY5KCDg9N6fngWzZfbTpUCIOMHYOjucMD9dwqEf9AAVwuzOTbxpzKJFnWZ5q/2YSgXh7EjV64DCqCD05+egZRTozX3zWZI8wSrNAQSqWvHR/O4OZaWP+UT1HWv31VNhl9JP5fKiCvE63HToUvFJXAgf0Qp7EVA== 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=dhvqOkMu2GXckDZf1/zbCsjg5AHZh23AH8C6jad/Dks=; b=i1Cw/kHA3jVzk2HTV+pmevZIJZ6961jvmW82Jmu+NavvwteChpfXSlaEWZSruhI9E8Ve3hDPAtmh0rmTyVvRtsuspAOKv7/LDjENK3cbn7DvZPOOnFg8lQSJ1uOlBDUf6zrtRb8yKSs07AnJF1lH6YVNRCrsh0ovTP1XqdqeriI= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:22 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:22 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 6/7] clk: imx: sccg-pll: Switch to clk_hw based API Thread-Topic: [PATCH 6/7] clk: imx: sccg-pll: Switch to clk_hw based API Thread-Index: AQHVjl6Mj3bsIZq53UurLtNlu0w/Lg== Date: Tue, 29 Oct 2019 13:41:21 +0000 Message-ID: <1572356175-24950-7-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: 26698e48-19a0-4694-018f-08d75c75af39 x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: X2+M6k8+okpt81fLqdKhJTUAI0bInbTK8q2YBZ9QZJRGBfiYcB/2hG40F1ErmYGbBrVlb8HEqP0qMGPXP2iHXooiCUTbGQAbN4kl9HH/ubbuMAnek2PCIHFnwiCVw/vEOTplbaGCsL9aA+7W6IL4iWkO2X0p1nGFUnbvSjcB9+rFqpzi4jIxAkXWkGi83HYJM1Zi8q7+OgQcOZMWcENkVoIdDRZYvnu6jsQCE+i9deVKKd0SLz8+/+tVZQn6fCyNOmcrC91WQ6tmF9g6LkHKYZbgnnTMcUd+RYDEZzmSoFdzlP2yDy2363bOgVLT2EWZQEsyj6KJF2rY1NNLvdYWOFxHz3SYWQY9Opr+ZNAXeXmQUPv6meSyMPhFC9ONeeA7iEGhZBgow7+UgeIpfx6D7rmm/PQ3x628P86hzTtQk/wDwawmakvLyQgPccSMoeS0 MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26698e48-19a0-4694-018f-08d75c75af39 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:21.8981 (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: x4qAm5WMGD4ujBuQjM3MoSlT/mN/JI/QJfAtRoPsh/AKv6vlcglnwo4qnD4bvrU2y9rdbiEiwEGsO8MRl5MrIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064129_795646_E4101BE4 X-CRM114-Status: GOOD ( 12.19 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.85 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Switch the imx_clk_sccg_pll 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: Peng Fan --- drivers/clk/imx/clk-sccg-pll.c | 4 ++-- drivers/clk/imx/clk.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-sccg-pll.c b/drivers/clk/imx/clk-sccg-pll.c index 5d65f65c512e..2cf874813458 100644 --- a/drivers/clk/imx/clk-sccg-pll.c +++ b/drivers/clk/imx/clk-sccg-pll.c @@ -506,7 +506,7 @@ static const struct clk_ops clk_sccg_pll_ops = { .determine_rate = clk_sccg_pll_determine_rate, }; -struct clk *imx_clk_sccg_pll(const char *name, +struct clk_hw *imx_clk_hw_sccg_pll(const char *name, const char * const *parent_names, u8 num_parents, u8 parent, u8 bypass1, u8 bypass2, @@ -545,5 +545,5 @@ struct clk *imx_clk_sccg_pll(const char *name, return ERR_PTR(ret); } - return hw->clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index a260b8dd3256..9de6bc590638 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -116,13 +116,17 @@ struct clk_hw *imx_clk_hw_frac_pll(const char *name, const char *parent_name, #define imx_clk_frac_pll(name, parent_name, base) \ imx_clk_hw_frac_pll(name, parent_name, base)->clk -struct clk *imx_clk_sccg_pll(const char *name, +struct clk_hw *imx_clk_hw_sccg_pll(const char *name, const char * const *parent_names, u8 num_parents, u8 parent, u8 bypass1, u8 bypass2, void __iomem *base, unsigned long flags); - +#define imx_clk_sccg_pll(name, parent_names, num_parents, parent, \ + bypass1, bypass2, base, flags) \ + imx_clk_hw_sccg_pll(name, parent_names, num_parents, parent, \ + bypass1, bypass2, base, flags)->clk + enum imx_pllv3_type { IMX_PLLV3_GENERIC, IMX_PLLV3_SYS, From patchwork Tue Oct 29 13:41:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11217913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A3E61515 for ; Tue, 29 Oct 2019 13:43:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 463352087E for ; Tue, 29 Oct 2019 13:43:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lAkYsjC1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="SgwHoNET" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 463352087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=db/dKHTQoQKFVMs9QzPyw6IJmeSTM+5MfSZrDR497/Q=; b=lAkYsjC1kx/zPn Lm4UiVrAEWiOkkfytsG6df81BLhky+aN5tCm5hut0EYbGjR75RudHhZ23FnAY/MMSKST+iZyOmoM+ fg0QrxxoRBcjp1ChKiBUScTLDnmSE3PJAAcNVoVSd1RgyTDeIfZa5AN9OJ5MS/g19QCnH2KgeB3D2 AQVX+82VNU5J+FItJBzpoCQpcJfkjOYt20awSeKzO6eVmh63FGmLa/ROth/X8gelBx2G8ZsXP7Azr 4xV3owLx8CiH7gAI3ovZS6yETFPm74+reAfkhQ3M3l5DCJ5U1JYuoyEv1J+uqbTPsQ9Yn5jc1MCcS yiLBdGFgpbTvoHWSA6Lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRm6-0002W8-CV; Tue, 29 Oct 2019 13:43:06 +0000 Received: from mail-eopbgr130085.outbound.protection.outlook.com ([40.107.13.85] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPRkf-00010q-9u for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2019 13:41:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwgQ4AMY5mEvl6VNUemquDmcdB4TyC1Z2geCMeDfOcqGaqErEATI/en10xhE9V/zyWOh2+X4B4KubW2HOe70dOEbtnreuVSGaijq4Ip464F2rF1N25PdIksTS0TF423CCFxqrXEITZKhWUGe3RLAur2vgHXfRUiBUSb2MnHwxu6Zx+Zbkb/QFwoE1f1pPqNl3ag3jq/cNG37YFk/kcthJU/tmQZ9wK0ox4HE4+90Yw8AatzSsJ79/VbXYN1/rZEsXRXxUPGOpX0VFMauvT0e7Rlw6Rq+MZrJT8qzIpKxEjgOuisOlTsh99cRqShQ72dwPCW3XhsX4zuWSMsHxicTGg== 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=3oLf7GDtX2gdlTwAjeFUAFyGC64Ffk0E74Fzd1BjxZg=; b=i+VxXkThR7XCIg34nG518rgzPb7r5nA2PUGD5VGqk18embOJ6+55HsgPiAJPiMYQb/GMw8QEGJN2awHU/Q0ArNpMzhgBE8g9vBZKJ4tNVeTmXgiiCEkqY9RQKfCAPfL8XfTSS6CDhXRL4XGd76Qe17jFEuGPvjChe0pxDbCq+gYrYNP3yDG6Kz8JSeq2PI0daE79yRwsMnSCDa4FfkPKcgn8Fc6tlqIYm4OcLy6+ShFurGgT933RDGzSL2/k8QbMOJrb+SvlxIP3ZZ0izrFXIjBvqHSL/pYe0rDDuy642a2O+7OY4Ry3AVYzw37hBI+/U06D5IFeJA3vXXHnlwPwLg== 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=3oLf7GDtX2gdlTwAjeFUAFyGC64Ffk0E74Fzd1BjxZg=; b=SgwHoNETNV4oPutxFVHDtir2Ibcx/JeQWDA2eDAhJHsXEM3Smfq8upfrbEc0GAk/rKTZxy2BABOMMeVkGfCZMd3aqwALMEgJfylGfKktlDqS5luyPdbf0gIo42jbFcehaJlbOBUdoFcojwZs0Rg+dFDLL1Iah/R3Gf96QG+GY3g= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5139.eurprd04.prod.outlook.com (20.176.215.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Tue, 29 Oct 2019 13:41:27 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::843c:e722:27cb:74e1%5]) with mapi id 15.20.2387.023; Tue, 29 Oct 2019 13:41:27 +0000 From: Peng Fan To: "mturquette@baylibre.com" , "sboyd@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Abel Vesa Subject: [PATCH 7/7] clk: imx: gate3: Switch to clk_hw based API Thread-Topic: [PATCH 7/7] clk: imx: gate3: Switch to clk_hw based API Thread-Index: AQHVjl6QP6B/hjNO9EqRDMbJjuGEWA== Date: Tue, 29 Oct 2019 13:41:27 +0000 Message-ID: <1572356175-24950-8-git-send-email-peng.fan@nxp.com> References: <1572356175-24950-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1572356175-24950-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: HK0P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::18) 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: c1004cfa-acc3-4b9b-0061-08d75c75b264 x-ms-traffictypediagnostic: AM0PR04MB5139:|AM0PR04MB5139: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(6436002)(102836004)(66946007)(52116002)(66556008)(66066001)(5660300002)(66476007)(2501003)(81166006)(8676002)(486006)(81156014)(14444005)(6506007)(386003)(66446008)(6486002)(64756008)(256004)(478600001)(26005)(2906002)(3846002)(76176011)(186003)(25786009)(99286004)(71190400001)(71200400001)(6116002)(6512007)(6636002)(54906003)(14454004)(7736002)(36756003)(446003)(11346002)(476003)(2616005)(305945005)(4326008)(44832011)(50226002)(316002)(110136005)(86362001)(2201001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5139; 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: 2/NkHmoK2IPxtyHYhTnH8Os90HTqvzNjNK9aPGgqlwJyK7GlnmEbYNT97kpuY88Cwk5SCsV3u5Rlb5FHZgXGRZlJ47T3etPPGHr5hitAXuiR5unL3J91ESQOuXFqF3t9qAQ6zCUskUr7DvcRAwVSqN+TXKTjNhZL810ycPaxjz35gesEciIeUk65gK02lFzRBBGX7reTYtkSWN8u4FQTx3DNAlYnmi7AgYRfSEbScKHT5OqHuhgIAfqGvofJt3AkLf8mrL8EZTSmd9+hj6WEl0dEM/+2YMJRt/9PouhObzdFmpWcqWHGZbwNJxA4jH+3o6ge0e2PjwBlS6Ow7r3LknwGemZAtCtygY+jZ4w+CLY3qY4PiGO/WKn3au7vkkIb1qAN6LaRw4exmZ9e+iOG1XyVNICxIdfHRkNtJU3nCH5mWaVjBmyxeUjNFTZkWsht MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1004cfa-acc3-4b9b-0061-08d75c75b264 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 13:41:27.4339 (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: qQoY+GtEYZAtTUDgio+ECKgX52cCue+4w4G0ak699eyK0wBqW3V5PT9FBG505ZAbitTT52iKkjgTV0hFu9lAOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5139 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191029_064137_409480_B8503004 X-CRM114-Status: GOOD ( 11.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.85 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , Jacky Bai , Anson Huang , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , Leonard Crestez , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Switch the imx_clk_hw_gate3_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. Signed-off-by: Peng Fan --- drivers/clk/imx/clk.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 9de6bc590638..cd92d9fdccf4 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -366,15 +366,18 @@ static inline struct clk_hw *imx_clk_hw_gate3(const char *name, const char *pare reg, shift, 0, &imx_ccm_lock); } -static inline struct clk *imx_clk_gate3_flags(const char *name, +static inline struct clk_hw *imx_clk_hw_gate3_flags(const char *name, const char *parent, void __iomem *reg, u8 shift, unsigned long flags) { - return clk_register_gate(NULL, name, parent, + return clk_hw_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, reg, shift, 0, &imx_ccm_lock); } +#define imx_clk_gate3_flags(name, parent, reg, shift, flags) \ + imx_clk_hw_gate3_flags(name, parent, reg, shift, flags)->clk + static inline struct clk_hw *imx_clk_hw_gate4(const char *name, const char *parent, void __iomem *reg, u8 shift) {