From patchwork Fri Dec 27 16:56:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3754 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 E3B8E43434 for ; Fri, 27 Dec 2024 17:57:50 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5d3f3d6a922sf3848240a12.1 for ; Fri, 27 Dec 2024 08:57:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735318670; cv=pass; d=google.com; s=arc-20240605; b=AUEs3C6AHfkUYh06Z7v325bSRdJ4t6iUYxxdLB1y0t6cZDyPMunZ6oGBh98pMKzz6l YwF1AMsmgK+WyCO79SxntF4DWgRSD/URgn2JGu3Kl9c2+7+aPWzkO9lOipgKJoxFmBMK RqGCA3AwfNQH7RDNvzzDnvSCE5YMn2Npyzf0s1EBrKTwFm3YYBAnmM9TDyM+KETfUh2W lu/0r9HSHzPTKxfnsbrbjYwgHoU4SVCVLjNXm9QI/JF8k8UWX8jQsagBDahYUepPR03Z KMZgH9l5G6BelD4C8iSLxW1M8VuhSaMIV4hRCcCy7BQBf2SyH0edKerQtql15+w0WU9v zgNg== 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=pBlcb29rc5V13oTqcl6xRMsMBIZ8ms/OjgEuwVt1RfQ=; fh=afNMPfqQhOMDowx9rfqKO7eQIzrqY9HG1ZZx2ECnAzU=; b=YEK14ZgCmPs8CbX02f1VG+xGnB+vswPEeWSBL/a7KnKiS8NFFW/Kh3FgsoGaJuSsEw kvQGVAlnZBRPYjl8wN9NaGH0dWlyfpQNEiXQ0jLQwP3mvoZRwaiy1jl4YUFxcTfoYorA ONHBoEb5/7UirGdYg7l6ORdVYILQZY+kOmA1Xaksbzjt+oFP3AVvs2TlFg93scim9ROD O5vT2PedIi8RjXAUYblx8rzcIh4akfnAlOX4Ecm+tmdRXDk006Eid736smT9hfVJwhFR unx/YHTgvPqK9eDutI4kwXCbKAKSCiSqsh5cZvmjU3wnDW6m9Kf7zWA4bm8MPTcUtsig dJWQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T4gshfVc; 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=1735318670; x=1735923470; 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=pBlcb29rc5V13oTqcl6xRMsMBIZ8ms/OjgEuwVt1RfQ=; b=lhxu7vkes8fMAd+yG1yTYyNoDU4/IIW5ob2HMqrhEy+PBZCK0Rdp9ciRHjqroZM3Zh b01d3tXrSolLKRCqhKm9tFrcFWjpXJxHoY9J5NhE1iQDFqgtbQTKHnAeAElbwXeWkuQ7 e6IZlhlNvL1UcuV0cUAjvs4r6h0KuHrrLytxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735318670; x=1735923470; 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=pBlcb29rc5V13oTqcl6xRMsMBIZ8ms/OjgEuwVt1RfQ=; b=gsik/IZ6rBrf/OiHgaItz2rdOUx730BnD59bBHQmwyUQby3drEDrKqzhoEOnPEfqRx qOwFAiHo+BF/abkNdIEuJVj53ji9/Rmp0hht0RqyVGlS+6wwKqwY6OAtFmwuXOA0v/gI ZXcRdhNEc8IDET0TAGSTcpOiY6rNQi2UaWIyO2dvYyYGoEIDx/vH7E7p77mWlOzfi1zJ l1/YQfYPlWe2FTZjXTfJqcwTeyVOg/eTGtNGb7jFtlBywLReTdx0Fer7Gu8AesIRBEvj A8vnjPbsLv7QYjFLHWc9FfGQoxzF88YF0Xh/Jr0ZRCffSdT+St1uL2XQrLprGqRpe9u5 jKPQ== X-Forwarded-Encrypted: i=2; AJvYcCUB3i+dCNuadaC+pQiKKTcVKC/8wbjsX+CnKXf06j+IVMGpO7RGL4lrwlAf8+noQ1F2DgsE8o2ZmE5srqZL@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yzyx/8hWJWqvC3t5vs44Uc7gSX0ve3iT29c+yXRgcBRGWvfbQ3i 4+Qh0KbawpAeCz4Jve0K+XB+XxC65z0APhYQ2f8gW7xbqz1Za/9dYL4R7/WDnSuSsA== X-Google-Smtp-Source: AGHT+IGTLuUDewlPV03ytVC4PLnduwU2hJl+4jgdTYcDBx6invSkskqMjsw2NTcQg9NB52ejweRv2A== X-Received: by 2002:a05:6402:40c1:b0:5d0:e3fa:17ca with SMTP id 4fb4d7f45d1cf-5d81ddfdd7fmr22592624a12.15.1735318670607; Fri, 27 Dec 2024 08:57:50 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:e9b:b0:5d3:cfc7:9eef with SMTP id 4fb4d7f45d1cf-5d8b86c7bb2ls113642a12.1.-pod-prod-08-eu; Fri, 27 Dec 2024 08:57:49 -0800 (PST) X-Received: by 2002:a17:907:3d86:b0:aa6:9eac:4b7e with SMTP id a640c23a62f3a-aac2d455458mr2795755666b.30.1735318668861; Fri, 27 Dec 2024 08:57:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735318668; cv=none; d=google.com; s=arc-20240605; b=RzZTsMU2/aAUdBZbfyVv5SEAoWskXQYJJ0LtvJaCF+5QS4mFGMlZDAnNtGYs8SDIhK aymmh1Ti30hVYttsf8FHAf7kAHp7YrBtTBGtipwVQyYGrVO/jAQceKu2zQ0vPBL2xF0r Afp3bk/Zn67yzvMNHjFMY3DZr9P5T0tGRSMj6vkHO+9HKO3GlokHtgI33mMNZp387kTK ZrHt/lHywGv7nwIBB5PsbdOzP9lksBO6DI1B/yjhkAyE/zGZctbbrbI7WJ0nwStFLXak jSUzyaigiZzD+fRo8sfzgyW5qYuC3Vi3Pf4cW34mzbJhJ+4TLGXpzVwa00YQ+Bi7pAOl lkQg== 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=2b1DvWsKR3kWK9JNfXRovoEHigCoxQCmQlYrGVfIyUo=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=fYgfckivOep5WiOvlQlNQWHOZFd9EOSqMBw3POic+WxDfcXPTM9IPGHtGwDomWVfH6 /bvpkIy0X46ZUr2i4mnhYLDm/dIt2rKYNKyrC4zstWV5Eis9jUBFCIxobap6lBdsVAAW 8hWPeBun6GR9+nPbEgYRvIqov+Kgb0tOOrW69X7KOBi6RLzpDyiGPMgj1OjFXY2sw4kA afzTxBmxsg1NwLg471qLW1rV7I5Vtd7H90YVuTmtYp7vbYS6Edbe9DK3nrY9ZwxXXw7s mf8llTWLeqcXNkk0I3jGXnsfe/eg++qcY5swrZ1QhbODMrQRIdt5LURHkTSTYNN9Jupr vNVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T4gshfVc; 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-aac0e80fa37sor670927166b.1.2024.12.27.08.57.48 for (Google Transport Security); Fri, 27 Dec 2024 08:57: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: ASbGncv/pGKf8q5MPuFqr3wqIHgf5Y0ZbEsvI4d9qBUM5d+dHY50tYoj9vJMYtVQAEW nfil1Z82S/8g3TsP6ruHeYaxPhJBECeL/QYIwGL0hSUbYPUBik9XcYrvnmdcsoWMcs8cUihfdZd NqxU0bC+hIVy+wFFbQp1rSvg2Exx/ObgAB80AeusaTfWdxWS6bVJRQGwcvWUapMe/dWizA6nak7 MXNkXbHNB8bXpXBiDvmXf6yJyBErOA+TpsjKSVFWqICbvA0nZE/IDdOeVjycibN3IkOzHbwcRCp 33pi1aR2woA6TaGbwYCA6w== X-Received: by 2002:a17:907:704:b0:aac:23db:af61 with SMTP id a640c23a62f3a-aac2874937fmr2719500066b.3.1735318668380; Fri, 27 Dec 2024 08:57:48 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.43.175]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f0159f1sm1130097266b.154.2024.12.27.08.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 08:57:48 -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 v7 15/23] clk: imx: add hw API imx_anatop_get_clk_hw Date: Fri, 27 Dec 2024 17:56:18 +0100 Message-ID: <20241227165719.3902388-16-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241227165719.3902388-1-dario.binacchi@amarulasolutions.com> References: <20241227165719.3902388-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=T4gshfVc; 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 --- 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