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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9194FC001B5 for ; Thu, 2 Nov 2023 12:20:47 +0000 (UTC) Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by mx.groups.io with SMTP id smtpd.web10.29549.1698927636349487939 for ; Thu, 02 Nov 2023 05:20:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@sberdevices.ru header.s=mail header.b=E5UKK0KV; spf=pass (domain: salutedevices.com, ip: 37.18.73.165, mailfrom: ivprusov@salutedevices.com) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 9851310003D; Thu, 2 Nov 2023 15:20:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 9851310003D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1698927634; bh=gBOdzydja8Nsi8AZU2xyNEDvA6Dqk2mnbxHqrUlwk0M=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=E5UKK0KVAU+P0oPfRgpNkhzsHJqgPxefyb4j8Jz/hl3nvUh+AxUytrIJloyPfChB6 KlXhV4DgT7zryq6vrpJ5JvtHrtcdLEM0092U9WdpdPBCoYGQT+pyC3knQ+opaa/n5x s457HgfNBo82zRCtc5ob+eghFYrt0EPCY10eunrewnQvE8nvaVF3rIUgEXp9fBuJSU Dk90c60NMlBkFewicfIJensuA6xQJbCo7xG0KKZ+j48yaTJZ/avWct0i+vl9bYoldi R+pws9fzhr3IuqNxWdwhoqfscg2iQKJqvgA/pV+L6X9QrMgwdYeYPTJJop+LQaM0HZ lxKks7K2sROnQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 2 Nov 2023 15:20:34 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Thu, 2 Nov 2023 15:20:34 +0300 From: Igor Prusov To: Michal Simek , Daniel Schwierzeck , Lukasz Majewski , Sean Anderson , Ryan Chen , Chia-Wei Wang , Neil Armstrong , Stefan Roese , Patrick Delaunay , Patrice Chotard CC: , , Igor Prusov , Aspeed BMC SW team , Joel Stanley , , , Subject: [PATCH v5 3/8] clk: k210: Move soc_clk_dump function Date: Thu, 2 Nov 2023 15:20:12 +0300 Message-ID: <20231102122017.56995-4-ivprusov@sberdevices.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102122017.56995-1-ivprusov@sberdevices.ru> References: <20231102122017.56995-1-ivprusov@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181075 [Nov 02 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ivprusov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_smtp_not_equal_from}, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;sberdevices.ru:5.0.1,7.1.1, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/02 06:57:00 #22385341 X-KSMG-AntiVirus-Status: Clean, skipped Content-Transfer-Encoding: quoted-printable List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Nov 2023 12:20:47 -0000 X-Groupsio-URL: https://groups.io/g/u-boot-amlogic/message/1813 Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov Reviewed-by: Sean Anderson --- drivers/clk/clk_k210.c | 92 +++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/clk/clk_k210.c b/drivers/clk/clk_k210.c index c534cc07e0..2f17152021 100644 --- a/drivers/clk/clk_k210.c +++ b/drivers/clk/clk_k210.c @@ -1238,52 +1238,6 @@ static int k210_clk_request(struct clk *clk) return 0; } =20 -static const struct clk_ops k210_clk_ops =3D { - .request =3D k210_clk_request, - .set_rate =3D k210_clk_set_rate, - .get_rate =3D k210_clk_get_rate, - .set_parent =3D k210_clk_set_parent, - .enable =3D k210_clk_enable, - .disable =3D k210_clk_disable, -}; - -static int k210_clk_probe(struct udevice *dev) -{ - int ret; - struct k210_clk_priv *priv =3D dev_get_priv(dev); - - priv->base =3D dev_read_addr_ptr(dev_get_parent(dev)); - if (!priv->base) - return -EINVAL; - - ret =3D clk_get_by_index(dev, 0, &priv->in0); - if (ret) - return ret; - - /* - * Force setting defaults, even before relocation. This is so we can - * set the clock rate for PLL1 before we relocate into aisram. - */ - if (!(gd->flags & GD_FLG_RELOC)) - clk_set_defaults(dev, CLK_DEFAULTS_POST_FORCE); - - return 0; -} - -static const struct udevice_id k210_clk_ids[] =3D { - { .compatible =3D "canaan,k210-clk" }, - { }, -}; - -U_BOOT_DRIVER(k210_clk) =3D { - .name =3D "k210_clk", - .id =3D UCLASS_CLK, - .of_match =3D k210_clk_ids, - .ops =3D &k210_clk_ops, - .probe =3D k210_clk_probe, - .priv_auto =3D sizeof(struct k210_clk_priv), -}; - #if IS_ENABLED(CONFIG_CMD_CLK) static char show_enabled(struct k210_clk_priv *priv, int id) { @@ -1342,3 +1296,49 @@ int soc_clk_dump(void) return 0; } #endif + +static const struct clk_ops k210_clk_ops =3D { + .request =3D k210_clk_request, + .set_rate =3D k210_clk_set_rate, + .get_rate =3D k210_clk_get_rate, + .set_parent =3D k210_clk_set_parent, + .enable =3D k210_clk_enable, + .disable =3D k210_clk_disable, +}; + +static int k210_clk_probe(struct udevice *dev) +{ + int ret; + struct k210_clk_priv *priv =3D dev_get_priv(dev); + + priv->base =3D dev_read_addr_ptr(dev_get_parent(dev)); + if (!priv->base) + return -EINVAL; + + ret =3D clk_get_by_index(dev, 0, &priv->in0); + if (ret) + return ret; + + /* + * Force setting defaults, even before relocation. This is so we can + * set the clock rate for PLL1 before we relocate into aisram. + */ + if (!(gd->flags & GD_FLG_RELOC)) + clk_set_defaults(dev, CLK_DEFAULTS_POST_FORCE); + + return 0; +} + +static const struct udevice_id k210_clk_ids[] =3D { + { .compatible =3D "canaan,k210-clk" }, + { }, +}; + +U_BOOT_DRIVER(k210_clk) =3D { + .name =3D "k210_clk", + .id =3D UCLASS_CLK, + .of_match =3D k210_clk_ids, + .ops =3D &k210_clk_ops, + .probe =3D k210_clk_probe, + .priv_auto =3D sizeof(struct k210_clk_priv), +}; --=20 2.34.1