Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1935678rwb; Wed, 26 Jul 2023 22:49:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlGKERtEqeeMGJgFd9wg4W6Xp9qa6oxsTNBnbBR6AHxUClGb+WjF7iN186gDIqqvhOTsYbp+ X-Received: by 2002:a05:6a20:440c:b0:137:2d73:707f with SMTP id ce12-20020a056a20440c00b001372d73707fmr4263361pzb.5.1690436955522; Wed, 26 Jul 2023 22:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690436955; cv=none; d=google.com; s=arc-20160816; b=WY39isoN3tRAkChJvodB34j1P9yJylq7nFa+MpKCKMCsY0EGgSnRRl9fWirOKKnIfu D25jpf6lzp0ZZ6tfeFyE5ojiDirwcrvoe3tE0MJoBB9M9fB5aOvGkrmFXKOVxGkjIrKz 4PEsVDtY1dnWkXkSI5nJOB/42AaOgrJl8oB6MLMYB/Z9atSv1/muP0FXaXi08+6azZG8 MapdgxfPi9nLxZ5vnRnDy5rOnwDyvKta90950xFKhywGqjhJKtueUhKn6ta0IP9rXEr7 Mmoor0hw+3gZOPDTtE69Ywfp+5X+xH3as4w21dPRwc4BpC6gDljeRCCoUQJ57Nspa0NY 0DVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mS51ZmJrNJRKzR5R8YYwfuBh1xwTctc46iViNhup/Iw=; fh=tq3emQg2XKUdfmQAxndWD33KQiXPLzS/0J6S3sPMeMI=; b=PrTC7Q8/ueYHVn4+DRGprs39pHlTvY2fIYIC0VkJ9AGortqs/fHyr9Sp7BdeFm3Xia u1eQhSam6rNRb8Pt9Z7UkAvWwobRhfpZvvUeMxJ69zPyTvWazEHr2Nqgnx1AwgyDiSLW J+dguRvkR5OAg/tmcrNvYGsNq8raCW7zZlkUUFT0WonJHWZfdkO7QykMFc7X+/FurACt NOFPGQbeE6mIEBTMmwrYHBIUFQmylyFENoztJ5mWjr81k6s04pl81zwZ5WnSIbLuvbZ9 JfxNHv7Pctf+ThEr2wHJkY4Crlv366ZSL+W+nLWRRDGDenXuH9OtJ+xnebPIzr7RGfMB n/jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=a+aBIZxH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn12-20020a056a00340c00b0066f7fe56433si797610pfb.103.2023.07.26.22.49.03; Wed, 26 Jul 2023 22:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=a+aBIZxH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbjG0Fdd (ORCPT + 99 others); Thu, 27 Jul 2023 01:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjG0Fd3 (ORCPT ); Thu, 27 Jul 2023 01:33:29 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB96273D for ; Wed, 26 Jul 2023 22:33:06 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bb8e45185bso3481315ad.1 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=fSGCtsFZblSEjMbzQ32iHyNEBGZegMGCHALyVXMYWMrxvB5gfyZe2BjjXeCH4hrVZm rQgra1Rm0LPqTEhWFxsRnpC3/5wxcY/+r6Z3KhEI55qxJVjhexvbtmM7rIWxn3mkvVg4 KYQmGTc/sSaHtACbfRB+q++ATlMWeu+QH0ARQdo77cPs2ejRaY5dPRTo+j5zLOB98qLA KV+7nA4ZnP2FJ5iRpIbWB04U1EU89TdkmFA3Ybtl2v3rr3PBKxoXLXY2QW5opHgKaoUs PNybGPjep+9h7MvyG7rEpWbxMd3QoEO58Rvl8iqVMGQaAvs7u5R6MCP0erAHV4DPaGlq KBeA== X-Gm-Message-State: ABy/qLZQM720PszPDHdAw/LSmnjkFVbvMgFfny90oFigzNXSxzg22VQ+ KO3O3C6/U6/L4n6LOby2TiUeEw== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.39.2