Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2009276rwb; Thu, 27 Jul 2023 00:06:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEEST3amEroIJ9flYfNuUL2yuBbkpsHET/TIfhMKBMKhUqFqhS/lcumm7qwYsfJc9bTUsIf X-Received: by 2002:a17:906:3088:b0:993:d6e8:2389 with SMTP id 8-20020a170906308800b00993d6e82389mr1273428ejv.26.1690441585055; Thu, 27 Jul 2023 00:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690441585; cv=none; d=google.com; s=arc-20160816; b=CeXndgQaqk4BxCg//VLaxDFXdX6KuV+GVHkn8G/fsR0I/egeJuviAwK7BdrqE/29aL BKywmsCUgFDs6uHmxOrCzIoZZK5/D7dHZc8uMszidFvH51cPuTI8BH+CbIGyouHwCxGB pO+yRHHUy2jKtVlBux5ipZsKzqj7PWqIDO3L6z7YgZE5X9XkcAYDwc1AzVbD00neS2R0 QYSN72nK7rwXBkrHBsRgMC0Nd2A1sXy9auRgnVLf1gzHzduSeQuQ0eLU4WUITqicxIGP NS+h24GJTZBv/KKkTYZLPLKgiZ/uRjHi5r6R1st8BTeTep1W2tsd/z45mP3ErqsYlalC VZEQ== 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=tDrEaG1FrYIYPpIkYqTQ35Nb2gC0x77uQ2+oCiptl8Y=; fh=tq3emQg2XKUdfmQAxndWD33KQiXPLzS/0J6S3sPMeMI=; b=zDE1tORQCCvNbBHaUI+36LxVE9/UxDDvfUyn9wcC2dqD2AJCY8I1TorRgU0WjRnaMx pp8fMNH1nwM+I+qEIIzlQbl2aBLpxvkj+/9RF5o32+nce472ExltygOuh5VycV0sNWZ3 rkpQS00cg8Qokq+yks/1TjSFOCFemHRV65f6OkozZsS+ScuSWHYYnr61QsFV/PscC/U3 oNH8CuEBS7iGAwIN8iZptr3shY4Xx9LBrZIwQjZMxXKjHJZUouOtPvGDmKpFhGSsDcs8 rIONW3hm6OOdkTdBEX3pcmuixID08XiwRUz9WwxlXB2RecjBAtcm80Y+b1Pn3mGwsoWC fr9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=TNmQRH6X; 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 q22-20020a17090622d600b0099bbcfbd199si618610eja.988.2023.07.27.00.06.00; Thu, 27 Jul 2023 00:06:25 -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=TNmQRH6X; 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 S231767AbjG0Fdo (ORCPT + 99 others); Thu, 27 Jul 2023 01:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbjG0Fdj (ORCPT ); Thu, 27 Jul 2023 01:33:39 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D57430C6 for ; Wed, 26 Jul 2023 22:33:20 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b9c5e07c1bso4614265ad.2 for ; Wed, 26 Jul 2023 22:33:20 -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=c3h/72nEX/Hbd05Xwqf8uD929p/SotPuTRnDhxJ5bN2La8PSdBuutTcQahmC0/wjCN ebJKakUm8jUhiynx0HyPluTkm8RxZl5WuMekqvAM00GFm04XKacLt0BHtsauGvEGfDTm 8nkjrvmShABmciZe+BBGB6TrcCdpCujBqHTJND6CF20X9FVbetXpZQHR9T1eV7f5IQcJ qV4vxk2oCiTuZcerplaidIZ8r+40KPkfkOXBDYP6prh7rIHqruL6/AQpmukzlf4PrWpG k09ro0g5UeQfBSUWRUKyOx2GXTmYGQ2k8JCRtebeqEik2uued2wDtxWGgv2+1VhogeaB 0nuw== X-Gm-Message-State: ABy/qLZa/YWRISRPrYc9qWanf+J9r/8IicOcjXuuKrq5OKGyEjJnpR57 GasPvwqe5N7I60IfpTtIQDyaew== 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 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=unavailable 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 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; -- 2.39.2