From patchwork Thu Apr 8 18:57:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12192295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BA66C43460 for ; Thu, 8 Apr 2021 19:00:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3520610CF for ; Thu, 8 Apr 2021 19:00:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3520610CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=1q6XqCbcn/si5SAD0+KH/hSmP2KKeByTs+Mj0bEYHBE=; b=bOHidl0B8Ld2qqpiJqX0AwL2P 6iFa7CoZV2w3UnZDjsiCB7yHD9smNYNHYebaDskkXaZ+meXU62ct+WnlocHCGokHWU47heHK9Qvxy E/diOwRogzp5K0QrrIe3iTJo0xA4os+jwB6aovmX2OXBkfqm1jdVhKlMacjJXnGH7dqAU3n6FuNaD C5jzC+UUw/rtyvAHCtzhVYSCi2TVbmR9O+iYd9xOOaeAPDG/7CmnrHgbIOiacOgYIbZ1YY51boI24 LO9MzgzjHOcwxCOHaoKNvVtuxld11Q9IleHQlUB+JjZniNOiBr4EZUNS6i27Ko60XwyJI80vvP2PF mEA5hSXhg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUZqx-0091d0-0D; Thu, 08 Apr 2021 18:58:07 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUZqf-0091U7-A5 for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 18:57:51 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4FGVrX3fPHz1qs3X; Thu, 8 Apr 2021 20:57:48 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4FGVrX3FwZz1sP6L; Thu, 8 Apr 2021 20:57:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id yKdnRZjQGlhH; Thu, 8 Apr 2021 20:57:46 +0200 (CEST) X-Auth-Info: cl6Qrnir4ogKBLWSnkIvFaukjculI3dZHSOpLRTSF1A= Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 8 Apr 2021 20:57:46 +0200 (CEST) From: Marek Vasut To: linux-arm-kernel@lists.infradead.org Cc: Marek Vasut , Alexandre Torgue , Christophe Roullier , Gabriel Fernandez , Patrice Chotard , Patrick Delaunay , Stephen Boyd , linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 3/7] clk: stm32mp1: Register clock with device_node pointer Date: Thu, 8 Apr 2021 20:57:27 +0200 Message-Id: <20210408185731.135511-4-marex@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210408185731.135511-1-marex@denx.de> References: <20210408185731.135511-1-marex@denx.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_195749_465740_C609C4F0 X-CRM114-Status: GOOD ( 16.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 Use of_clk_hw_register() where applicable to associate device_node with the newly registered clock, elsewhere use functions which permit passing the device node to newly registered clock. There are two exceptions, _clk_hw_register_fixed_factor() does not pass the device_node pointer to new fixed factor clock and neither does clk_stm32_register_composite(), because there is so far no way to do that. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Christophe Roullier Cc: Gabriel Fernandez Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org --- NOTE: But if this patch is acceptable, the _clk_hw_register_fixed_factor() and clk_stm32_register_composite() can be easily fixed up too. --- drivers/clk/clk-stm32mp1.c | 44 ++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index cf5a1d055c5a..85bba1ee5fbd 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -384,14 +384,11 @@ _clk_hw_register_gate(struct device_node *np, { struct gate_cfg *gate_cfg = cfg->cfg; - return clk_hw_register_gate(NULL, - cfg->name, - cfg->parent_name, - cfg->flags, - gate_cfg->reg_off + base, - gate_cfg->bit_idx, - gate_cfg->gate_flags, - lock); + return __clk_hw_register_gate(NULL, np, cfg->name, cfg->parent_name, + NULL, NULL, cfg->flags, + gate_cfg->reg_off + base, + gate_cfg->bit_idx, + gate_cfg->gate_flags, lock); } static struct clk_hw * @@ -415,16 +412,12 @@ _clk_hw_register_divider_table(struct device_node *np, { struct div_cfg *div_cfg = cfg->cfg; - return clk_hw_register_divider_table(NULL, - cfg->name, - cfg->parent_name, - cfg->flags, - div_cfg->reg_off + base, - div_cfg->shift, - div_cfg->width, - div_cfg->div_flags, - div_cfg->table, - lock); + return __clk_hw_register_divider(NULL, np, cfg->name, cfg->parent_name, + NULL, NULL, cfg->flags, + div_cfg->reg_off + base, + div_cfg->shift, div_cfg->width, + div_cfg->div_flags, div_cfg->table, + lock); } static struct clk_hw * @@ -435,10 +428,11 @@ _clk_hw_register_mux(struct device_node *np, { struct mux_cfg *mux_cfg = cfg->cfg; - return clk_hw_register_mux(NULL, cfg->name, cfg->parent_names, - cfg->num_parents, cfg->flags, - mux_cfg->reg_off + base, mux_cfg->shift, - mux_cfg->width, mux_cfg->mux_flags, lock); + return __clk_hw_register_mux(NULL, np, cfg->name, cfg->num_parents, + cfg->parent_names, NULL, NULL, cfg->flags, + mux_cfg->reg_off + base, mux_cfg->shift, + BIT(mux_cfg->width) - 1, + mux_cfg->mux_flags, NULL, lock); } /* MP1 Gate clock with set & clear registers */ @@ -598,7 +592,7 @@ clk_stm32_register_gate_ops(struct device_node *np, hw->init = &init; - ret = clk_hw_register(NULL, hw); + ret = of_clk_hw_register(np, hw); if (ret) hw = ERR_PTR(ret); @@ -889,7 +883,7 @@ static struct clk_hw *clk_register_pll(struct device_node *np, const char *name, element->lock = lock; hw = &element->hw; - err = clk_hw_register(NULL, hw); + err = of_clk_hw_register(np, hw); if (err) { kfree(element); @@ -1021,7 +1015,7 @@ static struct clk_hw *clk_register_cktim(struct device_node *np, const char *nam tim_ker->timpre = timpre; hw = &tim_ker->hw; - err = clk_hw_register(NULL, hw); + err = of_clk_hw_register(np, hw); if (err) { kfree(tim_ker);