From patchwork Sun Dec 1 17:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3682 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 494053F033 for ; Sun, 1 Dec 2024 18:47:40 +0100 (CET) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-aa53beff6f0sf117329366b.1 for ; Sun, 01 Dec 2024 09:47:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1733075260; cv=pass; d=google.com; s=arc-20240605; b=SyJr7UqLMG58Ab3ZuXi+SYsMDNGrkRhQd5bbJubIXDGRnc7OnRzTo5PM5EsEHmx3je JQ9aBljcfDTLxKRgB6Ga8tCkv/j++baBdi/IGBaaAG4CGS9LlT1nDWL0MrMhiHhS1lZY qY/80hdV/uuUFPp8JZkorrK/QVHqvegNoxFFDmBmsw1+PSx32MIwXrXgKI9yleOAIkf4 YIoLqkhzJNEZjx1Hzkm+ZeKxTAhea10ygTseHy5HaI3Ug5n5Ryp+hfeZZ3ZXsBz021Jb dIBEgN+ZKWh2dF4quTa2tEjZF4PSbainqe+kCQal1eMLZJpaPTTO9Rb5ccuHZnEKyHoy 9sHA== 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=ak+1VllBKXuy2KeeyWWLPQKI0bfKg4+r/QOEIWnJbVo=; fh=EG1/yl46r211YOKu2gu5FGsu4tcOcRW8csSe3az/0oo=; b=ZvpORSy0ytLthRE8A2ROYQUjtg0WBtspa+bexXlm+CiZUPVjr/DF5rrAp3yp4f0Nki dOvewHmto/b494MN3GXYRBBtNeKIgzZ5cELG6nosl5eGSI2wZhSvtZF5XfUnTVxKyqcF PQcPvejadRIWghKp3+nIvcADyyU+hksbSu9GFbxaUmLnGAl9xXOpDajQgSSrcJi7x+nJ A5oCImE6NF9D65nDDuQXRhWFruOidPmI8ihpZbqmK7M9d5UySMCjfykdvjviW1NQF6pN 2YEkqwTZr3nE9wUFJu41Poj7aYiiSC+ldwEuDDPlGnEyaJ8M5OXXzJGkjDcf/YQsWy+k YWyw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GnDyE+8z; 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=1733075260; x=1733680060; 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=ak+1VllBKXuy2KeeyWWLPQKI0bfKg4+r/QOEIWnJbVo=; b=PeQkK0IVN4tUDajjZMHXXWLaNUTrEYmsIjab1BaVgX2+vwMNH6fPNUiP8d04r1SjVt 4RvyQ18fp2y6meztmhl7YzO9KFB7HM0c7lNg1KzX1tMaFfQ9RFi4oJucg2lJqD7eVYY3 0B+aVgVrDSRceH1PTKYw+z+zBZ2LaacdnBReM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733075260; x=1733680060; 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=ak+1VllBKXuy2KeeyWWLPQKI0bfKg4+r/QOEIWnJbVo=; b=pDNjaUbEIL+hfEkQI/aovA19mFDmXIbKq7FOLhiipBxBrB7TdfuLw42MG4EDSmb9XD pMg1B+lCVUqzT0lrlPtQKGfblgzKKdxBXQ6Zo45vmnSafYrOhuneExxDRLr+EjlVVde/ JFArfiPyii0EASXC+/nhYJaIri2Y4YcHCdM0ew+okERUPTjGfnX6B2HZAhGQ06a0LuJ5 bVjtYN/APbEdKlIvqhp/EJKrLPUIpj7K/h4gEQRdZk7YpuzQu5+y2e4CjazNe91pL+tY HuBf4DTRwgZl47hehJmjAzGiro7m2dWQ/YLC7cr3JNtlA9tjuZGlP1dmsJ/3NqGX82dx s6QA== X-Forwarded-Encrypted: i=2; AJvYcCXd00irKARHv5hynic477k1QGCiw5an288Q+LsAnNUp4scIX+aN4JwNHvqcvUGh/d6gwDS0dXh5mjZMFBpU@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwaO+wel5sHC+S0Ce7ZCC4YGW53Rriad3SSTZ62+HDeuSFhDbLj SbHlOGN+mpT5h2CgOqamaadjn+U2y4jJq2B+oA3Bdc4pX25JmBgi1rjtogfIdHsyeA== X-Google-Smtp-Source: AGHT+IHuYDS2pzGKjlzkFjTHMhuQlStNzl/6t5ANY8Bu2EJRWu9lCE+7rmKdTSu/H38CSd7l3j5sTg== X-Received: by 2002:a05:6402:3206:b0:5d0:d5b3:618a with SMTP id 4fb4d7f45d1cf-5d0d5b362cemr6434944a12.5.1733075260010; Sun, 01 Dec 2024 09:47:40 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:318b:b0:5d0:e410:4698 with SMTP id 4fb4d7f45d1cf-5d0e4104770ls188163a12.1.-pod-prod-05-eu; Sun, 01 Dec 2024 09:47:38 -0800 (PST) X-Received: by 2002:a05:6402:3714:b0:5d0:e73c:b7f0 with SMTP id 4fb4d7f45d1cf-5d0e73cba52mr4420277a12.28.1733075258076; Sun, 01 Dec 2024 09:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733075258; cv=none; d=google.com; s=arc-20240605; b=alc8qK2XaaoYHRzjOEzXJ3ZIoTAzLFaKP1MMNzzcip6Q3ZsM3kT4pPFgs2rxpf3izC jVRgynjBNT9CXYcDhOUbeNTsN/dK0Dc1SLjqU6lnCREMs2riJ53NzEnvX7gUpqlsRCS0 zuPQFV7uu9vg/y/VaCTkLoYujG6wyhT4wPoWjOFG4WzEpsZRqMA5cylwA4ILtdUeSA/8 v0nTFLCro+N+udmAvObz+3SvDe+N1PGher55uWz91aU+iCa0o+PqM68cisHDtB1jr9IB cmegvp0kQ8csM3ZpDuI5UAoCXe1zhMiI2g7/QIybX/R6uRnuDbxLgyOY04qmJfoUNpc3 R/Hw== 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=eZ3YHSAuF6GRZeer7tzybOaIp6SswmD+4eSpj3aybE0=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=QK1BgNt2Bgc/8WZcQr1zca3zjigQatoGzGcKPww0sOGpatKF3KNHlM3N4RLibfk49X H0YEiEwJNtnLCY/SBsVC5MtFmB21s2kztmrVCQd9JeAqDK+bdvZ3DNvEcncz5WFl/I5D kn+kFxNJGmhA0vlYy93AeOJstPYjmbWg8e1ZyDrC2vfwM/EcELg6rjGog8aWNT/DIvY6 QK2MARfA/WbCymHWIEsVcVmUpKQjIPxyVtJWDjmv5X25dRmuSSbcSvao/6sBKcXayF3G qmrcu91ktfBSpPs5xlUfN8vCVnDt2efvZRK/0AgIjY1Eoga1iR8krTJL8zPaOaYAnrGE ScAQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GnDyE+8z; 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-aa599933b70sor129404166b.13.2024.12.01.09.47.38 for (Google Transport Security); Sun, 01 Dec 2024 09:47:38 -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: ASbGncupMB5j5Q/ENq9gAhPBKgjd6SuyGLn0ZHEh8pZ7AqqR+xovUj3PglQlG8thTeJ 2hpPiuTM+XLKa1vJf0Dnue+gdiVn6nrfKzrLXMJc325DD3TCrXAP643Pm5Tz6HF3le1bjoM1+8G X6+kYx9J+NIJPe1+Xd1pbmZUVSeTCDBuhu57ZAfm9Vj3PHGpy2vdQkA7iQGkez9w33CmgkqKJCw 3HRnoWbesiP5M07H3ovN2m70Ih5ce7PdcQ4HheGVEVF45mxwHTPvFuIu5N9yV05dXiF0B0GkJjA WaQ1O8lagBeFAmLm/P+/LkqDUFSX/qcr25/S36mfTrN/TsBcufgQ3Qx415E5sY6ohue64/E0Mza akZ13CUtFD7cEAhwl X-Received: by 2002:a05:6402:270d:b0:5d0:d2ed:ebb with SMTP id 4fb4d7f45d1cf-5d0d2ed103fmr8950481a12.3.1733075257612; Sun, 01 Dec 2024 09:47:37 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-54-94-193.retail.telecomitalia.it. [82.54.94.193]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa59990a78esm415220066b.163.2024.12.01.09.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Dec 2024 09:47:36 -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 v4 11/18] clk: imx: add hw API imx8m_anatop_get_clk_hw Date: Sun, 1 Dec 2024 18:46:11 +0100 Message-ID: <20241201174639.742000-12-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241201174639.742000-1-dario.binacchi@amarulasolutions.com> References: <20241201174639.742000-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=GnDyE+8z; 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 - Added in v4 --- (no changes since v1) drivers/clk/imx/clk.c | 26 ++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index df83bd939492..8a8473a77b7c 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -128,6 +128,32 @@ 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); +#if defined(CONFIG_CLK_IMX8MM) || defined(CONFIG_CLK_IMX8MN) || \ + defined(CONFIG_CLK_IMX8MP) || defined(CONFIG_CLK_IMX8MQ) +struct clk_hw *imx8m_anatop_get_clk_hw(int id) +{ +#if defined(CONFIG_CLK_IMX8MQ) + const char *compatible = "fsl,imx8mq-anatop"; +#else + const char *compatible = "fsl,imx8mm-anatop"; +#endif + struct device_node *np; + struct of_phandle_args args; + struct clk_hw *hw; + + np = of_find_compatible_node(NULL, NULL, compatible); + args.np = np; + args.args_count = 1; + args.args[0] = id; + of_node_put(np); + + 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(imx8m_anatop_get_clk_hw); +#endif + /* * 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..6b6af26f4f1e 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -487,4 +487,10 @@ 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); + +#if defined(CONFIG_CLK_IMX8MM) || defined(CONFIG_CLK_IMX8MN) || \ + defined(CONFIG_CLK_IMX8MP) || defined(CONFIG_CLK_IMX8MQ) +struct clk_hw *imx8m_anatop_get_clk_hw(int id); +#endif + #endif