linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: "sboyd@kernel.org" <sboyd@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	Abel Vesa <abel.vesa@nxp.com>,
	Leonard Crestez <leonard.crestez@nxp.com>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Anson Huang <anson.huang@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 2/3] clk: imx: pll14xx: introduce imx_clk_hw_pll14xx_flags
Date: Mon, 30 Dec 2019 09:13:05 +0000	[thread overview]
Message-ID: <1577696903-27870-3-git-send-email-peng.fan@nxp.com> (raw)
In-Reply-To: <1577696903-27870-1-git-send-email-peng.fan@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

imx_clk_hw_pll14xx_flags is intended to provide flexiblity when
add flags for clks, no need to add more imx_pll14xx_clk entries
in clk-pll14xx.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/imx/clk-pll14xx.c | 10 ++++++----
 drivers/clk/imx/clk.h         | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index 9288b21d4d59..030159dc4884 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -378,9 +378,11 @@ static const struct clk_ops clk_pll1443x_min_ops = {
 	.recalc_rate	= clk_pll1443x_recalc_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_clk_hw_pll14xx_flags(const char *name,
+					const char *parent_name,
+					void __iomem *base,
+					const struct imx_pll14xx_clk *pll_clk,
+					unsigned long flags)
 {
 	struct clk_pll14xx *pll;
 	struct clk_hw *hw;
@@ -393,7 +395,7 @@ struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name,
 		return ERR_PTR(-ENOMEM);
 
 	init.name = name;
-	init.flags = pll_clk->flags;
+	init.flags = pll_clk->flags | flags;
 	init.parent_names = &parent_name;
 	init.num_parents = 1;
 
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 65d80c675aa9..35a9d294b6df 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -131,9 +131,18 @@ 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_clk_hw_pll14xx_flags(const char *name,
+					const char *parent_name,
+					void __iomem *base,
+					const struct imx_pll14xx_clk *pll_clk,
+					unsigned long flags);
+
+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_clk_hw_pll14xx_flags(name, parent_name, base, pll_clk, 0);
+}
 
 struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name,
 		const char *parent, void __iomem *base);
-- 
2.16.4


  parent reply	other threads:[~2019-12-30  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30  9:12 [PATCH 0/3] clk: imx: avoid modify dram pll and improve for pll14xx Peng Fan
2019-12-30  9:13 ` [PATCH 1/3] clk: imx: pll14xx: avoid modify dram pll Peng Fan
2020-01-12  2:32   ` Shawn Guo
2020-01-14  0:11     ` Leonard Crestez
2019-12-30  9:13 ` Peng Fan [this message]
2019-12-30  9:13 ` [PATCH 3/3] clk: imx: imx8m: use imx_clk_hw_pll14xx_flags for " Peng Fan
2020-01-12  2:40   ` Shawn Guo

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=1577696903-27870-3-git-send-email-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --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=ping.bai@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --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).