linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@nxp.com>
To: Lee Jones <lee.jones@linaro.org>, Shawn Guo <shawnguo@kernel.org>,
	Peng Fan <peng.fan@nxp.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Anson Huang <anson.huang@nxp.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	Jacky Bai <ping.bai@nxp.com>
Cc: NXP Linux Team <linux-imx@nxp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Abel Vesa <abel.vesa@nxp.com>
Subject: [PATCH v3 06/13] clk: imx: pll14xx: Add the device as argument when registering
Date: Wed, 15 Apr 2020 11:02:46 +0300	[thread overview]
Message-ID: <1586937773-5836-7-git-send-email-abel.vesa@nxp.com> (raw)
In-Reply-To: <1586937773-5836-1-git-send-email-abel.vesa@nxp.com>

In order to allow runtime PM, the device needs to be passed on
to the register function. Audiomix clock controller, used on
i.MX8MP and future platforms, registers a pll14xx and has runtime
PM support.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/imx/clk-pll14xx.c |  8 ++++----
 drivers/clk/imx/clk.h         | 13 ++++++++++---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index a83bbbe..f9eb189 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -378,9 +378,9 @@ static const struct clk_ops clk_pll1443x_ops = {
 	.set_rate	= clk_pll1443x_set_rate,
 };
 
-struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name,
-				  void __iomem *base,
-				  const struct imx_pll14xx_clk *pll_clk)
+struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name,
+				const char *parent_name, void __iomem *base,
+				const struct imx_pll14xx_clk *pll_clk)
 {
 	struct clk_pll14xx *pll;
 	struct clk_hw *hw;
@@ -426,7 +426,7 @@ struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name,
 
 	hw = &pll->hw;
 
-	ret = clk_hw_register(NULL, hw);
+	ret = clk_hw_register(dev, hw);
 	if (ret) {
 		pr_err("%s: failed to register pll %s %d\n",
 			__func__, name, ret);
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 01ff1db..fcd9952a 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -133,9 +133,9 @@ struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
 #define imx_clk_pll14xx(name, parent_name, base, pll_clk) \
 	to_clk(imx_clk_hw_pll14xx(name, parent_name, base, pll_clk))
 
-struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name,
-				  void __iomem *base,
-				  const struct imx_pll14xx_clk *pll_clk);
+struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name,
+				const char *parent_name, void __iomem *base,
+				const struct imx_pll14xx_clk *pll_clk);
 
 struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name,
 		const char *parent, void __iomem *base);
@@ -242,6 +242,13 @@ static inline struct clk *to_clk(struct clk_hw *hw)
 	return hw->clk;
 }
 
+static inline struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name,
+				  void __iomem *base,
+				  const struct imx_pll14xx_clk *pll_clk)
+{
+	return imx_dev_clk_hw_pll14xx(NULL, name, parent_name, base, pll_clk);
+}
+
 static inline struct clk_hw *imx_clk_hw_fixed(const char *name, int rate)
 {
 	return clk_hw_register_fixed_rate(NULL, name, NULL, 0, rate);
-- 
2.7.4


  parent reply	other threads:[~2020-04-15  8:04 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  8:02 [PATCH v3 00/13] Add generic MFD i.MX mix and audiomix support Abel Vesa
2020-04-15  8:02 ` [PATCH v3 01/13] mfd: Add i.MX generic mix support Abel Vesa
2020-04-17  8:07   ` Lee Jones
2020-04-22  9:18     ` Abel Vesa
2020-04-23 15:21       ` Aisheng Dong
2020-04-24  6:27         ` Lee Jones
2020-04-30 10:03           ` Abel Vesa
2020-04-30 10:22             ` Aisheng Dong
2020-04-30 11:13               ` Abel Vesa
2020-04-15  8:02 ` [PATCH v3 02/13] Documentation: mfd: Add DT bindings for i.MX Mix Abel Vesa
2020-04-16 11:11   ` Arnd Bergmann
2020-04-15  8:02 ` [PATCH v3 03/13] arm64: dts: imx8mp: Add AIPS 4 and 5 Abel Vesa
2020-04-15  8:02 ` [PATCH v3 04/13] arm64: dts: imx8mp: Add audiomix node Abel Vesa
2020-04-15  8:02 ` [PATCH v3 05/13] clk: imx: gate2: Allow single bit gating clock Abel Vesa
2020-04-22 18:35   ` Stephen Boyd
2020-04-29  2:00   ` Shawn Guo
2020-04-15  8:02 ` Abel Vesa [this message]
2020-04-29  2:00   ` [PATCH v3 06/13] clk: imx: pll14xx: Add the device as argument when registering Shawn Guo
2020-04-15  8:02 ` [PATCH v3 07/13] clk: imx: Add helpers for passing the device as argument Abel Vesa
2020-04-29  2:01   ` Shawn Guo
2020-04-15  8:02 ` [PATCH v3 08/13] dt-bindings: clocks: imx8mp: Add ids for audiomix clocks Abel Vesa
2020-04-29  2:16   ` Shawn Guo
2020-04-15  8:02 ` [PATCH v3 09/13] clk: imx: Add audiomix clock controller support Abel Vesa
2020-04-22 18:38   ` Stephen Boyd
2020-04-15  8:02 ` [PATCH v3 10/13] arm64: dts: imx8mp: Add audiomix clock controller node Abel Vesa
2020-04-15  8:02 ` [PATCH v3 11/13] dt-bindings: reset: imx8mp: Add ids for audiomix reset Abel Vesa
2020-04-16 11:10   ` Arnd Bergmann
2020-04-15  8:02 ` [PATCH v3 12/13] reset: imx: Add audiomix reset controller support Abel Vesa
2020-04-23 15:47   ` Philipp Zabel
2020-04-15  8:02 ` [PATCH v3 13/13] arm64: dts: imx8mp: Add audiomix reset controller node Abel Vesa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1586937773-5836-7-git-send-email-abel.vesa@nxp.com \
    --to=abel.vesa@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).