From patchwork Thu Jul 27 05:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328740 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4E7CBEB64DD for ; Thu, 27 Jul 2023 05:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DYhUPzdgmXK1mPmU54KiY7sNYxsxa3YiGZXsdZVGbxo=; b=wbrFIlPWjS5ij6 73QEbpB88nXxHd6m91pqgMxGrAej1n35sXKmg9rjxxBEowKn75fE6vUPj1lZtuhC3ebIX6lGHkr5l wGLOU21HDYGZ2Z8GSwI6InUSTiIWi0mET1gxVzIGgoJa0ReWDHlAjJHOe5mIq7QG/UnAcbAgEVZes TjPeKeO8iaOkpYmdBMA4CcS2NWpkl4qQm3tlYHasWt0grxUfILWItbhSKxGInh3iJJag+uWtIt40N SsPi3V20BM6lDSpX+0W02jmqZjMfD2Jk/tFDk/RgtXdouF5Ju5h+ITOuxr6MK+/m0ln1scAPCZykO pLIhYNVckUxGjVbAyT/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcE-00CBdI-30; Thu, 27 Jul 2023 05:32:46 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtc7-00CBbu-2q for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:32:41 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bb84194bf3so3419595ad.3 for ; Wed, 26 Jul 2023 22:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435957; x=1691040757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Uyw3PNfZIGdqDhQAwksMXr4rBdSDRWmBdpkW/XA90lY=; b=drVvjIcn6IwB7Xn0zmy1NP5nq8SSNIQeAYnATBZ8fVrsX3Re7hS8xvzwCPrOOmVYDT yvIrdOKnD205U8KOaVniDdHmXe61quc45RJ0Xm894JcBaaGRr4BKabCckcXl5URiQWH0 OGbAX7YKljP3iTfl/3QanAGlykvZsQi5Y0AYQrXpWJViHwMX+u6xE7IXKi/2Z0Th2JQG IBiQCMQdJMO/DQaTOPzXZ1Tq9oT1VWrQk0dSWDwwnMayGY9EoNDPEtcPQjFfsnoaccIx 5iW8qx8pC5Q4xnmtaK6y7SmD1mHgGXItb87R/AB/rTYXh3OuZAYkoO7kg72q+pYebyVk KTxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435957; x=1691040757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uyw3PNfZIGdqDhQAwksMXr4rBdSDRWmBdpkW/XA90lY=; b=XPzf1GtxpH/PYxtLhugzjjnHrtQh65V9TJ7cVsFJSuEpjBz+K8r0KzoPrkwdUYAlTK 7hmAVQGNYT2JmYlY2jmJTl5Jfk2DGkIsSGL4YZTeKJhHFJ7JZhXPt+HUM0IJMx3yLNRN KNTFe/xRnyKbdoUgr32FX378JB1aq3wyBzuxCeY5AnGcBX4w55810H7MX+c0bjYJu5Tk wBnaRAGeJmtognnC9yVqZUuUguFfoEaBDCR6SjTW8y2iieJZeVmUYE4013LQTb6syL7t 7QvS1z0t/K/+sv1PuONtNL/lOx6cFhV6nBjrREtv8xJcZjp6r+F39K5Xyq/TMMyPRvrL P7RA== X-Gm-Message-State: ABy/qLbJB6rg0PQZXG1aqngiCWZ9vE55rbYRVkZWlQ5xw//5PSGXOkDP 9bCG+hgkVXL0arPBwpvbTJubgQ== X-Google-Smtp-Source: APBJJlFaiXidP9D8t/SlKdr/7PjGHe8B2LxzQ0uXp+qc5AmYStgN8YypNaZm+7pCUSKDHPRfKQtsJw== X-Received: by 2002:a17:903:2305:b0:1b8:1687:b53 with SMTP id d5-20020a170903230500b001b816870b53mr4574340plh.26.1690435956889; Wed, 26 Jul 2023 22:32:36 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:32:36 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 01/42] clk: at91: sama7g5: check __clk_get_hw() argument for errors Date: Thu, 27 Jul 2023 08:31:15 +0300 Message-Id: <20230727053156.13587-2-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223239_939386_E4A750CF X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org __clk_get_hw() argument in sama7g5 is obtained using of_clk_get_by_name() which might return error. Passing an error casted pointer to __clk_get_hw() may lead to crashes. Thus, check the pointer for errors before passing it to __clk_get_hw(). Fixes: de3383e993a5 ("clk: at91: sama7g5: switch to parent_hw and parent_data") Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sama7g5.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 91b5c6f14819..16e458be8304 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -988,14 +988,27 @@ static void __init sama7g5_pmc_setup(struct device_node *np) struct clk_hw *td_slck_hw, *md_slck_hw; static struct clk_parent_data parent_data; struct clk_hw *parent_hws[10]; + struct clk *clk; bool bypass; int i, j; - td_slck_hw = __clk_get_hw(of_clk_get_by_name(np, "td_slck")); - md_slck_hw = __clk_get_hw(of_clk_get_by_name(np, "md_slck")); - main_xtal_hw = __clk_get_hw(of_clk_get_by_name(np, main_xtal_name)); - - if (!td_slck_hw || !md_slck_hw || !main_xtal_hw) + clk = of_clk_get_by_name(np, "td_slck"); + if (IS_ERR(clk)) + return; + td_slck_hw = __clk_get_hw(clk); + if (!td_slck_hw) + return; + clk = of_clk_get_by_name(np, "md_slck"); + if (IS_ERR(clk)) + return; + md_slck_hw = __clk_get_hw(clk); + if (!md_slck_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; regmap = device_node_to_regmap(np); From patchwork Thu Jul 27 05:31:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328742 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6585DC001DC for ; Thu, 27 Jul 2023 05:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lRnlk0EP9AShUuen7MgHFIL5T7JsrFmENpRmx9HkPk8=; b=mgphlJkN/kC4nS VdJjTJKsz1SOaKwN6GEfpKlI0IKRUEyFLmGDLTLQZMXdS6mCN242UCXrAZc/SXUvjOdAu2Yb2pqtf MxIevT1pyA5Ln74blkW/N/Q2wVcyhGymQj/v8PilLH9sL5oG8zEKg6BzyZnKsJOFsqhW9Erqs/Hih zUWTgwVO2XLuiP14y/cNfIff+mlklT29M7iP7GMCwNhZDBKqMeJ9ZcEfwhWqa2q3loN8aKf/d3c4J CSsq6+p818jCOpJ3/7MfpYOu86Y4fFg5DdEOZ95RUSBnb56PKy6amP2TtzAN/sCWwJs6IENisCcx8 IRZywZ5/6ZJyUp8sPWag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcO-00CBfS-2L; Thu, 27 Jul 2023 05:32:56 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcF-00CBd1-0K for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:32:49 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b89cfb4571so4394015ad.3 for ; Wed, 26 Jul 2023 22:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435964; x=1691040764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b9Gh+k+Ek4/VSm59HjYvHVbU+3yoxdSusT5dev6nYow=; b=LC1J1Cspx60GAUJsiTYmriRBilILtB3wnVGXGVwUYiEVkyKZVVj9DrQuqW8vu42JIg 4TivKz5mquFmDFqUsR5TiW5UglqjyNnMsLOz2tDXc22bg4Qhq0BAHFDxCCBOq9tsSdpd bCJ/jO6y7mmwTbLoJnV9tc5LSjHWe7AmJd8arnTdqtnbdo4wUPdoG84Cx/duznARUYob Ik6lyEg+Sn2uWDhaGRHUVFwJvX50f69JCqP1xrYoUh48ePMDtgrd5bNX50TxFQ0MaMUp anQaywJUrycIpgKEqpfC/ZEEivAk/Ubf8ai5zbUivZGSVNANTZPEvx+qvEWFRr1rx6yR HnPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435964; x=1691040764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b9Gh+k+Ek4/VSm59HjYvHVbU+3yoxdSusT5dev6nYow=; b=dvImse/cIPTe8Iy99CbZIqVQ07oYMwJF3e4C+swjpOHz9qa/KzI5SRyQ1EtCTdmqzf 61Ab9AzV4vS5IbbSHGdapi6Pwsd9+6eS2cW8rxAxm+d9Z24E2Skichy1zzB2k5n7lJmx MBVFnZxmYcSy6HXoUw7HlJ1Mv6P4K5CZnor/h/RRHnefuLlRF0O2K9AaRK647xlhM5i6 gcHVTla2YPLINHwblYvV0wCQawGvFvOQX6b54+LZFUQGUOIwRKHbl2qlwuqmKFGlsbKW 4AuLaB6DUIZGVCAxkiqUWYzQjeeoiL6PIqchFopB60qsQSgIlOGYuo6chp004uzOsTX2 FPuw== X-Gm-Message-State: ABy/qLabROCAG+6myZbfHyK+YI0Fv2PMTA7Cry+pWP9StHFRsMG5ULkR tVUYfBCAf22X99hkK9HRymazBw== X-Google-Smtp-Source: APBJJlFrr5ZD5hclfXPll+bVt+fiL3e69OnCXZKnKadyR197MJfhDlT6oGdFH6zBnyDw2HINzYSoug== X-Received: by 2002:a17:902:d501:b0:1b8:b5f8:c485 with SMTP id b1-20020a170902d50100b001b8b5f8c485mr5337310plg.50.1690435964153; Wed, 26 Jul 2023 22:32:44 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:32:43 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 02/42] clk: at91: clk-usb: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:16 +0300 Message-Id: <20230727053156.13587-3-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223247_155200_243B6A09 X-CRM114-Status: GOOD ( 16.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in usb clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-usb were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-usb.c | 41 ++++++++++++++++++++++------------ drivers/clk/at91/dt-compat.c | 6 ++--- drivers/clk/at91/pmc.h | 11 +++++---- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 12 files changed, 46 insertions(+), 30 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 3f19e737ae4d..e5a034f208d8 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -157,7 +157,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_MCK] = hw; - hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", usb_div); + hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", NULL, usb_div); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 0799a13060ea..ae6f126f204a 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -434,7 +434,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_MCK] = hw; - hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", usb_div); + hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", NULL, usb_div); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index f45a7b80f7d8..684d2bcb36e8 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -176,7 +176,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, 2); + hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 751786184ae2..9fc20b177b13 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -201,7 +201,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_MCK] = hw; - hw = at91sam9n12_clk_register_usb(regmap, "usbck", "pllbck"); + hw = at91sam9n12_clk_register_usb(regmap, "usbck", "pllbck", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 3b801d12fac0..5728cfb9036f 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -222,7 +222,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, 2); + hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c index b0696a928aa9..21f50914c63e 100644 --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -221,12 +221,12 @@ static const struct clk_ops at91sam9n12_usb_ops = { static struct clk_hw * __init _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents, - u32 usbs_mask) + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents, u32 usbs_mask) { struct at91sam9x5_clk_usb *usb; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; usb = kzalloc(sizeof(*usb), GFP_KERNEL); @@ -235,7 +235,10 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9x5_usb_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; @@ -257,27 +260,30 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, struct clk_hw * __init at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents) { return _at91sam9x5_clk_register_usb(regmap, name, parent_names, - num_parents, SAM9X5_USBS_MASK); + parent_hws, num_parents, SAM9X5_USBS_MASK); } struct clk_hw * __init sam9x60_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents) { return _at91sam9x5_clk_register_usb(regmap, name, parent_names, - num_parents, SAM9X60_USBS_MASK); + parent_hws, num_parents, + SAM9X60_USBS_MASK); } struct clk_hw * __init at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct at91sam9x5_clk_usb *usb; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; usb = kzalloc(sizeof(*usb), GFP_KERNEL); @@ -286,7 +292,10 @@ at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9n12_usb_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT; @@ -390,11 +399,12 @@ static const struct clk_ops at91rm9200_usb_ops = { struct clk_hw * __init at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, const u32 *divisors) + const char *parent_name, struct clk_hw *parent_hw, + const u32 *divisors) { struct at91rm9200_clk_usb *usb; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; usb = kzalloc(sizeof(*usb), GFP_KERNEL); @@ -403,7 +413,10 @@ at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91rm9200_usb_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_PARENT; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index a32dc2111b90..ead99948375b 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -945,7 +945,7 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_usb(regmap, name, parent_names, + hw = at91sam9x5_clk_register_usb(regmap, name, parent_names, NULL, num_parents); if (IS_ERR(hw)) return; @@ -975,7 +975,7 @@ static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9n12_clk_register_usb(regmap, name, parent_name); + hw = at91sam9n12_clk_register_usb(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; @@ -1008,7 +1008,7 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) of_node_put(parent_np); if (IS_ERR(regmap)) return; - hw = at91rm9200_clk_register_usb(regmap, name, parent_name, divisors); + hw = at91rm9200_clk_register_usb(regmap, name, parent_name, NULL, divisors); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 0f52e80bcd49..515a3c5595b7 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -257,16 +257,19 @@ at91_clk_register_system(struct regmap *regmap, const char *name, struct clk_hw * __init at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents); + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents); struct clk_hw * __init at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init sam9x60_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents); + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents); struct clk_hw * __init at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, const u32 *divisors); + const char *parent_name, struct clk_hw *parent_hw, + const u32 *divisors); struct clk_hw * __init at91_clk_register_utmi(struct regmap *regmap_pmc, struct regmap *regmap_sfr, diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index e309cbf3cb9a..ddf993fe391f 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -297,7 +297,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) parent_names[0] = "pllack_divck"; parent_names[1] = "upllck_divck"; parent_names[2] = "main_osc"; - hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 3); + hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, NULL, 3); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index c16594fce90c..8bbc34e22cda 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -284,7 +284,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, 2); + hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 522ce6031446..05d0cdd22bc4 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -201,7 +201,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, 2); + hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 160c0bddb6a3..da84b4cef827 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -222,7 +222,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, 2); + hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C2EB4EB64DD for ; Thu, 27 Jul 2023 05:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ocfr/ylub3Ktryr/DGoQdujTLjS4/gNSZcBSmvXKims=; b=lP3z3JsKOxaADV Lgou3aB2ZwURICn/Vc31X8lYFsrKEWPPBBkXfXnUCG/2nkEBJn702TL4fapIlQX/SNaPajmMndwXH SNA2fXX0W7A4GwjxSZ6Ky+C8VFViARddG053eXVYshr3lLwYdNwFvl1CZ5+eCNpHvH5AeBTeUTkSJ 9Z7vOtGnhlyKjA+q+tvhh+dAn9FIBjnnSops9UgPLDNa0VjQIw0uWdX96vj9FGn5tIAUcmU6ouBDJ lgMxGCmjn9+sVpQCXMHtxlmlqZDXCUl4RclI+fFL6Ftq3SD3mSRxMd0SZZ+hvXl1eBaIUbK87kcrf 0sU8cBtIB4s0gFqeIIrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcP-00CBfj-0e; Thu, 27 Jul 2023 05:32:57 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcL-00CBeJ-0x for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:32:55 +0000 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-563dae89bc9so281099a12.2 for ; Wed, 26 Jul 2023 22:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435971; x=1691040771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FAVoXHZ5zvjZ262DesmDLqKSRAd4U2FxEZjVJgo3dJ4=; b=KKy2c5+u7/wBLVinxt7z+Adc/SzVAGTOKbC3oRrvt/QKaoxeyCBPKBDeJHrLp8VSyE 9oRgHE/+LQ80G3STCVua5wTWya0lyHpftSD/8YWYlg74zjVHQtRon1/gSfN0DevPIjPL zUBBoHIgDZg+PSR6VKx8gLrqTAfGoRJb+61fAa6kXgMrpLMSMolHRGkqLAVF4oED/z6d DPXVHNe7HKdyVgjBDPN09rDTvFGuvp1p1w36Zsafb8O3KdSmQleN0qKJLMePNjUlueEo XTwdE8H57g4Aq6ZNp+SuHRXNcHIi/B5tx06TdhfAFe0KQEddGyTw4IUbvF4fToLFOo9V K2Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435971; x=1691040771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FAVoXHZ5zvjZ262DesmDLqKSRAd4U2FxEZjVJgo3dJ4=; b=e91yidAubpiiAbkASo4MwEG8DfM0pk1Z0LePPF+6BHPS+AmX9tuU47IYzS1+aALgQo p+N4eTJ/1kwCbWE3e4pXM3wdXnYGBqbqz4dsVDSWnDPiFu7pvrLZ60LL1/iFhARmdk1P H25mFJpEAHiuvverDPydxFhGPWr3j/1p+8U4YsSi/hHVUF0PnBeByMGe2hfdidA73k3f 9QjRt4sl25pdzM8XMPh0NNopY7XsTjUS07XMYBa6l1dSVgJICNtNdC46QjEyufZ1nFx5 EusEtLPKWpNNESsLQzDH85jpMG989DWEA8tzkYCB8Jx2L7e0z/LVKtsgF6C3TNpYg2aY 8tDA== X-Gm-Message-State: ABy/qLZgBSfEUmKhSZBMZWrRkY/0h94BSU4phJnQ6/Hn/a+a2oX+FA0W jyJvAwb+64DSkIDFv+SJCMly0A== X-Google-Smtp-Source: APBJJlHYYoR6bV0fsTShxkpROL+ii8w1aBMMilcwh8A7MOFW0fRhhOj0GLZM2UL26NRudApmi9ugrA== X-Received: by 2002:a05:6a21:790b:b0:137:a9d7:de12 with SMTP id bg11-20020a056a21790b00b00137a9d7de12mr3456463pzc.59.1690435971266; Wed, 26 Jul 2023 22:32:51 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:32:50 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:17 +0300 Message-Id: <20230727053156.13587-4-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223253_399666_AE5EBD7B X-CRM114-Status: GOOD ( 19.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch SAM9X60 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Extra time saved on registration is ~180us when running at 600MHz. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sam9x60.c | 124 ++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index ddf993fe391f..c68cd969dd46 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -72,9 +73,9 @@ static const struct clk_pcr_layout sam9x60_pcr_layout = { .pid_mask = GENMASK(6, 0), }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } sam9x60_systemck[] = { @@ -82,11 +83,11 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "qspick", .p = "masterck_div", .id = 19 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "uhpck", .id = 6 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "qspick", .id = 19 }, }; static const struct { @@ -177,31 +178,34 @@ static const struct { static void __init sam9x60_pmc_setup(struct device_node *np) { + struct clk_hw *td_slck_hw, *md_slck_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw; + struct clk_hw *parent_hws[6], *hw, *usbck_hw; + static struct clk_parent_data parent_data; struct clk_range range = CLK_RANGE(0, 0); - const char *td_slck_name, *md_slck_name, *mainxtal_name; + const char *main_xtal_name = "main_xtal"; struct pmc_data *sam9x60_pmc; - const char *parent_names[6]; - struct clk_hw *main_osc_hw; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; - i = of_property_match_string(np, "clock-names", "td_slck"); - if (i < 0) + clk = of_clk_get_by_name(np, "td_slck"); + if (IS_ERR(clk)) return; - - td_slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "md_slck"); - if (i < 0) + td_slck_hw = __clk_get_hw(clk); + if (!td_slck_hw) return; - - md_slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + clk = of_clk_get_by_name(np, "md_slck"); + if (IS_ERR(clk)) + return; + md_slck_hw = __clk_get_hw(clk); + if (!md_slck_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -214,26 +218,28 @@ static void __init sam9x60_pmc_setup(struct device_node *np) if (!sam9x60_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 50000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 50000000); + if (IS_ERR(main_rc_hw)) goto err_free; - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, 0); + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, + &parent_data, 0); if (IS_ERR(hw)) goto err_free; - main_osc_hw = hw; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; sam9x60_pmc->chws[PMC_MAIN] = hw; hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "pllack_fracck", - "mainck", sam9x60_pmc->chws[PMC_MAIN], + NULL, sam9x60_pmc->chws[PMC_MAIN], 0, &plla_characteristics, &pll_frac_layout, /* @@ -246,7 +252,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) goto err_free; hw = sam9x60_clk_register_div_pll(regmap, &pmc_pll_lock, "pllack_divck", - "pllack_fracck", NULL, 0, &plla_characteristics, + NULL, hw, 0, &plla_characteristics, &pll_div_layout, /* * This feeds CPU. It should not @@ -259,14 +265,14 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->chws[PMC_PLLACK] = hw; hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "upllck_fracck", - "main_osc", main_osc_hw, 1, + NULL, main_osc_hw, 1, &upll_characteristics, &pll_frac_layout, CLK_SET_RATE_GATE); if (IS_ERR(hw)) goto err_free; hw = sam9x60_clk_register_div_pll(regmap, &pmc_pll_lock, "upllck_divck", - "upllck_fracck", NULL, 1, &upll_characteristics, + NULL, hw, 1, &upll_characteristics, &pll_div_layout, CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | @@ -276,17 +282,17 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = md_slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack_divck"; + parent_hws[0] = md_slck_hw; + parent_hws[1] = sam9x60_pmc->chws[PMC_MAIN]; + parent_hws[2] = sam9x60_pmc->chws[PMC_PLLACK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 3, - parent_names, NULL, &sam9x60_master_layout, + NULL, parent_hws, &sam9x60_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, &sam9x60_master_layout, + NULL, hw, &sam9x60_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); if (IS_ERR(hw)) @@ -294,26 +300,26 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->chws[PMC_MCK] = hw; - parent_names[0] = "pllack_divck"; - parent_names[1] = "upllck_divck"; - parent_names[2] = "main_osc"; - hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, NULL, 3); - if (IS_ERR(hw)) + parent_hws[0] = sam9x60_pmc->chws[PMC_PLLACK]; + parent_hws[1] = sam9x60_pmc->chws[PMC_UTMI]; + parent_hws[2] = main_osc_hw; + usbck_hw = sam9x60_clk_register_usb(regmap, "usbck", NULL, parent_hws, 3); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = md_slck_name; - parent_names[1] = td_slck_name; - parent_names[2] = "mainck"; - parent_names[3] = "masterck_div"; - parent_names[4] = "pllack_divck"; - parent_names[5] = "upllck_divck"; + parent_hws[0] = md_slck_hw; + parent_hws[1] = td_slck_hw; + parent_hws[2] = sam9x60_pmc->chws[PMC_MAIN]; + parent_hws[3] = sam9x60_pmc->chws[PMC_MCK]; + parent_hws[4] = sam9x60_pmc->chws[PMC_PLLACK]; + parent_hws[5] = sam9x60_pmc->chws[PMC_UTMI]; for (i = 0; i < 2; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 6, i, + NULL, parent_hws, 6, i, &sam9x60_programmable_layout, NULL); if (IS_ERR(hw)) @@ -322,9 +328,15 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + sam9x60_systemck[0].parent_hw = sam9x60_pmc->chws[PMC_MCK]; + sam9x60_systemck[1].parent_hw = usbck_hw; + sam9x60_systemck[2].parent_hw = sam9x60_pmc->pchws[0]; + sam9x60_systemck[3].parent_hw = sam9x60_pmc->pchws[1]; + sam9x60_systemck[4].parent_hw = sam9x60_pmc->chws[PMC_MCK]; for (i = 0; i < ARRAY_SIZE(sam9x60_systemck); i++) { hw = at91_clk_register_system(regmap, sam9x60_systemck[i].n, - sam9x60_systemck[i].p, NULL, + NULL, sam9x60_systemck[i].parent_hw, sam9x60_systemck[i].id, sam9x60_systemck[i].flags); if (IS_ERR(hw)) @@ -337,7 +349,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sam9x60_pcr_layout, sam9x60_periphck[i].n, - "masterck_div", NULL, + NULL, sam9x60_pmc->chws[PMC_MCK], sam9x60_periphck[i].id, &range, INT_MIN, sam9x60_periphck[i].flags); @@ -351,7 +363,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &sam9x60_pcr_layout, sam9x60_gck[i].n, - parent_names, NULL, NULL, 6, + NULL, parent_hws, NULL, 6, sam9x60_gck[i].id, &sam9x60_gck[i].r, INT_MIN); if (IS_ERR(hw)) From patchwork Thu Jul 27 05:31:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7167DC001E0 for ; Thu, 27 Jul 2023 05:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PBkkLduvXtwEXUHHWTODFuugmCdodBi1SUc+zO/M1rA=; b=S5zsg999/iZEEB wgabIbbYzOPaNlRDxAVxbW1XwP803brIHNf6r4EFam1JG6tKL81XE4c3zj4C3Fyck56JB6cH6uP/y VgVa3vjgzyE+FclHV2DM8nIzXrKJz5xOY3IzqIYXDwR+KfWzCVHLFq+FYcl0n+QaGhf7a7GyzTO+W bvgDU1gZi+yA5c+jtj6dHpmTaX1k3MxyIxnNPmNbrEjhI29TnfNHpDmeDN4Vy3RXlRRFpZC/uOu6z 1rddxUH4eCetrL3D1bDfjGjUrnmHl4IG2SsLuipdLOMO1YixyPWjovV0daGQSE1PiFr40hfny4evP UjF5efRL5Rh/LyX5qJQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcf-00CBkT-0x; Thu, 27 Jul 2023 05:33:13 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcR-00CBgI-3B for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:01 +0000 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-563d3e4f73cso294981a12.3 for ; Wed, 26 Jul 2023 22:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435978; x=1691040778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZOqReItDfaxB+nBJ9zQp2I4wwFvLbgDN9poIQ494Sec=; b=NB7doVVdgWMiRRp5hZkHS0QERPxUWcgaqil3/xOuD7rKNI9jl2wuxHFzDl7N5BBoOO sl3xJNyzvO0bfAnxkzIj7XB2TM9G9N9NB1i79wtoEmLx1OLdWCwh2Gmg9sMe+wQk8dev vYl9h2wmHjFe4B4v+EN50b/3agja8Xa6JRnolEgkoa+ZFEi3SYrtzKFs82tQLWW9ve6K tCwjxpBUGyULVV9R7jaM0IvUcbPPi1HNmwcvsH7MJlkCIaQNsi8mz7auF0JcChkn/Nyb ZQMym9LSeo1fv++udsWd9/YNECzzOjF7U1bFB4rjS1ZfZUhewLByo5ZcBnGnOBiZVtYA ZSOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435978; x=1691040778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZOqReItDfaxB+nBJ9zQp2I4wwFvLbgDN9poIQ494Sec=; b=i+eedXJBJoFWTyLDCw29YfFFAE0f0qlBn2QZwpXsHbRH2m/cLj+5dvh9tAWF20V6v1 CfSEwCyiWZp+F1GuEaK3iAqS97h039LVzT6gORr+2k/TT4Ol08opKXGvQ7h5F5pPDZaX K7HU/A4dLJUSNgCM85N64WbUSfQ0UWFuc+RLy3mX0R23g6Cfd/cAryA6i2f8WQ0oIwYt U6jxeJtQ8BqHdVLj+Gct2cz8nUZzaDyuDoeysRFi3VPohhZnwuTcDAvZJffLCzMnFpxV 9d5XrF4yhPfKVlMVu+yh1AnUjMN26yt6OdcGvN0Sjn2Hz/ClJ3j/IhQl/n8vDzPF6sfL 6MnQ== X-Gm-Message-State: ABy/qLYt752+MLiSloKn6ZvLNIt+Zk0xeEjvU3bdsXEa/QNtg/HCy2jo PwrWqyoAyl1FkZvALpJnke/JEA== X-Google-Smtp-Source: APBJJlG4g+UU2DlFHesikVn7Ehf7tvYVZYciQ2xv6muWvezUiwf85V/bBVOrFE/TJKyCXDSRtpnwNQ== X-Received: by 2002:a05:6a21:4985:b0:10f:52e2:49ec with SMTP id ax5-20020a056a21498500b0010f52e249ecmr3493892pzc.53.1690435978324; Wed, 26 Jul 2023 22:32:58 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:32:58 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 04/42] clk: at91: sam9x60: make checkpatch.pl happy Date: Thu, 27 Jul 2023 08:31:18 +0300 Message-Id: <20230727053156.13587-5-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223300_020375_C133FA3F X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the following checkpatch.pl CHECK: Please use a blank line after function/struct/union/enum declarations. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sam9x60.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index c68cd969dd46..930b4515a1dd 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -379,5 +379,6 @@ static void __init sam9x60_pmc_setup(struct device_node *np) err_free: kfree(sam9x60_pmc); } + /* Some clks are used for a clocksource */ CLK_OF_DECLARE(sam9x60_pmc, "microchip,sam9x60-pmc", sam9x60_pmc_setup); From patchwork Thu Jul 27 05:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 56276C001DC for ; Thu, 27 Jul 2023 05:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OzH46GX4urNBvVBYuTGLXuoU1W1QAcv3U8VZkYJaYfg=; b=IkxI+1FWQUgPoJ mQ2+wkNql8a6K1DFa6L4J34BqAYlstSVGWAAYsDzs2RBptjj4EFBv43/+wIHWbqFcdPU0kfRW3TDP MRAPrXIyfxeTnOAmFTCAcZg9HBfYjEF8IPhOL08WD3v7cfKv+5bSP5lz833rXMcN4E9inLHeThjBJ Wci6kUxGfC9tPjd8mZl9kxCJUn1cuxhE1nZ4lazHgCE01wU3IVre0LYQisdKoXZ/lTCXaApwD2P4C yApBRqgjU0XjM582S+r6A72pqIGuSKVEKscC2U9PH3zg8CIZMtcdI44RHN03O/5Iv7buu89PH1T6p 4OmNIqsvUyS2jiHkQuVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcf-00CBkn-2g; Thu, 27 Jul 2023 05:33:13 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtca-00CBi5-1R for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:10 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b89d47ffb6so3414115ad.2 for ; Wed, 26 Jul 2023 22:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435985; x=1691040785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mS51ZmJrNJRKzR5R8YYwfuBh1xwTctc46iViNhup/Iw=; b=a+aBIZxHWndgPLFmvXqnrfV1/Zes4TfvXi4F37flkt+iHpLt30VDFM1cmtuhTCRYX3 ojMASInkq4m53QK+3xPQudB5jfolz4FVZ5gXcx8OpRGHihcCvLLjt8uWIiOL4jOUsCbD s7oUsu6C0SYG792EAErxf+JpOlzCYo9N0KtZp6TW4QrtIvwerXgzkRmf93XPgPs74zNK DOOEViCfoA4irCztQRKncoa/z0w5zVIBHkPp7T3cwmfQeFI+bTSJREc4ZfYe+HPrePfw 7o+Wv2UUTl8YmGormBtv8f1WVFv84sMbQ8n7ODaJ4SOjFcWcOREvXX17Sm84g4XSRm1W pO/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435985; x=1691040785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mS51ZmJrNJRKzR5R8YYwfuBh1xwTctc46iViNhup/Iw=; b=DKIv+NXTDvMOvaxR3t7zel7nkFbeuQLQXqrI+VGWrNiFI+rOAMjA6Xfxas2sTOFxke KsRVOImZ3ZUpQAQoHK2EhMMxqQYb3ZVfpbl3P6Cudiiy4nNo5969S01NhADfQgfIE7mr m3dhvrv3VFCFaZtKbiG5hb0i7soeDzO3yNNNuRIYwPzCzfPBlzwPIUzXPF/VspeKlmUl MIDfBPdEC5xM1IOwfFyJHARa+2YpeAazpdwlEJlXNXiZPiTiq3eOf061imACVuIQcGa2 2xmiA9VbIKLxTZjzBM31A8L704++YnzNSMm8ivJDqBedlR1GduGc79CyDXI8yfDL7kjv FH6w== X-Gm-Message-State: ABy/qLaQVOfwD5W62lY7yw0DX0l2hiZVsp+ZVQUt/eDHmo9WnCNPzjZj T1lGBxXu5An3BuxBTueczpxk4w== X-Google-Smtp-Source: APBJJlHQDI/g7NUGzywOkdGH97lX4hE++O1875qEi81EkWhkKvN55oF3sEhivdPFuNR8aQY2Cu38Mg== X-Received: by 2002:a17:902:e80f:b0:1b8:b436:bef3 with SMTP id u15-20020a170902e80f00b001b8b436bef3mr4111821plg.24.1690435985384; Wed, 26 Jul 2023 22:33:05 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:05 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 05/42] clk: at91: clk-pll: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:19 +0300 Message-Id: <20230727053156.13587-6-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223308_486495_D3C590F5 X-CRM114-Status: GOOD ( 17.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in pll clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-pll were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 4 ++-- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 4 ++-- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-pll.c | 9 ++++++--- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 12 files changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index e5a034f208d8..623e232ec9c6 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -119,7 +119,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) @@ -127,7 +127,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1, + hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index ae6f126f204a..f39deb3ec00a 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -395,7 +395,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, slck_name = slowxtal_name; } - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, data->plla_layout, data->plla_characteristics); if (IS_ERR(hw)) @@ -403,7 +403,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1, + hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, data->pllb_layout, data->pllb_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 684d2bcb36e8..3436a09a6e8a 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -134,7 +134,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 9fc20b177b13..80ccd4a49df3 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -160,7 +160,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; @@ -171,7 +171,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1, + hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, &at91rm9200_pll_layout, &pllb_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 969f809e7d65..0e8657aac491 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -101,7 +101,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &at91rm9200_pll_layout, &sam9rl_plla_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 5728cfb9036f..6b8c755fefdf 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -182,7 +182,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index 249d6a53cedf..afd48cbaa6db 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -310,13 +310,13 @@ static const struct clk_ops pll_ops = { struct clk_hw * __init at91_clk_register_pll(struct regmap *regmap, const char *name, - const char *parent_name, u8 id, + const char *parent_name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_layout *layout, const struct clk_pll_characteristics *characteristics) { struct clk_pll *pll; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int offset = PLL_REG(id); unsigned int pllr; int ret; @@ -330,7 +330,10 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, init.name = name; init.ops = &pll_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index ead99948375b..d8e520e509d8 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -664,7 +664,7 @@ of_at91_clk_pll_setup(struct device_node *np, if (!characteristics) return; - hw = at91_clk_register_pll(regmap, name, parent_name, id, layout, + hw = at91_clk_register_pll(regmap, name, parent_name, NULL, id, layout, characteristics); if (IS_ERR(hw)) goto out_free_characteristics; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 515a3c5595b7..ce68c1b1fb70 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -211,7 +211,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init at91_clk_register_pll(struct regmap *regmap, const char *name, - const char *parent_name, u8 id, + const char *parent_name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_layout *layout, const struct clk_pll_characteristics *characteristics); struct clk_hw * __init diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 8bbc34e22cda..bc62b9ed4ea0 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -215,7 +215,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 05d0cdd22bc4..9d86c350a1e7 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -161,7 +161,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index da84b4cef827..8491b1e0391d 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -176,7 +176,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", 0, + hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3AF9DC001DC for ; Thu, 27 Jul 2023 05:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wdZMPFsNlvi9DriSdbSMhrpBNLA6azPLgeCIctOVuC4=; b=h0drY7m8CuXaaP 81sLUgWgDoyreFm/KVKDCWqj0DmUi04KRK0Qr3z5FSURy4nAyRQ+O+4V46iZuGsRB8JgiA5QStl8J yd65Cvh2McuQwW/X70CFvuC8EkdhyBK1aAq6kGkAUQhKbUvv8GDlZpzr9fAd1/TVdoKSAqtO5XDpi odtSjD2o9JOy8bwK/sAlhoHu8xlAjq08CoINjAndFWvZjfrVrtToJ0jzu6Rq7MD8r7j3KfdXFjDgG P4kmbpHHJJVocT+jReSa3fYLn2Q2iF3Kis/T7YG1ekm0Ux6QmZBD+FEwzYEkEmSC/sUuYgohBczZi B/3lidJXIyuaGxXdaLWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcw-00CBrk-0T; Thu, 27 Jul 2023 05:33:30 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtce-00CBk5-2v for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:14 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bbdc05a93bso2187475ad.0 for ; Wed, 26 Jul 2023 22:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435992; x=1691040792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p47IEHM+JZSsAANQ/kyvjM6x0oAWT/q0JwErNba07sU=; b=Jwa33zZJtyHQ6H92mgUKLxpuKwc455YJUiTrkI7z8K56ZNWLnw5UeW6SLUP+rNVRni IDIcwsZlCQLAQI/L8464HY/WPdd3RN4xbPZDGno3r3bdbezUcvwy+/pT17jiv3DW26Uk JYP9beEDushkyrKuTpEJaIBFNjnWn7q0ZRvV4hNcQX9wMPeavBy0K9hTbfXWnA8iosxR i3xQDBNBm6nMBkpozyoQJ0vRdI2KG68b1O2rX8lMxQej1bpkg95TAwAoCbeBPX17WXQI vrUYqrjnbTqwD0gCqWNILBwWsmF27jlAcQpSe23WxY7NRlxU6c9hx6ZEHQhPAZSI4eVW WVmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435992; x=1691040792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p47IEHM+JZSsAANQ/kyvjM6x0oAWT/q0JwErNba07sU=; b=Aj3Wqyd2vflm17MKovW33mGIgYsnsUq7rwI64scZ4tvkXIYF5jG/NPMKnKG1OSyy0h dgwR8oMf2LgtGE6GetV6gnUc7eejnr5ZdDi99l/zmAPLSLlGUzzMIiHEokIQJ2tcLfnH Orm4v1+9n8/H0jQfC7nxxoutJ0Ad1PqYoaQKu95t6Paa6lvpWu6Vhvey/9gQUxnbvsFA Js8/JFwEZxzhzP7oHW8rwqfvGiNsWcReBVfOyDeFA1J/oXQ9Qd2118Ja+8p+ZbQ+vnJW KSC5IjfFabsUGMUbtWezubb0Q4tWUoQj0vviLjEDO39B/jiY1gzEnMIE43vpGeMHisgN XR/Q== X-Gm-Message-State: ABy/qLaEKfmzZAYykB5BmUIrxBsQpXTbcfKsML0XLHeP+P8fhPMxdapg tcW2wki6tsNo3MmWPfxBI675TA== X-Google-Smtp-Source: APBJJlEpXgAf/SMRf0Z3BXR+DOQC2gQ41hjdzkvIn6yKyCoC8D2FLzqGxSICSduADERyliEuCcZ1sg== X-Received: by 2002:a17:902:7795:b0:1b8:b827:aa8e with SMTP id o21-20020a170902779500b001b8b827aa8emr3089993pll.11.1690435992455; Wed, 26 Jul 2023 22:33:12 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:12 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 06/42] clk: at91: clk-audio-pll: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:20 +0300 Message-Id: <20230727053156.13587-7-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223312_975271_1563857B X-CRM114-Status: GOOD ( 16.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in audio pll clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-audio-pll were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-audio-pll.c | 25 +++++++++++++++++-------- drivers/clk/at91/dt-compat.c | 6 +++--- drivers/clk/at91/pmc.h | 6 +++--- drivers/clk/at91/sama5d2.c | 6 +++--- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-pll.c index a92da64c12e1..7a13af95d628 100644 --- a/drivers/clk/at91/clk-audio-pll.c +++ b/drivers/clk/at91/clk-audio-pll.c @@ -450,7 +450,7 @@ static const struct clk_ops audio_pll_pmc_ops = { struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct clk_audio_frac *frac_ck; struct clk_init_data init = {}; @@ -462,7 +462,10 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_frac_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE; @@ -480,10 +483,10 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct clk_audio_pad *apad_ck; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; apad_ck = kzalloc(sizeof(*apad_ck), GFP_KERNEL); @@ -492,7 +495,10 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_pad_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; @@ -511,10 +517,10 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct clk_audio_pmc *apmc_ck; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; apmc_ck = kzalloc(sizeof(*apmc_ck), GFP_KERNEL); @@ -523,7 +529,10 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_pmc_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index d8e520e509d8..6698a770d45a 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -43,7 +43,7 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np) parent_name = of_clk_get_parent_name(np, 0); - hw = at91_clk_register_audio_pll_frac(regmap, name, parent_name); + hw = at91_clk_register_audio_pll_frac(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; @@ -69,7 +69,7 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np) parent_name = of_clk_get_parent_name(np, 0); - hw = at91_clk_register_audio_pll_pad(regmap, name, parent_name); + hw = at91_clk_register_audio_pll_pad(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; @@ -95,7 +95,7 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np) parent_name = of_clk_get_parent_name(np, 0); - hw = at91_clk_register_audio_pll_pmc(regmap, name, parent_name); + hw = at91_clk_register_audio_pll_pmc(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index ce68c1b1fb70..6d541b4d3f50 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -130,15 +130,15 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data); struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index bc62b9ed4ea0..d2af421abddc 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -227,19 +227,19 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_PLLACK] = hw; hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck", - "mainck"); + "mainck", NULL); if (IS_ERR(hw)) goto err_free; hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", - "audiopll_fracck"); + "audiopll_fracck", NULL); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_AUDIOPINCK] = hw; hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", - "audiopll_fracck"); + "audiopll_fracck", NULL); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C23D8EB64DD for ; Thu, 27 Jul 2023 05:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y8djzpwSNG5eFbp+YhKcGgt8beIriZrg31ALO0oi6q0=; b=3pBRX1NF4fmVE9 Jhn8+r8V/GYH/aBWTmF5EUImIsoHSndk/+GJuHdM//+9d01U+5nlLY2S9yqGfVBPNFzhssA5O2ruk AS0Te05XPQOAaxW3ncvQmTbf77fuAXlDtu/FKp6qz36t7kABaHHsODE9ZwL9AUErZcpxWsFiaj3pR SNVCX/agbxm64H484LBtENJTC6fQONTsq1RQaLC2XbuWp3DoWD3OxThq0Ju54e0lDtds5c9v7TBMn uJBayRtaTpT67W1L1HM6uOYnA1BTqHxb6r6HwgD8LnKfJG5wnE3Sis3GtUouoKMfZV8l2Pq8cybHj xRdsn0mNFG7X93P3IflQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcw-00CBs3-24; Thu, 27 Jul 2023 05:33:30 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtco-00CBnJ-1X for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:24 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bba2318546so4669435ad.1 for ; Wed, 26 Jul 2023 22:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690435999; x=1691040799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tDrEaG1FrYIYPpIkYqTQ35Nb2gC0x77uQ2+oCiptl8Y=; b=TNmQRH6XD/IQqkFuUnbUYHKPbUJtpCP9ZTd7hOjPFstkK4GGw2cOrkEXSJrRdk77Ss qool2eiA9B4NNiEyhGjOTFBRKoV+sCN/vODbxNiO65s2r5MD7FDhRuvbVn0hkwT0puLs lZbMQxJkqD2q1EoeXCK6avn+rNgNfXEH2ESjaDJBIgmjyvv5wgG0cT/ARkKS7mGBLa/h RTsQtwAxUuFX//+UIV4yaPX2gi+awiwQoglYmG+eXfzf0bVPFPNZRG24JgQ6hREbbVvo caVyWLd3gtrnrBIBYu4east4Mz0rJM6fKjwUTVYDM4AJwYNeU85+D4G/Sav7a4b7g3DT RblQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690435999; x=1691040799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tDrEaG1FrYIYPpIkYqTQ35Nb2gC0x77uQ2+oCiptl8Y=; b=fJKPW84dz6/R0xSmmgsn+hdxhhYwz8IDisie3tL1avaduB75ft8P4kEhGftEOo0Obc ehBSJwDwoeuSyvlAOwpBkJY0hzxJzqNQVDbz7SOpCJ3nTHyGpM1SWDMPXzxGWlaVEBwU zNcOX1583oB3uHJak2/DFRW4D6bBnCr7cG9g5T7J/7ptxgLA6KFaNe8DJELtH25xwKle LcDHAnSXHR9bWuVm98eWUifElgh21Y/fZb37TaVQfWTsR1nwXC+FBJBoCMbkPD9ikjRg Y3j02PuQnxmoGgVfn5ZU3yumb32PD76PwU5/9hWTxJtzWxhI5VN/Ou398f4yqr+TEe30 VxUw== X-Gm-Message-State: ABy/qLZY/5Cij/z1714Q9tvbISwIA+F6yNuyHyuRo4HWlnNNTA8mJX4E nRsXAzy0fRt8Z6nPZ0GGd7SYIA== X-Google-Smtp-Source: APBJJlEZZy7NFVfWXUN3El4Q2vpfEVNjq1UmwljSqneIebgGoed5M6gxjkSL5k6eFM37B6jaUMi+9Q== X-Received: by 2002:a17:902:728a:b0:1b8:a19e:a3d3 with SMTP id d10-20020a170902728a00b001b8a19ea3d3mr3388752pll.52.1690435999541; Wed, 26 Jul 2023 22:33:19 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:19 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 07/42] clk: at91: clk-plldiv: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:21 +0300 Message-Id: <20230727053156.13587-8-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223322_542450_BF96EAE8 X-CRM114-Status: GOOD ( 17.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in plldiv clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-plldiv were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-plldiv.c | 13 +++++++++---- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 3436a09a6e8a..cb98d22c2e30 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -139,7 +139,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 80ccd4a49df3..34dd7645f964 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -165,7 +165,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 6b8c755fefdf..37280852f086 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -187,7 +187,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c index ba3a1839a96d..1d5a0a6d299d 100644 --- a/drivers/clk/at91/clk-plldiv.c +++ b/drivers/clk/at91/clk-plldiv.c @@ -72,11 +72,11 @@ static const struct clk_ops plldiv_ops = { struct clk_hw * __init at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct clk_plldiv *plldiv; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; plldiv = kzalloc(sizeof(*plldiv), GFP_KERNEL); @@ -85,8 +85,13 @@ at91_clk_register_plldiv(struct regmap *regmap, const char *name, init.name = name; init.ops = &plldiv_ops; - init.parent_names = parent_name ? &parent_name : NULL; - init.num_parents = parent_name ? 1 : 0; + if (parent_hw) { + init.parent_hws = (const struct clk_hw **)&parent_hw; + init.num_parents = 1; + } else { + init.parent_names = parent_name ? &parent_name : NULL; + init.num_parents = parent_name ? 1 : 0; + } init.flags = CLK_SET_RATE_GATE; plldiv->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 6698a770d45a..6e010b5cb435 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -723,7 +723,7 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91_clk_register_plldiv(regmap, name, parent_name); + hw = at91_clk_register_plldiv(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 6d541b4d3f50..3f7ad79db4db 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -216,7 +216,7 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, const struct clk_pll_characteristics *characteristics); struct clk_hw * __init at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index d2af421abddc..7904f2122ed7 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -220,7 +220,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 9d86c350a1e7..7f2ac8f648dd 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -166,7 +166,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 8491b1e0391d..7cda8032653e 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -181,7 +181,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6DB55EB64DD for ; Thu, 27 Jul 2023 05:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FD5tMTBWy/4q0V6WqdebRsTXFSCCfnt0+aRIM86zBac=; b=SRQovSkshepdI5 WrZQyfFzPZf/L+3d5NxHEMpy+5Aiueo8Ptyk1vW0PpdWhisYl6EZ9KstOrdr/+qHpLKGTQaQ9fj68 AqLFxJ2zLdINGkf97xA/friV8rrOmv3+keTSq+S7HBMbtJ9tmHY2i2/bA7/xfXm6tEN0Cx2IhA2bv yPjMvUrr4E46Y52iUrFKytJ4z9Dk9oQprJUJ+px+vtIG5ZmnKG/l6FIVc8BxPyDj+U6yguuSPJ54E vGEYlcMcvRvLXd5xg/inL+XGb5/ordzjHAo5zWG4mFLfwtMMB7u2ry5nfUgyv/ZwSwHGci9mAg0Kq LrfqdxyUzXz+X3TGn3zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtcx-00CBsW-0x; Thu, 27 Jul 2023 05:33:31 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtct-00CBqv-1Z for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:29 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bb7b8390e8so3285545ad.2 for ; Wed, 26 Jul 2023 22:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436007; x=1691040807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ET3auG+YOLxA4Kz/fjW90vjtO8YNjKzJmKaIU71PEwg=; b=Qky0ouzrEazF7OV6EacrIQAM3rX40oemivrHJMql2tdK1nPdQkUqW3UsotdaVdtp1O utQ/MHsxc2TDqlW3sNgwqjIBhxQu5qqeKeY26RZ53DY6jPwCHs0W3F1/4EDiUpEAJDdk lU2WWR6bDv5AFIvQ4U1eoprq93jq87qlJ0v/PSGYsgOpYWz5W6W3om4khGaePa48odAp KVCwwcG0OXprw/mPnCjw3X0EylLgiRU6usjob8l8R1O+/WAX5Y2eg4Z3tBdN6zz7RV42 iDSIAbqpMLiPWekaaUPDt3ktUQvfxwzAUxuTg1GYsVsZVIQgx4NMk2WGg1vs90+DjJpk OroA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436007; x=1691040807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ET3auG+YOLxA4Kz/fjW90vjtO8YNjKzJmKaIU71PEwg=; b=fn3RREnsJCd3Fr7s74P1VHk/e3sj+mHg/jzsEGhGEnYXN5YfxK00dVIu7MtE86V8Ml UJ8TbJ49oi9oM1yNWHSh1EPtTidcNe8x9H/RrbBQLh37GKYWgR6/PDrVY5rzWJ1xZY4d FNBaGkKeRKAufdxgIB2RABeWlZH1zfOX/gF60e7gALf7V6BE0G4JXfXv3uxa9+o93SNO hcMbgg78/GdSox4DVvgKGUlZSJqHLxMHUS17Z21VE1ffqApyaC8TrEscJ1gfdsJ6Qdw+ us0Jq9+WvqasQgeWxOt+/a+S5dCXNy1ysEbkQ0C39pxGtsKotfbbqpVNlihW8DGD4Cx7 4OoQ== X-Gm-Message-State: ABy/qLbrlhaKfHo7WktFmNRAM2WLXIWUKHfWBuRJddkDhPXrdLjLDrt9 jKGxzv434RbLKmODAamGf3CZoA== X-Google-Smtp-Source: APBJJlF5djb+zVDVYWi+jQX6mFMN3qj/+EXFOyxmNMw6sHbNTiuDfY+nvggI6LNZBReVZGkB9Hq9xQ== X-Received: by 2002:a17:903:22c9:b0:1b8:30d8:bc45 with SMTP id y9-20020a17090322c900b001b830d8bc45mr3989756plg.47.1690436006998; Wed, 26 Jul 2023 22:33:26 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:26 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 08/42] clk: at91: clk-h32mx: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:22 +0300 Message-Id: <20230727053156.13587-9-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223327_533257_2652A110 X-CRM114-Status: GOOD ( 17.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in h32mx clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-h32mx were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-h32mx.c | 13 +++++++++---- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c index 1e6c12eeda10..d7cdade56454 100644 --- a/drivers/clk/at91/clk-h32mx.c +++ b/drivers/clk/at91/clk-h32mx.c @@ -83,10 +83,10 @@ static const struct clk_ops h32mx_ops = { struct clk_hw * __init at91_clk_register_h32mx(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_hw *parent_hw) { struct clk_sama5d4_h32mx *h32mxclk; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; h32mxclk = kzalloc(sizeof(*h32mxclk), GFP_KERNEL); @@ -95,8 +95,13 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, init.name = name; init.ops = &h32mx_ops; - init.parent_names = parent_name ? &parent_name : NULL; - init.num_parents = parent_name ? 1 : 0; + if (parent_hw) { + init.parent_hws = (const struct clk_hw **)&parent_hw; + init.num_parents = 1; + } else { + init.parent_names = parent_name ? &parent_name : NULL; + init.num_parents = parent_name ? 1 : 0; + } init.flags = CLK_SET_RATE_GATE; h32mxclk->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 6e010b5cb435..8540234e9d89 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -201,7 +201,7 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) parent_name = of_clk_get_parent_name(np, 0); - hw = at91_clk_register_h32mx(regmap, name, parent_name); + hw = at91_clk_register_h32mx(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 3f7ad79db4db..1604b44f2945 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -150,7 +150,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init at91_clk_register_h32mx(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 7904f2122ed7..8c7ff0108b41 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -276,7 +276,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div"); + hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div", NULL); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 7cda8032653e..04c848cd7001 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -214,7 +214,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div"); + hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div", NULL); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328748 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 38A49C001DC for ; Thu, 27 Jul 2023 05:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ogLS80p4O49tV/9aCyiiAl0CCH+Q1kZjhtvoJw7ZXgE=; b=zJeOdz0RFo/Puf gulExKb65ESBO4O50dfRjH5huZlUeL3KjbX6oKA6e5TwZFKZlkLMdUtGLHobHMbSTtfKOmqzcfOUJ Nw4K0bKuHMZ8b+KBbTS7hACJ9dfsfBuk7qvf4x0F34spDXEr9MIKuzlPkbYaDqX0mWrUeF2F5JBSj CoTi8ouIozbfczgCxON4mCmGkti/Wv09IRa/ZRK5EPe1aoY6ixrSyTPPGZpd7cBRx9uOK0TavFDgx b9h17CdL8HJrHJMcUF7bv1Eb1kc3YvcQFiZrjAlkz9R/G56mYb2GM+7g7w6TCZJNUR/4qfRa5TTm8 Eb1DoZ+CdFZ/7oZxqK3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdL-00CC2f-1S; Thu, 27 Jul 2023 05:33:55 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtd3-00CBuC-0Z for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:38 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b8ad907ba4so3557405ad.0 for ; Wed, 26 Jul 2023 22:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436014; x=1691040814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u6pPVVuf+iHSKHYY4ZFtCS4Q+L5PHxVLLeO9zsDmxdk=; b=I40E/Tu+tyrDTZMYc1cPYstrlmBQV6lwHdF/Wtzl6QsK+ppLtgCOOz0mQUFVkkA0/K Pma5M1Mr+XEtJn3bjdcSfgKI6wHMkOMB4ftatqfkjaBo1w5uV02nzkOJk2vq4x7G9IA/ aNWz0J5TfQFmLb7nSVOOk1gKSocVUnBWfxx77HC0LVsw9fbj/JJJmt8O6hz4XEcHgtc3 oGwrCDLHPZfd525go0ZfPDjM2AXs97ZkvraDqTOQdKml1FRv7jUY2Z4oMte7u4UPZWOX 2fvSeBRdKtdhO7ap8JuHbz4LqYV/wVEYjkKhrYafuwp9XtNRnajUgcz3iileulOXZutu /2xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436014; x=1691040814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u6pPVVuf+iHSKHYY4ZFtCS4Q+L5PHxVLLeO9zsDmxdk=; b=QV9mqGSg9hHF1j/x2/0tgLjY7IKIYNZBqTREr52ZIlR0q1492WvRiKLntkpXzd//nI HG30llBCVYmAOookrUI3bzmmrdzXJbYyiz7XgvL2zz5und//tPhbi1Zu59Epu2e9RK2C j4CsFTIPDtZVCAWC06Zf8MurgCRKOCwQul4oNjjVlv5JFzxdeTugS0y2+y/CCxc+AyY0 cicsXEOinNY7S6jrg8VIFX7zOlMoqRrL7tNV8418qk8pgDoIChWQOx7ETrntlv8vU26g Sxk6A3J10e1712GJ1xOySKJupA2YkElzsPGd2PYi0qZ55PldxQK+Yr/xDUXXGDpeiJhh OkPw== X-Gm-Message-State: ABy/qLaSTHTZgpMQ5OUIEbzVbm0T3VQTGg7QcTzXwM89QT54dKw8eXKp NM3T7i7ymbKt4tn5aaMS6zinkA== X-Google-Smtp-Source: APBJJlFm4mKsFff1Zkdn3PV2aA3+Ga6uV0BMrrpjW7y5ICZ5ZDzSKC4ZKS3AGNq3/3HADGo0vTK/7w== X-Received: by 2002:a17:902:c94e:b0:1b6:7f96:42ca with SMTP id i14-20020a170902c94e00b001b67f9642camr3754606pla.66.1690436014261; Wed, 26 Jul 2023 22:33:34 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:33 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 09/42] clk: at91: clk-i2s-mux: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:23 +0300 Message-Id: <20230727053156.13587-10-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223337_213772_A7928B8F X-CRM114-Status: GOOD ( 16.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in i2s mux clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-i2s-mux were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-i2s-mux.c | 7 +++++-- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/at91/clk-i2s-mux.c b/drivers/clk/at91/clk-i2s-mux.c index fe6ce172b8b0..f1981b8ee18d 100644 --- a/drivers/clk/at91/clk-i2s-mux.c +++ b/drivers/clk/at91/clk-i2s-mux.c @@ -50,7 +50,7 @@ static const struct clk_ops clk_i2s_mux_ops = { struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, - const char * const *parent_names, + const char * const *parent_names, struct clk_hw **parent_hws, unsigned int num_parents, u8 bus_id) { struct clk_init_data init = {}; @@ -63,7 +63,10 @@ at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, init.name = name; init.ops = &clk_i2s_mux_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; i2s_ck->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 8540234e9d89..f0498d9c269c 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -239,7 +239,7 @@ static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np) continue; hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name, - parent_names, 2, bus_id); + parent_names, NULL, 2, bus_id); if (IS_ERR(hw)) continue; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 1604b44f2945..e1fd87aebd27 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -154,7 +154,7 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, - const char * const *parent_names, + const char * const *parent_names, struct clk_hw **parent_hws, unsigned int num_parents, u8 bus_id); struct clk_hw * __init diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 8c7ff0108b41..f5d6c7a96cf2 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -372,7 +372,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_names[0] = "i2s0_clk"; parent_names[1] = "i2s0_gclk"; hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s0_muxclk", - parent_names, 2, 0); + parent_names, NULL, 2, 0); if (IS_ERR(hw)) goto err_free; @@ -381,7 +381,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_names[0] = "i2s1_clk"; parent_names[1] = "i2s1_gclk"; hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s1_muxclk", - parent_names, 2, 1); + parent_names, NULL, 2, 1); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328750 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F31A1C001DC for ; Thu, 27 Jul 2023 05:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gyG9YlITZTE3DpRvRmP+wH4kK88weKYOxWVtPtTME00=; b=weZbW1kNPAaMsx lUzF7VqbuYHczOjp8wsw2vW8RwCPTIiX7U3Z9ok5tPYFxdY6wq+2/LiETIMEpmz9aQQiTKEH/6pD+ g8J6mUa4SwjbtqDXNsqT/bUNFbLEk/niBdvvAvnHmKAPZZUnI7gU/KpOQbMkiueQNYeYUV0LoM9LP hN9ToLQDFXcRK5OGGchX5FwUps90XRRYxDfjQCVg48O/iBKDvlgn+NLo418IOA/6VU7i7BsHQvMWn g627tooobLn/sxsh5axY7HvwTwqgAP/62ecebe3QYx6I1YY0Fo0ClrM+wboheFbF/854BHoXbuN8o iABeQprhEx262bKB/TeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdL-00CC32-2z; Thu, 27 Jul 2023 05:33:55 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtd8-00CBxf-1k for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:44 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-56345ab18b0so294346a12.3 for ; Wed, 26 Jul 2023 22:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436022; x=1691040822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mx4drRTLsTo8BLvzaJxx0gqAvVOnYebcn8FvaHa6RBo=; b=m7Y6n6a0biU9wU3OEZlV51PTrYisbU3CVl8mv35Tvoiz8R81ht7ELjhBcuRQ0UM2en fmHlihmt4w6JuP8JXtP6UjWeKS5Re+QESFlaZUzUNUUkL+juKq1FVOMcz3ywENevnO9A cfv7M8A89p+f0yrAdJj4QeTrmWZrCDjvcxCBbv+uPJpqe+3IJKut0FaDmDjZnkSR6meW OvOt9qGB4bBYAtXinToNleXB+Skn2vG5SHGGTYjXhtoc56Cyn8JwbLZ3CYB8GoCYwBUF tXu6T5HwLV/oTdU6i4xIZHRQCgyselBzpkGYSAqHO8nYM9YtAqkwbHLLV2H/JOXudt+9 ZK7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436022; x=1691040822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mx4drRTLsTo8BLvzaJxx0gqAvVOnYebcn8FvaHa6RBo=; b=QElMegFQ4QEPoRUgHJXPserSHkCeEDn/mQ1BnNEvjbjXaHGn37enxNqXGsydDmcYva OUT45pM8vYyPWvzuPH4eO2zgLgCeqlPKCl715hcRwS7WnS/X/q6qMcCMxDMUTDHOLg0c dLngCwifsrgaVpzc2VvgdTW+JDppNwZWraxWfaxPJ172PDqM6HjwOMN8/0oonTu5MygH 070eIcumex4ZVOGfvKmHHw7iNJ3OUHQ6Nr89D4IHGW5uhzT6yABohL9Z03VEnPVY/tlq vL/2oU2nGRlCCI+j6ZcwrCY8zTndoX0hBcuXEZzRSDc/mCTaL/cVkGzRrWgGKstF6yeW xvdg== X-Gm-Message-State: ABy/qLbDsd2u/nu0gCKLGCbPK5jmwFlKrrwDf6bvsMdI9Rd+aAbn/v+p oHKatrHePQIcEdI5bK7/M9frXQ== X-Google-Smtp-Source: APBJJlE27IIV1/aO9kFhYFpQUxkfq2D5aR9B9DdKPgTgxMtU8whHLmifslSngsT/6RNiC1a7J+qR8g== X-Received: by 2002:a05:6a20:12c1:b0:135:38b5:7e58 with SMTP id v1-20020a056a2012c100b0013538b57e58mr4347746pzg.37.1690436021948; Wed, 26 Jul 2023 22:33:41 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:41 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 10/42] clk: at91: sama5d2: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:24 +0300 Message-Id: <20230727053156.13587-11-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223342_604597_205D878D X-CRM114-Status: GOOD ( 20.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch SAMA5D2 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Extra time saved on registration is ~410us when running at 492MHz. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sama5d2.c | 165 ++++++++++++++++++++----------------- 1 file changed, 89 insertions(+), 76 deletions(-) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index f5d6c7a96cf2..cdb578059449 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -37,9 +38,9 @@ static const struct clk_pcr_layout sama5d2_pcr_layout = { .pid_mask = GENMASK(6, 0), }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } sama5d2_systemck[] = { @@ -47,14 +48,14 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "lcdck", .p = "masterck_div", .id = 3 }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, - { .n = "iscck", .p = "masterck_div", .id = 18 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "lcdck", .id = 3 }, + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, + { .n = "iscck", .id = 18 }, }; static const struct { @@ -164,25 +165,29 @@ static const struct clk_programmable_layout sama5d2_programmable_layout = { static void __init sama5d2_pmc_setup(struct device_node *np) { + struct clk_hw *slow_clk_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw; + struct clk_hw *hw, *audio_fracck_hw, *usbck_hw, *parent_hws[6]; + static struct clk_parent_data parent_data; struct clk_range range = CLK_RANGE(0, 0); - const char *slck_name, *mainxtal_name; + const char *main_xtal_name = "main_xtal"; struct pmc_data *sama5d2_pmc; - const char *parent_names[6]; struct regmap *regmap, *regmap_sfr; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -195,51 +200,50 @@ static void __init sama5d2_pmc_setup(struct device_node *np) if (!sama5d2_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 100000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 100000000); + if (IS_ERR(main_rc_hw)) goto err_free; bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_MAIN] = hw; - - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, sama5d2_pmc->chws[PMC_MAIN], 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck", - "mainck", NULL); - if (IS_ERR(hw)) + audio_fracck_hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck", + NULL, sama5d2_pmc->chws[PMC_MAIN]); + if (IS_ERR(audio_fracck_hw)) goto err_free; - hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", - "audiopll_fracck", NULL); + hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", NULL, audio_fracck_hw); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_AUDIOPINCK] = hw; - hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", - "audiopll_fracck", NULL); + hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", NULL, audio_fracck_hw); if (IS_ERR(hw)) goto err_free; @@ -249,25 +253,25 @@ static void __init sama5d2_pmc_setup(struct device_node *np) if (IS_ERR(regmap_sfr)) regmap_sfr = NULL; - hw = at91_clk_register_utmi(regmap, regmap_sfr, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, regmap_sfr, "utmick", NULL, + sama5d2_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = sama5d2_pmc->chws[PMC_MAIN]; + parent_hws[2] = sama5d2_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d2_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); @@ -276,31 +280,31 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div", NULL); + hw = at91_clk_register_h32mx(regmap, "h32mxck", NULL, sama5d2_pmc->chws[PMC_MCK]); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_MCK2] = hw; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = sama5d2_pmc->chws[PMC_PLLACK]; + parent_hws[1] = sama5d2_pmc->chws[PMC_UTMI]; + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; - parent_names[5] = "audiopll_pmcck"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = sama5d2_pmc->chws[PMC_MAIN]; + parent_hws[2] = sama5d2_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d2_pmc->chws[PMC_UTMI]; + parent_hws[4] = sama5d2_pmc->chws[PMC_MCK]; + parent_hws[5] = sama5d2_pmc->chws[PMC_AUDIOPLLCK]; for (i = 0; i < 3; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 6, i, + NULL, parent_hws, 6, i, &sama5d2_programmable_layout, NULL); if (IS_ERR(hw)) @@ -309,9 +313,18 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + sama5d2_systemck[0].parent_hw = sama5d2_pmc->chws[PMC_MCK]; + sama5d2_systemck[1].parent_hw = sama5d2_pmc->chws[PMC_MCK]; + sama5d2_systemck[2].parent_hw = usbck_hw; + sama5d2_systemck[3].parent_hw = usbck_hw; + sama5d2_systemck[4].parent_hw = sama5d2_pmc->pchws[0]; + sama5d2_systemck[5].parent_hw = sama5d2_pmc->pchws[1]; + sama5d2_systemck[6].parent_hw = sama5d2_pmc->pchws[2]; + sama5d2_systemck[7].parent_hw = sama5d2_pmc->chws[PMC_MCK]; for (i = 0; i < ARRAY_SIZE(sama5d2_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d2_systemck[i].n, - sama5d2_systemck[i].p, NULL, + NULL, sama5d2_systemck[i].parent_hw, sama5d2_systemck[i].id, sama5d2_systemck[i].flags); if (IS_ERR(hw)) @@ -324,7 +337,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_periphck[i].n, - "masterck_div", NULL, + NULL, sama5d2_pmc->chws[PMC_MCK], sama5d2_periphck[i].id, &range, INT_MIN, sama5d2_periphck[i].flags); @@ -338,7 +351,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_periph32ck[i].n, - "h32mxck", NULL, + NULL, sama5d2_pmc->chws[PMC_MCK2], sama5d2_periph32ck[i].id, &sama5d2_periph32ck[i].r, INT_MIN, 0); @@ -348,17 +361,17 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->phws[sama5d2_periph32ck[i].id] = hw; } - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; - parent_names[5] = "audiopll_pmcck"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = sama5d2_pmc->chws[PMC_MAIN]; + parent_hws[2] = sama5d2_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d2_pmc->chws[PMC_UTMI]; + parent_hws[4] = sama5d2_pmc->chws[PMC_MCK]; + parent_hws[5] = sama5d2_pmc->chws[PMC_AUDIOPLLCK]; for (i = 0; i < ARRAY_SIZE(sama5d2_gck); i++) { hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_gck[i].n, - parent_names, NULL, NULL, 6, + NULL, parent_hws, NULL, 6, sama5d2_gck[i].id, &sama5d2_gck[i].r, sama5d2_gck[i].chg_pid); @@ -369,19 +382,19 @@ static void __init sama5d2_pmc_setup(struct device_node *np) } if (regmap_sfr) { - parent_names[0] = "i2s0_clk"; - parent_names[1] = "i2s0_gclk"; + parent_hws[0] = sama5d2_pmc->phws[54]; /* i2s0_clk */ + parent_hws[1] = sama5d2_pmc->phws[54]; /* i2s0_gclk */ hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s0_muxclk", - parent_names, NULL, 2, 0); + NULL, parent_hws, 2, 0); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_I2S0_MUX] = hw; - parent_names[0] = "i2s1_clk"; - parent_names[1] = "i2s1_gclk"; + parent_hws[0] = sama5d2_pmc->phws[55]; /* i2s1_clk */ + parent_hws[1] = sama5d2_pmc->ghws[55]; /* i2s1_gclk */ hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s1_muxclk", - parent_names, NULL, 2, 1); + NULL, parent_hws, 2, 1); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6D564C001E0 for ; Thu, 27 Jul 2023 05:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NebfGZaC/CR/6uIEmWK3aR+gXqt5mE2SYOjWSPpgVZ4=; b=DrMaurWJVp/UGQ zgKo6oyBXFVM+cLUznUrE9ITd5JcuUR0wYODzn7TlMv4tyKwyKpCrr+ukOM5NiNYBf5d86hRuAyX5 QID8GYQoldpG2Cye6P/1RzrJiiRdtjn5DxQDQ4VQlouQkHBN9puOG0cw2VD5wD8nICFeqWsGAqakZ qgRikywfQ35YP9bRUQP0EF/F50HdpTa+sUvJASgsUZiYBV71z5Mysm7D2TNwtqSM+CNenZ3jd0gx5 +8aPLevdzX3301t6ZUfEfo0DQ8qW2C/lwsdxuDIbF567jE8gXUWEuKDutZlIFH1KWY2EgV3DG+JmD 2sCCbQOheSie0CsLDJRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdM-00CC3V-22; Thu, 27 Jul 2023 05:33:56 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdI-00CC0P-0E for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:33:54 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b8ad907ba4so3558255ad.0 for ; Wed, 26 Jul 2023 22:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436029; x=1691040829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jm/m0e6p3OI9IQEk5rZymWEUT0ucuiLYWwUROUbSNCM=; b=LRKNwtfgw+/7uaq/ShJREdXltre+wvD8ytba7Jl1febDV3zkicZqG0LuPKUMz85FVz jh6TEBNC6CJjxz/svE8Ut6ZE0+eqIDy6oMGtIBrjnEhjtOyqM9TPUKpXxicgKkp+IAnG Bo1NhLeMPX9PeVPcpSrWpFCbCwHSeVMXZfTCNYbVCl7BAcDTRFa8GIbneaTFkBZQWyRy ZwhlFgS9//RYBu021feAcA7161D+4z+COoWXRPDKx9gCjX9rFzfr/RK+zihOhMqDoDK3 P5wdxPxZfXsLb6j0dxB1qgH7SN25iXHTB+/8OMYKfcXvvmy+DYn9xuLVXWjRjjZXe0cg /7pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436029; x=1691040829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jm/m0e6p3OI9IQEk5rZymWEUT0ucuiLYWwUROUbSNCM=; b=JkQLgvOt1mtHETwPVmLx3AKL5UuiOKl+csljObGo/ULqXQcIrlOKU4VQeDx00zo+g4 GWfEOtPKWjZg6veAzLaMNalukAkpjl4Oi7u2MASp7/FhRDQtFoZmpvC5YNtDWeUn+77j F67A/F3jblcef29CUyLIqES2hSsKgxWioD2nA2z/EEz+3Lnb04zid8R16QvwYTF5GEGd UfL39YL8RfC8mAEIagR+jMy2MdibZMg2zr01MmalpgkKIYTQGsRuKCUvfcTopynzXeVC oBBUYQxSpSy+XktHt8zZzYtYoMZ+SpOant9l37ocCAfhNvJBGXdSFBTwtW9JdZXild4q rjtg== X-Gm-Message-State: ABy/qLY+TU4sZRJ/G4tqeKYsWtYNtg0eEG7JK6rjSOUZjwnTcg74PwnW r+RXPtJU/uWYpgh2f+hZ+aN+cQ== X-Google-Smtp-Source: APBJJlGHPnyfRyR77fjalSkvJheNxztCmO6x2PKs8UOpLJLblBDPwinyWiRD3cBOqRiVi72luo0YRA== X-Received: by 2002:a17:902:c106:b0:1bb:8f37:dd0f with SMTP id 6-20020a170902c10600b001bb8f37dd0fmr3289035pli.45.1690436029073; Wed, 26 Jul 2023 22:33:49 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:48 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 11/42] clk: at91: clk-smd: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:25 +0300 Message-Id: <20230727053156.13587-12-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223352_122105_B5981288 X-CRM114-Status: GOOD ( 16.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in smd clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-smd were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-smd.c | 10 +++++++--- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 3 ++- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 37280852f086..13331e015dd7 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -226,7 +226,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, if (IS_ERR(hw)) goto err_free; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, 2); + hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 09c649c8598e..2c8432cc2fe6 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -111,11 +111,12 @@ static const struct clk_ops at91sam9x5_smd_ops = { struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents) + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents) { struct at91sam9x5_clk_smd *smd; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; smd = kzalloc(sizeof(*smd), GFP_KERNEL); @@ -124,7 +125,10 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9x5_smd_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index f0498d9c269c..f464e125c9fd 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -858,7 +858,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_smd(regmap, name, parent_names, + hw = at91sam9x5_clk_register_smd(regmap, name, parent_names, NULL, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index e1fd87aebd27..541d2ba2fea5 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -248,7 +248,8 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, u8 num_parents); + const char **parent_names, struct clk_hw **parent_hws, + u8 num_parents); struct clk_hw * __init at91_clk_register_system(struct regmap *regmap, const char *name, diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 7f2ac8f648dd..8326bb6a291c 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -205,7 +205,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, 2); + hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 04c848cd7001..1ff9286148da 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -228,7 +228,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_names[0] = "plladivck"; parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, 2); + hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 49FBBC001DC for ; Thu, 27 Jul 2023 05:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CeTP8vpWb1ExHqHAdKbh/hYcSZ4Ene2zpzmA5iQujPc=; b=bEdE47JlyEEGzm e29ehbYS+rbBQ3cs1ek8TjQSzU8wd4gqn8XJBj3cqPGQ+RuZhiKsaXJ+ZUuXYKuZjuJUrFgriApWN v6+6FArdzzz5sErmkqgJYWA96+ROh/ey+oZMqTfrFpN1/eSehbI34Ajt6Y5964WYkrn4hsCfetN+K 0oX4BY0QwbDDzhBpKpG2F8d6qTAzXAzyWCJ2TJq/0GH5HeziHG80CA5Vw9YgfVmovs5EMUA5SPlfz vR5VM4vBgS4BFRwAItvk3XaH8HM+i2dUzKjvlDu9dGFwVFSVgoRQE8rQXsoEZz731s1m35zUVriRE IsHNu2jp9fWV5FHnUWeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdm-00CCEP-05; Thu, 27 Jul 2023 05:34:22 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdP-00CC3a-11 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:01 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b8b2b60731so2936485ad.2 for ; Wed, 26 Jul 2023 22:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436036; x=1691040836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t4C9Oz1kltIRm38suchn59UxyDsm/QbdYXqrBIKy7eU=; b=lv/ar83B0jbhwKY2ab3VcuRlDhYDF+3c5B8hcYTNMY74KXuEXXKB/YBrL8Bo+2nmtu gpXuhKWBLJX+voHBzq1OMevlcmX1cQiYuK5S06/yiVHSeGtXkOPO0pO6fHnnA5+5sBsB Xk+EhkG/G8tRFH58Mu1TLs0/kK9Ich2nsn95w30V54QTfAtN6c2xaMBN+mi2gMwAiuGT gSCXke/FCLKPQk53BNBobq39MYi4Otcfb9FGVD0B/a1ZLfj5HH6dw0fpIl4tPP0yC34B qarlvw3ivcno8hZZbl7MA+dKt8Il3bGreiIYPSwKqhm51ErBIe3wPNpxQ2zy2QlRqGWD 8OMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436036; x=1691040836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t4C9Oz1kltIRm38suchn59UxyDsm/QbdYXqrBIKy7eU=; b=d1wqMPcjgm1HKcBebXeNUI2awXQNdRgKwOAp1bAOTSjMjIb/Q2Ep509YVA9ZURnj6r aeQWdZiDcxE8IgYgMpMdOtFeihh8lf6jMp3lZa1YWuKuhbI+62LSw1rRPVcZib75SByh hd0hg/WptVwjRQp6VXtL8Ck4G2JZGnAtKXP4RbkYAu+Gd4nuIVpvL31ya5C4hnxJ8+8h GI8PkTLxhYpnEH26tDUMuFNV/ndA7VANTNgS6Vj+cj48usd4+zaNqx4PY350SsZ2UYCH hicKbjgEbNQFAU7xXk2lYDajm2ygcMNuWxnQXMv9khl3SIhfUa+T08GkFnBnIgwAmEjt Y2UQ== X-Gm-Message-State: ABy/qLacCyY4+hOhNen+8F27MtQ0Oa9ADTystu6MEFy0BBwSTUf8xFe0 vGofk2p8OxH9HoFH1PBG7QMJhg== X-Google-Smtp-Source: APBJJlEOU9CIR0GAd1ZAfZ8u4GySVCT6xMYpY4J49vaD8T2wQ5M215lzZQ9jqzJh3xaYewN6Oa9peQ== X-Received: by 2002:a17:903:234c:b0:1a9:40d5:b0ae with SMTP id c12-20020a170903234c00b001a940d5b0aemr3852843plh.12.1690436036369; Wed, 26 Jul 2023 22:33:56 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:33:56 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 12/42] clk: at91: sama5d3: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:26 +0300 Message-Id: <20230727053156.13587-13-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223359_355683_298829E1 X-CRM114-Status: GOOD ( 19.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch SAMA5D3 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sama5d3.c | 124 +++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 8326bb6a291c..db0c66e24091 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -37,9 +38,9 @@ static const struct clk_pcr_layout sama5d3_pcr_layout = { .div_mask = GENMASK(17, 16), }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } sama5d3_systemck[] = { @@ -47,14 +48,14 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "lcdck", .p = "masterck_div", .id = 3 }, - { .n = "smdck", .p = "smdclk", .id = 4 }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "lcdck", .id = 3 }, + { .n = "smdck", .id = 4 }, + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, }; static const struct { @@ -114,24 +115,28 @@ static const struct { static void __init sama5d3_pmc_setup(struct device_node *np) { - const char *slck_name, *mainxtal_name; + struct clk_hw *slow_clk_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw, *mainck_hw; + struct clk_hw *parent_hws[5], *smdck_hw, *usbck_hw, *hw; + static struct clk_parent_data parent_data; + const char *main_xtal_name = "main_xtal"; struct pmc_data *sama5d3_pmc; - const char *parent_names[5]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (!IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -143,54 +148,56 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (!sama5d3_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 50000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 50000000); + if (IS_ERR(main_rc_hw)) goto err_free; bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + if (IS_ERR(mainck_hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, mainck_hw, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; sama5d3_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, mainck_hw); if (IS_ERR(hw)) goto err_free; sama5d3_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = mainck_hw; + parent_hws[2] = sama5d3_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d3_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + NULL, hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); @@ -199,28 +206,28 @@ static void __init sama5d3_pmc_setup(struct device_node *np) sama5d3_pmc->chws[PMC_MCK] = hw; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = sama5d3_pmc->chws[PMC_PLLACK]; + parent_hws[1] = sama5d3_pmc->chws[PMC_UTMI]; + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + if (IS_ERR(usbck_hw)) goto err_free; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); - if (IS_ERR(hw)) + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + if (IS_ERR(smdck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = mainck_hw; + parent_hws[2] = sama5d3_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d3_pmc->chws[PMC_UTMI]; + parent_hws[4] = sama5d3_pmc->chws[PMC_MCK]; for (i = 0; i < 3; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) @@ -229,9 +236,18 @@ static void __init sama5d3_pmc_setup(struct device_node *np) sama5d3_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + sama5d3_systemck[0].parent_hw = sama5d3_pmc->chws[PMC_MCK]; + sama5d3_systemck[1].parent_hw = sama5d3_pmc->chws[PMC_MCK]; + sama5d3_systemck[2].parent_hw = smdck_hw; + sama5d3_systemck[3].parent_hw = usbck_hw; + sama5d3_systemck[4].parent_hw = usbck_hw; + sama5d3_systemck[5].parent_hw = sama5d3_pmc->pchws[0]; + sama5d3_systemck[6].parent_hw = sama5d3_pmc->pchws[1]; + sama5d3_systemck[7].parent_hw = sama5d3_pmc->pchws[2]; for (i = 0; i < ARRAY_SIZE(sama5d3_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d3_systemck[i].n, - sama5d3_systemck[i].p, NULL, + NULL, sama5d3_systemck[i].parent_hw, sama5d3_systemck[i].id, sama5d3_systemck[i].flags); if (IS_ERR(hw)) @@ -244,7 +260,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d3_pcr_layout, sama5d3_periphck[i].n, - "masterck_div", NULL, + NULL, sama5d3_pmc->chws[PMC_MCK], sama5d3_periphck[i].id, &sama5d3_periphck[i].r, INT_MIN, From patchwork Thu Jul 27 05:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A591CC001DC for ; Thu, 27 Jul 2023 05:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zJGQDWhSHika6TBxuqOHo70CNFP45Dl+kKPVKBvZzKA=; b=RyJAwv8udXVYEe jlIJwJ8JLFfbGfA1f90HGf9J23OZioeRAuudlwTDfANR2uiyc4kRgNiL3ZN4FkVbY/O95atfYEp0/ ukRt3oGaY3nihqAygtf3ZzF/pl9gauUXwIOawzUoiCphGhaM4dprJPtQc6uV8b5ip9HWnrFEzxhaO 71ePn2YuL2elYY2KqgkkVwR8fn8Uaku9jcJQ0GnvDcLcS6sXzjr8Ue7l0AIH/3Bl2hqmSjokUg7Mn B6k0mdMf7Vvu1uJzKWC4AIn+L7+p+k2XVEjcjHKg1zd9ZNkOYw5Y5wa3MciGI7FYCSFQPHFnC9eAq hgeRLHPKCPHWYdJtIe7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdm-00CCEj-1k; Thu, 27 Jul 2023 05:34:22 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdU-00CC6s-0G for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:05 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b8ad8383faso4782495ad.0 for ; Wed, 26 Jul 2023 22:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436043; x=1691040843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wj/zrL8WwstmXnH1Iv4DJ7LsdbSE0/SZKmUpfuJWIbY=; b=SkwKPnpOR8Z5XGlFbjS/UMoDRkdlP11vGl2TiPxlx6nUE8ssAcqu22tL8udwSA4B8r V5g9pDV1XNvMVDbrfzyxJM2GEtIVDLYBD05OkibLfrzFGYKf5f00cEcLI78gzljDn5h5 t0ozMF4W91aI52nesrSWZNuYtNBLqkZ2A7oU3nvNqbBzCRsyp5LfQl0O7BlX5SneCa1A TiRyc8d89yPv9/geLCZXvT48uuNX6KnXlu4F4ij9awAkQqWoVSBtqb+DS/nduw8+oQwR k2FhahE3AyOji7/roqQXLCW0wFqHjEGXPHiSC+Vc4XrPJuSJdp1wh+cQ3R6XHn2jobQz 01Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436043; x=1691040843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wj/zrL8WwstmXnH1Iv4DJ7LsdbSE0/SZKmUpfuJWIbY=; b=GuIw7schWqmNneXN4WnqkF3J+bhXBqpFmOQlGaw7OWBUH6HtqS1F+96mDbZSGRYYoA t1nPa4LktpoH++X2jEZpvE834LkejBGXujqd1ZeH51avhxlJyMjaPM1SDV9eQEHdbQHJ RW4JShWOBNxZE/Otzq0AtIS1nN9rDG1wnSXz5ttJN+owzTjGu7OLRVetJ267Ey5Exsjn lBL/oMKrlMyCUAjOtaJruDVK0NH+zZwIXtIBHeejUPE2IcFfsoE+xpEs3kcMeXUA9aVB xEdmG8htOauD9czDGoT/Enp7ZltZqtAqmWcBBF+ujDe8d1j+TxBBpFJp/SHi0+D59/43 MYWA== X-Gm-Message-State: ABy/qLbXnuOVL7HjFxRgZ9KlrZYzyK56sCihTXIFLdOz2UTU5rCpe99J r0j2WvFrSZWrUFkiQeDMzfX5iQ== X-Google-Smtp-Source: APBJJlH6VVHpmUq+5fWHet5chIXLNq550gkLg6fJI38OQMt+EeCcLhBG1OmgTl2N6iN3wLb63nplDQ== X-Received: by 2002:a17:902:c941:b0:1b8:a4e5:1735 with SMTP id i1-20020a170902c94100b001b8a4e51735mr5146515pla.61.1690436043560; Wed, 26 Jul 2023 22:34:03 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:03 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 13/42] clk: at91: sama5d3: make checkpatch.pl happy Date: Thu, 27 Jul 2023 08:31:27 +0300 Message-Id: <20230727053156.13587-14-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223404_118820_15EFD2FF X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the following checkpatch.pl CHECK: Please use a blank line after function/struct/union/enum declarations. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sama5d3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index db0c66e24091..e1c1ba907e3a 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -278,6 +278,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) err_free: kfree(sama5d3_pmc); } + /* * The TCB is used as the clocksource so its clock is needed early. This means * this can't be a platform driver. From patchwork Thu Jul 27 05:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4E7B3EB64DD for ; Thu, 27 Jul 2023 05:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hi59Se3ljQb4bTFEeWn0nY+UzPmVbuHux9ipaMqCljM=; b=PWa9hccnhs7Zah k9k4gQXGKrEho0iaFCluMovciqKtFiplhk0VVCWfiDziMYqt/Oz+ovZ1rtvQZToer27YJn4Jwm/0M yk5i7vpbflGoA0tRn4sOnwHMRm/mK/9rPGxf3dOBE+CdlPkyPm1Y6GTe9CK4W6S7fairOvMDmjsTK 7x8LafSJ6VKVeJBjf2zT5R3tznpbv3uxM5gbg4j61vJPMyUONnJ+JVrqV50TmTmXxBKROBfqZ9uTK 1XDVkbHARPmBLmil58SecCMyAyqxfMhkr5GMAYpcvlOnV72fpxzf/Cr1B5RozkCLeA8+2emT8Hy1e szX7qxTgKqcUP9ZuVk+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdn-00CCFE-0v; Thu, 27 Jul 2023 05:34:23 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtde-00CCAB-2G for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:18 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686ea67195dso446408b3a.2 for ; Wed, 26 Jul 2023 22:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436051; x=1691040851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S/H1fFwwjqngvhNBP4nbjwJK1x037U3/vvPMvetEGEQ=; b=cCou1bY1xsAlB2b6a4i1I7lerXT5fsZkJvyRpw5Mo4MywIyStAQwDk9yq+EDJcACv+ h2SmYuQVZHU9kkmlOCKr1y+dS1nE+6HHS7IBwZ3cOYpwVss3HTw0KFT1F94ryGUj64lm SoPQOUfi/KhpZhMTINH5TLS4kuodTPnVVhfW31eCZHirZ0UAs2z4ul9GwbfySyvvdA3d K6lZcQC2Chzdedy8/ZqZ8Q8ymfVJ/9sen1+twv3SLcbjp4s0DNUEWCQNVCzAFczwJjF7 BeO+Suhc57pDm8guAqAEW3eeDbwZ6vJ91DMZocS59FqJDRlxyzrN8tncrjrxZzQiFKFW aLLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436051; x=1691040851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S/H1fFwwjqngvhNBP4nbjwJK1x037U3/vvPMvetEGEQ=; b=TGcT7fZA8kCqYiagLKDtBByRL4GAGc7sXtniVPJYvFIAI0Tr/DjPbOu2BtnT0SveC5 P+dpWa/8nGC7IbRtDCGWf1V0ZwawzrrWz8fIpum9Dhi1fghpPoXG2xVygTOLhh9ntDDD et0uw3Q6B8bj1T/LOzc3iUFoO+TT4Aedx0LN0dH+pLGGjaOYRcSfJgotPL42hWuozO1U 3/XTo1luOiNzAIlP8XlfnPX3fS8AWk+pUkKapfwLbYFa/zCpJbUcXYVMvCmKYH7NjQP9 SO4bgjUJGOSZ6Lz3fEBU7cn+mSDwb2WZTOX/t10v/aNARzcgNO05Adb2p6XN2/wv2w6s Ufyg== X-Gm-Message-State: ABy/qLZBUHIuTEpqOsTcXqoKJvdvQOrftc+iOf/y4YX3NLQDwGEqyGPz Mll2Avkdxx4VSIV9QuRIBO45/A== X-Google-Smtp-Source: APBJJlHB/Kj7fixhJPcAfs7KQhIrnMeDg4xvC+Y2wuApi8GCcup3iOgeGozUrsiDj4ZDjwC/WZrsHA== X-Received: by 2002:a05:6a21:a105:b0:135:38b5:7e63 with SMTP id aq5-20020a056a21a10500b0013538b57e63mr3366868pzc.46.1690436050915; Wed, 26 Jul 2023 22:34:10 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:10 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 14/42] clk: at91: sama5d4: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:28 +0300 Message-Id: <20230727053156.13587-15-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223414_788147_9FE8803A X-CRM114-Status: GOOD ( 18.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch SAMA5D4 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/sama5d4.c | 131 +++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 58 deletions(-) diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 1ff9286148da..ac7565b26dce 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -36,9 +37,9 @@ static const struct clk_pcr_layout sama5d4_pcr_layout = { .pid_mask = GENMASK(6, 0), }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } sama5d4_systemck[] = { @@ -46,14 +47,14 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "lcdck", .p = "masterck_div", .id = 3 }, - { .n = "smdck", .p = "smdclk", .id = 4 }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "lcdck", .id = 3 }, + { .n = "smdck", .id = 4 }, + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, }; static const struct { @@ -128,25 +129,29 @@ static const struct { static void __init sama5d4_pmc_setup(struct device_node *np) { + struct clk_hw *slow_clk_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw, *mainck_hw; + struct clk_hw *parent_hws[5], *smdck_hw, *usbck_hw, *hw; + static struct clk_parent_data parent_data; struct clk_range range = CLK_RANGE(0, 0); - const char *slck_name, *mainxtal_name; + const char *main_xtal_name = "main_xtal"; struct pmc_data *sama5d4_pmc; - const char *parent_names[5]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -158,54 +163,55 @@ static void __init sama5d4_pmc_setup(struct device_node *np) if (!sama5d4_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 100000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 100000000); + if (IS_ERR(main_rc_hw)) goto err_free; bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, mainck_hw, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; sama5d4_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, mainck_hw); if (IS_ERR(hw)) goto err_free; sama5d4_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = mainck_hw; + parent_hws[2] = sama5d4_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d4_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); @@ -214,36 +220,36 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", "masterck_div", NULL); + hw = at91_clk_register_h32mx(regmap, "h32mxck", NULL, sama5d4_pmc->chws[PMC_MCK]); if (IS_ERR(hw)) goto err_free; sama5d4_pmc->chws[PMC_MCK2] = hw; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = sama5d4_pmc->chws[PMC_PLLACK]; + parent_hws[1] = sama5d4_pmc->chws[PMC_UTMI]; + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = sama5d4_pmc->chws[PMC_PLLACK]; + parent_hws[1] = sama5d4_pmc->chws[PMC_UTMI]; + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + if (IS_ERR(smdck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = mainck_hw; + parent_hws[2] = sama5d4_pmc->chws[PMC_PLLACK]; + parent_hws[3] = sama5d4_pmc->chws[PMC_UTMI]; + parent_hws[4] = sama5d4_pmc->chws[PMC_MCK]; for (i = 0; i < 3; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) @@ -252,9 +258,18 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + sama5d4_systemck[0].parent_hw = sama5d4_pmc->chws[PMC_MCK]; + sama5d4_systemck[1].parent_hw = sama5d4_pmc->chws[PMC_MCK]; + sama5d4_systemck[2].parent_hw = smdck_hw; + sama5d4_systemck[3].parent_hw = usbck_hw; + sama5d4_systemck[4].parent_hw = usbck_hw; + sama5d4_systemck[5].parent_hw = sama5d4_pmc->pchws[0]; + sama5d4_systemck[6].parent_hw = sama5d4_pmc->pchws[1]; + sama5d4_systemck[7].parent_hw = sama5d4_pmc->pchws[2]; for (i = 0; i < ARRAY_SIZE(sama5d4_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d4_systemck[i].n, - sama5d4_systemck[i].p, NULL, + NULL, sama5d4_systemck[i].parent_hw, sama5d4_systemck[i].id, sama5d4_systemck[i].flags); if (IS_ERR(hw)) @@ -267,7 +282,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d4_pcr_layout, sama5d4_periphck[i].n, - "masterck_div", NULL, + NULL, sama5d4_pmc->chws[PMC_MCK], sama5d4_periphck[i].id, &range, INT_MIN, sama5d4_periphck[i].flags); @@ -281,7 +296,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d4_pcr_layout, sama5d4_periph32ck[i].n, - "h32mxck", NULL, + NULL, sama5d4_pmc->chws[PMC_MCK2], sama5d4_periph32ck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) From patchwork Thu Jul 27 05:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1906FC001E0 for ; Thu, 27 Jul 2023 05:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TBaCFlxdhntps3sGEhWKJf2fccytIsTgilLAJQ6W1aM=; b=HWhlbBjIR47uwq LmaSzDTcHMLQdgpjvlbgNDXGN1y2fK+2D82zpns0iPFMk3E3PLvOhCzKQWMhMbH2sSWLFcRtInaYd p4AhreoXNojnTBqTTDpg+wYscnn579p402gjxrpjRnwkLxxUgfR6Td1fxmGp/RQMAV+rqzGeVWjzI DBxmIkfIAKnjg7NgjttMVo07fpKUXArSuXPWsXiF5Kxim5XSYBlPDWoZmLLKjCbJ4LQoXLMU7sma4 dQahrv+SfAfrX0ALcug2UwY4L8Z4eA7Jh6RwRp/f8SVCzG280kdc66njeNE90q2TUa64LQm7sV8MD b0Ix9XjKnnJnO1Vpvv/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteB-00CCPo-2n; Thu, 27 Jul 2023 05:34:47 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdl-00CCDA-0F for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:26 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b9e9765f2cso3290065ad.3 for ; Wed, 26 Jul 2023 22:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436058; x=1691040858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vv/BMVL/ZNeEbINcL/4raUcc3c4bebGIY3s5gcWMzMg=; b=AwhaRTb2XGZ8++zthKDFi0GoOgt4+AVSjoTKSwiALiQQfTPGrPlFN+zCC8OWvcLTbq MfvVbI0dWwjGzIUIpdfqUWOoDD7RfOuW1jr4X0z1bxyzLoZp+QhMiemlaWzsQ92tzTDl HWr1XP4mnBkJMuq8q5Mdow078dYC7uM8hw4ZEqpNUfi17JkcwscH3UuKakFdKk9soN45 uowuT5dCIe0i391ceDEtUOH4lCXXGgwceVzTOCS31daBC+Mfz8N42/z8HsQ8hh9RMKu3 D/EsXHz2kOh9f0k48Wi93ky423/BsO7uWgWKY/S76mc+QuPCTTwelVeweANl3HkRimjS /c6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436058; x=1691040858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vv/BMVL/ZNeEbINcL/4raUcc3c4bebGIY3s5gcWMzMg=; b=l56VPjvRCZUqLScV2XLDXhFbuVJx04JtHoVcYOBRn/av3TNUJ5r5tmhMZ4EiAyITsl A8Gg9itW84shW49SmjM3Hef/e1cRVl7vZlOOPHwCRToY77tYOtEpKT94ZbuY1bK8sE6t jN5Ifm2dYLjezuOYZ0PLxa0t1vOLn/UxH3jMYKg4np73mgcUe1Or8UPxyAPtg5b4VxOP orb/dQFl+sSUOWPNwzgUEpjG4Z3NEmrtQrBIjIZPjHR11Tqsmvv8lc3bx436C93R4kLL wpBQI63gori6XxDymQoJROgKbTZFfd6NcIruShkRMekSPcsILzpYTfbPu1hreC19TmSa 1ZZw== X-Gm-Message-State: ABy/qLbuoA2q8LEstI9cGwd6i67ZJ7jZ+fYH+9KNgoykF3tAmKZwWJV+ 7NiPSVUBhlZouAfNIt5foNh/Cw== X-Google-Smtp-Source: APBJJlELQG6oURUodMw1YgwQCG0dIqzVNWhe4qROJGNFhczx0pxHNp2MdbJMh+cQ5ErPIWttcG8Dug== X-Received: by 2002:a17:902:8210:b0:1b8:9552:2249 with SMTP id x16-20020a170902821000b001b895522249mr3216329pln.43.1690436058098; Wed, 26 Jul 2023 22:34:18 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:17 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 15/42] clk: at91: at91sam9x5: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:29 +0300 Message-Id: <20230727053156.13587-16-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223421_134639_AE3C7CBF X-CRM114-Status: GOOD ( 19.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91SAM9X5 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9x5.c | 123 +++++++++++++++++++--------------- 1 file changed, 68 insertions(+), 55 deletions(-) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 13331e015dd7..8b2747091b03 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -38,9 +39,9 @@ static const struct clk_pll_characteristics plla_characteristics = { .out = plla_out, }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } at91sam9x5_systemck[] = { @@ -48,12 +49,12 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "smdck", .p = "smdclk", .id = 4 }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "smdck", .id = 4 }, + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, }; static const struct clk_pcr_layout at91sam9x5_pcr_layout = { @@ -133,25 +134,29 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, const struct pck *extra_pcks, bool has_lcdck) { + struct clk_hw *slow_clk_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw; + struct clk_hw *parent_hws[6], *smdck_hw, *usbck_hw, *hw; + static struct clk_parent_data parent_data; struct clk_range range = CLK_RANGE(0, 0); - const char *slck_name, *mainxtal_name; + const char *main_xtal_name = "main_xtal"; struct pmc_data *at91sam9x5_pmc; - const char *parent_names[6]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -162,56 +167,57 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, if (!at91sam9x5_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 50000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 50000000); + if (IS_ERR(main_rc_hw)) goto err_free; bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; at91sam9x5_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9x5_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; at91sam9x5_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9x5_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; at91sam9x5_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9x5_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9x5_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9x5_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); @@ -220,28 +226,28 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_pmc->chws[PMC_MCK] = hw; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = at91sam9x5_pmc->chws[PMC_PLLACK]; + parent_hws[1] = at91sam9x5_pmc->chws[PMC_UTMI]; + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + if (IS_ERR(usbck_hw)) goto err_free; - hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_names, NULL, 2); - if (IS_ERR(hw)) + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + if (IS_ERR(smdck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9x5_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9x5_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9x5_pmc->chws[PMC_UTMI]; + parent_hws[4] = at91sam9x5_pmc->chws[PMC_MCK]; for (i = 0; i < 2; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) @@ -250,9 +256,16 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + at91sam9x5_systemck[0].parent_hw = at91sam9x5_pmc->chws[PMC_MCK]; + at91sam9x5_systemck[1].parent_hw = smdck_hw; + at91sam9x5_systemck[2].parent_hw = usbck_hw; + at91sam9x5_systemck[3].parent_hw = usbck_hw; + at91sam9x5_systemck[4].parent_hw = at91sam9x5_pmc->pchws[0]; + at91sam9x5_systemck[5].parent_hw = at91sam9x5_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9x5_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9x5_systemck[i].n, - at91sam9x5_systemck[i].p, NULL, + NULL, at91sam9x5_systemck[i].parent_hw, at91sam9x5_systemck[i].id, at91sam9x5_systemck[i].flags); if (IS_ERR(hw)) @@ -262,8 +275,8 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, } if (has_lcdck) { - hw = at91_clk_register_system(regmap, "lcdck", "masterck_div", - NULL, 3, 0); + hw = at91_clk_register_system(regmap, "lcdck", NULL, + at91sam9x5_pmc->chws[PMC_MCK], 3, 0); if (IS_ERR(hw)) goto err_free; @@ -274,7 +287,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9x5_pcr_layout, at91sam9x5_periphck[i].n, - "masterck_div", NULL, + NULL, at91sam9x5_pmc->chws[PMC_MCK], at91sam9x5_periphck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) @@ -287,7 +300,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9x5_pcr_layout, extra_pcks[i].n, - "masterck_div", NULL, + NULL, at91sam9x5_pmc->chws[PMC_MCK], extra_pcks[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) From patchwork Thu Jul 27 05:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B4614C41513 for ; Thu, 27 Jul 2023 05:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fWloROkkajOJ8Yoipx1ZTOyp127BwhNrGtSlqQVe3r0=; b=YDcJg2zlCquKNb 0q9Zn6cq2kbSJGKf64Ohyn9jeEuCWnzWA+Zdey8QxroCmtMR0QWER53pMaW8EtJaa1kLQ0nTrL6r7 Eqp/GfdlpZm0RVoz0Es71njpc8DfJpxhUK18FcnBEqmWEtgyCzRvjKAu6bmN1GrxyKCVabQltNxfc AibuboL2e7qNbBPPCBjmA4QaqBgCOl7NISToSxtdA69sfbIKwxSIkjKXgd0AJAH1fAzqy/HdCHTpu qn7q0WI131yuv6xQmNvd6b8I9OuTqv4xkDtTI+0nqJLnIqSDwX30tbDETU5OPDFNZHDbGblAlzFfd 1WPVl2KunE02qrvQkEfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteC-00CCQE-2I; Thu, 27 Jul 2023 05:34:48 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdp-00CCGW-2R for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:27 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b8ad8383faso4784145ad.0 for ; Wed, 26 Jul 2023 22:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436065; x=1691040865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kid366wiUoXwgFB76gRtzNPUPTmnA2Hry2ysnz0JRIc=; b=iTwFAaZoQR0slAJQ6ZFA/OIw+wZMhPqKMeCFKKIIIz6uKqzdUa+gbJasrMqdi9lWEq hBecxsx7vGEPk7T+2ns7Wrt6FXL6w2JgAUWH0ysS6/qSMRS/yy8g5MYf4w9CzdrC0GCV h4ZoAnSYM/gy1yDYzORz6Q0DeDA9BKWE/fSnhW/xelNXOtNKNqp/la9Fiqc7Mx9VxKig jbbHK5r4tYpfdJ2UE+u6xg0W6mc1+163RQ7vcRaUp7jQvv1Q719naD4ehEfChm64WjXn jhvCxUOncdCEqipYRVj8QdunhyxuaoxLD37GgrEWsFciZ95NbgIq5ccR5H2NcKxt5Exm lY9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436065; x=1691040865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kid366wiUoXwgFB76gRtzNPUPTmnA2Hry2ysnz0JRIc=; b=CXQ17JVt3rvm5sLPbtyCD3U8rXnoMDb3NcNvaisjowNB3wFdU2hYJcLVq5ywP4073t gezOhSv46H6O9LPISoPrWhfZS9MWX/WtLzbTW+QPri8WuCsPC5++lISqMwAbYfulVcPP eAv2invdoFPeSBth6HKu/F/pH1ILjmKtNZlvbTd2lYo90Al59cIkBD4aPwTeDejWEbLw 0TANedYviBCO+zuLZ5Q876K9Rj2fH9DQXD/MitrtngMvpj/e3ufXCzQLGnNX3fMtq+Cp sRXe9RdYVWRpbK+70f33NDWPC7ynPH6E7G2qDHvbfPj73HFzjIrb42Xtp/7RmVt7YR7i R6pw== X-Gm-Message-State: ABy/qLZpIFRRqptQHz4XM+ZpU/s9nAjpQswjKhoWSOfoZozRaCSqPGLU mP5TxfhNzseIRx84oGmQ9XrO3g== X-Google-Smtp-Source: APBJJlH0XNbuHwIiz8HkLlyy1CZ4I1oM876K9F2n/xW/gkzLy9fK4Ym4GPsj3gVktULHuk9bYJI2AQ== X-Received: by 2002:a17:902:ec8c:b0:1ab:11c8:777a with SMTP id x12-20020a170902ec8c00b001ab11c8777amr5186878plg.13.1690436065269; Wed, 26 Jul 2023 22:34:25 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:25 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 16/42] clk: at91: at91rm9200: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:30 +0300 Message-Id: <20230727053156.13587-17-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223425_796323_F26D5A8B X-CRM114-Status: GOOD ( 17.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91RM9200 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 96 ++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 623e232ec9c6..87fd7b1609bd 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -11,7 +12,7 @@ static DEFINE_SPINLOCK(rm9200_mck_lock); struct sck { char *n; - char *p; + struct clk_hw *parent_hw; u8 id; }; @@ -39,13 +40,13 @@ static const struct clk_pll_characteristics rm9200_pll_characteristics = { .out = rm9200_pll_out, }; -static const struct sck at91rm9200_systemck[] = { - { .n = "udpck", .p = "usbck", .id = 1 }, - { .n = "uhpck", .p = "usbck", .id = 4 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, - { .n = "pck3", .p = "prog3", .id = 11 }, +static struct sck at91rm9200_systemck[] = { + { .n = "udpck", .id = 1 }, + { .n = "uhpck", .id = 4 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, + { .n = "pck3", .id = 11 }, }; static const struct pck at91rm9200_periphck[] = { @@ -76,25 +77,29 @@ static const struct pck at91rm9200_periphck[] = { static void __init at91rm9200_pmc_setup(struct device_node *np) { - const char *slowxtal_name, *mainxtal_name; + struct clk_hw *slow_xtal_hw, *main_xtal_hw, *main_osc_hw; + struct clk_hw *parent_hws[6], *usbck_hw, *hw; + static struct clk_parent_data parent_data; + const char *main_xtal_name = "main_xtal"; struct pmc_data *at91rm9200_pmc; u32 usb_div[] = { 1, 2, 0, 0 }; - const char *parent_names[6]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_xtal"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_xtal"); + if (IS_ERR(clk)) return; - - slowxtal_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_xtal_hw = __clk_get_hw(clk); + if (!slow_xtal_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -108,18 +113,20 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", "main_osc", NULL); + hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_osc_hw); if (IS_ERR(hw)) goto err_free; at91rm9200_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91rm9200_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) @@ -127,7 +134,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, + hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91rm9200_pmc->chws[PMC_MAIN], 1, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) @@ -135,20 +142,19 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_PLLBCK] = hw; - parent_names[0] = slowxtal_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "pllbck"; + parent_hws[0] = slow_xtal_hw; + parent_hws[1] = at91rm9200_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91rm9200_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91rm9200_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91rm9200_master_layout, &rm9200_mck_characteristics, &rm9200_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, &at91rm9200_master_layout, &rm9200_mck_characteristics, &rm9200_mck_lock, CLK_SET_RATE_GATE, 0); @@ -157,21 +163,22 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_MCK] = hw; - hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", NULL, usb_div); - if (IS_ERR(hw)) + usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", NULL, + at91rm9200_pmc->chws[PMC_PLLBCK], usb_div); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = slowxtal_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "pllbck"; + parent_hws[0] = slow_xtal_hw; + parent_hws[1] = at91rm9200_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91rm9200_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91rm9200_pmc->chws[PMC_PLLBCK]; for (i = 0; i < 4; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 4, i, + NULL, parent_hws, 4, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) @@ -180,9 +187,16 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + at91rm9200_systemck[0].parent_hw = usbck_hw; + at91rm9200_systemck[1].parent_hw = usbck_hw; + at91rm9200_systemck[2].parent_hw = at91rm9200_pmc->pchws[0]; + at91rm9200_systemck[3].parent_hw = at91rm9200_pmc->pchws[1]; + at91rm9200_systemck[4].parent_hw = at91rm9200_pmc->pchws[2]; + at91rm9200_systemck[5].parent_hw = at91rm9200_pmc->pchws[3]; for (i = 0; i < ARRAY_SIZE(at91rm9200_systemck); i++) { hw = at91_clk_register_system(regmap, at91rm9200_systemck[i].n, - at91rm9200_systemck[i].p, NULL, + NULL, at91rm9200_systemck[i].parent_hw, at91rm9200_systemck[i].id, 0); if (IS_ERR(hw)) goto err_free; @@ -193,7 +207,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91rm9200_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91rm9200_periphck[i].n, - "masterck_div", NULL, + NULL, at91rm9200_pmc->chws[PMC_MCK], at91rm9200_periphck[i].id); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AE5C8C001E0 for ; Thu, 27 Jul 2023 05:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gR2wqP8tVzQj2LrjsSwiB+LKFVJZ8I2BFgvg2Hcnxrg=; b=swiE5kDXzOlGgL KzhaFtyMNoYxb6J9mbLSdPpQor10xN3xeKzWt97XlUZk+6Uyxi/z/d6ce6poCNtbzECT6I0LDaEgn dfci911l+c8qvAtEq1TPZaYScdH9lQ6swSVdvaC65edkvbC3Xj4E/z53imEC/EB/O2T0/AMmsNzUO ul7Yx0o0h3V1KGI9+IryxWie/hugt7/yjcM5aumU7gHI14Ww1IXZewBzkiO9E8BcZihEszi4fbjYv nFE8RKn9fDJCX3eJeHnf421sGQhi2fTxH0OHY+Qnq4XauKeDZF9EiEAJobVuXmn4wPa0T3vt1iZNl S1A3FBJa2buYzBv+mEXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteE-00CCRJ-0U; Thu, 27 Jul 2023 05:34:50 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtdx-00CCJZ-0d for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:38 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bba04b9df3so4572795ad.0 for ; Wed, 26 Jul 2023 22:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436072; x=1691040872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ebMv2zCUuI7+v0WKO0rdWUfZu6i4M/aH4M1ZWTbcC5E=; b=UESfxiMcGDxlM1+U0+b3DvIMqaPqSBSzUy3qM/gkfnnNlkWAG3ZdIzl53O0z4qltun Wl/n+L6woG9wbC3LMG3mtRaejY5DGnpaqLKSvRN9Rw3k8nLKJg3Y49JO0chE1iXgG1YB nNNBIDDYt2qO0F9ettcIpre/DqAds659sTcWeJm/E+rTrvvX6dThgvGHB/o57lkUJFG9 DHK6Unam/w1yTXcjLk3krIxIdDZvFslyF3c6yillKuUBGh91LxQ7aWQITjc9n4KV2ddT hyp6s5V8DI/vhTaTeaq6h+/mexJOq3Z6zy6CF7VlBcLVSNp/3cURn4TcWHk8mO77eaCN j2hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436072; x=1691040872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ebMv2zCUuI7+v0WKO0rdWUfZu6i4M/aH4M1ZWTbcC5E=; b=DUez3fibbJRiivBMhsFdmBZVTrR3QaD6O4Bekk95uwWR2iXUnsp/Dcjg2N1RSUvzZ3 ySA2JSjuIXl7G3BfYrzjHPAuk+ot/c6STo5o8rtP8MqGmIunO62tugkzxrc5vWZnOVjH VtEFtT4SG6J6kSJxhB3aE17Ndhwfgy7UCNFMavWFdNUs8ZHDW1IlhDggEd6nAV5SOdm8 kEEkek8jgM0GI9D4w0aaEjTGQLalRrO4NcUzt3hU1pzp5d6AnnpzZ/oWFbjDyXyixo3e e+/v3G5i7usv0ohb/xA4D+7nvptw4c+1z0ciurbk7CAKtiBvuBvBivT/yw5WyLbi0Elc JrDQ== X-Gm-Message-State: ABy/qLaSa8XIGxWohfBJKXnmOM5EmK6tuEvQKkhjYj4BnGyh2lSpJk8P 1B9foCBU+5lv3Yl8Mu37/3VaHw== X-Google-Smtp-Source: APBJJlH/rWJB689lBz7rTzs6xmQVeNVmFZwhaM3Q5OCgAtFY95fFTFrJS86LuDHuBedkbLwcj1MiDw== X-Received: by 2002:a17:903:22d1:b0:1b8:b2c6:7e8d with SMTP id y17-20020a17090322d100b001b8b2c67e8dmr4820694plg.66.1690436072684; Wed, 26 Jul 2023 22:34:32 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:32 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 17/42] clk: at91: at91rm9200: fix checkpatch.pl check Date: Thu, 27 Jul 2023 08:31:31 +0300 Message-Id: <20230727053156.13587-18-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223433_246041_AF20BCDE X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following checkpatch.pl check: drivers/clk/at91/at91rm9200.c:100: CHECK: Alignment should match open parenthesis Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 87fd7b1609bd..a862a0a18972 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -106,8 +106,8 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) return; at91rm9200_pmc = pmc_data_allocate(PMC_PLLBCK + 1, - nck(at91rm9200_systemck), - nck(at91rm9200_periphck), 0, 4); + nck(at91rm9200_systemck), + nck(at91rm9200_periphck), 0, 4); if (!at91rm9200_pmc) return; From patchwork Thu Jul 27 05:31:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 34A9EC00528 for ; Thu, 27 Jul 2023 05:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=agwOgKRCDdTukx1ZCFqP/BElVYzLYjMVZVFHim7FqMQ=; b=06o03WorCT+/73 VpNl/Kw0kIWirQFiY/FG3lzYRIKmMKuaVVYJ6K5XIjDFx9auoVGqJtvjbrRBvcaOTH/3lQidLSFui fbNVGXfpw3ULeE/x9fazZXJxDuQFQ4iFc3fxTKTb+UtNrxq29eJQpC4eYj+kD+wnyVn6br6fE/XCi UHbldoC4IsMhm8UoqvWJ41Gw3k5s6D0Iv+XpYcn0WH+lXUWmM/CjH8ggY+asGv3yeAnKjOT0nsRKZ PHU9NvDuqgOEjCqGlHlOombPJ7Wv1d2Yv1AFjjEM0RD+8SF2r0slPFelX/KJCKqrrrQJzrivR910t vY2MhdXeT38CLudOQt5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteE-00CCRz-2d; Thu, 27 Jul 2023 05:34:50 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOte4-00CCMY-0s for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:42 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1bb893e6365so3404105ad.2 for ; Wed, 26 Jul 2023 22:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436079; x=1691040879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fRCZH4GGM1E14D8FGmRam/hRPth71ctX83uTK0gxaqc=; b=AdlbqsjbBdcn/EdEJb2LCLEioo8YFANuQmf67SxKzZPYqENGC4s6ucFjuztzOJpoCc JM2FxjqtAvMkz9Szl++ADE8A9hw5jIZS3jl1XCByzdIPVfulumg8/lwE/xIHNZU+06Li r/k7QyUkbC0k2nVSbXbZJWJ7KXRPTA76hqcbmgoOM7c7yYMf6wBtRsNH8EO93Z8hiPkB AEQNGuqMxSL+CnWsw9SH5Y3CWij+9RRW5M3WSuT1ULKAVnYjpnLhJfeRQ8Foco/0SxdR VexKYCKFFwTcZj2Y2plyxp+M0SXbDvG4HCGrDNBcncCAAV3rsymp2jAr8Y3cigaAOcU/ XEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436079; x=1691040879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fRCZH4GGM1E14D8FGmRam/hRPth71ctX83uTK0gxaqc=; b=DSi3AYbaqgQBKd9ZYKyWJzPUliIVc2H6v49M5SdM2s72FTARNaNbzNZazmh2GKg2Ft UaBjMf3e5hSkbTXWWwKkwjaNzeyhhOKrI/s3MR4PAloNYq1jkc6hI0LDOMbP0zD+qmGc 0io3u4L+v1LrL7SIgMQSbvBfer0sstaHQpkoSDnQ6EBwljoU+P5Pr48FwbbuOeXwbzUu b08AZD28zfdPC7K6Mjs7VnkHqD24nvqbrwQSbsHidqXVXobkhn/OcsfrDhvzr8qxWtr6 tMOCWZ0ZOmwyJ+rRWQptawbTtXck+++4QDnEVEEednTaVaa33ltmPCknmQn58tXpGPGM 33cA== X-Gm-Message-State: ABy/qLbPYsGUg8WgWHRJqOwLrGWvZ+pd27hHPO50bz11vpRYyxZCit+j 7cdN4hESYu8wjoa0q/iKqz+lpw== X-Google-Smtp-Source: APBJJlExUH0L/WX/KUv9vnLUnpAxPAgjWkHqBlJL7WFDFDhavzVhK7nkGWSMpRtLiPS6S6yphRc6RQ== X-Received: by 2002:a17:902:7047:b0:1b3:9d13:34b3 with SMTP id h7-20020a170902704700b001b39d1334b3mr3348176plt.37.1690436079762; Wed, 26 Jul 2023 22:34:39 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:39 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 18/42] clk: at91: at91rm9200: fix checkpatch.pl check Date: Thu, 27 Jul 2023 08:31:32 +0300 Message-Id: <20230727053156.13587-19-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223440_401303_30653788 X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following checkpatch.pl check: drivers/clk/at91/at91rm9200.c:216: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index a862a0a18972..e0418ab5d65c 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -222,6 +222,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) err_free: kfree(at91rm9200_pmc); } + /* * While the TCB can be used as the clocksource, the system timer is most likely * to be used instead. However, the pinctrl driver doesn't support probe From patchwork Thu Jul 27 05:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BFB90C001E0 for ; Thu, 27 Jul 2023 05:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hu7yWHGJ1C4CyaCJe4EpeNdMghT5nRJcV5KTrD1PhP0=; b=FMH8+q+yOoV6tK 0IcS2PgkxJaNTdR+/bhDq59dos9pbhAvIOeWd5XE7w8YpY2YBTlpIItztsW6jFxdIKbHvwAjpyV8G q7Bxltd6Rm4DtUAYslxVFRAAY3wEyWJ7oeSd0vbf7mQUEyssMZQW1tIBQ8MD3Fzwug3vHas1lTDLf GEw5nmqBb3CnSjSZNakRhErC58vjBJkwB/M9jLBz3gJoLW8yhFX/wv9EssnOvwY+F4mzzg3KDVhKJ 5BIAuyNKMdZu8ofrJydleIPMemI2B7dq6rhsNv39a/XpZLBSTw/bezaynKFmgfGvR+R/nn3ZbNPRb 7W/3Ck4glYpMha39m0Aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtep-00CChE-1z; Thu, 27 Jul 2023 05:35:27 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOteB-00CCPV-1C for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:49 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b89d47ffb6so3419695ad.2 for ; Wed, 26 Jul 2023 22:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436087; x=1691040887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o/6KrvhXqa5iLUixbjzuBMiv5UYsjXjQw1Ru7hJmwyo=; b=p7tqgkwFoLsNlG4MKl0lVbtVdD+bXOGOQxOh6qFvDVQ71iCs2xwdGom9AGn/uqw8l3 uo/Ts0xEX36uzQgg8NN28OubEeAM+X41hXn52DW/S/pNFHiIKFKDN1VolkzW0MkY8UHf TFVdbFpTVlsPy0vYRQ+qZcQHSONLtM3/qxZ94DiudPxmDxfeUPDw/fbOGW9Z1gavoavn E66e3X8MNL2EhipQO5qxbTepxclX8z1Monf/djmATYpDtnCVuYWiwdKfde7LrVuakRsR 4aNS2WZIqB+hUeYktFBs7F50JstPJzh+HGoH1R9nXSSj8+wd2MqNmN6XdKqG8PWv2tyI KVlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436087; x=1691040887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o/6KrvhXqa5iLUixbjzuBMiv5UYsjXjQw1Ru7hJmwyo=; b=TRpXCgLv0bhw1/UiHHxypoywJ1ZN5zfzZer67g4Up0gRyRW4ZBm8It1g8e5Fth/S0I fJzz6VA++VoVrCPR62ZAjNSPKKZRA9spIV1Ch5sRxl9KQ5WgTH5Vpv4UYoF5wFJDovlT veI8xgAioH625JNDTD+FjKicBnIVyqn1Z+5UFbdQGf0p2tP7Tk/dhVsFtbxLakEVhjIe Vk51rh5RDaUMqdkTWic23FVC270T1vDAF2RzWJ/sB6fqGUuSE3fLMQmBFPqtfQb+hqDM MhQb3iMZ4M0l3yHwjYtNkQk3dPdmw2yphsW9TB1pP2YQ82iIT0x55NkwThpWj67tE8c3 SPnA== X-Gm-Message-State: ABy/qLZjXfJu8vijOUktVj8bsDQdEPN1fVvSym1R3It8INClgpWe3O+f 1Jo4p5QYD5Czmp+0H/Y63uBreQ== X-Google-Smtp-Source: APBJJlEVCaNJ7OenwzA/7lBAkzFCqELwzJ48BMLT8HbMb1NI9Bu9mnwabvkhELC4Ad8laFZ98RKiFw== X-Received: by 2002:a17:902:b60a:b0:1b6:80f0:d969 with SMTP id b10-20020a170902b60a00b001b680f0d969mr2928961pls.11.1690436086872; Wed, 26 Jul 2023 22:34:46 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:46 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 19/42] clk: at91: clk-slow: add support for parent_hw Date: Thu, 27 Jul 2023 08:31:33 +0300 Message-Id: <20230727053156.13587-20-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223447_411159_0C304AF1 X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for parent_hw in slow clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-slow were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/clk-slow.c | 8 ++++++-- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index f39deb3ec00a..55350331b07e 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -385,7 +385,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, parent_names[0] = "slow_rc_osc"; parent_names[1] = "slow_xtal"; hw = at91_clk_register_sam9260_slow(regmap, "slck", - parent_names, 2); + parent_names, NULL, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index ac9f7a48b76e..bea66216ed82 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -39,11 +39,12 @@ struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, const char **parent_names, + struct clk_hw **parent_hws, int num_parents) { struct clk_sam9260_slow *slowck; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; if (!name) @@ -58,7 +59,10 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, init.name = name; init.ops = &sam9260_slow_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)&parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = 0; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index f464e125c9fd..dbc59ac44828 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -822,7 +822,7 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9260_slow(regmap, name, parent_names, + hw = at91_clk_register_sam9260_slow(regmap, name, parent_names, NULL, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 541d2ba2fea5..6816e350d6d6 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -244,6 +244,7 @@ struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, const char **parent_names, + struct clk_hw **parent_hws, int num_parents); struct clk_hw * __init From patchwork Thu Jul 27 05:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4B9B4C04FDF for ; Thu, 27 Jul 2023 05:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T1EzyYFbqtMZ2h1TgCF8/X8KgEg2J1fz8IFWdif9gsU=; b=NrMATkLD4UYdt6 m6db4nQ7/7XfiCtrl2rAm4RetzkUREBWXSedzklfJNVnRoWRHcYepJ0PccSDDCgwmJDZhAo5ygOwa 0DUhe45FGn4od22Udajyhikx9nnXPOfp9bkRXc9Smj2nIbqeKxlFMv7h1PhE2B0RgzsoytBnlLfv6 XXsCv4Qicx6zHYETNnour83zl5fk8/fhV2U5NOIa6i4ACJdOxztUna8F0e1GLEWsrEnzbMO5qZd9d JxovTYbsd+Q2p/Goq4TAkWDuIB2DXEoe+4YxR1D/rMj1ha91VoZeJUGZODrzEo+PgJjd8dLBgy0Q7 wYPGApC/0NaSfoCkMAQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteq-00CChY-0J; Thu, 27 Jul 2023 05:35:28 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOteI-00CCTo-1k for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:34:56 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bb893e6365so3404945ad.2 for ; Wed, 26 Jul 2023 22:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436094; x=1691040894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EBbNugk5HlQlfZHqiOgCV5xi8h3KCTbkMOfTcf6vRhA=; b=Id14NP7yd/JImdN8lyAnXofVzX4iaeIgUf9JDxY6LmHBdN3I3aS4+ju0haYsHe0p4O R25ny66K46hZ6FcqWIzeG5IRTHDFkGhw2r6xnkmWxb9rG4MoMOlmS+IhucZuHlEhNOeA d9g2DSO6oT8sVGbxBNznGD0FkGfWtou4JIcMDRIpZ4J8YTRmjV3NeGnrY3N4tJTf49Ks OG1o36YclVqsj3xGm4CcLcO8ixR0jjlbxxMn+wXycc8vj3ENto2eL7zLIFOIx0ooe5cM fBhHXOcyoAfPRlIOAL0JI0OUDsxgLQS4X0Uo7HGMpBbffrYkBPF8M9oh9sW27JzkrsSm F/jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436094; x=1691040894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EBbNugk5HlQlfZHqiOgCV5xi8h3KCTbkMOfTcf6vRhA=; b=VCGNXjkE/8pNtmstagAWSLDEaJdjDka2z0/OQiExVITWKjEQ/vHl3Ni47dhrUKHAk6 DYJrwe+/tUQXeLtxE3Rwl8g1JJHI5VdRPMMbA+eBLRV/Y7F9xs4I0fzDw+tLsUtx+8mF 0PG9ob1A0gdKWdIxyBVDvOZLodelEJSsyCtvz+qOMmkcdgcytO9lOMIKJ6UAFlzumJCr 74IKaDO5QQ8MAr42RmogFyDF3OKfBgHeqltBMpZxks0giyDNxnKlVeiZmlUrcbnO1yNH Cv5h1q9w97zpr+mZXv+kFNP4e4JrYRnjclEV4d1A4Sb0T+DFxNtpxHscZOCi1KM70Zmw 4exg== X-Gm-Message-State: ABy/qLbqORDKQb9hwA3VJPj6db4/9P4L9FzjZNI/Ox0FlI27zC5aB9Yt btaQxjrCHJ6OpAkkCI82Oft48A== X-Google-Smtp-Source: APBJJlFHB3fbxz9kQNZcbEoiaodWds/3Wlbiqfinvqoq5s0dSd6rVHUql6diHUdm1pZI7v0EJsUFwg== X-Received: by 2002:a17:902:6ac3:b0:1b3:fafd:11c5 with SMTP id i3-20020a1709026ac300b001b3fafd11c5mr3247438plt.44.1690436093938; Wed, 26 Jul 2023 22:34:53 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:34:53 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 20/42] clk: at91: at91sam9260: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:34 +0300 Message-Id: <20230727053156.13587-21-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223454_581808_95B82058 X-CRM114-Status: GOOD ( 18.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91SAM92600 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9260.c | 139 ++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 61 deletions(-) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 55350331b07e..1ef7c02bee63 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -9,7 +10,7 @@ struct sck { char *n; - char *p; + struct clk_hw *parent_hw; u8 id; }; @@ -24,7 +25,7 @@ struct at91sam926x_data { const struct clk_pll_layout *pllb_layout; const struct clk_pll_characteristics *pllb_characteristics; const struct clk_master_characteristics *mck_characteristics; - const struct sck *sck; + struct sck *sck; const struct pck *pck; u8 num_sck; u8 num_pck; @@ -72,11 +73,11 @@ static const struct clk_pll_characteristics sam9260_pllb_characteristics = { .out = sam9260_pllb_out, }; -static const struct sck at91sam9260_systemck[] = { - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, +static struct sck at91sam9260_systemck[] = { + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, }; static const struct pck at91sam9260_periphck[] = { @@ -213,15 +214,15 @@ static const struct clk_pll_characteristics sam9261_pllb_characteristics = { .out = sam9261_pllb_out, }; -static const struct sck at91sam9261_systemck[] = { - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, - { .n = "pck3", .p = "prog3", .id = 11 }, - { .n = "hclk0", .p = "masterck_div", .id = 16 }, - { .n = "hclk1", .p = "masterck_div", .id = 17 }, +static struct sck at91sam9261_systemck[] = { + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, + { .n = "pck3", .id = 11 }, + { .n = "hclk0", .id = 16 }, + { .n = "hclk1", .id = 17 }, }; static const struct pck at91sam9261_periphck[] = { @@ -277,13 +278,13 @@ static const struct clk_pll_characteristics sam9263_pll_characteristics = { .out = sam9260_plla_out, }; -static const struct sck at91sam9263_systemck[] = { - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, - { .n = "pck2", .p = "prog2", .id = 10 }, - { .n = "pck3", .p = "prog3", .id = 11 }, +static struct sck at91sam9263_systemck[] = { + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, + { .n = "pck2", .id = 10 }, + { .n = "pck3", .id = 11 }, }; static const struct pck at91sam9263_periphck[] = { @@ -329,26 +330,29 @@ static struct at91sam926x_data at91sam9263_data = { static void __init at91sam926x_pmc_setup(struct device_node *np, struct at91sam926x_data *data) { - const char *slowxtal_name, *mainxtal_name; + struct clk_hw *slow_xtal_hw, *main_xtal_hw; + struct clk_hw *parent_hws[4], *usbck_hw, *hw; + static struct clk_parent_data parent_data; + const char *main_xtal_name = "main_xtal"; struct pmc_data *at91sam9260_pmc; u32 usb_div[] = { 1, 2, 4, 0 }; - const char *parent_names[6]; - const char *slck_name; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_xtal"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_xtal"); + if (IS_ERR(clk)) return; - - slowxtal_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_xtal_hw = __clk_get_hw(clk); + if (!slow_xtal_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -363,12 +367,14 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, bypass); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", "main_osc", NULL); + hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw); if (IS_ERR(hw)) goto err_free; @@ -382,20 +388,17 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, if (IS_ERR(hw)) goto err_free; - parent_names[0] = "slow_rc_osc"; - parent_names[1] = "slow_xtal"; - hw = at91_clk_register_sam9260_slow(regmap, "slck", - parent_names, NULL, 2); + parent_hws[0] = hw; + parent_hws[1] = slow_xtal_hw; + hw = at91_clk_register_sam9260_slow(regmap, "slck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; at91sam9260_pmc->chws[PMC_SLOW] = hw; - slck_name = "slck"; - } else { - slck_name = slowxtal_name; + slow_xtal_hw = hw; } - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9260_pmc->chws[PMC_MAIN], 0, data->plla_layout, data->plla_characteristics); if (IS_ERR(hw)) @@ -403,7 +406,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, + hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91sam9260_pmc->chws[PMC_MAIN], 1, data->pllb_layout, data->pllb_characteristics); if (IS_ERR(hw)) @@ -411,12 +414,12 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_PLLBCK] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "pllbck"; + parent_hws[0] = slow_xtal_hw; + parent_hws[1] = at91sam9260_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9260_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9260_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91rm9200_master_layout, data->mck_characteristics, &at91sam9260_mck_lock); @@ -424,7 +427,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + NULL, hw, &at91rm9200_master_layout, data->mck_characteristics, &at91sam9260_mck_lock, @@ -434,21 +437,22 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_MCK] = hw; - hw = at91rm9200_clk_register_usb(regmap, "usbck", "pllbck", NULL, usb_div); - if (IS_ERR(hw)) + usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", NULL, + at91sam9260_pmc->chws[PMC_PLLBCK], usb_div); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "pllbck"; + parent_hws[0] = slow_xtal_hw; + parent_hws[1] = at91sam9260_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9260_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9260_pmc->chws[PMC_PLLBCK]; for (i = 0; i < data->num_progck; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 4, i, + NULL, parent_hws, 4, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) @@ -457,9 +461,22 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + data->sck[0].parent_hw = usbck_hw; + data->sck[1].parent_hw = usbck_hw; + data->sck[2].parent_hw = at91sam9260_pmc->pchws[0]; + data->sck[3].parent_hw = at91sam9260_pmc->pchws[1]; + if (data->num_sck == 6) { + data->sck[4].parent_hw = at91sam9260_pmc->pchws[2]; + data->sck[5].parent_hw = at91sam9260_pmc->pchws[3]; + } + if (data->num_sck == 8) { + data->sck[6].parent_hw = at91sam9260_pmc->chws[PMC_MCK]; + data->sck[7].parent_hw = at91sam9260_pmc->chws[PMC_MCK]; + } for (i = 0; i < data->num_sck; i++) { hw = at91_clk_register_system(regmap, data->sck[i].n, - data->sck[i].p, NULL, + NULL, data->sck[i].parent_hw, data->sck[i].id, 0); if (IS_ERR(hw)) goto err_free; @@ -470,7 +487,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, for (i = 0; i < data->num_pck; i++) { hw = at91_clk_register_peripheral(regmap, data->pck[i].n, - "masterck_div", NULL, + NULL, at91sam9260_pmc->chws[PMC_MCK], data->pck[i].id); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A3D86C001DC for ; Thu, 27 Jul 2023 05:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9H1YtnNtdPn9hEOi++dce2qsqdaDnLpx4ixgAUwxWj8=; b=HSYqIiYpMHo2wa RFJMQJSOTvAHkIfIW8tp5q1JZ/1Abra1oblLO+L8OBh90myS3Rtak5ZHXjf8n9RKg/tQztaiQt8jC 5Q6C5S4+i+qrYXs/3SYYjl1Gq8vzDUXmxI+bvDWwu/SUvHUlfr4xV19/ay1FTnYkbcOyT+uwaJX6/ o0vHLVjmuxBpk/FhrkpEUGoWInXG3GRdVBt2MxkHOLoFGTU4iI1E/Bkr1Xvh/IAUiwBuwUV3Iqzb6 KArSECVD23beTyxLXgYpw7IC50Wp/35oNLnAO4CVZIrnzr7Rk9LiNN0QrgS/69eNrE6eRaVVORSxo VkQHY63cUIXKLtnQgLRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOteq-00CChr-23; Thu, 27 Jul 2023 05:35:28 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOteT-00CCXc-0d for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:07 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1b8ad9eede0so4502485ad.1 for ; Wed, 26 Jul 2023 22:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436102; x=1691040902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IPc4xkfMOnwN3v1hN3TZE1CkBeQhVeO0+VXhvPhtWPg=; b=GMmp5BcXZd9dB3f7uXMLXzpogGD0Qvb2qTdk7XviCAzh1sJjgA89Cm7hs9GVw/wu29 JA7HMRoKd0Tymzjq9Z6A8mdPmDjBh9EVesGrYmnKFbL20CMdb9u+57njwBKvMYwtCa7a SZb+sW4OYK+YrdDxEL/983P9ZSl/KXoNkl4VqRdUhW108Tj+NVgjKVckbKKeXM0isDn4 dDJa0roLpUO76vhPH+sy4a8XQupAh5CAuRPXUq4TpaYrE6lZjIvejCbBdNnsOzj9yKId i4joV5DpVrJIJ2PxJkXxqTvDT+EiKBtSxkT1baX/p/wzzEkydmJ1eNIu/3EiXSVyW9ol Pw2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436102; x=1691040902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IPc4xkfMOnwN3v1hN3TZE1CkBeQhVeO0+VXhvPhtWPg=; b=WsMJLpSPpyzaOAGQ7iJrofAKIzo7fNx2FCgoW4SPUua5gUk2+CgrrvI1HkemENFZDK KWsSutf99nwucMzVceaP5LDMPS0u6LHGtVQJj34qsgV9jh+RKWutafd9Qj/jQXdVHZg0 SzdX3CDN2PSKlZALDag/mK9BGvicrwgpLu16+N7W6gAyEcgngNXyMMSou8v2uoNB+cu2 q4ae31eneqZLuzQzlskfzFLKe5ntQpeEJ1CTbgb+R/A5TBrzLLtBzAYQPk4FJksLEEOu whbn89/ENq/avX9+/v+azri0g/P8Xhvplgc+Nl7ejnzow9aZ/P37Wxoh6ybcvq0+K1d/ GsWw== X-Gm-Message-State: ABy/qLbfE/3eg+t78IFf0UuFIsTj/0PIeIGIWtrfsnJ1nAOtzKLT2CwE MryD/7KH4SVshKA++8xiiNLvag== X-Google-Smtp-Source: APBJJlGvsyYVwugQYrfhrhzSrbO30GTHiLg6TStd308FuhX3YzF02NHK7qv4MWcydZg/iiIMBpj80Q== X-Received: by 2002:a17:902:830c:b0:1bb:83cd:ad83 with SMTP id bd12-20020a170902830c00b001bb83cdad83mr3513348plb.28.1690436101995; Wed, 26 Jul 2023 22:35:01 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:01 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 21/42] clk: at91: at91sam9g45: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:35 +0300 Message-Id: <20230727053156.13587-22-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223505_242612_3633841B X-CRM114-Status: GOOD ( 19.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91SAM9G45 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9g45.c | 92 +++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index cb98d22c2e30..684ce0f79d3b 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -37,9 +38,9 @@ static const struct clk_pll_characteristics plla_characteristics = { .out = plla_out, }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } at91sam9g45_systemck[] = { @@ -47,10 +48,10 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "uhpck", .id = 6 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, }; struct pck { @@ -92,24 +93,28 @@ static const struct pck at91sam9g45_periphck[] = { static void __init at91sam9g45_pmc_setup(struct device_node *np) { - const char *slck_name, *mainxtal_name; + struct clk_hw *parent_hws[5], *usbck_hw, *hw; + struct clk_hw *slow_clk_hw, *main_xtal_hw; + static struct clk_parent_data parent_data; + const char *main_xtal_name = "main_xtal"; struct pmc_data *at91sam9g45_pmc; - const char *parent_names[6]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -123,40 +128,42 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, bypass); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", "main_osc", NULL); + hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw); if (IS_ERR(hw)) goto err_free; at91sam9g45_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9g45_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; at91sam9g45_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9g45_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; at91sam9g45_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9g45_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9g45_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9g45_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91rm9200_master_layout, &mck_characteristics, &at91sam9g45_mck_lock); @@ -164,7 +171,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + NULL, hw, &at91rm9200_master_layout, &mck_characteristics, &at91sam9g45_mck_lock, @@ -174,24 +181,24 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_pmc->chws[PMC_MCK] = hw; - parent_names[0] = "plladivck"; - parent_names[1] = "utmick"; - hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_names, NULL, 2); - if (IS_ERR(hw)) + parent_hws[0] = at91sam9g45_pmc->chws[PMC_PLLACK]; + parent_hws[1] = at91sam9g45_pmc->chws[PMC_UTMI]; + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9g45_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9g45_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9g45_pmc->chws[PMC_UTMI]; + parent_hws[4] = at91sam9g45_pmc->chws[PMC_MCK]; for (i = 0; i < 2; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91sam9g45_programmable_layout, NULL); if (IS_ERR(hw)) @@ -200,9 +207,14 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + at91sam9g45_systemck[0].parent_hw = at91sam9g45_pmc->chws[PMC_MCK]; + at91sam9g45_systemck[1].parent_hw = usbck_hw; + at91sam9g45_systemck[2].parent_hw = at91sam9g45_pmc->pchws[0]; + at91sam9g45_systemck[3].parent_hw = at91sam9g45_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9g45_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9g45_systemck[i].n, - at91sam9g45_systemck[i].p, NULL, + NULL, at91sam9g45_systemck[i].parent_hw, at91sam9g45_systemck[i].id, at91sam9g45_systemck[i].flags); if (IS_ERR(hw)) @@ -214,7 +226,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91sam9g45_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91sam9g45_periphck[i].n, - "masterck_div", NULL, + NULL, at91sam9g45_pmc->chws[PMC_MCK], at91sam9g45_periphck[i].id); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 914CBC001DC for ; Thu, 27 Jul 2023 05:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=53z3G8cTM6+PALYVjBJQ6sOonD07Q2mh7f2mswBPEBY=; b=Yau7BFZ+6Mbu6o muocRi2Rw6rX7xQDNHvh8PIKiZm/jT4DhNwIKV4fvWfUGbUG7qcbntGfYZnt3gDhOVZqLdKOUE1au HfYxT6l/yJNSB3xGweFO0AoGCDsP/wB9sechHC0aDcd6QVuu9oLNuUyJ5RoCefS1ciaWoKANnAl5m O32brCiR/z14A6a62EdjVqqJMcy24X/+yyTipNy2DzvcJS9f7Kb3WtQ9NiY7/jVugDN0s1qpRiP+s HnRrhihsFyingVNF3i8iNNPj1w63AKi8rmd7vH9EZwC4cryGkhDGh+PRMHvBE7cXNRnVQcRhHls/S KGqj6dSvk7G3Gqehqlpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOter-00CCiG-0b; Thu, 27 Jul 2023 05:35:29 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtea-00CCaq-2O for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:14 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-686b879f605so396555b3a.1 for ; Wed, 26 Jul 2023 22:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436109; x=1691040909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8W9kuJkMcvh5EIR1rkxuFuZSM/bg9HqW6C8Akxa9PTk=; b=MAZHn9Fs1Wr+ausou3GNnGfYd0iaJfcvXuvDmVV4J2mG8A+3uOhRVMt8nm3s3Nt6vU bVximShHZdGu014nr4d6xPoEe+l+c8gB2SQAj2TfvLXuBqVMZrTUfXO3kVZn4ZOvoy37 x0jk4RQWC5H2z93dSdPA5LD4AOdc153GcNjevwQAB5OGi4fcIF42ojaYCa+qV2x25ZHg eWXelqBUDlGXQovf3yuKS36D8pj3/kou+O/w3+EPKx7lqAmifruQhFuBlwW2jFYLuced y5y1ktmPRP3ehZnky6767tc4N6Zt/kA1YOOMkB/98vjvqtLovB+iXof5mSGqYcIpMBDk 2mLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436109; x=1691040909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8W9kuJkMcvh5EIR1rkxuFuZSM/bg9HqW6C8Akxa9PTk=; b=IX8ju09tSIBvmbp7BYkcN/08mF030vpmGu7qf3z2rmdQmIBBgQRlyP46P2qCUIrpqf G0OVurFaaNu3WLyai/wETHzeMz9jm7vy3RP0AF7nyCf4mWjn+Lh8QqO/TLU33lHSIvy7 EQ+zDVyv1klPhLyvm3yiyT7ByJxes7aujd7Cu2smU12An4Wt7Su9UHSdazaOomdvrIlY rbKUmpEa//vGnm71K3uVxTWpYebExVdBZW+STautiPuLgKwM4zNvOKGCadS1aZAyDB9T ELQZ/hQP8RaMkBSYOqRW4gzKkfChq/nj6ls2aftIxfwHwPX7PcZqRRt3dkanhGSGwrng RFEA== X-Gm-Message-State: ABy/qLZO2BwZCILMMzZncl7QVb6F/ypO4tkUNP5o1AMISDVdrhSWgtsD QWSb009URwFQGQCkwONzfJTiuQ== X-Google-Smtp-Source: APBJJlFr7Ubx6veXreYCq9qaNTfA3hoIMxlxKrM+QpfvNqZ1MgIHvumx6BmFslYRsgIIJIQ7F8001A== X-Received: by 2002:a05:6a20:7347:b0:133:6e6e:2b11 with SMTP id v7-20020a056a20734700b001336e6e2b11mr3207205pzc.2.1690436108919; Wed, 26 Jul 2023 22:35:08 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:08 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 22/42] clk: at91: at91sam9g45: fix checkpatch.pl check Date: Thu, 27 Jul 2023 08:31:36 +0300 Message-Id: <20230727053156.13587-23-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223512_781546_441F3637 X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following checkpatch.pl check: drivers/clk/at91/at91sam9g45.c:235: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9g45.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 684ce0f79d3b..868897fad3f0 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -241,6 +241,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) err_free: kfree(at91sam9g45_pmc); } + /* * The TCB is used as the clocksource so its clock is needed early. This means * this can't be a platform driver. From patchwork Thu Jul 27 05:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9E276C00528 for ; Thu, 27 Jul 2023 05:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u7jkRpI5UGDSNDUhcia2TxoaOlnQCV/RIEtYpTtE4LY=; b=E0j7rGDzgSwhli Vq9o6OhHyB4UTib5Jh1CImFryhLuR5lFPUXhS/flwYSC4NVvDELd2nAHVc/e5kYlos4yed9iQUDRY SEC5GAzzSsi0cBis66VLBdO2Nx8hGr/J4XUW7kVCaXN8DEc5bXyl0leXc2iBI65DyP6Bp1cITTSwV xmOScFapKYvS/FkfOygcbZiW3Fh/T/PJQYJ4wXn8hn2ss9ztaCnbWw+fPbsmaBkUAvbrM9HP9SUHF VizB4sNwwyFGskJdWlsjtGfSLUwqcdcQtedFwxzeCtfuMHT2f5e2+OrYRJb3tjGTZxUPHN6MxD70G FEDZFSN9KxVXsXtc21Lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOter-00CCia-2H; Thu, 27 Jul 2023 05:35:29 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtef-00CCd6-0l for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:18 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b89d47ffb6so3421825ad.2 for ; Wed, 26 Jul 2023 22:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436116; x=1691040916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SA2TrheluzQnAFbCVQ+vAz4zJ4LsOThO95zEdvuZGfo=; b=EkFF4gPwxDnbKx/J7LkqyC3bIRRwG52czDWaorcgXR6HrgdZ4jyxRV7FP+wbQJr4RB tn1xQmZIaBehGueBCk18NcjvkUGndC3danISrC3TxPSiyfylohNlZi5lXcqm/4CZOPKl Uttv5Y/8HDk1gLq1quYhFC/6OTM2E4c5Nd4/bTpq8UkAZ4SmACiUdY1FSlKwnH4KBGVR UvoMu3M1vFeBGeM4wH8UARSvJIJDzm6suo5Lznue0tUR1oXn5lnYpllFKIbZpvTPrXBE LGRaF2IpkCoLlwJE+vpLABswUF5IgwCqJqhpXdqzETC4X929DRTCsJ+o6oNLFMsEGjyR 7V4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436116; x=1691040916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SA2TrheluzQnAFbCVQ+vAz4zJ4LsOThO95zEdvuZGfo=; b=BSmlOyQeb+XD8ZHhMsYGVKSs3tXThdxJNZEvKSkVza3J4pXY2vh0f98lZtD9sXQPk2 lXXk3KeAXyWiO8DEaqSdv9Si+hdKzpWIA5TzoOFsez8D7qHzj308Od6Uo/yYkQrdj8IU fdSckdVj9Nng1w4iLx9UaQ9jFHU3Q86Fzjne3/CQUlgLzxXDv3RzFu5PKhOmOwtFgnqI SGCKBN2Tu7SOAP3m26u4hwbFG8xUGCIrLKjEUPU+QJZTdPzGjB85bPneRzfN4cWRJGC+ H0sSiEtE4he3PjYoEKTJ2vveUN+kM40Oea/5KxCx4+J9rN52twTqQpxWJ2wpr+HmYtz0 Kitw== X-Gm-Message-State: ABy/qLaCld/g9SSvnxa/JBdOeOjpVKS+0VwqABvgukH948C0e8W05npi xe05KyfPFLdBo/U8GldA6r5XRg== X-Google-Smtp-Source: APBJJlEzht+QR53SZxeYmEj0hRCQ1Y6DMJIqdzDM7dzKYeYqRgd4FqDbqo4bvKSF2FjZ9Ci8CBmyhg== X-Received: by 2002:a17:902:ee55:b0:1b8:3dec:48de with SMTP id 21-20020a170902ee5500b001b83dec48demr3404846plo.47.1690436116638; Wed, 26 Jul 2023 22:35:16 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:16 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 23/42] clk: at91: at91sam9n12: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:37 +0300 Message-Id: <20230727053156.13587-24-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223517_279948_2B8E4D27 X-CRM114-Status: GOOD ( 18.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91SAM9N12 clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9n12.c | 109 +++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 34dd7645f964..d8dcff9ffaaa 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -51,9 +52,9 @@ static const struct clk_pll_characteristics pllb_characteristics = { .out = pllb_out, }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; unsigned long flags; u8 id; } at91sam9n12_systemck[] = { @@ -61,12 +62,12 @@ static const struct { * ddrck feeds DDR controller and is enabled by bootloader thus we need * to keep it enabled in case there is no Linux consumer for it. */ - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL }, - { .n = "lcdck", .p = "masterck_div", .id = 3 }, - { .n = "uhpck", .p = "usbck", .id = 6 }, - { .n = "udpck", .p = "usbck", .id = 7 }, - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL }, + { .n = "lcdck", .id = 3 }, + { .n = "uhpck", .id = 6 }, + { .n = "udpck", .id = 7 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, }; static const struct clk_pcr_layout at91sam9n12_pcr_layout = { @@ -111,25 +112,29 @@ static const struct pck at91sam9n12_periphck[] = { static void __init at91sam9n12_pmc_setup(struct device_node *np) { + struct clk_hw *parent_hws[5], *usbck_hw, *main_rc_hw, *main_osc_hw, *hw; + struct clk_hw *slow_clk_hw, *main_xtal_hw; + static struct clk_parent_data parent_data; + const char *main_xtal_name = "main_xtal"; struct clk_range range = CLK_RANGE(0, 0); - const char *slck_name, *mainxtal_name; struct pmc_data *at91sam9n12_pmc; - const char *parent_names[6]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; bool bypass; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -140,50 +145,52 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) if (!at91sam9n12_pmc) return; - hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, - 50000000); - if (IS_ERR(hw)) + main_rc_hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000, + 50000000); + if (IS_ERR(main_rc_hw)) goto err_free; bypass = of_property_read_bool(np, "atmel,osc-bypass"); - hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, - bypass); - if (IS_ERR(hw)) + parent_data.name = main_xtal_name; + parent_data.fw_name = main_xtal_name; + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + bypass); + if (IS_ERR(main_osc_hw)) goto err_free; - parent_names[0] = "main_rc_osc"; - parent_names[1] = "main_osc"; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2); + parent_hws[0] = main_rc_hw; + parent_hws[1] = main_osc_hw; + hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); if (IS_ERR(hw)) goto err_free; at91sam9n12_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9n12_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); + hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); if (IS_ERR(hw)) goto err_free; at91sam9n12_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", "mainck", NULL, 1, + hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91sam9n12_pmc->chws[PMC_MAIN], 1, &at91rm9200_pll_layout, &pllb_characteristics); if (IS_ERR(hw)) goto err_free; at91sam9n12_pmc->chws[PMC_PLLBCK] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "pllbck"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9n12_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9n12_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9n12_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &at91sam9n12_mck_lock); @@ -191,7 +198,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + NULL, hw, &at91sam9x5_master_layout, &mck_characteristics, &at91sam9n12_mck_lock, @@ -201,22 +208,23 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_MCK] = hw; - hw = at91sam9n12_clk_register_usb(regmap, "usbck", "pllbck", NULL); - if (IS_ERR(hw)) + usbck_hw = at91sam9n12_clk_register_usb(regmap, "usbck", NULL, + at91sam9n12_pmc->chws[PMC_PLLBCK]); + if (IS_ERR(usbck_hw)) goto err_free; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "plladivck"; - parent_names[3] = "pllbck"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9n12_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9n12_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9n12_pmc->chws[PMC_PLLBCK]; + parent_hws[4] = at91sam9n12_pmc->chws[PMC_MCK]; for (i = 0; i < 2; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) @@ -225,9 +233,16 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + at91sam9n12_systemck[0].parent_hw = at91sam9n12_pmc->chws[PMC_MCK]; + at91sam9n12_systemck[1].parent_hw = at91sam9n12_pmc->chws[PMC_MCK]; + at91sam9n12_systemck[2].parent_hw = usbck_hw; + at91sam9n12_systemck[3].parent_hw = usbck_hw; + at91sam9n12_systemck[4].parent_hw = at91sam9n12_pmc->pchws[0]; + at91sam9n12_systemck[5].parent_hw = at91sam9n12_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9n12_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9n12_systemck[i].n, - at91sam9n12_systemck[i].p, NULL, + NULL, at91sam9n12_systemck[i].parent_hw, at91sam9n12_systemck[i].id, at91sam9n12_systemck[i].flags); if (IS_ERR(hw)) @@ -240,7 +255,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9n12_pcr_layout, at91sam9n12_periphck[i].n, - "masterck_div", NULL, + NULL, at91sam9n12_pmc->chws[PMC_MCK], at91sam9n12_periphck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) From patchwork Thu Jul 27 05:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 867BCEB64DD for ; Thu, 27 Jul 2023 05:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J7QSKGKLjXftcF5pkd9SiCkPYPsDq2o5cAbSc92oJ18=; b=NXgdkJzKMRBD30 Kp3KLZeZEOnJMYm//qJ+GOEaNiIuPJGdL3LxMS/WshfAb/nPIm06H/pc2sQaw2W1kZE8POUIesmPz D2cRcIDiqCk5KD1Kz2/mR7o/XHRsCIKGfQu6jQPcRt788TJW0d3MkKrMgmb2VAS7cnlslUJ7zK28P jPaUkFo5a5Ugp7TZbiirj05TR6Zio0i37XeWtrCYgPCbAnTKQtQ+6WqYtgCmZ2iLLuguWHI5P10rN YH6HkZTujsEUwAvOJc+BBx2Nz4oAmsfyI1tM4Feivgc20KTnFGUybvwRFOiZsC1HMu/VY2PStpVGO 7T0fJlX7MYLSkHO82E+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtet-00CCjd-0S; Thu, 27 Jul 2023 05:35:31 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOten-00CCfz-2h for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:27 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bbc7b2133fso3476405ad.1 for ; Wed, 26 Jul 2023 22:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436124; x=1691040924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GiPKeEp/OnJVAeiXOlEa57rkvX7TbeABjU0rqvFwffg=; b=Gv96cxC9tN5YDqs7yjb8N7ef2X97pLKH1U6k0a/M+7tHu8ixpB52+7qb1oORhVB0D9 QkghtXksO+DJ6mH9Ou167j/oqRrieRoLajl4KNITe73qT9k0D8MdIjABMwEyBCEnKcm6 5pKAoy2HnAHJeBxmcMndj6w+lRwA7MQgCfWd+dKLXwByYc3pk/Avu9Mq/RWtIptpTATY MhAfL+v0oAo3OUyfTBIk9DZhrtBBPowoCsTF0Pb35LvC4Ay7OqTgUOgPg6Mvob8Fo6UU 1GwTxynTvs7fGBrhezkxYimDWOz9A+a7XXUqAz7hes8x014htOJF3wjy3WLVQmvEJ61w vycQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436124; x=1691040924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GiPKeEp/OnJVAeiXOlEa57rkvX7TbeABjU0rqvFwffg=; b=ZiEt3t2erDs7Az96ZDz/kpciiF2tIn11moTTNizUThIFM2JbyN9tsw7apo4k/HeSEd K5LCPWwq8kFHurxombkOVhmdY/ec2rYS7gR1cad2uYyQGyaC+5LxfMhfo1/jiZx330yH S62R9TqV2JgMC92GAJ5G/qDEHSgM5MxC576XXlXc0rOOoag8pMFSZlt/OzPA7x1UlGQ8 Zn2dy1ZfVe/PYMZ3NfXxUVIQou0CTo7izRn9WrMqF9Tk1lvh86lQNIiqRB6q3qTjoWHe lqicXOMmqvUU+UUCA4oUxYu5rfkWFWHwEoyzYsPfKODZz5acnsUvfoozlYCktSYb1My6 83Ig== X-Gm-Message-State: ABy/qLZPZjiCqf3LZymrrzGjJFcIPsXRHEwXoOHgcefT9gpvgcxR28Jr CMMWDYuTnEnY3bfnaSc1MsZriA== X-Google-Smtp-Source: APBJJlFINJit9i5ARlN+Vsj+y55YmXolkqEqxQH3HTSxW35zdaX+DZVXitsrxj1AE1PQfpnc9plraw== X-Received: by 2002:a17:902:c1d4:b0:1bb:98e8:5db2 with SMTP id c20-20020a170902c1d400b001bb98e85db2mr3420427plc.26.1690436123881; Wed, 26 Jul 2023 22:35:23 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:23 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 24/42] clk: at91: at91sam9n12: remove checkpatch.pl checks Date: Thu, 27 Jul 2023 08:31:38 +0300 Message-Id: <20230727053156.13587-25-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223525_888891_AFC4A244 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the following checkpatch.pl checks: drivers/clk/at91/at91sam9n12.c:135: CHECK: Alignment should match open parenthesis drivers/clk/at91/at91sam9n12.c:264: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9n12.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index d8dcff9ffaaa..01d943ebb680 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -141,7 +141,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) return; at91sam9n12_pmc = pmc_data_allocate(PMC_PLLBCK + 1, - nck(at91sam9n12_systemck), 31, 0, 2); + nck(at91sam9n12_systemck), 31, 0, 2); if (!at91sam9n12_pmc) return; @@ -271,6 +271,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) err_free: kfree(at91sam9n12_pmc); } + /* * The TCB is used as the clocksource so its clock is needed early. This means * this can't be a platform driver. From patchwork Thu Jul 27 05:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C1B66EB64DD for ; Thu, 27 Jul 2023 05:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=njpgKJIbUuG/nyuizyAarVe5pABFERZJs+hXCeqKCVg=; b=hu5QfXnCHzTiHx k1Tq5G+oGsxBO9GlXO9G3zY0HuB5qMkoVGgF9kxK6C65sSZSc+jZm8NXykJJ5nKLWN2EuXKpDlqN0 AVRJ9YuPMhrFYXR6pRA4DDd4YFMzcGNRYA0dxl/fKWtn2xq7medvFnOel7NibImR3CPdFymnRfAlr KjjYNgHB/nW+mw2ZaPyySuGvDbr85UZKAezUuOXbJobNWj0w/0wFmOM6xWXfpH9lmX8E5j6a8aTi3 dagcR0Gs+JG3W6dchEscavvWzIQX3HYY0TjUfukZzAMEiHoOt6ivoSbiW+lL/EpfFsUfA1grLdt4b 79i8C4HGpfR852w3YxSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfj-00CD5N-0n; Thu, 27 Jul 2023 05:36:23 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtet-00CCk5-2i for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:33 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bb8e45185bso3488925ad.1 for ; Wed, 26 Jul 2023 22:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436131; x=1691040931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2eV7FwAQnhqmKgtMd0G6R4TLPgqzhAKhV6ZHHlFmK5M=; b=mra48eD2kN04BmlLuyAEvoEKjENVGmX08ZtHeBWV3TrnVT8w9cDYeNjDK+3LTUo9pg BMHCmE8isRPu0hr1Br50C0+6Dv3T1FQvw1R3Q8iGjbu3mc/1+ctEz37Hto6vI34nn3sd VsXpIHD3auMSYQzDlH6e7Adai3jRYKt3dzxNDWJiXRZirk2k2a8qfbAkGGu/j3PTbjaV RQlKgl8oI8g/eOIUdKJN6x+RB9Xw6gDIQIMDr9WnyydaJv2Kbu3CHdWPztkN7nX+ojDg OKx8pcW2FkGy6WlJPOOYqbUG26xl+6B1LY9oqVX0mutOICzTvJ0lyzsyLfOxgT58bqc6 vf1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436131; x=1691040931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2eV7FwAQnhqmKgtMd0G6R4TLPgqzhAKhV6ZHHlFmK5M=; b=jkwH8KbFS5mePeqfm4Gl16jKS1/XSDEcJB7ErRb1KsJTMs4WFQbN3wg405GaCwgQKB 193Wgpq/BGVGjym0GaBGyy9fMduGSJuVRCVdsGzoAkJD3oQPY2YCuR4UAAs5opK7kdrW S9Os3WrxcC1BPi5Jsi1oFg8tjtvhyznXVz5owX9MXW5f42iUA1ldkQ1t/vPhJZc53BSU W0808jqVAcKts4ybQnsjH3OARtSA+0u3IUPIZegFA5txHjSFZ/98IVHzDCDXswFBvuB7 bzXx6GRO/ZpzVva4RUZQ4V3nfbljIgBZL88709mI9IDfANYEuoWyUtb6JfA3c/K3jzY9 Zydg== X-Gm-Message-State: ABy/qLZOW9W9ZBK33udjHS/gu38iylSh5giNU1SG2YOwUWIbl/VsuD8X P/UBoZs8UdaCD5+suyd6nwr7jg== X-Google-Smtp-Source: APBJJlHvImL9nMGYwJO3XtrJzHDpD8HPaM0PRBf1WB8LD5lptPCb27jBcnAi8tB4UrHR6TMuogusIA== X-Received: by 2002:a17:903:11d1:b0:1bb:7b0a:374 with SMTP id q17-20020a17090311d100b001bb7b0a0374mr4165915plh.4.1690436131299; Wed, 26 Jul 2023 22:35:31 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:31 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 25/42] clk: at91: at91sam9rl: switch to parent_hw Date: Thu, 27 Jul 2023 08:31:39 +0300 Message-Id: <20230727053156.13587-26-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223531_906089_27F1B060 X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch AT91SAM9RL clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9rl.c | 70 +++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 0e8657aac491..29f24a5b1fef 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -28,13 +29,13 @@ static const struct clk_pll_characteristics sam9rl_plla_characteristics = { .out = sam9rl_plla_out, }; -static const struct { +static struct { char *n; - char *p; + struct clk_hw *parent_hw; u8 id; } at91sam9rl_systemck[] = { - { .n = "pck0", .p = "prog0", .id = 8 }, - { .n = "pck1", .p = "prog1", .id = 9 }, + { .n = "pck0", .id = 8 }, + { .n = "pck1", .id = 9 }, }; static const struct { @@ -67,23 +68,25 @@ static const struct { static void __init at91sam9rl_pmc_setup(struct device_node *np) { - const char *slck_name, *mainxtal_name; + struct clk_hw *parent_hws[5], *hw, *slow_clk_hw, *main_xtal_hw; + const char *main_xtal_name = "main_xtal"; struct pmc_data *at91sam9rl_pmc; - const char *parent_names[6]; struct regmap *regmap; - struct clk_hw *hw; + struct clk *clk; int i; - i = of_property_match_string(np, "clock-names", "slow_clk"); - if (i < 0) + clk = of_clk_get_by_name(np, "slow_clk"); + if (IS_ERR(clk)) return; - - slck_name = of_clk_get_parent_name(np, i); - - i = of_property_match_string(np, "clock-names", "main_xtal"); - if (i < 0) + slow_clk_hw = __clk_get_hw(clk); + if (!slow_clk_hw) + return; + clk = of_clk_get_by_name(np, main_xtal_name); + if (IS_ERR(clk)) + return; + main_xtal_hw = __clk_get_hw(clk); + if (!main_xtal_hw) return; - mainxtal_name = of_clk_get_parent_name(np, i); regmap = device_node_to_regmap(np); if (IS_ERR(regmap)) @@ -95,13 +98,13 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) if (!at91sam9rl_pmc) return; - hw = at91_clk_register_rm9200_main(regmap, "mainck", mainxtal_name, NULL); + hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_xtal_hw); if (IS_ERR(hw)) goto err_free; at91sam9rl_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", "mainck", NULL, 0, + hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9rl_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &sam9rl_plla_characteristics); if (IS_ERR(hw)) @@ -109,18 +112,18 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck", NULL); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9rl_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; at91sam9rl_pmc->chws[PMC_UTMI] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "utmick"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9rl_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9rl_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9rl_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - parent_names, NULL, + NULL, parent_hws, &at91rm9200_master_layout, &sam9rl_mck_characteristics, &sam9rl_mck_lock); @@ -128,7 +131,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - "masterck_pres", NULL, + NULL, hw, &at91rm9200_master_layout, &sam9rl_mck_characteristics, &sam9rl_mck_lock, CLK_SET_RATE_GATE, 0); @@ -137,18 +140,18 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->chws[PMC_MCK] = hw; - parent_names[0] = slck_name; - parent_names[1] = "mainck"; - parent_names[2] = "pllack"; - parent_names[3] = "utmick"; - parent_names[4] = "masterck_div"; + parent_hws[0] = slow_clk_hw; + parent_hws[1] = at91sam9rl_pmc->chws[PMC_MAIN]; + parent_hws[2] = at91sam9rl_pmc->chws[PMC_PLLACK]; + parent_hws[3] = at91sam9rl_pmc->chws[PMC_UTMI]; + parent_hws[4] = at91sam9rl_pmc->chws[PMC_MCK]; for (i = 0; i < 2; i++) { char name[6]; snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, 5, i, + NULL, parent_hws, 5, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) @@ -157,9 +160,12 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->pchws[i] = hw; } + /* Set systemck parent hws. */ + at91sam9rl_systemck[0].parent_hw = at91sam9rl_pmc->pchws[0]; + at91sam9rl_systemck[1].parent_hw = at91sam9rl_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9rl_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9rl_systemck[i].n, - at91sam9rl_systemck[i].p, NULL, + NULL, at91sam9rl_systemck[i].parent_hw, at91sam9rl_systemck[i].id, 0); if (IS_ERR(hw)) goto err_free; @@ -170,7 +176,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91sam9rl_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91sam9rl_periphck[i].n, - "masterck_div", NULL, + NULL, at91sam9rl_pmc->chws[PMC_MCK], at91sam9rl_periphck[i].id); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 76A6DEB64DD for ; Thu, 27 Jul 2023 05:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6semRH/gYB5BCS6OJAod4SAZ/ozelEno9Wl962B/M6I=; b=FqVxIRkxzgMxL8 lGFFYOBC5m5ewNGxEsOOiF9VMbkqnIShLOBddAZV3XhHUMBI6rgx9OSwxJ+R6DS3ur2kvbNMM7jHw 18ymVVHgefC5AJRHpS4ICHdEmmtSeUi5GN0dW7mmQQ+t+xbbGWYWLo5QbWVZpt3TYj1IRXpFW8tw8 XOD/JvJJYSN1RnYuCwvhLfW1HsGUqNxsWv/quekESyB0YWcRzxXuSQaRmOtRLX8QYv5s2KER2oAdI Kj17HyQL4Ed8JHYMLfi66UIRACcn08NcdIqmhi28Hn6rg/sLNVHonXXJNKefKCABdGYdCbf/WP7hg rICrzo/1EXlfQqp+7O9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfj-00CD5g-2b; Thu, 27 Jul 2023 05:36:23 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtf1-00CCo2-15 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:42 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bb775625e2so3332325ad.1 for ; Wed, 26 Jul 2023 22:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436139; x=1691040939; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yQlXbwoci/ewwucHyWtCCTQ2+X4L0Fz5xsjb1IQcag4=; b=Bg5yjQAjktp2tJN/SXnI4Hbxj/NHVgUV4xq2Aq1auahzR1Uc+3pqQO1aOt8K2rE2Vh 9S/5SYQbxmkPVwaFQQqurFrabLky1ex30remLU9wCYUbRBhdwNmgsqQCMP9pjh3qJOaF RlLL5pfKUQ6F/HOrNjjebOXkb3+9ZdefSZVrAQiQ7MCW64ortIe3AMxkBysncZBoy/i/ o207ddtT7pYA7NCUIxD/m1AnPWwcjDV31mYa56A9BAD4V1a17UlN23zqU20OAfZ4wcYc IU89p/pQyc9/M6cNV31hcc4J1CoWIi0FSAGWlb73PvUJbjB14GYUhq6oQpRS8852jBn4 YwdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436139; x=1691040939; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yQlXbwoci/ewwucHyWtCCTQ2+X4L0Fz5xsjb1IQcag4=; b=cpw+/EJhiW1bJbx4iqROzMvhZJFlwnGVIm+NQIYPAYegvIP3+uaxWCDhsqwwDR9CaV BtVEczhFh6xjlfic95FVNWxGK/GRB+NSfTbwf0wyS2v1w6r4RsdqT7RWiOB6vEaX3xY9 yy7EJdPcG6mjsYU5Iyef5bhgD0R7z5//0P9gtg5SmiYg4I2Qz79GzE/WDJSE+Fvx4+K3 FrYAzN/mKN9/8VgWawS1Dtqe8A9zo4SsfbnfKsKLM6LNnxkHdX/oT4fK7/AdwSBlckjT pM63F6aQUtF0YqSbzHvFIJT7TcYUB5h8qOMDv1hMrH2577GPwTzCSrF3CldzfVrFH/QN 9Pvw== X-Gm-Message-State: ABy/qLbAaiXsauOYfbgj3iHQYzc7AbUAZsMbR7amYpTpVt7w8395SOl3 LVOeBOaZbdNTtT1RvbwIYAa8Ng== X-Google-Smtp-Source: APBJJlHsDVCtvEOmrOaGJqf0BjQfeVpMuyWKgqwEHE5zMzyunm3gXSds0Z9gD5iv2xDyHelkUGaIeg== X-Received: by 2002:a17:902:8c86:b0:1b8:c63:4b79 with SMTP id t6-20020a1709028c8600b001b80c634b79mr1658635plo.19.1690436138684; Wed, 26 Jul 2023 22:35:38 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:38 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 26/42] clk: at91: dt-compat: switch to parent_hw and parent_data Date: Thu, 27 Jul 2023 08:31:40 +0300 Message-Id: <20230727053156.13587-27-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223539_385881_4ECFF1A4 X-CRM114-Status: GOOD ( 18.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch old dt-compat clocks to use parent_hw and parent_data. Having parent_hw instead of parent names improves to clock registration speed and re-parenting. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/dt-compat.c | 328 +++++++++++++++++++++++++---------- 1 file changed, 232 insertions(+), 96 deletions(-) diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index dbc59ac44828..044e1fc821e2 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -29,11 +30,11 @@ static DEFINE_SPINLOCK(mck_lock); #ifdef CONFIG_HAVE_AT91_AUDIO_PLL static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np) { - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; const char *name = np->name; - const char *parent_name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); @@ -41,9 +42,15 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np) if (IS_ERR(regmap)) return; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; - hw = at91_clk_register_audio_pll_frac(regmap, name, parent_name, NULL); + hw = at91_clk_register_audio_pll_frac(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -55,11 +62,11 @@ CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_frac_setup, static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np) { - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; const char *name = np->name; - const char *parent_name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); @@ -67,9 +74,15 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np) if (IS_ERR(regmap)) return; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; - hw = at91_clk_register_audio_pll_pad(regmap, name, parent_name, NULL); + hw = at91_clk_register_audio_pll_pad(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -81,11 +94,11 @@ CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_pad_setup, static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np) { - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; const char *name = np->name; - const char *parent_name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); @@ -93,9 +106,15 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np) if (IS_ERR(regmap)) return; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; - hw = at91_clk_register_audio_pll_pmc(regmap, name, parent_name, NULL); + hw = at91_clk_register_audio_pll_pmc(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -126,18 +145,26 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) int num; u32 id; const char *name; - struct clk_hw *hw; - unsigned int num_parents; - const char *parent_names[GENERATED_SOURCE_MAX]; + struct clk_hw *hw, *parent_hws[GENERATED_SOURCE_MAX]; + unsigned int num_parents, i; struct device_node *gcknp, *parent_np; struct clk_range range = CLK_RANGE(0, 0); struct regmap *regmap; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > GENERATED_SOURCE_MAX) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } num = of_get_child_count(np); if (!num || num > PERIPHERAL_MAX) @@ -171,7 +198,7 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &dt_pcr_layout, name, - parent_names, NULL, NULL, + NULL, parent_hws, NULL, num_parents, id, &range, chg_pid); if (IS_ERR(hw)) @@ -187,11 +214,11 @@ CLK_OF_DECLARE(of_sama5d2_clk_generated_setup, "atmel,sama5d2-clk-generated", #ifdef CONFIG_HAVE_AT91_H32MX static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) { - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; const char *name = np->name; - const char *parent_name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); @@ -199,9 +226,15 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) if (IS_ERR(regmap)) return; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; - hw = at91_clk_register_h32mx(regmap, name, parent_name, NULL); + hw = at91_clk_register_h32mx(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -217,11 +250,10 @@ CLK_OF_DECLARE(of_sama5d4_clk_h32mx_setup, "atmel,sama5d4-clk-h32mx", static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np) { struct regmap *regmap_sfr; - u8 bus_id; - const char *parent_names[2]; + u8 bus_id, i; struct device_node *i2s_mux_np; - struct clk_hw *hw; - int ret; + struct clk_hw *hw, *parent_hws[2] = {}; + struct clk *clk; regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr"); if (IS_ERR(regmap_sfr)) @@ -234,16 +266,26 @@ static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np) if (bus_id > I2S_BUS_NR) continue; - ret = of_clk_parent_fill(i2s_mux_np, parent_names, 2); - if (ret != 2) + for (i = 0; i < 2; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + break; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + break; + } + if (!parent_hws[1]) continue; hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name, - parent_names, NULL, 2, bus_id); + NULL, parent_hws, 2, bus_id); if (IS_ERR(hw)) continue; of_clk_add_hw_provider(i2s_mux_np, of_clk_hw_simple_get, hw); + + parent_hws[1] = NULL; } } CLK_OF_DECLARE(sama5d2_clk_i2s_mux, "atmel,sama5d2-clk-i2s-mux", @@ -258,6 +300,7 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np) struct regmap *regmap; bool bypass; struct device_node *parent_np; + static struct clk_parent_data parent_data; of_property_read_string(np, "clock-output-names", &name); bypass = of_property_read_bool(np, "atmel,osc-bypass"); @@ -269,7 +312,9 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91_clk_register_main_osc(regmap, name, parent_name, NULL, bypass); + parent_data.name = parent_name; + parent_data.fw_name = parent_name; + hw = at91_clk_register_main_osc(regmap, name, NULL, &parent_data, bypass); if (IS_ERR(hw)) return; @@ -308,13 +353,12 @@ CLK_OF_DECLARE(at91sam9x5_clk_main_rc_osc, "atmel,at91sam9x5-clk-main-rc-osc", static void __init of_at91rm9200_clk_main_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); of_property_read_string(np, "clock-output-names", &name); parent_np = of_get_parent(np); @@ -323,7 +367,15 @@ static void __init of_at91rm9200_clk_main_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91_clk_register_rm9200_main(regmap, name, parent_name, NULL); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; + + hw = at91_clk_register_rm9200_main(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -334,18 +386,26 @@ CLK_OF_DECLARE(at91rm9200_clk_main, "atmel,at91rm9200-clk-main", static void __init of_at91sam9x5_clk_main_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_names[2]; - unsigned int num_parents; + struct clk_hw *hw, *parent_hws[2]; + unsigned int num_parents, i; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > 2) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); of_node_put(parent_np); @@ -354,7 +414,7 @@ static void __init of_at91sam9x5_clk_main_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9x5_main(regmap, name, parent_names, NULL, + hw = at91_clk_register_sam9x5_main(regmap, name, NULL, parent_hws, num_parents); if (IS_ERR(hw)) return; @@ -393,19 +453,27 @@ static void __init of_at91_clk_master_setup(struct device_node *np, const struct clk_master_layout *layout) { - struct clk_hw *hw; - unsigned int num_parents; - const char *parent_names[MASTER_SOURCE_MAX]; + struct clk_hw *hw, *parent_hws[MASTER_SOURCE_MAX]; + unsigned int num_parents, i; const char *name = np->name; struct clk_master_characteristics *characteristics; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > MASTER_SOURCE_MAX) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < MASTER_SOURCE_MAX; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } of_property_read_string(np, "clock-output-names", &name); @@ -420,12 +488,12 @@ of_at91_clk_master_setup(struct device_node *np, return; hw = at91_clk_register_master_pres(regmap, "masterck_pres", num_parents, - parent_names, NULL, layout, + NULL, parent_hws, layout, characteristics, &mck_lock); if (IS_ERR(hw)) goto out_free_characteristics; - hw = at91_clk_register_master_div(regmap, name, "masterck_pres", NULL, + hw = at91_clk_register_master_div(regmap, name, NULL, hw, layout, characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); if (IS_ERR(hw)) @@ -457,15 +525,19 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) { int num; u32 id; - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name; struct device_node *periphclknp; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) return; num = of_get_child_count(np); @@ -490,7 +562,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) if (type == PERIPHERAL_AT91RM9200) { hw = at91_clk_register_peripheral(regmap, name, - parent_name, NULL, id); + NULL, parent_hw, id); } else { struct clk_range range = CLK_RANGE(0, 0); unsigned long flags = 0; @@ -511,8 +583,8 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) &pmc_pcr_lock, &dt_pcr_layout, name, - parent_name, NULL, + parent_hw, id, &range, INT_MIN, flags); @@ -640,17 +712,23 @@ of_at91_clk_pll_setup(struct device_node *np, const struct clk_pll_layout *layout) { u32 id; - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; struct regmap *regmap; - const char *parent_name; const char *name = np->name; struct device_node *parent_np; struct clk_pll_characteristics *characteristics; + struct clk *clk; if (of_property_read_u32(np, "reg", &id)) return; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; of_property_read_string(np, "clock-output-names", &name); @@ -664,7 +742,7 @@ of_at91_clk_pll_setup(struct device_node *np, if (!characteristics) return; - hw = at91_clk_register_pll(regmap, name, parent_name, NULL, id, layout, + hw = at91_clk_register_pll(regmap, name, NULL, parent_hw, id, layout, characteristics); if (IS_ERR(hw)) goto out_free_characteristics; @@ -707,13 +785,19 @@ CLK_OF_DECLARE(sama5d3_clk_pll, "atmel,sama5d3-clk-pll", static void __init of_at91sam9x5_clk_plldiv_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; of_property_read_string(np, "clock-output-names", &name); @@ -723,7 +807,7 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91_clk_register_plldiv(regmap, name, parent_name, NULL); + hw = at91_clk_register_plldiv(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -739,18 +823,26 @@ of_at91_clk_prog_setup(struct device_node *np, { int num; u32 id; - struct clk_hw *hw; - unsigned int num_parents; - const char *parent_names[PROG_SOURCE_MAX]; + struct clk_hw *hw, *parent_hws[PROG_SOURCE_MAX]; + unsigned int num_parents, i; const char *name; struct device_node *progclknp, *parent_np; struct regmap *regmap; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > PROG_SOURCE_MAX) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } num = of_get_child_count(np); if (!num || num > (PROG_ID_MAX + 1)) @@ -770,7 +862,7 @@ of_at91_clk_prog_setup(struct device_node *np, name = progclknp->name; hw = at91_clk_register_programmable(regmap, name, - parent_names, NULL, num_parents, + NULL, parent_hws, num_parents, id, layout, mux_table); if (IS_ERR(hw)) continue; @@ -802,18 +894,26 @@ CLK_OF_DECLARE(at91sam9x5_clk_prog, "atmel,at91sam9x5-clk-programmable", static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_names[2]; - unsigned int num_parents; + struct clk_hw *hw, *parent_hws[2]; + unsigned int num_parents, i; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents != 2) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } parent_np = of_get_parent(np); regmap = syscon_node_to_regmap(parent_np); of_node_put(parent_np); @@ -822,7 +922,7 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9260_slow(regmap, name, parent_names, NULL, + hw = at91_clk_register_sam9260_slow(regmap, name, NULL, parent_hws, num_parents); if (IS_ERR(hw)) return; @@ -837,18 +937,26 @@ CLK_OF_DECLARE(at91sam9260_clk_slow, "atmel,at91sam9260-clk-slow", static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) { - struct clk_hw *hw; - unsigned int num_parents; - const char *parent_names[SMD_SOURCE_MAX]; + struct clk_hw *hw, *parent_hws[SMD_SOURCE_MAX]; + unsigned int num_parents, i; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > SMD_SOURCE_MAX) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } of_property_read_string(np, "clock-output-names", &name); @@ -858,7 +966,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_smd(regmap, name, parent_names, NULL, + hw = at91sam9x5_clk_register_smd(regmap, name, NULL, parent_hws, num_parents); if (IS_ERR(hw)) return; @@ -873,11 +981,11 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) { int num; u32 id; - struct clk_hw *hw; + struct clk_hw *hw, *parent_hw; const char *name; struct device_node *sysclknp, *parent_np; - const char *parent_name; struct regmap *regmap; + struct clk *clk; num = of_get_child_count(np); if (num > (SYSTEM_MAX_ID + 1)) @@ -898,7 +1006,13 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) if (of_property_read_string(np, "clock-output-names", &name)) name = sysclknp->name; - parent_name = of_clk_get_parent_name(sysclknp, 0); + clk = of_clk_get(sysclknp, 0); + if (IS_ERR(clk)) + continue; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + continue; /* * ddrck feeds DDR controller and is enabled by bootloader thus @@ -908,7 +1022,7 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) if (!strcmp(sysclknp->name, "ddrck")) flags = CLK_IS_CRITICAL; - hw = at91_clk_register_system(regmap, name, parent_name, NULL, + hw = at91_clk_register_system(regmap, name, NULL, parent_hw, id, flags); if (IS_ERR(hw)) continue; @@ -924,18 +1038,26 @@ CLK_OF_DECLARE(at91rm9200_clk_sys, "atmel,at91rm9200-clk-system", static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) { - struct clk_hw *hw; - unsigned int num_parents; - const char *parent_names[USB_SOURCE_MAX]; + struct clk_hw *hw, *parent_hws[USB_SOURCE_MAX]; + unsigned int num_parents, i; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > USB_SOURCE_MAX) return; - of_clk_parent_fill(np, parent_names, num_parents); + for (i = 0; i < num_parents; i++) { + clk = of_clk_get(np, i); + if (IS_ERR(clk)) + return; + + parent_hws[i] = __clk_get_hw(clk); + if (!parent_hws[i]) + return; + } of_property_read_string(np, "clock-output-names", &name); @@ -945,7 +1067,7 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_usb(regmap, name, parent_names, NULL, + hw = at91sam9x5_clk_register_usb(regmap, name, NULL, parent_hws, num_parents); if (IS_ERR(hw)) return; @@ -957,14 +1079,18 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name = np->name; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) return; of_property_read_string(np, "clock-output-names", &name); @@ -975,7 +1101,7 @@ static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9n12_clk_register_usb(regmap, name, parent_name, NULL); + hw = at91sam9n12_clk_register_usb(regmap, name, NULL, parent_hw); if (IS_ERR(hw)) return; @@ -986,15 +1112,19 @@ CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name = np->name; u32 divisors[4] = {0, 0, 0, 0}; struct regmap *regmap; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); - if (!parent_name) + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) return; of_property_read_u32_array(np, "atmel,clk-divisors", divisors, 4); @@ -1008,7 +1138,7 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) of_node_put(parent_np); if (IS_ERR(regmap)) return; - hw = at91rm9200_clk_register_usb(regmap, name, parent_name, NULL, divisors); + hw = at91rm9200_clk_register_usb(regmap, name, NULL, parent_hw, divisors); if (IS_ERR(hw)) return; @@ -1021,13 +1151,19 @@ CLK_OF_DECLARE(at91rm9200_clk_usb, "atmel,at91rm9200-clk-usb", #ifdef CONFIG_HAVE_AT91_UTMI static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np) { - struct clk_hw *hw; - const char *parent_name; + struct clk_hw *hw, *parent_hw; const char *name = np->name; struct regmap *regmap_pmc, *regmap_sfr; struct device_node *parent_np; + struct clk *clk; - parent_name = of_clk_get_parent_name(np, 0); + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) + return; + + parent_hw = __clk_get_hw(clk); + if (!parent_hw) + return; of_property_read_string(np, "clock-output-names", &name); @@ -1055,7 +1191,7 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np) regmap_sfr = NULL; } - hw = at91_clk_register_utmi(regmap_pmc, regmap_sfr, name, parent_name, NULL); + hw = at91_clk_register_utmi(regmap_pmc, regmap_sfr, name, NULL, parent_hw); if (IS_ERR(hw)) return; From patchwork Thu Jul 27 05:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AA018C00528 for ; Thu, 27 Jul 2023 05:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YRmufpEZiXenmFm3q10IbDaynPxG2zuL8Bp86bID5Vs=; b=HVLVIN4bwqNjVC AjfbFCDkuQH4tIXDBFKK6/1R9PitDXLTyZ0rRYWAtnTCFcaNk9xBRpjqokw2yjx9MxxyOXAQ5fUIs yNA/vr8D4mYc+Hzr6XbdyK3chSkvJN0W6iiPhKaE4dsnvZSh6PO1JnxEprc8jUkzZIF5bmqv1hG4T 1NgW3idHC9a2bPVQYyQbQwR12AETAcxc3KpGIRaAfz1GGV9TfdoNJXTRPWyNN6Ea+W/gEDuwritdb ASw8pqykR6XNIVV2J0txpr9mkLqoXw5rh4VewT8d5uGQ6Z3jih4egA2bfqnoomVHmWSmQMTQaRtwf Se5XHsCLN1pTRdKg1D8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfk-00CD5z-15; Thu, 27 Jul 2023 05:36:24 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtf8-00CCrn-0u for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:48 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bba48b0bd2so3393985ad.3 for ; Wed, 26 Jul 2023 22:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436146; x=1691040946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t8HhL8+T58fsNy2ml6XhMwevzcQUIPpdggE6E7sZkqw=; b=me5Ao9gm+3uVJoSHfhX5wwMlcbIWGAsrNYGUqwcb9jsJteHJRkJtXFIjvJC1J7c0Ol /FVWm+ZkPd/jxaG0hajJqqdwAeV6b5goie8TnBS0g7F8444cEUpG8tRk1gOjABySbYdT 1CnCn1B1s33naPM4/j8dIO4R6DRy8+o5zMYe8lb9kbcwY/ciLL0sHiPR/ygX0q9Bp9Yc eSmsoYfVXm7nqEdO0sGaBR7Jko07FZ2Gdiq9LbK7iZ2swIrlAHw59Y30f9sAvSb+7hmW pTyHID27hUsSmVQoOAq/FqZsn/4wks8mqwGXy6pmS0nA3sBv+SWNc9v27/o3ILFPn+mS MM9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436146; x=1691040946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t8HhL8+T58fsNy2ml6XhMwevzcQUIPpdggE6E7sZkqw=; b=Fufk4/gPJv76R9WNiDc3sY507vJQCuxKyqDkEvXEjxBPMgMCcwIU48SN74jgYVVEXQ J6hoPvUj3g+iuqOsQxC/vXhpGjAXGHhMSnn3Xu4qk0PTPjzRsD0jkOwOqMTxOSUntZ4T OROzgeig2OS+seLvKYRxgYcbc31x2RPGjCJ+PlttdhExgEPAvbJCtUkhZyo/+9Ps/JTX NJM6genXWU16K5EKqW8IoQ6Psa5lymAUhw0fz8V1pdnrXO3wSUQRsF86LoBHPGXsj0un VIkFkz5PIBjnZBibDyl8juNKyBbrnyG5CTzozUisX9lvnW/Tw6ue23XKR6r49ZZoppkG Zeow== X-Gm-Message-State: ABy/qLZqoebsKoPLnS8GkAkZq52pQNZ/Lqn8VE6LJ1ansYZnsFld1C5c XaxwQNSyli0IL1R5HVfM12gnYg== X-Google-Smtp-Source: APBJJlHqUeH1XUuot+AZNE6uBAlVN8Awfh8eCBLXAKtzbHs/lj9/Md8g/aUqbAQ/0eOK3aM6rVdfnQ== X-Received: by 2002:a17:902:8a88:b0:1bb:a7bc:37a4 with SMTP id p8-20020a1709028a8800b001bba7bc37a4mr3407360plo.24.1690436145769; Wed, 26 Jul 2023 22:35:45 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:45 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 27/42] clk: at91: clk-audio-pll: remove parent_names support Date: Thu, 27 Jul 2023 08:31:41 +0300 Message-Id: <20230727053156.13587-28-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223546_589236_A03D110C X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-audio-pll. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-audio-pll.c | 21 ++++++--------------- drivers/clk/at91/dt-compat.c | 6 +++--- drivers/clk/at91/pmc.h | 6 +++--- drivers/clk/at91/sama5d2.c | 6 +++--- 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-pll.c index 7a13af95d628..fc08ca53bfad 100644 --- a/drivers/clk/at91/clk-audio-pll.c +++ b/drivers/clk/at91/clk-audio-pll.c @@ -450,7 +450,7 @@ static const struct clk_ops audio_pll_pmc_ops = { struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct clk_audio_frac *frac_ck; struct clk_init_data init = {}; @@ -462,10 +462,7 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_frac_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE; @@ -483,7 +480,7 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct clk_audio_pad *apad_ck; struct clk_init_data init = {}; @@ -495,10 +492,7 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_pad_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; @@ -517,7 +511,7 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct clk_audio_pmc *apmc_ck; struct clk_init_data init = {}; @@ -529,10 +523,7 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, init.name = name; init.ops = &audio_pll_pmc_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 044e1fc821e2..91bc2fada6ec 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -50,7 +50,7 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np) if (!parent_hw) return; - hw = at91_clk_register_audio_pll_frac(regmap, name, NULL, parent_hw); + hw = at91_clk_register_audio_pll_frac(regmap, name, parent_hw); if (IS_ERR(hw)) return; @@ -82,7 +82,7 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np) if (!parent_hw) return; - hw = at91_clk_register_audio_pll_pad(regmap, name, NULL, parent_hw); + hw = at91_clk_register_audio_pll_pad(regmap, name, parent_hw); if (IS_ERR(hw)) return; @@ -114,7 +114,7 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np) if (!parent_hw) return; - hw = at91_clk_register_audio_pll_pmc(regmap, name, NULL, parent_hw); + hw = at91_clk_register_audio_pll_pmc(regmap, name, parent_hw); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 6816e350d6d6..711b55a6b0ab 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -130,15 +130,15 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data); struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index cdb578059449..3920de445eca 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -233,17 +233,17 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_PLLACK] = hw; audio_fracck_hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck", - NULL, sama5d2_pmc->chws[PMC_MAIN]); + sama5d2_pmc->chws[PMC_MAIN]); if (IS_ERR(audio_fracck_hw)) goto err_free; - hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", NULL, audio_fracck_hw); + hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", audio_fracck_hw); if (IS_ERR(hw)) goto err_free; sama5d2_pmc->chws[PMC_AUDIOPINCK] = hw; - hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", NULL, audio_fracck_hw); + hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", audio_fracck_hw); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A3294C001DC for ; Thu, 27 Jul 2023 05:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sh2Gdr0NwxlT7Lpk3WkljDh2Xn6DN9YCoFmRby1W62g=; b=lb45KXVODLZPUN IOj5LX1sKa20rd+qpdthd34zuLe3LiXLUNw8pBbpSrAH13uNYIVrjwnZSD7GG7Ezjj0Nxe7Jj8dTm GoFmoNIFESCZHSwJNdYzRcg6kibXDI278BQCK6fFtkE5byAf5COeQLmHgX1r7NI1MzLkBh+0u3N0j XUibx4aAydbNLRpD2rfz8ZGRnzVuxGh45g7Gj7zXAg0BgGhyESvj8w7k7s3wnYB4XYBi2ZKgsr85R k8YosjRZQ19TLUHTnl7TPFqf2qFm42iY7LxqkeW8cKHq4D73VdqE+EZi3Ln77aQwZGloLtWI/zBlJ 2eYizKhBCBHlzbnP5vrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfk-00CD6Q-2m; Thu, 27 Jul 2023 05:36:24 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfH-00CCva-0c for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:35:58 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1bb73eb80e4so455513fac.3 for ; Wed, 26 Jul 2023 22:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436153; x=1691040953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xp28KzPE+ieFfhPUt9Jo6e3yDprwJgBDl/Tw7iUm9QY=; b=l/wz+kw1GJMRBj7tsp/sNDXv0czPU+bDH78cW2IpD0LbCvy5qy5joTEc9WIdlIY6Gu lFKHVnKW+Q5XNjpyLx6wSaIA6o2HFfv3AXsTThRRubOhxNWOvBy6wCEaXsMZ3cvK69Lq h/Q1XGjpLy6hJ0A2Unz0Hc7e2oPT9Qp+9yd5RBN2KxQk82BIt5BB/FLHUVJKWEWdfJnY N7wTns67f6gHWF83hOnmvr9weAGtquUqGSd6c4dq01r+ZJylJZcPXoouZ3FQxgNW0nmL 3ZocZsftwM8BMXRduAJn5W9c2sby7WUB8k8zHcLkEo9XxBWoNUqUO90p6Y9lSS7LKoZB FNiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436153; x=1691040953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xp28KzPE+ieFfhPUt9Jo6e3yDprwJgBDl/Tw7iUm9QY=; b=GxxpLHsM2rkVkCP/ZTNqo2z1lc9O/t/2s86VMLeKS5Tr/NUXEWZ7Smu0hUYT+FcG+1 cweuvzYDCKDTegCWZEK/0GhjXOQCrbo36VLstcs/aRTxQ3TmuRVukYmAVq/Ffj/V/d/T mBi/PvUAE5T5FuB8P0y/WnxYY3HTSgeUE9h1u7cfbrTn10LxebQBkD8+nz8UPtk9M1PP WyhAULG9EDM0H4Fivf4Sq72IfmgVV80jvFAVwGOL2U0EO0KkNfWUJGP++AvGa781mnmR nEpAqZ8HIYlU/fP//uS1+Iw9s5dmU/ZYXnA5IEVUKJjVFRLHcdHHTmDQMsr0VTzglkNZ IUiw== X-Gm-Message-State: ABy/qLYPBrkdj9DKx7E39J3w1lMySfC/oBMGZLm7Sw1SObCJ3ItHHY8m XGwH1Hwdcb7ldPtDiyunr5kxdA== X-Google-Smtp-Source: APBJJlGFr3EU/A5Eka8jw779q9ZR6uM8cgVvTe3C2t7dO4LjZxg11yMbDuHGcm0iPCelU8t20dYJdQ== X-Received: by 2002:a05:6871:68a:b0:1b7:6039:4c97 with SMTP id l10-20020a056871068a00b001b760394c97mr1923408oao.16.1690436152911; Wed, 26 Jul 2023 22:35:52 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:52 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 28/42] clk: at91: clk-generated: remove parent_names support Date: Thu, 27 Jul 2023 08:31:42 +0300 Message-Id: <20230727053156.13587-29-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223555_270344_FE5423BD X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-generated driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-generated.c | 10 +++------- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 3 +-- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama7g5.c | 2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c index 4b4edeecc889..042553c7118a 100644 --- a/drivers/clk/at91/clk-generated.c +++ b/drivers/clk/at91/clk-generated.c @@ -318,8 +318,7 @@ static void clk_generated_startup(struct clk_generated *gck) struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const struct clk_pcr_layout *layout, - const char *name, const char **parent_names, - struct clk_hw **parent_hws, + const char *name, struct clk_hw **parent_hws, u32 *mux_table, u8 num_parents, u8 id, const struct clk_range *range, int chg_pid) @@ -329,7 +328,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, struct clk_hw *hw; int ret; - if (!(parent_names || parent_hws)) + if (!parent_hws) return ERR_PTR(-ENOMEM); gck = kzalloc(sizeof(*gck), GFP_KERNEL); @@ -338,10 +337,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, init.name = name; init.ops = &generated_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; if (chg_pid >= 0) diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 91bc2fada6ec..816a7ee353d6 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -198,7 +198,7 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &dt_pcr_layout, name, - NULL, parent_hws, NULL, + parent_hws, NULL, num_parents, id, &range, chg_pid); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 711b55a6b0ab..87ba2586d5e5 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -143,8 +143,7 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const struct clk_pcr_layout *layout, - const char *name, const char **parent_names, - struct clk_hw **parent_hws, u32 *mux_table, + const char *name, struct clk_hw **parent_hws, u32 *mux_table, u8 num_parents, u8 id, const struct clk_range *range, int chg_pid); diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index 930b4515a1dd..43997f686b87 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -363,7 +363,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &sam9x60_pcr_layout, sam9x60_gck[i].n, - NULL, parent_hws, NULL, 6, + parent_hws, NULL, 6, sam9x60_gck[i].id, &sam9x60_gck[i].r, INT_MIN); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 3920de445eca..2d4bf9e1a79c 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -371,7 +371,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_gck[i].n, - NULL, parent_hws, NULL, 6, + parent_hws, NULL, 6, sama5d2_gck[i].id, &sama5d2_gck[i].r, sama5d2_gck[i].chg_pid); diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 16e458be8304..b2d27193741b 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1235,7 +1235,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, &sama7g5_pcr_layout, - sama7g5_gck[i].n, NULL, + sama7g5_gck[i].n, parent_hws, mux_table, num_parents, sama7g5_gck[i].id, From patchwork Thu Jul 27 05:31:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 16E9EC04E69 for ; Thu, 27 Jul 2023 05:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bi1ZFUpXX9AgLth/KG0uHfuN0OGEByQQ0An2pBwVOmE=; b=dtUxi1r+GxW/r0 ymxPJmZrtJwDz9QbUWuE1s6XvgrnJdFEQMSkwN6QWdZqVXu6L+ZNzHyw2Lu7crfzIV4+tjBrs4cyF j9x/ZJfs19OvcWQuPMUjYQSf7s6iBulVYzcRLgwIAAHD+YBgp2dW7ItHsFlkpnO2RX0gKQhm/r4PP cNelkvLVv7/dhQp+mpLHafK+GGBVEliNau/qKSiqYDLMwU5A5q24z4lscfHl2BRO+2zdnWj4sK7Zf cUOu6G2o+xlAerzknfs/30VZnl/Kz5E6VWpDrfv9Y9V7GllmqPZwE8FBGw1h/hLdT1P+ybyPQLSqc WOQ7yzOgugiQTqlD0FIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfl-00CD6l-1F; Thu, 27 Jul 2023 05:36:25 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfM-00CCzo-2I for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:02 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b8ad907ba4so3565665ad.0 for ; Wed, 26 Jul 2023 22:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436160; x=1691040960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tZjA/S5rkAI45EIQ8pwCaKfyj6nPmHrCItt9RJLE9cc=; b=nTtP8b9CSgkFgg32JpTd5UHEzmEllvNl41ff0GI36YGsZVfI3unXLhJLIfWPqssdfD jdyh/9kZ7JDeSIlZYrP+ViHnPDab+yF29x9F+0BoSRprtm7GLcATD59n2LpAg5+fyX05 RAhZrJe6gy/RJ7pM+LD8SCXqw5xKJq4uiwmEqXvBPJ7zK5uoHuebdv5a0sLJl7oyf6YM MuPXrerqClkfQtsWkKFmtpoJ88AluPHl4mR09XuwWWu+Z+lidskXoYFVxW054tmzrVwc qFdeVFs5yZ55zdlhcnmPbfUN2gdQmRfuerF6raRQ9lQV5JlbgwjBQGzRKhVh43An3lY/ 9jow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436160; x=1691040960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tZjA/S5rkAI45EIQ8pwCaKfyj6nPmHrCItt9RJLE9cc=; b=NAlNp0pZIW7fHgxuBmHNcU9jzY+pmllltDAsPLTf3vaOjd8uI465ZMqWUa5WP2ESM4 XEaFbwkHLJ9vquAX/kakoZfh779qzIAw1ZwaZc3v1FfXWeGSm58ZZezKHae4k9fj/H6A 3ZKUqAr0d+ue7QYFkGVceb+IyayBh/Zu8MMVOMOUxQO6A1Z3xD43ow4D1blxHovfIdAs krximBK8zdYf3Lo2D+Bo1T/D9jMdgnGEc4Pi1RcSjM/8aMLHNbwVr9r9mOI9vpM34Yes HYw3ZsGPaXek1xCzsgK4eM2G9oTgLw8AhjHc/fUxLzJBQyvFx2DWwRf0ab7z8JeZ8ORT ifEw== X-Gm-Message-State: ABy/qLapVogh4koLpYSqcDe/PHa1hJPN7nFsM4Alacw1GH//FE7l/3HR AuAK9K8374Pjwb2Zt/UfpOEoCA== X-Google-Smtp-Source: APBJJlEnqTGNOQscpftBLsei9noqgRw7/LuMRVXVScuPebiJkYEppzbJfbM+vcPjAU02zFrFT8/1Pg== X-Received: by 2002:a17:902:db09:b0:1ba:fe63:6616 with SMTP id m9-20020a170902db0900b001bafe636616mr3831454plx.6.1690436160099; Wed, 26 Jul 2023 22:36:00 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:35:59 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 29/42] clk: at91: clk-h32mx: remove parent_names support Date: Thu, 27 Jul 2023 08:31:43 +0300 Message-Id: <20230727053156.13587-30-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223600_749352_B980AEEE X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-h32mx driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-h32mx.c | 11 +++-------- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c index d7cdade56454..0e139bf731ec 100644 --- a/drivers/clk/at91/clk-h32mx.c +++ b/drivers/clk/at91/clk-h32mx.c @@ -83,7 +83,7 @@ static const struct clk_ops h32mx_ops = { struct clk_hw * __init at91_clk_register_h32mx(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct clk_sama5d4_h32mx *h32mxclk; struct clk_init_data init = {}; @@ -95,13 +95,8 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, init.name = name; init.ops = &h32mx_ops; - if (parent_hw) { - init.parent_hws = (const struct clk_hw **)&parent_hw; - init.num_parents = 1; - } else { - init.parent_names = parent_name ? &parent_name : NULL; - init.num_parents = parent_name ? 1 : 0; - } + init.parent_hws = parent_hw ? (const struct clk_hw **)&parent_hw : NULL; + init.num_parents = parent_hw ? 1 : 0; init.flags = CLK_SET_RATE_GATE; h32mxclk->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 816a7ee353d6..058b65c2d88d 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -234,7 +234,7 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np) if (!parent_hw) return; - hw = at91_clk_register_h32mx(regmap, name, NULL, parent_hw); + hw = at91_clk_register_h32mx(regmap, name, parent_hw); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 87ba2586d5e5..11f7ab4d1ad8 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -149,7 +149,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init at91_clk_register_h32mx(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 2d4bf9e1a79c..93c646e0b6ef 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -280,7 +280,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", NULL, sama5d2_pmc->chws[PMC_MCK]); + hw = at91_clk_register_h32mx(regmap, "h32mxck", sama5d2_pmc->chws[PMC_MCK]); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index ac7565b26dce..b4375cb1c3f3 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -220,7 +220,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_pmc->chws[PMC_MCK] = hw; - hw = at91_clk_register_h32mx(regmap, "h32mxck", NULL, sama5d4_pmc->chws[PMC_MCK]); + hw = at91_clk_register_h32mx(regmap, "h32mxck", sama5d4_pmc->chws[PMC_MCK]); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5030DC001DC for ; Thu, 27 Jul 2023 05:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GWsdTF4XuQS0P8iBRY+fUnou+MLG7FaXz9/ow7qaRv0=; b=okZ6uBQCifisEE /UNA7tttR4YrndI96p9+87A76Hxkt/rGrKFgVy9r/J66maoAHR/x7Olmexgw+JB4A1DXKnEqyDhdl 3aSEBgBKfxQ/M7VegdWSPeFq+M8KNXfdRqrgRYYmbpMH4e/uzGnb68Qo2xmWdJB6UqsiugA6jXqe9 CasL8RTyylcV7sfojBc48f4c2mHjRhh6Oqj9X2uaGSwR9SSA994JFEc+IagVM6JpQXQCoFTDfwTGr WcU1uQNxUC6+1ql6ZBCLA2WbwOJ0ysPkiZ3iWipEfCesPfSea0/AEr1B0b9YJzCy69B+HFme/S6Pi /g7T4A2LuI8KSwEDyZzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfn-00CD8N-0t; Thu, 27 Jul 2023 05:36:27 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfT-00CD25-2I for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:09 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1b8ad356f03so3352095ad.1 for ; Wed, 26 Jul 2023 22:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436167; x=1691040967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WeeIlCY0YkV9dl6D14N0gEidgFKUnfmPXMsUhAICJi0=; b=ccDxRKhV5iS27apESIGTH5S5TCn6nV4keOklEAis81F2zhY4N9inDuLRgxBE5iGomf M0bK11YSAQgCFbRKafhDBzlGQX0BvaNJYkD6BOnyHiZ/WMvvw3V4KcDjBrwXCFJaGFWx Xx1NdWp/31agRWMwF/Z+AhDx4fRgq38/9Jx+WJaUvb6gR5hJAe5MmTTOyCCdqKeqozpg 2vh1qSTVe7WumG6hJuoNMchDXuCSmFE8Slb8zUGW6JPmNQKPHtiz76OEnmcdTB0+M/0w ktvv0TRJpNio/k249dPGioypgnnd0RFh1H90yCDBkXt1XRIlnXzIvk98ehbvntY/N9mZ 7flA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436167; x=1691040967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WeeIlCY0YkV9dl6D14N0gEidgFKUnfmPXMsUhAICJi0=; b=LZCNvnbx+tZcw+RC8ZobqhsQb867QryEYd7SIzQPwLmQgeZADMJRd/cNK0EhkO+rJ2 rHM/3X/Rfwk/kvT8Zir94CmucJjDqCO5utIe/YwxD2gih+ahthgKDdmyUmow7oM2uz6t iGtSSs3qYSjINOMF6pvbuzSrTg9uqrJDOLzwNH8EInlHv+hnilTaoY5DhSRhOGgzkIba OIxtiI9kBX0H2yky5XjNghfhNNIbGb8LUzOh2AHvLv2FJ2c5KIePo3ylhYCx6iF+Fdk+ i+aCHRNyhlvoCJcRPl6obcGEQiIp3qKHLng+WpZzFTNcNXTmpUaxD/A4kOhUVf/oIuAs +f1g== X-Gm-Message-State: ABy/qLZGbuI3LLXM4PAxC212cRnqQZuwD18rLSihgrmgALtcHsI1nD6L X96Eo7giMeCFpkagH8aQujFTXg== X-Google-Smtp-Source: APBJJlF/XwQZpd1LX1Lt4eTiYkh6jAVDh1H64Ef5bGckyVA4hPgK35Lo58LEqcGOZDq2Sh17vE+m1w== X-Received: by 2002:a17:902:e5c4:b0:1bb:c87d:756d with SMTP id u4-20020a170902e5c400b001bbc87d756dmr4130989plf.42.1690436167186; Wed, 26 Jul 2023 22:36:07 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:06 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 30/42] clk: at91: clk-i2s-mux: remove parent_names support Date: Thu, 27 Jul 2023 08:31:44 +0300 Message-Id: <20230727053156.13587-31-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223607_756655_1E4201E4 X-CRM114-Status: GOOD ( 15.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-i2s-mux driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-i2s-mux.c | 8 ++------ drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 3 +-- drivers/clk/at91/sama5d2.c | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/clk/at91/clk-i2s-mux.c b/drivers/clk/at91/clk-i2s-mux.c index f1981b8ee18d..ea84e8f5becd 100644 --- a/drivers/clk/at91/clk-i2s-mux.c +++ b/drivers/clk/at91/clk-i2s-mux.c @@ -50,8 +50,7 @@ static const struct clk_ops clk_i2s_mux_ops = { struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, - const char * const *parent_names, struct clk_hw **parent_hws, - unsigned int num_parents, u8 bus_id) + struct clk_hw **parent_hws, unsigned int num_parents, u8 bus_id) { struct clk_init_data init = {}; struct clk_i2s_mux *i2s_ck; @@ -63,10 +62,7 @@ at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, init.name = name; init.ops = &clk_i2s_mux_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; i2s_ck->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 058b65c2d88d..7ab116a6e701 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -279,7 +279,7 @@ static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np) continue; hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name, - NULL, parent_hws, 2, bus_id); + parent_hws, 2, bus_id); if (IS_ERR(hw)) continue; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 11f7ab4d1ad8..07f372abcfd0 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -153,8 +153,7 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_i2s_mux_register(struct regmap *regmap, const char *name, - const char * const *parent_names, struct clk_hw **parent_hws, - unsigned int num_parents, u8 bus_id); + struct clk_hw **parent_hws, unsigned int num_parents, u8 bus_id); struct clk_hw * __init at91_clk_register_main_rc_osc(struct regmap *regmap, const char *name, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 93c646e0b6ef..17a40cedd7fb 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -385,7 +385,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_hws[0] = sama5d2_pmc->phws[54]; /* i2s0_clk */ parent_hws[1] = sama5d2_pmc->phws[54]; /* i2s0_gclk */ hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s0_muxclk", - NULL, parent_hws, 2, 0); + parent_hws, 2, 0); if (IS_ERR(hw)) goto err_free; @@ -394,7 +394,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_hws[0] = sama5d2_pmc->phws[55]; /* i2s1_clk */ parent_hws[1] = sama5d2_pmc->ghws[55]; /* i2s1_gclk */ hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s1_muxclk", - NULL, parent_hws, 2, 1); + parent_hws, 2, 1); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 88618C41513 for ; Thu, 27 Jul 2023 05:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lYuWnmG7VVW8R8nnL2COKsm43lNB4KJqyO+s6lHNULw=; b=KdvBq8C65aVOMW 71KTEWsILEev1UThWf/WBtfb0hRh0GIPS9ayMbRxs3UejEjPP3j1mTopqujwVzPZmmbCOjKlJo/R2 P6kOIx/Oh8S+4YMXb9z4nooqwH24CJ2aiR0M3XL0hEAduXV/a74GFZmcT2afM6k/zMSGkU7tmRIVo 6qH/l5pgCImEzW8+imy3buNxc42tyqU+60pGrDvX+a8femPscq+lh17fxzr651rqBKHxpFJk1WoW7 3S9yMhxuueIXRfC5nT7lq/cj/afdFPUS8FD9SOeFH2gOP58azXZuFYp74zOr2kJUQT+9V/Eh95K7M 74skIns2s4+ziq9M9rMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfp-00CDA6-29; Thu, 27 Jul 2023 05:36:29 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfe-00CD3X-0g for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:20 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-7680e3910dfso57555985a.0 for ; Wed, 26 Jul 2023 22:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436174; x=1691040974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LPKRD6M8sYpV7bnQLsbqFVgQafgsIsDaV98IpKMiI6g=; b=lYVAGJkyuE0KiNJzacX0O2CCrD7GP0MoLr4j0DgwcYwPphuk/mgM6ViG3oO5Qy+2Z4 b6x00dJNZ80Ge3t0xPnGMR8Fw2x1NnC3Kgk4JC4aHuf57VyeaotqAfGtSZGA3SJoeNyQ VNq9U3bd6PzNtE5x572SeoDYaT6MLqNhkuzSAVSKsVNFjGzs3GR5gFZygOfB4eIn/IPZ c7jWQ8YPYhrTEA/P1H24hhDVvuEHzGAzvkrO0IR3HkytpXDJSTK8chdpOXYrGaeM+Q+i PmbCkiMSgsRAatgD4oxjDj+xYb8KECWI9fpmZNNdVXkMEO6ZsOFDcdEZTcaM35+SCY0S M1CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436174; x=1691040974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPKRD6M8sYpV7bnQLsbqFVgQafgsIsDaV98IpKMiI6g=; b=FLpsuIE1igtcY3k/asj9vZKOi+15cTf/xPwkM6FRxXCe1PGM/L1VKrG2ZD+joolJXC awYlx7e+4oouDXnNZw+0jUEo2FoEy9RZqCGsHxwgyFeu6jPzWhClHEBbjkj5PQYPG1bh xvUhFrFtu+Y+BW2mQVSmVWrDnAxH1RbnlxvRu+t4EF1XvB8y027dJ8cR0TdWgv2ZtwlG HefgNgM27aCGffTa8MIOkDozYILkmsCi1FYapBAbsesWr33+TfIAwdEPgjTbbfHCzqFw WKdcyZOGjD/ZH25xhKosKq6oUHtPcuitTSxoZ/STN6iE6RUTKS8qdMk4NtPjpCwmZf7w WACg== X-Gm-Message-State: ABy/qLaQyQ6LYCjUA7PM/29CSiR6wvR4HKHM5O/REdqcESdYMuo5HQxV D2s1qmsRIjXZcmxFIP1rXFJgKw== X-Google-Smtp-Source: APBJJlEtKCCsCmYuKhGONio+jtko2qgCcabGtqrNTwQxSOALvyhmFcHjdkIhgyVQk6bAG4+Fvnbrfw== X-Received: by 2002:a05:620a:2894:b0:765:a9d7:2ca2 with SMTP id j20-20020a05620a289400b00765a9d72ca2mr4698758qkp.48.1690436174497; Wed, 26 Jul 2023 22:36:14 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:14 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 31/42] clk: at91: clk-main: remove parent_names support Date: Thu, 27 Jul 2023 08:31:45 +0300 Message-Id: <20230727053156.13587-32-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223618_249701_0DE18BCD X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-main driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 4 ++-- drivers/clk/at91/at91sam9g45.c | 4 ++-- drivers/clk/at91/at91sam9n12.c | 4 ++-- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-main.c | 24 ++++++------------------ drivers/clk/at91/dt-compat.c | 7 +++---- drivers/clk/at91/pmc.h | 3 --- drivers/clk/at91/sam9x60.c | 5 ++--- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 4 ++-- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 4 ++-- 14 files changed, 30 insertions(+), 47 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index e0418ab5d65c..441b744eed5e 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -115,12 +115,12 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_osc_hw); + hw = at91_clk_register_rm9200_main(regmap, "mainck", main_osc_hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 1ef7c02bee63..709f01c4dab9 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -369,12 +369,12 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw); + hw = at91_clk_register_rm9200_main(regmap, "mainck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 868897fad3f0..535f3af23560 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -130,12 +130,12 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, hw); + hw = at91_clk_register_rm9200_main(regmap, "mainck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 01d943ebb680..9327129d574e 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -154,14 +154,14 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 29f24a5b1fef..67ff1132ef0d 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -98,7 +98,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) if (!at91sam9rl_pmc) return; - hw = at91_clk_register_rm9200_main(regmap, "mainck", NULL, main_xtal_hw); + hw = at91_clk_register_rm9200_main(regmap, "mainck", main_xtal_hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 8b2747091b03..7c08a5bdb974 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -176,14 +176,14 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 9b462becc693..e4ebc9f88e46 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -151,7 +151,6 @@ static const struct clk_ops main_osc_ops = { struct clk_hw * __init at91_clk_register_main_osc(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_parent_data *parent_data, bool bypass) { @@ -160,7 +159,7 @@ at91_clk_register_main_osc(struct regmap *regmap, struct clk_hw *hw; int ret; - if (!name || !(parent_name || parent_data)) + if (!name || !parent_data) return ERR_PTR(-EINVAL); osc = kzalloc(sizeof(*osc), GFP_KERNEL); @@ -169,10 +168,7 @@ at91_clk_register_main_osc(struct regmap *regmap, init.name = name; init.ops = &main_osc_ops; - if (parent_data) - init.parent_data = (const struct clk_parent_data *)parent_data; - else - init.parent_names = &parent_name; + init.parent_data = (const struct clk_parent_data *)parent_data; init.num_parents = 1; init.flags = CLK_IGNORE_UNUSED; @@ -401,7 +397,6 @@ static const struct clk_ops rm9200_main_ops = { struct clk_hw * __init at91_clk_register_rm9200_main(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) { struct clk_rm9200_main *clkmain; @@ -412,7 +407,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap, if (!name) return ERR_PTR(-EINVAL); - if (!(parent_name || parent_hw)) + if (!parent_hw) return ERR_PTR(-EINVAL); clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); @@ -421,10 +416,7 @@ at91_clk_register_rm9200_main(struct regmap *regmap, init.name = name; init.ops = &rm9200_main_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = 0; @@ -551,7 +543,6 @@ static const struct clk_ops sam9x5_main_ops = { struct clk_hw * __init at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, int num_parents) { @@ -564,7 +555,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, if (!name) return ERR_PTR(-EINVAL); - if (!(parent_hws || parent_names) || !num_parents) + if (!parent_hws || !num_parents) return ERR_PTR(-EINVAL); clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); @@ -573,10 +564,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, init.name = name; init.ops = &sam9x5_main_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_PARENT_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 7ab116a6e701..2bd3ad0a11fd 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -314,7 +314,7 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np) parent_data.name = parent_name; parent_data.fw_name = parent_name; - hw = at91_clk_register_main_osc(regmap, name, NULL, &parent_data, bypass); + hw = at91_clk_register_main_osc(regmap, name, &parent_data, bypass); if (IS_ERR(hw)) return; @@ -375,7 +375,7 @@ static void __init of_at91rm9200_clk_main_setup(struct device_node *np) if (!parent_hw) return; - hw = at91_clk_register_rm9200_main(regmap, name, NULL, parent_hw); + hw = at91_clk_register_rm9200_main(regmap, name, parent_hw); if (IS_ERR(hw)) return; @@ -414,8 +414,7 @@ static void __init of_at91sam9x5_clk_main_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9x5_main(regmap, name, NULL, parent_hws, - num_parents); + hw = at91_clk_register_sam9x5_main(regmap, name, parent_hws, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 07f372abcfd0..0b4de5648944 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -160,16 +160,13 @@ at91_clk_register_main_rc_osc(struct regmap *regmap, const char *name, u32 frequency, u32 accuracy); struct clk_hw * __init at91_clk_register_main_osc(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_parent_data *parent_data, bool bypass); struct clk_hw * __init at91_clk_register_rm9200_main(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, int num_parents); struct clk_hw * __init diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index 43997f686b87..dbf9841d341f 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -225,14 +225,13 @@ static void __init sam9x60_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, - &parent_data, 0); + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, 0); if (IS_ERR(hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 17a40cedd7fb..eda45c5b75f9 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -209,14 +209,14 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index e1c1ba907e3a..1a149e428971 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -157,14 +157,14 @@ static void __init sama5d3_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(mainck_hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index b4375cb1c3f3..71fd5714ce31 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -172,14 +172,14 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, &parent_data, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + mainck_hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index b2d27193741b..a6a79d1450ec 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1037,14 +1037,14 @@ static void __init sama7g5_pmc_setup(struct device_node *np) parent_data.name = main_xtal_name; parent_data.fw_name = main_xtal_name; - main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", NULL, + main_osc_hw = at91_clk_register_main_osc(regmap, "main_osc", &parent_data, bypass); if (IS_ERR(main_osc_hw)) goto err_free; parent_hws[0] = main_rc_hw; parent_hws[1] = main_osc_hw; - hw = at91_clk_register_sam9x5_main(regmap, "mainck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 21789EB64DD for ; Thu, 27 Jul 2023 05:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j8rH/SnP9WxHWgXUKjVkIEHRTigezaL15XqT1VfDBZ8=; b=YEmpwYvoMFk0+q JrkFDnhF04ROlt6UJFVLCiQmybMAsbDHn2PqryCgxJV3lbAbfyxzjD3B8ylXYfwX8i5Z8dLdq/XfB L7M28MocJ8377qJWdXJ9OKNkHsQRr37uqqcXSY7a6Kb8p1p433qVUnjqoTI6k+C5tQvBn4JPs0Hq8 p+drEt6kBN2o3aqb3ol0CASbmXvV0ICO6pt6SkH1fOKvqmD8MTbZYr8mjVZsRQfvUdrQc08z70zyV OjwOyTaxD1rqlqWgVP6QV0JPk9iP51vvmYP+owdLEUlc9keYuiA9AOzIMdVQEjKKck+q2DVMZ0jQz XmUEAp01BWwrPMcjySkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtg7-00CDMg-0M; Thu, 27 Jul 2023 05:36:47 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfi-00CD50-0b for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:24 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b8c81e36c0so3590965ad.0 for ; Wed, 26 Jul 2023 22:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436181; x=1691040981; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4OtWdYk/NDUHZT7tkNeY9e4iyBez1HDTbhZxXvmkFCQ=; b=QD2NBMhcRdYlRqIaz5M+38+QVNqIRmBZ0lnr4SBGwDgdbRbf4LKlXyS0BgCs/Nl+n7 jphVTSvTeDMjl40S9Np44r92m7n/69jucWK10YfeJfyoIYJ8xrvlN+tiqUikcehNCzL6 zNpShJvyc9lamns5KnYqOKrI/40ke/aLuq55F7pvxoBsST3F5Ffz7ELx7WJfPx5aaMs/ hUdl5o/tcVWa+BRYhQ19dZcNXUdH+jD6y234V3puOYK4ZR7lWvuCN8NfpYGeRWcX6bdk BZ/ieMr6/29F1C2gKpSD0cE3GYaeH/HZpWYBZ+9v/YcSrjdgkChor5HtLNgNB1HP80J4 UX1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436181; x=1691040981; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4OtWdYk/NDUHZT7tkNeY9e4iyBez1HDTbhZxXvmkFCQ=; b=WGPHbHvtbg5aE2PwNK9ZrJAOVHKzocGppFiRD4cV4nOWRpZqnfBp4gF2dJikG5rNaq yKUCruWO3GppBzoOnDw3gd8ZH28FU5gGXsjZ+yjphuz8DPzMLcA781vEFerEN/jWDJPl ZEyKU6X0a1U6gQ0D+nmgZgxNoKD4FrCUC/JeOKKRZDEVN2D3E3wO82Xri9ND8fwOIChR lY4gpwQAKXTGArs/jH0sSl8WjYA0gKxmvVFqDiqTpCyosU7juwItO/53SuTvRDU2nbX9 02gKqiMJeYGmkdRL4LdWVCJw0E3SHa0PeAYX2oVwZUjEMXoySoRi8+bLhZaZ8knpL4qm 6b7w== X-Gm-Message-State: ABy/qLZPMNF9xyEQG94ldyfOXsv09my+hYGWCuo/AG7zWv6gAOaP87Eq 4QmAUrtdXx19PE4TMy+lvbnkIg== X-Google-Smtp-Source: APBJJlFyN5WzNPTb08+mhYuBXBaQ2MgG4ob8LHeDLIDS+aMaWBB100k5LIj1rMlOoz9pNp5M0ooS4w== X-Received: by 2002:a17:902:da82:b0:1bb:c7bc:ceb4 with SMTP id j2-20020a170902da8200b001bbc7bcceb4mr4198969plx.60.1690436181683; Wed, 26 Jul 2023 22:36:21 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:21 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 32/42] clk: at91: clk-master: remove parent_names support Date: Thu, 27 Jul 2023 08:31:46 +0300 Message-Id: <20230727053156.13587-33-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223622_230238_F132D8A7 X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-master driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 5 ++--- drivers/clk/at91/at91sam9g45.c | 5 ++--- drivers/clk/at91/at91sam9n12.c | 5 ++--- drivers/clk/at91/at91sam9rl.c | 5 ++--- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-master.c | 23 ++++++----------------- drivers/clk/at91/dt-compat.c | 4 ++-- drivers/clk/at91/pmc.h | 6 ++---- drivers/clk/at91/sam9x60.c | 4 ++-- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 5 ++--- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 5 ++--- 14 files changed, 32 insertions(+), 51 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 441b744eed5e..9e32189ac374 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -147,14 +147,14 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) parent_hws[2] = at91rm9200_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91rm9200_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91rm9200_master_layout, &rm9200_mck_characteristics, &rm9200_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91rm9200_master_layout, &rm9200_mck_characteristics, &rm9200_mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 709f01c4dab9..538bbecdbdeb 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -419,15 +419,14 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, parent_hws[2] = at91sam9260_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91sam9260_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91rm9200_master_layout, data->mck_characteristics, &at91sam9260_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91rm9200_master_layout, data->mck_characteristics, &at91sam9260_mck_lock, diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 535f3af23560..fbd4d68dae56 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -163,15 +163,14 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) parent_hws[2] = at91sam9g45_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91sam9g45_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91rm9200_master_layout, &mck_characteristics, &at91sam9g45_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91rm9200_master_layout, &mck_characteristics, &at91sam9g45_mck_lock, diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 9327129d574e..e9b266d1de91 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -190,15 +190,14 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) parent_hws[2] = at91sam9n12_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91sam9n12_pmc->chws[PMC_PLLBCK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &at91sam9n12_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91sam9x5_master_layout, &mck_characteristics, &at91sam9n12_mck_lock, diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 67ff1132ef0d..1e027fa938b6 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -123,15 +123,14 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) parent_hws[2] = at91sam9rl_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91sam9rl_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91rm9200_master_layout, &sam9rl_mck_characteristics, &sam9rl_mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91rm9200_master_layout, &sam9rl_mck_characteristics, &sam9rl_mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 7c08a5bdb974..27c41fc7b097 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -211,13 +211,13 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, parent_hws[2] = at91sam9x5_pmc->chws[PMC_PLLACK]; parent_hws[3] = at91sam9x5_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index 15c46489ba85..1ee19c670213 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -472,7 +472,6 @@ static const struct clk_ops master_pres_ops = { static struct clk_hw * __init at91_clk_register_master_internal(struct regmap *regmap, const char *name, int num_parents, - const char **parent_names, struct clk_hw **parent_hws, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, @@ -485,7 +484,7 @@ at91_clk_register_master_internal(struct regmap *regmap, unsigned long irqflags; int ret; - if (!name || !num_parents || !(parent_names || parent_hws) || !lock) + if (!name || !num_parents || !parent_hws || !lock) return ERR_PTR(-EINVAL); master = kzalloc(sizeof(*master), GFP_KERNEL); @@ -494,10 +493,7 @@ at91_clk_register_master_internal(struct regmap *regmap, init.name = name; init.ops = ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = flags; @@ -530,22 +526,20 @@ at91_clk_register_master_internal(struct regmap *regmap, struct clk_hw * __init at91_clk_register_master_pres(struct regmap *regmap, const char *name, int num_parents, - const char **parent_names, struct clk_hw **parent_hws, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock) { return at91_clk_register_master_internal(regmap, name, num_parents, - parent_names, parent_hws, layout, + parent_hws, layout, characteristics, &master_pres_ops, lock, CLK_SET_RATE_GATE); } struct clk_hw * __init -at91_clk_register_master_div(struct regmap *regmap, - const char *name, const char *parent_name, +at91_clk_register_master_div(struct regmap *regmap, const char *name, struct clk_hw *parent_hw, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock, u32 flags, u32 safe_div) @@ -559,7 +553,6 @@ at91_clk_register_master_div(struct regmap *regmap, ops = &master_div_ops_chg; hw = at91_clk_register_master_internal(regmap, name, 1, - parent_name ? &parent_name : NULL, parent_hw ? &parent_hw : NULL, layout, characteristics, ops, lock, flags); @@ -811,7 +804,6 @@ static const struct clk_ops sama7g5_master_ops = { struct clk_hw * __init at91_clk_sama7g5_register_master(struct regmap *regmap, const char *name, int num_parents, - const char **parent_names, struct clk_hw **parent_hws, u32 *mux_table, spinlock_t *lock, u8 id, @@ -824,7 +816,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, unsigned int val; int ret; - if (!name || !num_parents || !(parent_names || parent_hws) || !mux_table || + if (!name || !num_parents || !parent_hws || !mux_table || !lock || id > MASTER_MAX_ID) return ERR_PTR(-EINVAL); @@ -834,10 +826,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, init.name = name; init.ops = &sama7g5_master_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; if (chg_pid >= 0) diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 2bd3ad0a11fd..590d0f115647 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -487,12 +487,12 @@ of_at91_clk_master_setup(struct device_node *np, return; hw = at91_clk_register_master_pres(regmap, "masterck_pres", num_parents, - NULL, parent_hws, layout, + parent_hws, layout, characteristics, &mck_lock); if (IS_ERR(hw)) goto out_free_characteristics; - hw = at91_clk_register_master_div(regmap, name, NULL, hw, + hw = at91_clk_register_master_div(regmap, name, hw, layout, characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 0b4de5648944..c26dcbc8c475 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -171,15 +171,14 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_master_pres(struct regmap *regmap, const char *name, - int num_parents, const char **parent_names, - struct clk_hw **parent_hws, + int num_parents, struct clk_hw **parent_hws, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock); struct clk_hw * __init at91_clk_register_master_div(struct regmap *regmap, const char *name, - const char *parent_names, struct clk_hw *parent_hw, + struct clk_hw *parent_hw, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock, u32 flags, u32 safe_div); @@ -187,7 +186,6 @@ at91_clk_register_master_div(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_sama7g5_register_master(struct regmap *regmap, const char *name, int num_parents, - const char **parent_names, struct clk_hw **parent_hws, u32 *mux_table, spinlock_t *lock, u8 id, bool critical, int chg_pid); diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index dbf9841d341f..ce54684e4684 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -285,13 +285,13 @@ static void __init sam9x60_pmc_setup(struct device_node *np) parent_hws[1] = sam9x60_pmc->chws[PMC_MAIN]; parent_hws[2] = sam9x60_pmc->chws[PMC_PLLACK]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 3, - NULL, parent_hws, &sam9x60_master_layout, + parent_hws, &sam9x60_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, &sam9x60_master_layout, + hw, &sam9x60_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index eda45c5b75f9..a25184ea7aef 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -265,13 +265,13 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_hws[2] = sama5d2_pmc->chws[PMC_PLLACK]; parent_hws[3] = sama5d2_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 1a149e428971..5c0ef9416370 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -190,14 +190,13 @@ static void __init sama5d3_pmc_setup(struct device_node *np) parent_hws[2] = sama5d3_pmc->chws[PMC_PLLACK]; parent_hws[3] = sama5d3_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 71fd5714ce31..88841d7d5477 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -205,13 +205,13 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_hws[2] = sama5d4_pmc->chws[PMC_PLLACK]; parent_hws[3] = sama5d4_pmc->chws[PMC_UTMI]; hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, + parent_hws, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw, + hw = at91_clk_register_master_div(regmap, "masterck_div", hw, &at91sam9x5_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index a6a79d1450ec..d18b2b7885e0 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1103,8 +1103,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) } } - hw = at91_clk_register_master_div(regmap, "mck0", NULL, - sama7g5_plls[PLL_ID_CPU][1].hw, + hw = at91_clk_register_master_div(regmap, "mck0", sama7g5_plls[PLL_ID_CPU][1].hw, &mck0_layout, &mck0_characteristics, &pmc_mck0_lock, CLK_GET_RATE_NOCACHE, 5); if (IS_ERR(hw)) @@ -1138,7 +1137,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) sama7g5_mckx[i].ep_count); hw = at91_clk_sama7g5_register_master(regmap, sama7g5_mckx[i].n, - num_parents, NULL, parent_hws, mux_table, + num_parents, parent_hws, mux_table, &pmc_mckX_lock, sama7g5_mckx[i].id, sama7g5_mckx[i].c, sama7g5_mckx[i].ep_chg_id); From patchwork Thu Jul 27 05:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E802CEB64DD for ; Thu, 27 Jul 2023 05:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+2QbgalvFxouGiRqT6NjiCnrZxluLJtFPix4JVci1T8=; b=wJ+2knA4SmaVjx QRf2i0PimOEumyn6IeVMG1anSm2m067mqBRX+CEsKte5qYMcpVx0KMC1Gv1cUP23e5qvVZM3OT0vt OkXIzQtAhDChOULzbxmRsTnAZJjen2IDq8XvT7f4ECiZh3tYrvLVTDZQrOPc1xw5Uub1bBk826Jgs uRWYldETLiB3Op2klg2ggXhCfM56ebv5XKZDewoluPpA1NKmlBJzT7Qu79wqU/ksEcatJCEkN/UWv BlxEPctfwVZF/hHi+7+TU8hNz2LT2TLl6lh1sAhY/gDJUO3LsvvBvAZz85j8qGfUu5KtMEuyz4RJF snfnD3I3SAdTuBhHCQlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOtg8-00CDNR-0b; Thu, 27 Jul 2023 05:36:48 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfr-00CD9L-2f for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:34 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-569fdf846edso435841eaf.2 for ; Wed, 26 Jul 2023 22:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436189; x=1691040989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aHiZnC//dKhKHVPO0qNmCO5eqfKdG5DqSJMZ1aUfAvU=; b=XTzAZjbSrpWj9+zWSZTLphmvyX0gW2ZlfsxwTUDO8CbQmuQytLUbOi6j/FcxQFoZfZ XyA1sEfCbCquleeQFsOB0qBYMTvkeAddSMeczxr3pfyBkXyNEAUNRq42Tm/D38S0pPgQ OWWkqozWo7HPgwTOuOTPadQHEXKmb+0s5Dvs8bq7A71n1nDdUuoMAzVMfC2EQ2HWLAtR ShlLjVEhAoIjaXHCxBo57JaGB2GWIDkDZZcBFe+jPSPi2Y95lgq2p08LlZrIU1BqwUOS sCpLP3fA7ufQCjAWVR30Lzibvq4VClY/3vtTKaVDXQUbdiv6E8u05m/lohnmzLqlFFvr CcZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436189; x=1691040989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aHiZnC//dKhKHVPO0qNmCO5eqfKdG5DqSJMZ1aUfAvU=; b=HM42rqhK7XYTIR/Rxt/G7mjwcsZ/OzyPIr2hePgWYu7ff3zyEljuS+Q1rYSd1Xz81S P0dH2C1TUe729bZCVP8E4vU0+fWgtLSY8jDumXNdprPJslI4hgPO7golWMvSLFC0hhuQ ffPmiiTtKmpzcToxp6ZUDzwHLsEY1LwXEgP2VgU5AhFG0p0gZgFJrVyzYOzZg5ldLHUz rH9fQFMHMvnWPZqd9l9vbjM6ddxCiAlgffcPvOR+5kGcKmXjjfIswqHcsbR3w/56qrRe QFiWF5bSWvWrpk/lYNS42E94tGAseX7vS9HD+F73suWx2JdvCIS6hf/fd/5ddozIcAOt hyDg== X-Gm-Message-State: ABy/qLZbR454XVARQ1XEJiAxMXVxrsC7bJq3pvKsHBzNZivPQPfd6H4t dsW/dLLCTD6O5ff+uI4m0JdSnw== X-Google-Smtp-Source: APBJJlGuQ00Fuq1b7Mx/AmGyo5y38uf06QC6VXRVfFWX5zi5TqxvXLHpcZKB5MuFsluVWmuXDtvvjQ== X-Received: by 2002:a05:6808:428e:b0:3a4:8ac7:3407 with SMTP id dq14-20020a056808428e00b003a48ac73407mr1803669oib.42.1690436188765; Wed, 26 Jul 2023 22:36:28 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:28 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 33/42] clk: at91: clk-peripheral: remove parent_names support Date: Thu, 27 Jul 2023 08:31:47 +0300 Message-Id: <20230727053156.13587-34-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223631_890837_B644343C X-CRM114-Status: GOOD ( 17.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-peripheral driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-peripheral.c | 20 ++++++-------------- drivers/clk/at91/dt-compat.c | 3 +-- drivers/clk/at91/pmc.h | 6 ++---- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 1 - 14 files changed, 22 insertions(+), 34 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 9e32189ac374..7cb90d71d0ce 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -207,7 +207,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91rm9200_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91rm9200_periphck[i].n, - NULL, at91rm9200_pmc->chws[PMC_MCK], + at91rm9200_pmc->chws[PMC_MCK], at91rm9200_periphck[i].id); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 538bbecdbdeb..9839bd4586cd 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -486,7 +486,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, for (i = 0; i < data->num_pck; i++) { hw = at91_clk_register_peripheral(regmap, data->pck[i].n, - NULL, at91sam9260_pmc->chws[PMC_MCK], + at91sam9260_pmc->chws[PMC_MCK], data->pck[i].id); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index fbd4d68dae56..e7f2173ff6c1 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -225,7 +225,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91sam9g45_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91sam9g45_periphck[i].n, - NULL, at91sam9g45_pmc->chws[PMC_MCK], + at91sam9g45_pmc->chws[PMC_MCK], at91sam9g45_periphck[i].id); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index e9b266d1de91..2d26c202b257 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -254,7 +254,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9n12_pcr_layout, at91sam9n12_periphck[i].n, - NULL, at91sam9n12_pmc->chws[PMC_MCK], + at91sam9n12_pmc->chws[PMC_MCK], at91sam9n12_periphck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 1e027fa938b6..c7fc4bcf4e5b 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -175,7 +175,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(at91sam9rl_periphck); i++) { hw = at91_clk_register_peripheral(regmap, at91sam9rl_periphck[i].n, - NULL, at91sam9rl_pmc->chws[PMC_MCK], + at91sam9rl_pmc->chws[PMC_MCK], at91sam9rl_periphck[i].id); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 27c41fc7b097..8da2732a73fa 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -287,7 +287,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9x5_pcr_layout, at91sam9x5_periphck[i].n, - NULL, at91sam9x5_pmc->chws[PMC_MCK], + at91sam9x5_pmc->chws[PMC_MCK], at91sam9x5_periphck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) @@ -300,7 +300,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &at91sam9x5_pcr_layout, extra_pcks[i].n, - NULL, at91sam9x5_pmc->chws[PMC_MCK], + at91sam9x5_pmc->chws[PMC_MCK], extra_pcks[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c index c173a44c800a..73c90fa535e0 100644 --- a/drivers/clk/at91/clk-peripheral.c +++ b/drivers/clk/at91/clk-peripheral.c @@ -97,15 +97,14 @@ static const struct clk_ops peripheral_ops = { struct clk_hw * __init at91_clk_register_peripheral(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, - u32 id) + struct clk_hw *parent_hw, u32 id) { struct clk_peripheral *periph; struct clk_init_data init = {}; struct clk_hw *hw; int ret; - if (!name || !(parent_name || parent_hw) || id > PERIPHERAL_ID_MAX) + if (!name || !parent_hw || id > PERIPHERAL_ID_MAX) return ERR_PTR(-EINVAL); periph = kzalloc(sizeof(*periph), GFP_KERNEL); @@ -114,10 +113,7 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name, init.name = name; init.ops = &peripheral_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = 0; @@ -447,8 +443,7 @@ static const struct clk_ops sam9x5_peripheral_chg_ops = { struct clk_hw * __init at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, const struct clk_pcr_layout *layout, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, + const char *name, struct clk_hw *parent_hw, u32 id, const struct clk_range *range, int chg_pid, unsigned long flags) { @@ -457,7 +452,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, struct clk_hw *hw; int ret; - if (!name || !(parent_name || parent_hw)) + if (!name || !parent_hw) return ERR_PTR(-EINVAL); periph = kzalloc(sizeof(*periph), GFP_KERNEL); @@ -465,10 +460,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, return ERR_PTR(-ENOMEM); init.name = name; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = flags; if (chg_pid < 0) { diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 590d0f115647..8f67a7a94c54 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -561,7 +561,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) if (type == PERIPHERAL_AT91RM9200) { hw = at91_clk_register_peripheral(regmap, name, - NULL, parent_hw, id); + parent_hw, id); } else { struct clk_range range = CLK_RANGE(0, 0); unsigned long flags = 0; @@ -582,7 +582,6 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type) &pmc_pcr_lock, &dt_pcr_layout, name, - NULL, parent_hw, id, &range, INT_MIN, diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index c26dcbc8c475..54088c6d4de4 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -192,13 +192,11 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, struct clk_hw * __init at91_clk_register_peripheral(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, - u32 id); + struct clk_hw *parent_hw, u32 id); struct clk_hw * __init at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, const struct clk_pcr_layout *layout, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, + const char *name, struct clk_hw *parent_hw, u32 id, const struct clk_range *range, int chg_pid, unsigned long flags); diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index ce54684e4684..148873fced1b 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -348,7 +348,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sam9x60_pcr_layout, sam9x60_periphck[i].n, - NULL, sam9x60_pmc->chws[PMC_MCK], + sam9x60_pmc->chws[PMC_MCK], sam9x60_periphck[i].id, &range, INT_MIN, sam9x60_periphck[i].flags); diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index a25184ea7aef..809926c63078 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -337,7 +337,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_periphck[i].n, - NULL, sama5d2_pmc->chws[PMC_MCK], + sama5d2_pmc->chws[PMC_MCK], sama5d2_periphck[i].id, &range, INT_MIN, sama5d2_periphck[i].flags); @@ -351,7 +351,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d2_pcr_layout, sama5d2_periph32ck[i].n, - NULL, sama5d2_pmc->chws[PMC_MCK2], + sama5d2_pmc->chws[PMC_MCK2], sama5d2_periph32ck[i].id, &sama5d2_periph32ck[i].r, INT_MIN, 0); diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 5c0ef9416370..4453f47798b7 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -259,7 +259,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d3_pcr_layout, sama5d3_periphck[i].n, - NULL, sama5d3_pmc->chws[PMC_MCK], + sama5d3_pmc->chws[PMC_MCK], sama5d3_periphck[i].id, &sama5d3_periphck[i].r, INT_MIN, diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 88841d7d5477..9f6ad0699702 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -282,7 +282,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d4_pcr_layout, sama5d4_periphck[i].n, - NULL, sama5d4_pmc->chws[PMC_MCK], + sama5d4_pmc->chws[PMC_MCK], sama5d4_periphck[i].id, &range, INT_MIN, sama5d4_periphck[i].flags); @@ -296,7 +296,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama5d4_pcr_layout, sama5d4_periph32ck[i].n, - NULL, sama5d4_pmc->chws[PMC_MCK2], + sama5d4_pmc->chws[PMC_MCK2], sama5d4_periph32ck[i].id, &range, INT_MIN, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index d18b2b7885e0..9cba1ad116a8 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1195,7 +1195,6 @@ static void __init sama7g5_pmc_setup(struct device_node *np) hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock, &sama7g5_pcr_layout, sama7g5_periphck[i].n, - NULL, sama7g5_mckx[sama7g5_periphck[i].p].hw, sama7g5_periphck[i].id, &sama7g5_periphck[i].r, From patchwork Thu Jul 27 05:31:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1A0A2C41513 for ; Thu, 27 Jul 2023 05:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rxgdfUK0k2U7CUHdqeMro5l42YrPwFKWcQ0pf7Fu0EQ=; b=Kk5wZX1uX7PrJo WCUFrWYFMgber1KX6xKwTtcS0+uv23A4SRuSdI5Oh3ebqTlnBJKhOv6wpf2nq+VpxZWfFKJsvvhtm PTYVeuJhT9XYUaYse8bgDIPUNZ44rUwFDs18HWvo3jfLbemyV7itG6PTiJ0k7fBr5Jk/HUfTwk0FP 1t8De1LbiGYgdYxd83oUlJSzWHjCKIQz6O9zbgAeri5Wj0thNfZZvnFgORfcvrQM9y5nAhC+q3a1e /r81IQtZEdoLaTcyZcbAF9K0W6w+N5gRFVAbcS5OkUZia2/Pu2Iu6/SFbD5tsLZZsU8AAAG9OkV5b 2s2lfT+ZWbcgyL3Y6oxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOth9-00CDmX-1I; Thu, 27 Jul 2023 05:37:51 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtfy-00CDEH-2v for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:42 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bba54f7eefso11597025ad.1 for ; Wed, 26 Jul 2023 22:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436196; x=1691040996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ByePe5DbQDlx4lAkxeKpmFm+qeO1gWfKXQQMnKlrww=; b=jOsuR1pJ6p+T0RXaWm+bg+0pSTTcoYNwaUJJ7b6ofHkn/FvRS6BvSv/U8dU5ZyVo4K uw26yqnLwmNcjgB+iEO/l5cGtkrjDbdpFfIcgOP4Dc7zS0+H1ijaX/WWd5Fcui7Yj+RZ LcD2cDWYdTv7Rn9Kmc6t/R7r7VnUumQFa4T9T4EXfRYP6K268dKKpka/spxSncyvONQs vvoyv7pRCotPkGypQFga2Mm0ufvIhwZ/C6nvL/WyMxiDVimTWoKA6/hI3b2P6XjRN8p2 5ZBsUGEcDi7LfqAslqvZjyfA8vg1xXcRCjdClPjlqPh/SxQiYEBF/16yGv9Fs0XQHjh+ G8hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436196; x=1691040996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ByePe5DbQDlx4lAkxeKpmFm+qeO1gWfKXQQMnKlrww=; b=GXQCmgdKAzog6hevT++i6TkYv/EhiKBohngFdjv5DCqDQRmGK8rtRwipE9RE4bPLM2 JIVZmPp5nv2A7J495tgzdWpKpsD63HNODehs1kbJdOUEpCziLfaPCYFkenY8HiCFbCNW yquSxJsV5NjpiR69GIXp1zDk3EpIIV7fcX/+nNzBV7lAJcZiNr9a7owGorKVhVzlwzjT RepM6VvWF4Z0/2xBLiFCjcA3L4lrcvKW77K2qlHxnsIWYkuEDmF6JSYlVJ/+iik5JrLl qQMLBP1DwEqv2LAA+t7pjoqiYZFKFKUv84YHyovHvK96VopTJiizEAI9mFWIdI99asec vXog== X-Gm-Message-State: ABy/qLZXO0Eqh5nk9RWLGvan5bkj09N6cry8v9C5/MuBRcHuSRzR7CBy KjPzYhTEfgaYyTTnkvhiJVtH9A== X-Google-Smtp-Source: APBJJlEe+63OnRONr3wZoGDYR7Z2G7TPoO0Mvk3H1ayi9D/amEEYYcLJK00E/hIcMCjtsLvLG9xeUQ== X-Received: by 2002:a17:902:d2cb:b0:1bb:b2f7:e075 with SMTP id n11-20020a170902d2cb00b001bbb2f7e075mr2143020plc.7.1690436195828; Wed, 26 Jul 2023 22:36:35 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:35 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 34/42] clk: at91: clk-pll: remove parent_names support Date: Thu, 27 Jul 2023 08:31:48 +0300 Message-Id: <20230727053156.13587-35-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223638_942342_5778C34C X-CRM114-Status: GOOD ( 14.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-pll driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 4 ++-- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 4 ++-- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-pll.c | 7 ++----- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 12 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 7cb90d71d0ce..be88279c3443 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -126,7 +126,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91rm9200_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91rm9200_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) @@ -134,7 +134,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91rm9200_pmc->chws[PMC_MAIN], 1, + hw = at91_clk_register_pll(regmap, "pllbck", at91rm9200_pmc->chws[PMC_MAIN], 1, &at91rm9200_pll_layout, &rm9200_pll_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 9839bd4586cd..bd5e0ce432d3 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -398,7 +398,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, slow_xtal_hw = hw; } - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9260_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91sam9260_pmc->chws[PMC_MAIN], 0, data->plla_layout, data->plla_characteristics); if (IS_ERR(hw)) @@ -406,7 +406,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91sam9260_pmc->chws[PMC_MAIN], 1, + hw = at91_clk_register_pll(regmap, "pllbck", at91sam9260_pmc->chws[PMC_MAIN], 1, data->pllb_layout, data->pllb_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index e7f2173ff6c1..ca585440c54f 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -141,7 +141,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9g45_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91sam9g45_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 2d26c202b257..2109b8cdf4ad 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -167,7 +167,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9n12_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91sam9n12_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; @@ -178,7 +178,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_pll(regmap, "pllbck", NULL, at91sam9n12_pmc->chws[PMC_MAIN], 1, + hw = at91_clk_register_pll(regmap, "pllbck", at91sam9n12_pmc->chws[PMC_MAIN], 1, &at91rm9200_pll_layout, &pllb_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index c7fc4bcf4e5b..4ae8028600d5 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -104,7 +104,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9rl_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91sam9rl_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &sam9rl_plla_characteristics); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 8da2732a73fa..4cbb72a29f14 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -189,7 +189,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, at91sam9x5_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", at91sam9x5_pmc->chws[PMC_MAIN], 0, &at91rm9200_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index afd48cbaa6db..2ba068718f83 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -310,7 +310,7 @@ static const struct clk_ops pll_ops = { struct clk_hw * __init at91_clk_register_pll(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, u8 id, + struct clk_hw *parent_hw, u8 id, const struct clk_pll_layout *layout, const struct clk_pll_characteristics *characteristics) { @@ -330,10 +330,7 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, init.name = name; init.ops = &pll_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 8f67a7a94c54..13e251e59853 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -740,7 +740,7 @@ of_at91_clk_pll_setup(struct device_node *np, if (!characteristics) return; - hw = at91_clk_register_pll(regmap, name, NULL, parent_hw, id, layout, + hw = at91_clk_register_pll(regmap, name, parent_hw, id, layout, characteristics); if (IS_ERR(hw)) goto out_free_characteristics; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 54088c6d4de4..5fd1e76b3ec7 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -202,7 +202,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init at91_clk_register_pll(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, u8 id, + struct clk_hw *parent_hw, u8 id, const struct clk_pll_layout *layout, const struct clk_pll_characteristics *characteristics); struct clk_hw * __init diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 809926c63078..b99a8bb9bf9a 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -221,7 +221,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) goto err_free; sama5d2_pmc->chws[PMC_MAIN] = hw; - hw = at91_clk_register_pll(regmap, "pllack", NULL, sama5d2_pmc->chws[PMC_MAIN], 0, + hw = at91_clk_register_pll(regmap, "pllack", sama5d2_pmc->chws[PMC_MAIN], 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 4453f47798b7..35a9dfd0e66d 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -168,7 +168,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(mainck_hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", NULL, mainck_hw, 0, + hw = at91_clk_register_pll(regmap, "pllack", mainck_hw, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 9f6ad0699702..ae76c59c7d42 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -183,7 +183,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_pll(regmap, "pllack", NULL, mainck_hw, 0, + hw = at91_clk_register_pll(regmap, "pllack", mainck_hw, 0, &sama5d3_pll_layout, &plla_characteristics); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 246E9EB64DD for ; Thu, 27 Jul 2023 05:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2a0nyDOdLzScMmkWxEzjl5ee5V4OJUJdjf8mFczNljk=; b=4rdTNdQStXEfH3 uqAk/z8KPgQZEQXG/5IvemQQCQU4QVaxymX2q3JzI8aloZitMFrvYBiLlugk2tTSyJNQmHSgyqdnG gWmihMmunbr0T+VVafJMw7iVvYSSEFeA6tAQmu1AU+5Xpl84/dVNXoW/dOk5jPXVS+JXfUiRblaGT LdFsAmRR0aZE1P27h6fYSmHmpo2XWKY7xU29zLREhaCAWkJS5fdsqV5ef+Y/3T+wqIrTiUV2YFa6X X+fhyNJeuhjnEdhVVYXcak8JQeJV7g3VaVhzjbhWX/HtVGfBOg6fp5PTzF4IwGwt1MtVq0esRKp+n YxrXCYeGuXJWbSJRWSDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOth9-00CDn3-2z; Thu, 27 Jul 2023 05:37:51 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtg3-00CDJc-1u for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:36:45 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bb81809ca8so4398935ad.3 for ; Wed, 26 Jul 2023 22:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436203; x=1691041003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wrKKqV0HQO2EhBMgbawQJpGyCpTF7In/U2sRYiMWbK8=; b=D5aKsLXGy2j6jm8tkzlTTceO4RSJRpKu2I3aRV4a0QzXpd5bjWkf+kAqE3F3BaNRfX DxaJ8Pde3fczdc/xBBGN/rAm0qcu8nBsr5/DMRo2EY6KhqcJL6B8It06mbh1wmECKQi+ lXciwovoIn1XmRc1i3qlC0eKwscXTiOGxSvgnOBGDjs5uCo8FJuiENt0wdOflwftWEM6 Z4bsbLB42Al2coRZvmXCMI4Of6jh6UC9ad+64wVD6PdAzwwvKuhWmE64zJU8vA6FZKfe eYFe0JJzcc+6TnQCAASwcDr20VpiO+it/Nl6pKOtUzOyZiIhmtbWNVsEaL65+KXKLIgN 69Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436203; x=1691041003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wrKKqV0HQO2EhBMgbawQJpGyCpTF7In/U2sRYiMWbK8=; b=Wdb6hEIas2+CrpFb6EKoCT4MSLAxSkaR4OI9HOJWD5xV0lexwPqLdVH1PvBfb3xGLI 3zjYoN3VqmLAFRd4rLkigmwx55KdBf0JAfEjthbJ1EjMTpdChK4ch0PoOizvvm7UBoIa v1ARHcFwac8vgluisgitBaWGKrMNoU2DH9W4CXzKDQl58/s90fxzU1tsSC1V5OpXhPXq sVI/5Foah4lmE2Bvgyq1LKjRL8yDQPsICsiSfbz+hy+a0Qi3EQJ5MXLGezSiIwv71Frf 3gi5jv/jL5uqph6cuIa7y2CN3+6JHx1Dymb4G1FXSsp2vreWjUZhLQcyVThIQCWSCsth +8sQ== X-Gm-Message-State: ABy/qLYx+ZQF6KEBtG41MxHwB2UUer5izK10naKqretuLVJkgp3Zk/yw LHXD8C/1vd3oIDOb1LmUStPRgw== X-Google-Smtp-Source: APBJJlE+dM7AhEcN3LsCBRnRDe2BI9iVnvhfO+ozfURw/g7mC/rtS5q2NMPSSbrQGFnSw/NceZ2jnQ== X-Received: by 2002:a17:902:b413:b0:1b8:2c6f:3248 with SMTP id x19-20020a170902b41300b001b82c6f3248mr3913704plr.39.1690436202969; Wed, 26 Jul 2023 22:36:42 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:42 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 35/42] clk: at91: clk-plldiv: remove parent_names support Date: Thu, 27 Jul 2023 08:31:49 +0300 Message-Id: <20230727053156.13587-36-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223643_682124_A6778747 X-CRM114-Status: GOOD ( 15.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-plldiv driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-plldiv.c | 11 +++-------- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 9 files changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index ca585440c54f..2bda11df7f0d 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -146,7 +146,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 2109b8cdf4ad..0c22b82ef368 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -172,7 +172,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 4cbb72a29f14..c2c5e9fe669c 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -194,7 +194,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c index 1d5a0a6d299d..e4efb4ccab33 100644 --- a/drivers/clk/at91/clk-plldiv.c +++ b/drivers/clk/at91/clk-plldiv.c @@ -72,7 +72,7 @@ static const struct clk_ops plldiv_ops = { struct clk_hw * __init at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct clk_plldiv *plldiv; struct clk_hw *hw; @@ -85,13 +85,8 @@ at91_clk_register_plldiv(struct regmap *regmap, const char *name, init.name = name; init.ops = &plldiv_ops; - if (parent_hw) { - init.parent_hws = (const struct clk_hw **)&parent_hw; - init.num_parents = 1; - } else { - init.parent_names = parent_name ? &parent_name : NULL; - init.num_parents = parent_name ? 1 : 0; - } + init.parent_hws = parent_hw ? (const struct clk_hw **)&parent_hw : NULL; + init.num_parents = parent_hw ? 1 : 0; init.flags = CLK_SET_RATE_GATE; plldiv->hw.init = &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 13e251e59853..85193e4656b9 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -805,7 +805,7 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91_clk_register_plldiv(regmap, name, NULL, parent_hw); + hw = at91_clk_register_plldiv(regmap, name, parent_hw); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 5fd1e76b3ec7..eed88a480b11 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -207,7 +207,7 @@ at91_clk_register_pll(struct regmap *regmap, const char *name, const struct clk_pll_characteristics *characteristics); struct clk_hw * __init at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index b99a8bb9bf9a..75d5b1a3733b 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -226,7 +226,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 35a9dfd0e66d..a50e82460e70 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -173,7 +173,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index ae76c59c7d42..b6b41ceae13c 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -188,7 +188,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) if (IS_ERR(hw)) goto err_free; - hw = at91_clk_register_plldiv(regmap, "plladivck", NULL, hw); + hw = at91_clk_register_plldiv(regmap, "plladivck", hw); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6834FC001DC for ; Thu, 27 Jul 2023 05:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5rCw3xeRtrRtSk3q89MmkYsaWqpa9PK8yK7D0r6WZGQ=; b=NQMy0jdDImx+kj +4pDolKIwR58GjqCK0V7pHoH5YM2N+AglzKKxPXYSuFml/GCu/5oNP3jjWXm7gQjYKdNIGQ1N8Kjo n/3z8RZW3iBkWh8l7hwn8aXW7uqgBe5gt8mnCKmVsAPAN+eiNixXm4jwkFXWHn71h7aNG5Y+6Ao28 ehu28PzlTjpeZ9xhEHak5NuhQive4NQaR9t8gKQ9Nut8vLaX92glST+e0XRc7rdbkzY7F2kABNn3/ 1svAFSJsim0Tso6VguDb92YCMWDtDzFLYVlp+J392GpMU/ZmwaJuEGFNpfJ5ZhG3mJoiWgdLdXqGh o6WccZMTI6/tp8bUWVOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthA-00CDnK-1J; Thu, 27 Jul 2023 05:37:52 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgD-00CDPK-13 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:01 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b8ad9eede0so4511075ad.1 for ; Wed, 26 Jul 2023 22:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436210; x=1691041010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Q+Yl7hN1VwiQcIkQgiV66Esb2RGUFiRs91OdVgtBh0=; b=M0glJThlvwbGMQ+zCXsOdBo8zfEv8aUEkaRD1lWoFtxH8KWlcevQsd8CVfI5jCSbV5 GviLj1eQYirIuNhvCwfOZYnKqOeGaDAGmQ81PpzBhpgCl3DFaXkBEbmGf4feY8CwCXbh sPrPP2xuvoBD4ePCM3Fdsz0idTiBaWIkTMf9ffxGN7PhhFC3fIG0ZaNpq37DJACJcPvZ MPDIofZp+XOLQELb9C6kXuwvLBe4xAz0PIaOHCipxoc6tIgR0Hi0laRXYOu1IDGDx8Bu zamHJme4DZQSOzBVNzw88sbqFlCLSPMF60KtvVt6e7of+G+gm7KBRLKOf5yQUjDJlyKR TyTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436210; x=1691041010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Q+Yl7hN1VwiQcIkQgiV66Esb2RGUFiRs91OdVgtBh0=; b=ISEaw39GNWCNekebQobClL+rd5heFOtsghqU2EzWlVMZMRhl6uZz2cm4lZCKdfzQU3 WPzIopPawp4gQrzkrQvJIA0ZAd2+tz96a9UgcZdZYVsCz2fSXC7o69H4kSKtDWSl6GGy KroYDc2TTnTgNHD+H9vXbUZ36zGRBhkb3xyS4REacfFf6rbMwzEmFzMHTVQ2QUSHN0hE YtlxiRZoe0wNEMo9PumZfp1m+TZvLF7h6DKOvGEDy7OXKftHeGDYc/6A3dGCVyXmXNcH Su654YcJnrNtvI2GLERYPTbBtceNsns2Wh03mA5uAUozgFIFtnuGDH8nx1M2QYoVd6t4 kz9g== X-Gm-Message-State: ABy/qLbhxZPAzTwQBlQ4psDNX2JbL0wOlgTTOe+kVJxusLzIi/COKxTx xxdbjWs9IdyvvgVtTyx+IvYAQw== X-Google-Smtp-Source: APBJJlHVSJGhP4xROul0kKK8gz7i1cwuobZUOhpNAjMjCbAOJfpC/qq2G3ht/RzeTU5qSvAZiVg1jw== X-Received: by 2002:a17:902:ea06:b0:1b8:4e00:96b with SMTP id s6-20020a170902ea0600b001b84e00096bmr5499076plg.9.1690436210347; Wed, 26 Jul 2023 22:36:50 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:50 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 36/42] clk: at91: clk-programmable: remove parent_names support Date: Thu, 27 Jul 2023 08:31:50 +0300 Message-Id: <20230727053156.13587-37-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223653_402975_5F6B9D7B X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-programmable driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-programmable.c | 10 +++------- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- drivers/clk/at91/sama7g5.c | 2 +- 14 files changed, 16 insertions(+), 20 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index be88279c3443..9305cb6eaef2 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -178,7 +178,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 4, i, + parent_hws, 4, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index bd5e0ce432d3..c118ff23548b 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -451,7 +451,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 4, i, + parent_hws, 4, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 2bda11df7f0d..a5bc6f5c8173 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -197,7 +197,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91sam9g45_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 0c22b82ef368..b4dfe2d1de8a 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -223,7 +223,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 4ae8028600d5..48d79189fc98 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -150,7 +150,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91rm9200_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index c2c5e9fe669c..f278bee3417c 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -247,7 +247,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 1195fb405503..a400aac5b2e2 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -213,8 +213,7 @@ static const struct clk_ops programmable_ops = { }; struct clk_hw * __init -at91_clk_register_programmable(struct regmap *regmap, - const char *name, const char **parent_names, +at91_clk_register_programmable(struct regmap *regmap, const char *name, struct clk_hw **parent_hws, u8 num_parents, u8 id, const struct clk_programmable_layout *layout, u32 *mux_table) @@ -224,7 +223,7 @@ at91_clk_register_programmable(struct regmap *regmap, struct clk_init_data init = {}; int ret; - if (id > PROG_ID_MAX || !(parent_names || parent_hws)) + if (id > PROG_ID_MAX || !parent_hws) return ERR_PTR(-EINVAL); prog = kzalloc(sizeof(*prog), GFP_KERNEL); @@ -233,10 +232,7 @@ at91_clk_register_programmable(struct regmap *regmap, init.name = name; init.ops = &programmable_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 85193e4656b9..11fdbca8ee83 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -860,7 +860,7 @@ of_at91_clk_prog_setup(struct device_node *np, name = progclknp->name; hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, num_parents, + parent_hws, num_parents, id, layout, mux_table); if (IS_ERR(hw)) continue; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index eed88a480b11..7d2524109776 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -226,7 +226,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init at91_clk_register_programmable(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents, u8 id, const struct clk_programmable_layout *layout, u32 *mux_table); diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index 148873fced1b..897a8f2d6102 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -318,7 +318,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 6, i, + parent_hws, 6, i, &sam9x60_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 75d5b1a3733b..c64b79b44ba6 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -304,7 +304,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 6, i, + parent_hws, 6, i, &sama5d2_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index a50e82460e70..021e012fe202 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -226,7 +226,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index b6b41ceae13c..e196ec80570f 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -249,7 +249,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); hw = at91_clk_register_programmable(regmap, name, - NULL, parent_hws, 5, i, + parent_hws, 5, i, &at91sam9x5_programmable_layout, NULL); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 9cba1ad116a8..baec84bd5d06 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1171,7 +1171,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) snprintf(name, sizeof(name), "prog%d", i); - hw = at91_clk_register_programmable(regmap, name, NULL, parent_hws, + hw = at91_clk_register_programmable(regmap, name, parent_hws, 9, i, &programmable_layout, sama7g5_prog_mux_table); From patchwork Thu Jul 27 05:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F2C55C04E69 for ; Thu, 27 Jul 2023 05:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gfzWnvCkf0QSBcjDbIadS0moad3pyG1jsJErkbeXmAw=; b=IZxI+ycCOmJ1VO 5smKiYiF6N+r4IlYy4JeZc2LSLm4nVay+OJjbm0N4qrCUNxa8pKi+HuwLbZHd5c4ObcAPBslDThhk 8F0UFxIZf8eQZvi1PKwARj7yy+HAD0lzCIanletOO6CrNyyciEWs7fjSovH9BcowxTYVIS/cl0Vv5 Mrv0HAHbJIGuiN/SMEGQzSg/z35EEozWItTAdjPbrPBsMBY2Jsc4EAPYGUbA4A96AEbxQebvlJavI 0yRC6iro75Nbpbo+ubxX2AVJyw9T0FP+n4dSWc/g2X8sSfW4pKK/2t2vMYsc7oqiUS0GyK/lT6RpH 85oGrZBgCtrjGXUjJtbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthA-00CDnc-2z; Thu, 27 Jul 2023 05:37:52 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgJ-00CDUI-0E for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:07 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bba2318546so4687255ad.1 for ; Wed, 26 Jul 2023 22:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436218; x=1691041018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rFDKIrER1Q8EDEuXgmXxXy7qiRoYOQyJHV+mlKGKhyM=; b=Q5pItotCSKZWCFdXRGzjghrjkFi3Z+sL99/EwD3Ud+0lavJWRnFGQcG6R/iJ0c0TXT ic/vw6K4bWiQE6uKkhkm3GJFvQyyQK2EfHDZu622BFd72xzRH53btHPRiPzreyUVh/iz lm5zXMA1QdQ0lC4Dx8qpxKISW74rUgtQeRe3s5m8APoc9Kw7Txf4YfsMMN/xrF91WMIj boLQeStCa0Rvxfk9p16kl10ebs4CovIh1JwOtMxDkxCTasP5WYdA7GI3vbvVljYvUyj2 thyshFC6UF1wuFcrV+p5KZwTitrW4H5GTyZ5Ift67NF5kW+oi7mIOhKan6DBuHdfLTjR 63wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436218; x=1691041018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rFDKIrER1Q8EDEuXgmXxXy7qiRoYOQyJHV+mlKGKhyM=; b=i4qp+pcyOUNBw7kltsXkmbI8UPQeBochzoNWwJk2OhSmDoaFFyqqQ++8MKUu5u+Va/ 8z+FpF+JnGCEaX++xYDRf6u5+VLwCBjhezjEs2C1nwKiMBqJFK8vUo6tcOKZDNZq4xVF QNTtZFRs8UxJK0rzwE4gTXmJK9wtygHavB/GP9Y/slJ43u9IBKynWbyG3sCrnUd7p0IM rb1+K8VeSx3t5Nw5pY99Qc66il0RqwEFacFHrBxaoWPq6DOFqGFwCJ5xktUq6zs9bhjk TMuUhkJZi5FhCROTyulihkTfHVXWldhH4+UOPKKvwREfg/GLQ+slCLQZbAIlGAURH8Xd Xw8g== X-Gm-Message-State: ABy/qLZbg2NmwGc6DyeOJ9fQWAeqITQL0GLIoDk8lgMeJhBAZsV/mvm6 uS2vuRCyUOvDuXTMk5wcxL2Nqw== X-Google-Smtp-Source: APBJJlFsafDnT8kkWkk3yUqoJROLuqetgWn4uUQXGuwpxasw70Gtt8yiGSgxsI8WlcWcysUugjf0SA== X-Received: by 2002:a17:902:f681:b0:1b6:b805:5ae3 with SMTP id l1-20020a170902f68100b001b6b8055ae3mr4943140plg.3.1690436218328; Wed, 26 Jul 2023 22:36:58 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:36:58 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 37/42] clk: at91: clk-sam9x60-pll: remove parent_names support Date: Thu, 27 Jul 2023 08:31:51 +0300 Message-Id: <20230727053156.13587-38-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223659_166711_C46DD13C X-CRM114-Status: GOOD ( 15.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-sam9x60-pll driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-sam9x60-pll.c | 16 ++++------------ drivers/clk/at91/pmc.h | 6 ++---- drivers/clk/at91/sam9x60.c | 8 ++++---- drivers/clk/at91/sama7g5.c | 4 ++-- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c index ff65f7b916f0..787ab36ecdba 100644 --- a/drivers/clk/at91/clk-sam9x60-pll.c +++ b/drivers/clk/at91/clk-sam9x60-pll.c @@ -609,8 +609,7 @@ static const struct clk_ops sam9x60_div_pll_ops_chg = { struct clk_hw * __init sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, u8 id, + const char *name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_characteristics *characteristics, const struct clk_pll_layout *layout, u32 flags) { @@ -629,10 +628,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, return ERR_PTR(-ENOMEM); init.name = name; - if (parent_name) - init.parent_names = &parent_name; - else - init.parent_hws = (const struct clk_hw **)&parent_hw; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; if (flags & CLK_SET_RATE_GATE) init.ops = &sam9x60_frac_pll_ops; @@ -695,8 +691,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, struct clk_hw * __init sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, u8 id, + const char *name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_characteristics *characteristics, const struct clk_pll_layout *layout, u32 flags, u32 safe_div) @@ -720,10 +715,7 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, return ERR_PTR(-ENOMEM); init.name = name; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; if (flags & CLK_SET_RATE_GATE) init.ops = &sam9x60_div_pll_ops; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 7d2524109776..fe86cca2776e 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -211,16 +211,14 @@ at91_clk_register_plldiv(struct regmap *regmap, const char *name, struct clk_hw * __init sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, u8 id, + const char *name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_characteristics *characteristics, const struct clk_pll_layout *layout, u32 flags, u32 safe_div); struct clk_hw * __init sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, u8 id, + const char *name, struct clk_hw *parent_hw, u8 id, const struct clk_pll_characteristics *characteristics, const struct clk_pll_layout *layout, u32 flags); diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index 897a8f2d6102..68abd0fd47db 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -238,7 +238,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->chws[PMC_MAIN] = hw; hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "pllack_fracck", - NULL, sam9x60_pmc->chws[PMC_MAIN], + sam9x60_pmc->chws[PMC_MAIN], 0, &plla_characteristics, &pll_frac_layout, /* @@ -251,7 +251,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) goto err_free; hw = sam9x60_clk_register_div_pll(regmap, &pmc_pll_lock, "pllack_divck", - NULL, hw, 0, &plla_characteristics, + hw, 0, &plla_characteristics, &pll_div_layout, /* * This feeds CPU. It should not @@ -264,14 +264,14 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_pmc->chws[PMC_PLLACK] = hw; hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, "upllck_fracck", - NULL, main_osc_hw, 1, + main_osc_hw, 1, &upll_characteristics, &pll_frac_layout, CLK_SET_RATE_GATE); if (IS_ERR(hw)) goto err_free; hw = sam9x60_clk_register_div_pll(regmap, &pmc_pll_lock, "upllck_divck", - NULL, hw, 1, &upll_characteristics, + hw, 1, &upll_characteristics, &pll_div_layout, CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index baec84bd5d06..0d81a955e686 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1074,7 +1074,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) hw = sam9x60_clk_register_frac_pll(regmap, &pmc_pll_lock, sama7g5_plls[i][j].n, - NULL, parent_hw, i, + parent_hw, i, sama7g5_plls[i][j].c, sama7g5_plls[i][j].l, sama7g5_plls[i][j].f); @@ -1083,7 +1083,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) case PLL_TYPE_DIV: hw = sam9x60_clk_register_div_pll(regmap, &pmc_pll_lock, sama7g5_plls[i][j].n, - NULL, sama7g5_plls[i][0].hw, i, + sama7g5_plls[i][0].hw, i, sama7g5_plls[i][j].c, sama7g5_plls[i][j].l, sama7g5_plls[i][j].f, From patchwork Thu Jul 27 05:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C53D7C04FE0 for ; Thu, 27 Jul 2023 05:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eS6vu55vychFvlmbdD7JRhud9JUNtQ+8DEtNF7uNz6k=; b=4moKq7BgmbKiaE k9CQ2O1dd7fk74uwekiv2c0f1A3HuingPD5hP8dQfIJGWhrhAb+bhAXBuiCPhFc8OeAHLrfFB1nxx koTCVzcp7ZiZKgrWzwwu+8eQQIFQ/U2tsK2zCo2dAB9b6o2GHMfvVGQ+sVHDLV5ZpaOm0o36FwHKy C4+xfG3MqN/t7RotrPx5SXSOUb4FBUk7S6s7DwoyBEmswsH7bvxomb7ar4roHMX+kfkkoEYLWIKk7 V/LTTKqPxuV7RDaon0U/8U7mFoSwL81CItNJjSBIYE/zafoB+PWmMElsEBPWTR2LDTBeFdh3xWRxA sXL4tSa1GosO5MQuDJUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthB-00CDnv-1M; Thu, 27 Jul 2023 05:37:53 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgQ-00CDXZ-0m for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:16 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bb775625e2so3338325ad.1 for ; Wed, 26 Jul 2023 22:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436225; x=1691041025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HhTcRhK2gQ4jMW+59NMw/SaH7OUANNH6Zo/DOVN6+as=; b=DlLGy8hlTRIK/ljo4LGFmrYRfDnd+QvQ7CtqcZrNfjWPSXrFxRQi4Z/7shGMIDLqvK QMxlty1Q+Ma232hFEwGF3lSfAQZnxtK75Nl+GkFtlZdyjV9SrCAZ3ISwTHQG+d0kY6Je 6K23ojczKRZIwqOXOP6JDy0YnX/XKf5gw4HwYQzvozTh8SdcIHYR50rxel58D5NT0z5M +nIvynHPLNBsZazi/zhoxTG+w1CTN6hhSm4au62rRvn2iCdeEkKFQYg+zHUO19m/9i0w kktYtXExlIRmASejBBzkcI5Rzz+GA+4qm4gj7hKF9obMZeKSDSaWMQQlwCQ+Iyx4BVe+ YVeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436225; x=1691041025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HhTcRhK2gQ4jMW+59NMw/SaH7OUANNH6Zo/DOVN6+as=; b=JaAvQTROP13AseZpVhfGh4Lzqi0zw9TWGtui8J9wssq15shBudBXs5D0NhwverxKfc lrvZygig1lWA8cVN/MKuelZeU8Y79oQpf3oAfpptq/RpXtAGb/9SZSkDF4POoFfGmHK4 +t2kST0Ll7qD/pP9HPgW/YNUI4XBuHxqBjWYe2Qjl9Drd5BN4ew19dD1SemeHG9ZqIyH gAiiaiHpIdm0aDwb1B1mF501Ou1Z7KkqUgtFyEumi9vILUL7jSadkfmuc7L9RFYKq2qZ YZsb5x2G15TQD0NAJp/GgGOce/reBVmVpyifhnwrLLYWc87PK34i/l4Fvuwxbe6MM4j3 gDMw== X-Gm-Message-State: ABy/qLYHccOftQuVXcL2rcL7BTvUCG5jwh4ogE5+RovKOUKZrxQ3KBxA PxFJmKGac7H0W83J5ZTYDtKEHw== X-Google-Smtp-Source: APBJJlGfluXGrnux48EdeGE9eNFdWvTPEzEfURqjbaC5EvOyWGXSriaNT9nM7vumitgl8/c6QopSTQ== X-Received: by 2002:a17:903:1d1:b0:1b8:5bca:8256 with SMTP id e17-20020a17090301d100b001b85bca8256mr1971040plh.31.1690436225650; Wed, 26 Jul 2023 22:37:05 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:37:05 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 38/42] clk: at91: clk-slow: remove parent_names support Date: Thu, 27 Jul 2023 08:31:52 +0300 Message-Id: <20230727053156.13587-39-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223706_290638_704F324B X-CRM114-Status: GOOD ( 15.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-slow driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/clk-slow.c | 8 ++------ drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 1 - 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index c118ff23548b..97efc39a7e2b 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -390,7 +390,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, parent_hws[0] = hw; parent_hws[1] = slow_xtal_hw; - hw = at91_clk_register_sam9260_slow(regmap, "slck", NULL, parent_hws, 2); + hw = at91_clk_register_sam9260_slow(regmap, "slck", parent_hws, 2); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index bea66216ed82..ee2dfc44d29e 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -38,7 +38,6 @@ static const struct clk_ops sam9260_slow_ops = { struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, int num_parents) { @@ -50,7 +49,7 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, if (!name) return ERR_PTR(-EINVAL); - if (!parent_names || !num_parents) + if (!parent_hws || !num_parents) return ERR_PTR(-EINVAL); slowck = kzalloc(sizeof(*slowck), GFP_KERNEL); @@ -59,10 +58,7 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, init.name = name; init.ops = &sam9260_slow_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)&parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)&parent_hws; init.num_parents = num_parents; init.flags = 0; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 11fdbca8ee83..90d92a410097 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -920,7 +920,7 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) of_property_read_string(np, "clock-output-names", &name); - hw = at91_clk_register_sam9260_slow(regmap, name, NULL, parent_hws, + hw = at91_clk_register_sam9260_slow(regmap, name, parent_hws, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index fe86cca2776e..a0b49dd3749f 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -232,7 +232,6 @@ at91_clk_register_programmable(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_sam9260_slow(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, int num_parents); From patchwork Thu Jul 27 05:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 81492EB64DD for ; Thu, 27 Jul 2023 05:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3rdJtUvL8AQN1P70441s0SsoK5a2glhGHHQhcx+pnXA=; b=Xgzm0PclZC5b28 /SHOuHgeeV8hk0SqZ+Oi0reiZBOyqwDeG6oKvUym65Lx7vBphsEKQ2IE8pxyoofvMU2Ez6XmjiCKm 1SXP+wajlRtBP6mVxMJcLwjeUd4dygH6+1IcMFKDXyWGV6LpnEqFj6am23ULIBnRrjjlZr83peKZi 5jUjp9xNG+dB135YTYO/NYtaM8usHiX3A+LrXNi1/jOMPBqPJYhmRDTD/dp0F4oj9FNv0Y8SheBf8 UijgepuwzqhxZIiJUIbLXiYc0YboVc4Tkror/fXXYdEka4/2RtbVCOXXUmW1Oh5ErYe3EmLZZTsS9 kqZP14zjyjqEStdIKmbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthB-00CDoA-2z; Thu, 27 Jul 2023 05:37:53 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgX-00CDai-0y for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:25 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b89d47ffb6so3428095ad.2 for ; Wed, 26 Jul 2023 22:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436233; x=1691041033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rMrH2veSKJpQGvEe5VG+6yf2IP3UM7TTWUkhUdnFvBE=; b=m9WxlI86VXkvIJaFZfBm9fikWzK2MXmSLJNO1gZJ2uRq6s8IzrMtlcTgZMgvEj+600 sSBdKIlxf26m7GzYTWJMR04vM45e48dNkTtVN4IlXE3+FsqLJO67ubZqHx16RGzcOicG LP0JtY7a/pKBRoXgfDsPEi5Ny2Y4fbyvDNgxv23T4eqeqKGxXsjfPQcbqZwfsqzR+sp+ nMdgyVT8zAITbTAZXsml2cdZPeguyd/OIboLKr55+OGZUL9wJOyj2+29lwzL/WuygTsI yjONzfNg8PiHWPPCx+Y+We/eE+UysNO0nQoux9GQ4o1VBvfwWopHWj0ILfUmlRRSiRVD ZD6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436233; x=1691041033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rMrH2veSKJpQGvEe5VG+6yf2IP3UM7TTWUkhUdnFvBE=; b=RQCJelv6z9qwiJ5kgW8/pumBdp1nVrXH8VRwFwTU1Ovv8ZY5F7FFGU5tWfuSJ1YpxV 31+TuFVS9AWTAkSiK7mTccmvsYkYdZcpsvm/2aI7xfngdrjOLfRjBHtkAP9kLTrkT13q TXbi/f5IR09KjcL6aeAL4kplUauzS7h2Wh4UT+fIw+40DHbIqYJ0O0St/I7nB/dJoE4F TDSv0wb6Dj5bXhOvsczz6+vdUZWLOspsd3P1R803TJtaG8RuXitYHDMW6pju45jjxpdK u1ZMiOd/ExRD3Dc3jVxK98oGvrdn7D5LJ5qmj9JVAp+dgD1AA1b0fa7gignoezhIeV3n h1zg== X-Gm-Message-State: ABy/qLYT7xzLnCRAsSMmbCxzZrRwOuk5DaMynPSdC++d3z7cl3+DGGak ej7ogmmXdhMM3kfpiR9S3AZokw== X-Google-Smtp-Source: APBJJlE/b2NsE/TFI2LCOh8FQAgahRyUACaBkgzFTkwLVBYX122bL58KV0FwOFGGcwnKGd+Ib2/Stw== X-Received: by 2002:a17:902:bcc9:b0:1b1:7362:9a18 with SMTP id o9-20020a170902bcc900b001b173629a18mr3093097pls.27.1690436232704; Wed, 26 Jul 2023 22:37:12 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:37:12 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 39/42] clk: at91: clk-smd: remove parent_names support Date: Thu, 27 Jul 2023 08:31:53 +0300 Message-Id: <20230727053156.13587-40-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223713_375267_0722F7E9 X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-smd driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-smd.c | 7 ++----- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index f278bee3417c..93165263502e 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -232,7 +232,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, if (IS_ERR(usbck_hw)) goto err_free; - smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_hws, 2); if (IS_ERR(smdck_hw)) goto err_free; diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 2c8432cc2fe6..b182c11386ea 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -111,7 +111,7 @@ static const struct clk_ops at91sam9x5_smd_ops = { struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents) { struct at91sam9x5_clk_smd *smd; @@ -125,10 +125,7 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9x5_smd_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 90d92a410097..294e3b0e8a9d 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -964,7 +964,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_smd(regmap, name, NULL, parent_hws, + hw = at91sam9x5_clk_register_smd(regmap, name, parent_hws, num_parents); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index a0b49dd3749f..131ef55d3e47 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -237,7 +237,7 @@ at91_clk_register_sam9260_slow(struct regmap *regmap, struct clk_hw * __init at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents); struct clk_hw * __init diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 021e012fe202..239806dcd03d 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -211,7 +211,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) if (IS_ERR(usbck_hw)) goto err_free; - smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_hws, 2); if (IS_ERR(smdck_hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index e196ec80570f..f193460495c0 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -234,7 +234,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_hws[0] = sama5d4_pmc->chws[PMC_PLLACK]; parent_hws[1] = sama5d4_pmc->chws[PMC_UTMI]; - smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", NULL, parent_hws, 2); + smdck_hw = at91sam9x5_clk_register_smd(regmap, "smdclk", parent_hws, 2); if (IS_ERR(smdck_hw)) goto err_free; From patchwork Thu Jul 27 05:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328810 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6A08BEB64DD for ; Thu, 27 Jul 2023 05:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=POFfqgXQxTHWB+NpvhN0KDNtEeJi5bybLaM6HfQR9Ns=; b=NrfKKGx0qAQb71 zIDIxuKIRv5CkLJG4N5yhTkhWgabC7CLnkEEKSMc9Lbz5bP0rngg5obEuaC9JQgB1UJPD6IqOdbhs 2iA2ArlmrnYpCCVOE31OBkZgNXhKpzxKSnn2X+RKisjYmRSlnF2Ipfk1qpL/it7f/n4pGYKXD6qXG MQw9+nEIxQz21FFMgyrPL3Cwhw0te6gdr5cpMACBzMhoZIeny18QEo6ezLPNxROjmgwODLDxjQ0sz be7H/vzhfwQGU+oZTSN/XSDehFwtoURQNPlwz7802DU41ojo3CInrC/eY3eNAuYPiC4xkB8OaOgA/ I3JHJ0uvHMMDlOFoOxFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthC-00CDoQ-1Q; Thu, 27 Jul 2023 05:37:54 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgn-00CDh7-2h for linux-arm-kernel@bombadil.infradead.org; Thu, 27 Jul 2023 05:37:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/MZ4Kp4lF1KjxsdE0fjXbxu2hcT01qgittw8+AX1ais=; b=f79uLDUcZMofecxI9fPp5FR2eE hVjPoKzUR7GVBzGeQFwjmmc950YnBDQ+z6E1HLteIaZP0NXLTtz7p2hbQEkZmJ8Q1TbSSOkrEo9yR LJw643Gz5jvrNTFqE6d1RFdTl34bkw1KgX7wsRBDHk/ESDXYfb5ePpRPXQRTQ+3JnIl24U5iXQsv+ CM6BRWv5QaE4KYjzqVhmGjXUMDIH9j19ROQWFOqHk9JiHentNb3mAM/pbrOTv8v6eCRnmvSgnelZ4 cznD59xtvdW46Yb7IvY1gDQQOGLsQJSApnFkHXHD5LuNeGTKBjC/Pug5uXGSzBbDzODp50U5ToAwb cr7yVymg==; Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgi-0070UF-1L for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:28 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b9ecf0cb4cso3730275ad.2 for ; Wed, 26 Jul 2023 22:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436240; x=1691041040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/MZ4Kp4lF1KjxsdE0fjXbxu2hcT01qgittw8+AX1ais=; b=i33XmaIPrG9ujwJu4RPYfqz8tKC9aklbCEg/XJ0TTJ22HMJou819xTe2CJOD+h3BaJ A4TvzOl9/d4C6hKAUdtaXx/zc0/ybVl7vZZ+yX/IlkoHLbWnkdV96jSTpq/2OFIAwcYX 03PFq2YbVY5QL/bXMseU1ec/qce+ZTGCeE/sCEBNHoMpixUyw//bfdfFFO0vs5HpCz1o 84B/RrGpCUNU8JdlQ89/x3Bs+Wi5hQkGo6Q601oO8Sp+nS7e8tXSbt1BvCn7Z37t7tg4 RonKcJUBVICucljvRHrdMp0nyUzxeo5S4RPgAqTJNCkX3DMToGxBlC7Byoxm18iRo7+q QRgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436240; x=1691041040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MZ4Kp4lF1KjxsdE0fjXbxu2hcT01qgittw8+AX1ais=; b=BoYs9A401M0E+Ugfvgl1KHGSOpZzW9wd2MMUhQCnJ6gcRLHnPSuhhPuPW6G8nTpR/0 vUrWGCte9d1PfPe3oFO+wmkJh6DgOhu5zjOPKH2M1yQWVDm7F5QEOSgk2RHKzixDjds9 jyNV7ap1y5lpi7h0NUhUvyNRVzxsnvcY2FCJc+CefSQGnup1BI0Q5sj8QAhBljeu4rPO g/nMtfKqMX8VmELc+dZX5sj1nOBOJhO080gX1cfnXKloKnrpFe52RfYraTvLVRIYWXJK vwugecZJ/7cF9HF8ZVuadDFrrA4hLV9tfGBsQyDmhWg2dK5anykSphjezpjvcYPbdjD2 hO2A== X-Gm-Message-State: ABy/qLaNO90TVAMYWlQzdMeYTJLSin/JmvQ9ezAsIAfBpUPsuToUnD6g tCi5AOjmfJIXyNoygvDUkZYcfg== X-Google-Smtp-Source: APBJJlEIhpktItHVR8GLsrBTfxaptzEbAomzADKwH8ieh3QikL6C736GamLQQJ60kN7bcb9GVJvQGQ== X-Received: by 2002:a17:902:ec92:b0:1bb:6875:5a73 with SMTP id x18-20020a170902ec9200b001bb68755a73mr3655798plg.2.1690436240057; Wed, 26 Jul 2023 22:37:20 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:37:19 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 40/42] clk: at91: clk-system: remove parent_names support Date: Thu, 27 Jul 2023 08:31:54 +0300 Message-Id: <20230727053156.13587-41-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_063724_969083_9FB0A51A X-CRM114-Status: GOOD ( 16.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-system driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-system.c | 9 +++------ drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- drivers/clk/at91/sama7g5.c | 2 +- 14 files changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 9305cb6eaef2..4b8a9c27cc9e 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -196,7 +196,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_systemck[5].parent_hw = at91rm9200_pmc->pchws[3]; for (i = 0; i < ARRAY_SIZE(at91rm9200_systemck); i++) { hw = at91_clk_register_system(regmap, at91rm9200_systemck[i].n, - NULL, at91rm9200_systemck[i].parent_hw, + at91rm9200_systemck[i].parent_hw, at91rm9200_systemck[i].id, 0); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 97efc39a7e2b..71002ada33dd 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -475,7 +475,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, } for (i = 0; i < data->num_sck; i++) { hw = at91_clk_register_system(regmap, data->sck[i].n, - NULL, data->sck[i].parent_hw, + data->sck[i].parent_hw, data->sck[i].id, 0); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index a5bc6f5c8173..bf5951097fca 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -213,7 +213,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_systemck[3].parent_hw = at91sam9g45_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9g45_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9g45_systemck[i].n, - NULL, at91sam9g45_systemck[i].parent_hw, + at91sam9g45_systemck[i].parent_hw, at91sam9g45_systemck[i].id, at91sam9g45_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index b4dfe2d1de8a..fa7daab2793b 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -241,7 +241,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_systemck[5].parent_hw = at91sam9n12_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9n12_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9n12_systemck[i].n, - NULL, at91sam9n12_systemck[i].parent_hw, + at91sam9n12_systemck[i].parent_hw, at91sam9n12_systemck[i].id, at91sam9n12_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index 48d79189fc98..eaa757f6670a 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -164,7 +164,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_systemck[1].parent_hw = at91sam9rl_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9rl_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9rl_systemck[i].n, - NULL, at91sam9rl_systemck[i].parent_hw, + at91sam9rl_systemck[i].parent_hw, at91sam9rl_systemck[i].id, 0); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 93165263502e..994010f1cf03 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -265,7 +265,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_systemck[5].parent_hw = at91sam9x5_pmc->pchws[1]; for (i = 0; i < ARRAY_SIZE(at91sam9x5_systemck); i++) { hw = at91_clk_register_system(regmap, at91sam9x5_systemck[i].n, - NULL, at91sam9x5_systemck[i].parent_hw, + at91sam9x5_systemck[i].parent_hw, at91sam9x5_systemck[i].id, at91sam9x5_systemck[i].flags); if (IS_ERR(hw)) @@ -275,7 +275,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, } if (has_lcdck) { - hw = at91_clk_register_system(regmap, "lcdck", NULL, + hw = at91_clk_register_system(regmap, "lcdck", at91sam9x5_pmc->chws[PMC_MCK], 3, 0); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c index 90eed39d0785..3f626a65ce9c 100644 --- a/drivers/clk/at91/clk-system.c +++ b/drivers/clk/at91/clk-system.c @@ -105,7 +105,7 @@ static const struct clk_ops system_ops = { struct clk_hw * __init at91_clk_register_system(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, u8 id, + struct clk_hw *parent_hw, u8 id, unsigned long flags) { struct clk_system *sys; @@ -113,7 +113,7 @@ at91_clk_register_system(struct regmap *regmap, const char *name, struct clk_init_data init = {}; int ret; - if (!(parent_name || parent_hw) || id > SYSTEM_MAX_ID) + if (!parent_hw || id > SYSTEM_MAX_ID) return ERR_PTR(-EINVAL); sys = kzalloc(sizeof(*sys), GFP_KERNEL); @@ -122,10 +122,7 @@ at91_clk_register_system(struct regmap *regmap, const char *name, init.name = name; init.ops = &system_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_PARENT | flags; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 294e3b0e8a9d..dc8eb6036643 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -1020,7 +1020,7 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) if (!strcmp(sysclknp->name, "ddrck")) flags = CLK_IS_CRITICAL; - hw = at91_clk_register_system(regmap, name, NULL, parent_hw, + hw = at91_clk_register_system(regmap, name, parent_hw, id, flags); if (IS_ERR(hw)) continue; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 131ef55d3e47..bdb2dfb8fa86 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -242,7 +242,7 @@ at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_system(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, + struct clk_hw *parent_hw, u8 id, unsigned long flags); struct clk_hw * __init diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index 68abd0fd47db..f344cbbc9c25 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -335,7 +335,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) sam9x60_systemck[4].parent_hw = sam9x60_pmc->chws[PMC_MCK]; for (i = 0; i < ARRAY_SIZE(sam9x60_systemck); i++) { hw = at91_clk_register_system(regmap, sam9x60_systemck[i].n, - NULL, sam9x60_systemck[i].parent_hw, + sam9x60_systemck[i].parent_hw, sam9x60_systemck[i].id, sam9x60_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index c64b79b44ba6..0fce17af769e 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -324,7 +324,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_systemck[7].parent_hw = sama5d2_pmc->chws[PMC_MCK]; for (i = 0; i < ARRAY_SIZE(sama5d2_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d2_systemck[i].n, - NULL, sama5d2_systemck[i].parent_hw, + sama5d2_systemck[i].parent_hw, sama5d2_systemck[i].id, sama5d2_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 239806dcd03d..c00380ed0000 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -246,7 +246,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) sama5d3_systemck[7].parent_hw = sama5d3_pmc->pchws[2]; for (i = 0; i < ARRAY_SIZE(sama5d3_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d3_systemck[i].n, - NULL, sama5d3_systemck[i].parent_hw, + sama5d3_systemck[i].parent_hw, sama5d3_systemck[i].id, sama5d3_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index f193460495c0..0d2a834a5903 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -269,7 +269,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_systemck[7].parent_hw = sama5d4_pmc->pchws[2]; for (i = 0; i < ARRAY_SIZE(sama5d4_systemck); i++) { hw = at91_clk_register_system(regmap, sama5d4_systemck[i].n, - NULL, sama5d4_systemck[i].parent_hw, + sama5d4_systemck[i].parent_hw, sama5d4_systemck[i].id, sama5d4_systemck[i].flags); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 0d81a955e686..61f7027f1033 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1183,7 +1183,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) for (i = 0; i < ARRAY_SIZE(sama7g5_systemck); i++) { hw = at91_clk_register_system(regmap, sama7g5_systemck[i].n, - NULL, sama7g5_pmc->pchws[i], + sama7g5_pmc->pchws[i], sama7g5_systemck[i].id, 0); if (IS_ERR(hw)) goto err_free; From patchwork Thu Jul 27 05:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 05C22C001E0 for ; Thu, 27 Jul 2023 05:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RV6PhZvfphEdTY+KfIe6ai4qsd/GPm6vHa0yGDh7BPI=; b=jYyJCLKsPGiWEg YIsbd7UedOiSPMBXybSuhP1GZka09hDEilV/aB3AApM2suyuPGGjyi5jC8XRn69wJ+/Ai0JOuRuma hion2nG/xHRe2kuRN4BzoSJEhgVy06udly8yNlrHensc1KnuEAE6/A/QSADOmylDiyNm9Y1QUf3jX sUolgcHyhAvmveruJiVb16w/BQEVBcjUnQ53dQShO45Cha5rdHZlMEj7nRpHcpqBaLa6/5jChBetQ upmtjfoVKzj3KWZG5xJBILRBPoSrtqr2f+lC/+uML+g6a5JJigf7ebvWXK3MacHSNt2CAISox+cYt cC/K5yzufT4k81t6OOQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthD-00CDoe-0A; Thu, 27 Jul 2023 05:37:55 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgm-00CDgT-03 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:39 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bb775625e2so3339825ad.1 for ; Wed, 26 Jul 2023 22:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436247; x=1691041047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R0MCABlKnn4W9o3M4XSOlKm6XX3ypG2eLBBMZazV5aU=; b=nSsgtq6GND/KRpXTCP6YcWA+uA/ZLZDk70vsMiY9jZtEYLHnW8HOnsHyzGgp9BWYrN yG1oLeeKD38YXZfm+r/9OtAajFL8T64g1OdK2SMlGqNymUDHHrmS3dzJdawJpxAE6HD9 m87dfNdpWlHAa1Lqkl2XtjyslgOQpOdMMfhJwhLyldvDqaaHeAipDf/UW8mImDFT2MoG QG86Usv2Dlu4HA+jYw9znLlCCRyH3R0k2AQq9r0bYH+laHUbvmEeq5jHuTAIY/XRZkEX Nni5Qo5N9kay+wvtJlQuHVDNH1bSUA3aFm7vK/cVRuXz+BtpjaISH/Q3AVwmlnMG5yo3 cdcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436247; x=1691041047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R0MCABlKnn4W9o3M4XSOlKm6XX3ypG2eLBBMZazV5aU=; b=eSoleWhFxegZ1DHT2v2wH/q8W84K0/X/q8vLSsGGZUDR5epLJ59EiE2chhhYRlNYc5 7ktuRac5dNb2hAC/JrWo4wLRpFiXs6mJfdMG1P1OQpMvlcgiZqwAqqsItIFVqvLeOH9e nrAzRu7mVMNlKPPSm9pglA73sedf9nD161VPiD2nABFR/XB4NpvuIdgHLmQ/dO9Ul2lG fgkeD+2pmpXzm/tGlKRIObreTVSqeGR/RsKfSvRMgw4klgDes1WP9wdznZlrOfTSlSAk L0S2xdZtWvIOAI2c88TtH5AEI23hj+fQENqoCbQpN6sgM/Y9IW810rJ1aQVXCE+NWsMD T1sg== X-Gm-Message-State: ABy/qLZkxOevb8l+iTqIpF5f2l/QaXKNTAOY01J2wFUKAnrPQsoFGpbf Zifl9U7qoh9JFfCk2iNAHyQqQQ== X-Google-Smtp-Source: APBJJlHlq1g/jxGnxtE5kc0Zu6/vUpuzTqsqYM1q0IAdRpnngQGqQf7SqFxL1bbqjNqkdtAbei9jUg== X-Received: by 2002:a17:902:d50b:b0:1bb:c896:1da3 with SMTP id b11-20020a170902d50b00b001bbc8961da3mr2356971plg.24.1690436247121; Wed, 26 Jul 2023 22:37:27 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:37:26 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 41/42] clk: at91: clk-usb: remove parent_names support Date: Thu, 27 Jul 2023 08:31:55 +0300 Message-Id: <20230727053156.13587-42-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223728_081954_7988B952 X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-usb driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91rm9200.c | 2 +- drivers/clk/at91/at91sam9260.c | 2 +- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-usb.c | 35 ++++++++++++---------------------- drivers/clk/at91/dt-compat.c | 6 +++--- drivers/clk/at91/pmc.h | 8 ++++---- drivers/clk/at91/sam9x60.c | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 12 files changed, 28 insertions(+), 39 deletions(-) diff --git a/drivers/clk/at91/at91rm9200.c b/drivers/clk/at91/at91rm9200.c index 4b8a9c27cc9e..05060b72acab 100644 --- a/drivers/clk/at91/at91rm9200.c +++ b/drivers/clk/at91/at91rm9200.c @@ -163,7 +163,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np) at91rm9200_pmc->chws[PMC_MCK] = hw; - usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", NULL, + usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", at91rm9200_pmc->chws[PMC_PLLBCK], usb_div); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9260.c b/drivers/clk/at91/at91sam9260.c index 71002ada33dd..2b0ffcee9e40 100644 --- a/drivers/clk/at91/at91sam9260.c +++ b/drivers/clk/at91/at91sam9260.c @@ -436,7 +436,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np, at91sam9260_pmc->chws[PMC_MCK] = hw; - usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", NULL, + usbck_hw = at91rm9200_clk_register_usb(regmap, "usbck", at91sam9260_pmc->chws[PMC_PLLBCK], usb_div); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index bf5951097fca..1e5262b678f5 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -182,7 +182,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) parent_hws[0] = at91sam9g45_pmc->chws[PMC_PLLACK]; parent_hws[1] = at91sam9g45_pmc->chws[PMC_UTMI]; - usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_hws, 2); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index fa7daab2793b..9b4e28b9f21b 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -207,7 +207,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np) at91sam9n12_pmc->chws[PMC_MCK] = hw; - usbck_hw = at91sam9n12_clk_register_usb(regmap, "usbck", NULL, + usbck_hw = at91sam9n12_clk_register_usb(regmap, "usbck", at91sam9n12_pmc->chws[PMC_PLLBCK]); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 994010f1cf03..1968dd69fbf7 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -228,7 +228,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, parent_hws[0] = at91sam9x5_pmc->chws[PMC_PLLACK]; parent_hws[1] = at91sam9x5_pmc->chws[PMC_UTMI]; - usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_hws, 2); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c index 21f50914c63e..37ea588cb534 100644 --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -221,7 +221,7 @@ static const struct clk_ops at91sam9n12_usb_ops = { static struct clk_hw * __init _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents, u32 usbs_mask) { struct at91sam9x5_clk_usb *usb; @@ -235,10 +235,7 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9x5_usb_ops; - if (parent_hws) - init.parent_hws = (const struct clk_hw **)parent_hws; - else - init.parent_names = parent_names; + init.parent_hws = (const struct clk_hw **)parent_hws; init.num_parents = num_parents; init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; @@ -260,26 +257,25 @@ _at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, struct clk_hw * __init at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents) { - return _at91sam9x5_clk_register_usb(regmap, name, parent_names, - parent_hws, num_parents, SAM9X5_USBS_MASK); + return _at91sam9x5_clk_register_usb(regmap, name, parent_hws, + num_parents, SAM9X5_USBS_MASK); } struct clk_hw * __init sam9x60_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents) { - return _at91sam9x5_clk_register_usb(regmap, name, parent_names, - parent_hws, num_parents, - SAM9X60_USBS_MASK); + return _at91sam9x5_clk_register_usb(regmap, name, parent_hws, + num_parents, SAM9X60_USBS_MASK); } struct clk_hw * __init at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { struct at91sam9x5_clk_usb *usb; struct clk_hw *hw; @@ -292,10 +288,7 @@ at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91sam9n12_usb_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT; @@ -399,8 +392,7 @@ static const struct clk_ops at91rm9200_usb_ops = { struct clk_hw * __init at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, - const u32 *divisors) + struct clk_hw *parent_hw, const u32 *divisors) { struct at91rm9200_clk_usb *usb; struct clk_hw *hw; @@ -413,10 +405,7 @@ at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, init.name = name; init.ops = &at91rm9200_usb_ops; - if (parent_hw) - init.parent_hws = (const struct clk_hw **)&parent_hw; - else - init.parent_names = &parent_name; + init.parent_hws = (const struct clk_hw **)&parent_hw; init.num_parents = 1; init.flags = CLK_SET_RATE_PARENT; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index dc8eb6036643..285ede5d6702 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -1065,7 +1065,7 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9x5_clk_register_usb(regmap, name, NULL, parent_hws, + hw = at91sam9x5_clk_register_usb(regmap, name, parent_hws, num_parents); if (IS_ERR(hw)) return; @@ -1099,7 +1099,7 @@ static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np) if (IS_ERR(regmap)) return; - hw = at91sam9n12_clk_register_usb(regmap, name, NULL, parent_hw); + hw = at91sam9n12_clk_register_usb(regmap, name, parent_hw); if (IS_ERR(hw)) return; @@ -1136,7 +1136,7 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) of_node_put(parent_np); if (IS_ERR(regmap)) return; - hw = at91rm9200_clk_register_usb(regmap, name, NULL, parent_hw, divisors); + hw = at91rm9200_clk_register_usb(regmap, name, parent_hw, divisors); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index bdb2dfb8fa86..5e65f5b59536 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -247,18 +247,18 @@ at91_clk_register_system(struct regmap *regmap, const char *name, struct clk_hw * __init at91sam9x5_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents); struct clk_hw * __init at91sam9n12_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); struct clk_hw * __init sam9x60_clk_register_usb(struct regmap *regmap, const char *name, - const char **parent_names, struct clk_hw **parent_hws, + struct clk_hw **parent_hws, u8 num_parents); struct clk_hw * __init at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw, + struct clk_hw *parent_hw, const u32 *divisors); struct clk_hw * __init diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index f344cbbc9c25..b3dfdcbc950f 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -302,7 +302,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) parent_hws[0] = sam9x60_pmc->chws[PMC_PLLACK]; parent_hws[1] = sam9x60_pmc->chws[PMC_UTMI]; parent_hws[2] = main_osc_hw; - usbck_hw = sam9x60_clk_register_usb(regmap, "usbck", NULL, parent_hws, 3); + usbck_hw = sam9x60_clk_register_usb(regmap, "usbck", parent_hws, 3); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 0fce17af769e..fa14c6f7d37a 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -288,7 +288,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) parent_hws[0] = sama5d2_pmc->chws[PMC_PLLACK]; parent_hws[1] = sama5d2_pmc->chws[PMC_UTMI]; - usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_hws, 2); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index c00380ed0000..0713a6b21c8a 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -207,7 +207,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) parent_hws[0] = sama5d3_pmc->chws[PMC_PLLACK]; parent_hws[1] = sama5d3_pmc->chws[PMC_UTMI]; - usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_hws, 2); if (IS_ERR(usbck_hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 0d2a834a5903..d0bd025876ac 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -228,7 +228,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) parent_hws[0] = sama5d4_pmc->chws[PMC_PLLACK]; parent_hws[1] = sama5d4_pmc->chws[PMC_UTMI]; - usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", NULL, parent_hws, 2); + usbck_hw = at91sam9x5_clk_register_usb(regmap, "usbck", parent_hws, 2); if (IS_ERR(usbck_hw)) goto err_free; From patchwork Thu Jul 27 05:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13328808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id ACBC3C04FE1 for ; Thu, 27 Jul 2023 05:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=phzRdqbYQagdXNCN8iEHdMdEA4eOkHBtmBmNEpcaB0M=; b=G7jyz+PaAltPe1 M92IOM6q4YCJ+vQ8+paWkIYtFlwoA9c+jTJs+HCzCavwBYJ59C51WPc8/ecOdkx9FuYjV6x7PqDnZ 7KdIlK1re01mxaXXS5ovRO0/OiigXqJICHa4wbvq8rQ85Yt5hz1HS/67XC29M0GfEho+Bw2+gyNpU VkoxDFvvs8g6eTLsXWht3KfUVzKTJd8bzq+nXWP1SpQzeUgBzx5d441ZzLDgRNzf4ILYGQ5JD40i4 q4agZuWIX2vVIVPgFj0N3O06zGsrmXobr/qSdKvLSXXShq8znFxgmnhWG0uUZDCYALJpCRyy2x1Om b3gpiq0o2oSzDJKHClCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOthD-00CDp9-1p; Thu, 27 Jul 2023 05:37:55 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOtgv-00CDjy-0o for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 05:37:45 +0000 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-563e860df0fso375679a12.2 for ; Wed, 26 Jul 2023 22:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1690436256; x=1691041056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MGj8fnk95YF2UgdI2+UIkZtkwoXa64ISRzxRMHwyox0=; b=Ywm0o4powSfA2UBaRTJ5e3QOp6qBwwzYfKaQmkfZK/cBIgZdByQLZqDG7g9hldVmrK LKfjfKHmR2IiQ/fRAOkdCtHvT7hGVEOHfPjw4z9qJcpoQaDxBaO/lVEoftBYH1QZoagv 3M+aB/7QeDbpipvYgJez7zdvLG8usjeXwsWeIKaeRK6hdfC3KFeCrk/iU4R1VLMw+22r cKNyIA0EtTZrh6B9awVPGuC7Gn+GnvldlKxwprAE6+FGOuZIOVr0TikSguzyb0A9/F3f qdnIOg2GLQRDiVojDSeSbSUN1kOm8vQ9QO6+wrqu0NBtZhomZyHr/pKAKCvp22T3a00q 1smQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690436256; x=1691041056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGj8fnk95YF2UgdI2+UIkZtkwoXa64ISRzxRMHwyox0=; b=P3iAn1VBZ+bNERVA3J0MxNenIj+HVwlwn5Sqfc5sIi7wZUXANA54WbAu5U+XHScbkF RH3u01JKrCJ5QoBFonsbIvl1M4gN2On+PafgpvHu6zygpIay5m9gMCWAABuUqbhF9eCr FapoU5bHb3t6xjWqA3PH+zQsy9AI3Eb+v9uQDPJ6QcjHRVw/U6ZaPwST1DMH7+89u4m0 s55lBTzveEgQes3Cdsj/r9u2gDKKLxmOW8olpzi/G242KQcBiEf9BaXyhdWOMCGz/bTG vaFtb20bD9wjml1QzSSKVmiZcVBHIwdBaQvPNdpOfQt5ya0X6nTpLeoCAZELUpsKoWXs F7Mw== X-Gm-Message-State: ABy/qLZ5/+OscSJp+CLZp4vo/kJG8wzVE3FjJ2wS0+AHDER+L2AljQPB 7IfGvbgKiGS+boiA+eOxjfUMEA== X-Google-Smtp-Source: APBJJlFvFb4k1Z2ecpW1EVwDrhqZYgAuvp4+vjV9Qd1lMw5gzgmBXW6LFcQ6J7aI7tCDRnM60zb36Q== X-Received: by 2002:a17:90a:df86:b0:267:f99f:492f with SMTP id p6-20020a17090adf8600b00267f99f492fmr3348479pjv.48.1690436256696; Wed, 26 Jul 2023 22:37:36 -0700 (PDT) Received: from localhost.localdomain ([82.78.167.79]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b001bb889530adsm319059pli.217.2023.07.26.22.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 22:37:36 -0700 (PDT) From: Claudiu Beznea To: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, mripard@kernel.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com, Claudiu Beznea Subject: [PATCH 42/42] clk: at91: clk-utmi: remove parent_names support Date: Thu, 27 Jul 2023 08:31:56 +0300 Message-Id: <20230727053156.13587-43-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230726_223737_308955_014D22A7 X-CRM114-Status: GOOD ( 17.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove parent_names support as parent_hw support is now available on all platforms using clk-utmi driver. Signed-off-by: Claudiu Beznea --- drivers/clk/at91/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9rl.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-utmi.c | 23 ++++++++--------------- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 5 ++--- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- drivers/clk/at91/sama7g5.c | 2 +- 10 files changed, 18 insertions(+), 26 deletions(-) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 1e5262b678f5..1a20ce75201b 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -152,7 +152,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np) at91sam9g45_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9g45_pmc->chws[PMC_MAIN]); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", at91sam9g45_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9rl.c b/drivers/clk/at91/at91sam9rl.c index eaa757f6670a..05ea2bf3c73b 100644 --- a/drivers/clk/at91/at91sam9rl.c +++ b/drivers/clk/at91/at91sam9rl.c @@ -112,7 +112,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np) at91sam9rl_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9rl_pmc->chws[PMC_MAIN]); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", at91sam9rl_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 1968dd69fbf7..b3a7d5803168 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -200,7 +200,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np, at91sam9x5_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, at91sam9x5_pmc->chws[PMC_MAIN]); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", at91sam9x5_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c index 40c84f5af5e8..8e2cf4893609 100644 --- a/drivers/clk/at91/clk-utmi.c +++ b/drivers/clk/at91/clk-utmi.c @@ -143,8 +143,7 @@ static const struct clk_ops utmi_ops = { static struct clk_hw * __init at91_clk_register_utmi_internal(struct regmap *regmap_pmc, struct regmap *regmap_sfr, - const char *name, const char *parent_name, - struct clk_hw *parent_hw, + const char *name, struct clk_hw *parent_hw, const struct clk_ops *ops, unsigned long flags) { struct clk_utmi *utmi; @@ -152,7 +151,7 @@ at91_clk_register_utmi_internal(struct regmap *regmap_pmc, struct clk_init_data init = {}; int ret; - if (!(parent_name || parent_hw)) + if (!parent_hw) return ERR_PTR(-EINVAL); utmi = kzalloc(sizeof(*utmi), GFP_KERNEL); @@ -161,13 +160,8 @@ at91_clk_register_utmi_internal(struct regmap *regmap_pmc, init.name = name; init.ops = ops; - if (parent_hw) { - init.parent_hws = parent_hw ? (const struct clk_hw **)&parent_hw : NULL; - init.num_parents = parent_hw ? 1 : 0; - } else { - init.parent_names = parent_name ? &parent_name : NULL; - init.num_parents = parent_name ? 1 : 0; - } + init.parent_hws = parent_hw ? (const struct clk_hw **)&parent_hw : NULL; + init.num_parents = parent_hw ? 1 : 0; init.flags = flags; utmi->hw.init = &init; @@ -186,11 +180,10 @@ at91_clk_register_utmi_internal(struct regmap *regmap_pmc, struct clk_hw * __init at91_clk_register_utmi(struct regmap *regmap_pmc, struct regmap *regmap_sfr, - const char *name, const char *parent_name, - struct clk_hw *parent_hw) + const char *name, struct clk_hw *parent_hw) { return at91_clk_register_utmi_internal(regmap_pmc, regmap_sfr, name, - parent_name, parent_hw, &utmi_ops, CLK_SET_RATE_GATE); + parent_hw, &utmi_ops, CLK_SET_RATE_GATE); } static int clk_utmi_sama7g5_prepare(struct clk_hw *hw) @@ -289,8 +282,8 @@ static const struct clk_ops sama7g5_utmi_ops = { struct clk_hw * __init at91_clk_sama7g5_register_utmi(struct regmap *regmap_pmc, const char *name, - const char *parent_name, struct clk_hw *parent_hw) + struct clk_hw *parent_hw) { return at91_clk_register_utmi_internal(regmap_pmc, NULL, name, - parent_name, parent_hw, &sama7g5_utmi_ops, 0); + parent_hw, &sama7g5_utmi_ops, 0); } diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 285ede5d6702..68211b36c8f6 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -1189,7 +1189,7 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np) regmap_sfr = NULL; } - hw = at91_clk_register_utmi(regmap_pmc, regmap_sfr, name, NULL, parent_hw); + hw = at91_clk_register_utmi(regmap_pmc, regmap_sfr, name, parent_hw); if (IS_ERR(hw)) return; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 5e65f5b59536..889230d29bf2 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -263,11 +263,10 @@ at91rm9200_clk_register_usb(struct regmap *regmap, const char *name, struct clk_hw * __init at91_clk_register_utmi(struct regmap *regmap_pmc, struct regmap *regmap_sfr, - const char *name, const char *parent_name, - struct clk_hw *parent_hw); + const char *name, struct clk_hw *parent_hw); struct clk_hw * __init at91_clk_sama7g5_register_utmi(struct regmap *regmap, const char *name, - const char *parent_name, struct clk_hw *parent_hw); + struct clk_hw *parent_hw); #endif /* __PMC_H_ */ diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index fa14c6f7d37a..cf1f34a69862 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -253,7 +253,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) if (IS_ERR(regmap_sfr)) regmap_sfr = NULL; - hw = at91_clk_register_utmi(regmap, regmap_sfr, "utmick", NULL, + hw = at91_clk_register_utmi(regmap, regmap_sfr, "utmick", sama5d2_pmc->chws[PMC_MAIN]); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 0713a6b21c8a..707e501b1a73 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -179,7 +179,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np) sama5d3_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, mainck_hw); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", mainck_hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index d0bd025876ac..542c7cccda46 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -194,7 +194,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np) sama5d4_pmc->chws[PMC_PLLACK] = hw; - hw = at91_clk_register_utmi(regmap, NULL, "utmick", NULL, mainck_hw); + hw = at91_clk_register_utmi(regmap, NULL, "utmick", mainck_hw); if (IS_ERR(hw)) goto err_free; diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 61f7027f1033..012e992ce14b 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -1151,7 +1151,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np) sama7g5_pmc->chws[sama7g5_mckx[i].eid] = hw; } - hw = at91_clk_sama7g5_register_utmi(regmap, "utmick", NULL, main_xtal_hw); + hw = at91_clk_sama7g5_register_utmi(regmap, "utmick", main_xtal_hw); if (IS_ERR(hw)) goto err_free;