From patchwork Sun Dec 29 14:49:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3775 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BCE6D3F174 for ; Sun, 29 Dec 2024 15:50:50 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5d401852efcsf2113860a12.2 for ; Sun, 29 Dec 2024 06:50:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735483850; cv=pass; d=google.com; s=arc-20240605; b=QBqD5ndWW22h8ziy9qotuAO0RlBZIirj+TIp5ZY2iGgc84xQuNAoJO/3C9U3U39ckk 4GoRtwl+nE8Ik3fTLwaufiZj+Z+C1hUgqT7eJw2iGYcok4eNirwanW9sENL4NZaTRUpa X/WCd86u/aiYdVKbA1TIl01ER3B83v9ICMARv2VU2ImUXzrp4VYPf8jyVgWmPih/efYh 0QHMd+lk3QLsOWiyUNBIZLbjKSTf+htsELRWMvGBHW8gq+RbNVqo6IlV2y3HGrpYiYUe yhmiD9qbKHAlXRLmcrkHGP6VwBO38NNYR8BklQU4i9YPY8v6Y/vt6wVA+txPbTT24b7x Zucg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4qm7v1Sqd+/QOvs8Buuub8VboolYTFhtWq0iKyij33o=; fh=KlKhP6aJn9EeWD0cbiVfG/D3I+RsyQmZSveGLttC8Nc=; b=c6mIMCSFnmO8dWRvxsP1n1rETxqG6QJH+oYP6+mFuItnSiHRSk3gS18JENUNiTXXPA d2ONdsIgw/EbRxIzwgwKM+UR8ZqVHUOy7xyoY2l051UcV2IKdSGHRmTcTvF33ERHqvam lfgtUmTcMhFQiyESLi1s6jZ8YunzwTTJBTKLXMJR/4sueztqM2z7N5/iohAtKTFPQ2TQ 24aeKqogoNC8Vkd8Z+K+umz1UjxKRjqoAjN6fEZY1iZtbsA3/wtv7xxxt4Pfqnfx7VIG KHRYiZbWrP3NCCXEj5qUoObdL5QZsmQsJPvRsUsSFJ3Vlg8q8goF+IAq28euF/1rR+SF p3NQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b+97rXzz; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1735483850; x=1736088650; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4qm7v1Sqd+/QOvs8Buuub8VboolYTFhtWq0iKyij33o=; b=FPYpmGSxwZbFz3dIzmJwYi9TPij+xogJy2VAsafnujTnsdqf996r9RsWKXsnfhW4xK wMg/vqg0aAMlbveh3d7QLjL1punEpeAgRQGP3odmlSA8KLlRgZESwASGXY7/TXhZYIOG AZ3JfuI6dGRd8X0cFb2kYYrXxS2SAqGZbe+/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735483850; x=1736088650; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4qm7v1Sqd+/QOvs8Buuub8VboolYTFhtWq0iKyij33o=; b=vz1e6XS1zu1p28wSAT6XOe7g0UsKeo8BA+nTQbJaFtgKIYnTu2UFUtm1kaCCK2Q9fd 8IodjIpLl60+CTxMed801P6PhG2KHU1PCySXuYU/NoP1SSTvz3C83GURtnPriXPUcMOA CkQEM+sxTextirWFB+4zM5iswi9vOf6/dF6mmJ+N0deykzJmxtgslQegWbC4gEThEoQ1 l/EVA6s+wGHTWIxPVAzL6pNwGoGgvOJXngDEz+3yscGK2aWUuuYxhSl8HZqVBnQPhCs/ mLYWbePV7og9TKSHhbgLIzB8rv92+udi88tUPznUDwAqP1yoxwzNJWX9TMy8/Z6NFcdF +DAw== X-Forwarded-Encrypted: i=2; AJvYcCWvzhBo+CPoLtU8aZl2H18Bvbv31pC1Iz3oTvBsl+4MWlxURCq9bv3Tkcm8l0z54eY7uj5VvSK2tp5xM63B@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyfHr7PEEwECnN8OYMSC/qh/scN6Vde+UR+AXnh70FMEp63lw63 s2TaxEXt47NhmLhq9fiCojRnz8hnY3V2FH6WlKepVEwAXx44Iw3gDS1KBbjseb9kng== X-Google-Smtp-Source: AGHT+IHRBSdXv4+/tBWmNa17+NWKlujuVwq7e4Us3Jx+LBYRbZIztrdU4HHqJWZ38yV/CqMSLAMr7A== X-Received: by 2002:a05:6402:43ce:b0:5d3:ec6e:64bf with SMTP id 4fb4d7f45d1cf-5d81de2dc4amr29800989a12.34.1735483850447; Sun, 29 Dec 2024 06:50:50 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a50:ba83:0:b0:5d3:ce70:f22c with SMTP id 4fb4d7f45d1cf-5d86f3f224els358212a12.1.-pod-prod-04-eu; Sun, 29 Dec 2024 06:50:48 -0800 (PST) X-Received: by 2002:a17:907:96a0:b0:aa6:7feb:193f with SMTP id a640c23a62f3a-aac2ad81a25mr3181093666b.20.1735483848479; Sun, 29 Dec 2024 06:50:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735483848; cv=none; d=google.com; s=arc-20240605; b=De69av7J+npqzdLeioUmMuBZPVmyv/a5GQL81/kw2nrkI7/8PdZ+UH25hn++qEw30W SQEuqkWXEV7eUP3JgzNE/46thnmNzPsIAP1VVnzI+vG2/9Yr4R0X4zVQPpe54aAt2WA+ iSQLA/eJ6ZDX4UEH2r4Oud1Qq50if02AGEr1HzlPQPvamEmHGcwgwKZfv+M1JjCrs1Iy 2lspfi+0NkOzdePIDGjidSWwcaWdIrTHWlEUAhkc7/Oh3uPFrkAopu/O2atGrq9jeCpr +jjDZuSulKfjprLMWaRQjCcl0wspks8GVySlIdg1W+ZG3pz/tV39d/S+0PQdYNs0Ds5j aZQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=CHfQ/VeJmhz8wn8A9KlfaIopMLyJVISWJA2tyBqE4w0=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=HUjwbUGhllSHYGCBkSeOHF5yw+HwNy1LGOEAKTEAsqV/LS+HSsHjBt6Yi2BalYrgJ6 WY38/zP08O4uLOE7wIPA2i6yeebHXuGMab1FO9LbC6NBbij0R5tPeRqjteLPCAwJELGK J2oXDqi4JN2Ko81piPBzgjGxziuO3nws1WY9eUC7o3V79kB+h1ZmYPTue1Jd7sNHbgBh 5EBLf242Ad/ZEH978yLyAeTYqXFfucY+DqxeBbIJLnXEkLGp/uXRzuEy4qATPJk2MGAA UDx2VVspMSQwu9GZhaa6jw8yxXPgPm2DHU/zbfBl6kQSRbTKYcqV2p0yV634owHFFY+6 bmPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b+97rXzz; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-aac0eae5d8asor760420766b.10.2024.12.29.06.50.48 for (Google Transport Security); Sun, 29 Dec 2024 06:50:48 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: ASbGncurPplvEaqA0i5eaaa5XlgcMq2iHaDrwZMs4r155JFuuFazl2xmRVRL8iMa4pP ea0dIcR4OeKvhQOGM0oQxVveFqEDYjGnyoNpk/SIeqWutyP5zrWNmt2m149Qzb256Dt9I+N7lea dzV+ZVgtMvWgq85T4iJUdrp5ic2UETBFlE6wN6hbF5MGcivlZBNZk9kR1i0LtCHkP6K0sJkNpck 7xirmR1ew6Zf8mJ3/obMCz9evqJpdreqmkqAd7YwhULy0DOt8A8EPcs/G7A6EjRiDB2wLX+tPtX jX1cXlioy14XZ9ghhXk+hQ== X-Received: by 2002:a17:907:96a0:b0:aa6:7feb:193f with SMTP id a640c23a62f3a-aac2ad81a25mr3181092166b.20.1735483848082; Sun, 29 Dec 2024 06:50:48 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.43.175]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895080sm1362084466b.47.2024.12.29.06.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2024 06:50:47 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Abel Vesa , Fabio Estevam , Michael Turquette , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Stephen Boyd , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v8 10/18] clk: imx: add hw API imx_anatop_get_clk_hw Date: Sun, 29 Dec 2024 15:49:34 +0100 Message-ID: <20241229145027.3984542-11-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241229145027.3984542-1-dario.binacchi@amarulasolutions.com> References: <20241229145027.3984542-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=b+97rXzz; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Get the hw of a clock registered by the anatop module. This function is preparatory for future developments. Signed-off-by: Dario Binacchi Reviewed-by: Peng Fan --- (no changes since v7) Changes in v7: - Add device_node type parameter to imx8m_anatop_get_clk_hw() - Rename imx8m_anatop_get_clk_hw() to imx_anatop_get_clk_hw() - Drop the gaurding macros so the code can be used also by i.MX9 Changes in v5: - Consider CONFIG_CLK_IMX8M{M,N,P,Q}_MODULE to fix compilation errors Changes in v4: - New drivers/clk/imx/clk.c | 15 +++++++++++++++ drivers/clk/imx/clk.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index df83bd939492..a906d3cd960b 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -128,6 +128,21 @@ struct clk_hw *imx_get_clk_hw_by_name(struct device_node *np, const char *name) } EXPORT_SYMBOL_GPL(imx_get_clk_hw_by_name); +struct clk_hw *imx_anatop_get_clk_hw(struct device_node *np, int id) +{ + struct of_phandle_args args; + struct clk_hw *hw; + + args.np = np; + args.args_count = 1; + args.args[0] = id; + + hw = __clk_get_hw(of_clk_get_from_provider(&args)); + pr_debug("%s: got clk: %s\n", __func__, clk_hw_get_name(hw)); + return hw; +} +EXPORT_SYMBOL_GPL(imx_anatop_get_clk_hw); + /* * This fixups the register CCM_CSCMR1 write value. * The write/read/divider values of the aclk_podf field diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index aa5202f284f3..50e407cf48d9 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -487,4 +487,6 @@ struct clk_hw *imx_clk_gpr_mux(const char *name, const char *compatible, u32 reg, const char **parent_names, u8 num_parents, const u32 *mux_table, u32 mask); +struct clk_hw *imx_anatop_get_clk_hw(struct device_node *np, int id); + #endif