All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacky Bai <ping.bai@nxp.com>
To: "A.s. Dong" <aisheng.dong@nxp.com>,
	"sboyd@kernel.org" <sboyd@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"jacky.baip@gmail.com" <jacky.baip@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: RE: [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion
Date: Mon, 19 Mar 2018 07:46:17 +0000	[thread overview]
Message-ID: <HE1PR04MB311383FB9988727A63ED3A3587D40@HE1PR04MB3113.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <AM3PR04MB3065CB215B6264649D64C9B80D70@AM3PR04MB306.eurprd04.prod.outlook.com>

> > Subject: [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion
> >
> > Add new gate/gate2 wrapper function to register clocks with optional fl=
ags.
> >
> > Signed-off-by: Bai Ping <ping.bai@nxp.com>
>=20
> AFAIK Stephen requested to switch to clk_hw based APIs when reviewing my
> mx7ulp clk driver. We may need some comments from Stephen here.
>=20
> Hi Stefen,
>=20
> Do you have any comments about this?
>=20

I think we need to just keep it as we did on other imx6 platform.=20
In the clk driver, we need to do 'clk_set_rate/clk_set_parent' for clks tha=
t need
special init sequence('assigned-clocks' in dts is not applicable for such f=
low) .
If the we register with clk_hw_xxx API, it seems not easy to handle such th=
ings.

Additionally, if we switch to clk_hw based driver for imx6sll, all the old =
imx6 platform
need to be changed accordingly. Too many efforts.

Jacky

> Regards
> Dong Aisheng
>=20
> > ---
> >  change from v3->v4:
> >  - no
> >  change from v4->5:
> >  - optimize commit subject
> > ---
> >  drivers/clk/imx/clk.h | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index
> > d69c4bb..8076ec0 100644
> > --- a/drivers/clk/imx/clk.h
> > +++ b/drivers/clk/imx/clk.h
> > @@ -123,6 +123,13 @@ static inline struct clk *imx_clk_gate(const char
> > *name, const char *parent,
> >  			shift, 0, &imx_ccm_lock);
> >  }
> >
> > +static inline struct clk *imx_clk_gate_flags(const char *name, const
> > +char
> > *parent,
> > +		void __iomem *reg, u8 shift, unsigned long flags) {
> > +	return clk_register_gate(NULL, name, parent, flags |
> > CLK_SET_RATE_PARENT, reg,
> > +			shift, 0, &imx_ccm_lock);
> > +}
> > +
> >  static inline struct clk *imx_clk_gate_dis(const char *name, const
> > char *parent,
> >  		void __iomem *reg, u8 shift)
> >  {
> > @@ -137,6 +144,13 @@ static inline struct clk *imx_clk_gate2(const
> > char *name, const char *parent,
> >  			shift, 0x3, 0, &imx_ccm_lock, NULL);  }
> >
> > +static inline struct clk *imx_clk_gate2_flags(const char *name, const
> > +char
> > *parent,
> > +		void __iomem *reg, u8 shift, unsigned long flags) {
> > +	return clk_register_gate2(NULL, name, parent, flags |
> > CLK_SET_RATE_PARENT, reg,
> > +			shift, 0x3, 0, &imx_ccm_lock, NULL); }
> > +
> >  static inline struct clk *imx_clk_gate2_shared(const char *name,
> >  		const char *parent, void __iomem *reg, u8 shift,
> >  		unsigned int *share_count)
> > --
> > 1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: ping.bai@nxp.com (Jacky Bai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion
Date: Mon, 19 Mar 2018 07:46:17 +0000	[thread overview]
Message-ID: <HE1PR04MB311383FB9988727A63ED3A3587D40@HE1PR04MB3113.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <AM3PR04MB3065CB215B6264649D64C9B80D70@AM3PR04MB306.eurprd04.prod.outlook.com>

> > Subject: [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion
> >
> > Add new gate/gate2 wrapper function to register clocks with optional flags.
> >
> > Signed-off-by: Bai Ping <ping.bai@nxp.com>
> 
> AFAIK Stephen requested to switch to clk_hw based APIs when reviewing my
> mx7ulp clk driver. We may need some comments from Stephen here.
> 
> Hi Stefen,
> 
> Do you have any comments about this?
> 

I think we need to just keep it as we did on other imx6 platform. 
In the clk driver, we need to do 'clk_set_rate/clk_set_parent' for clks that need
special init sequence('assigned-clocks' in dts is not applicable for such flow) .
If the we register with clk_hw_xxx API, it seems not easy to handle such things.

Additionally, if we switch to clk_hw based driver for imx6sll, all the old imx6 platform
need to be changed accordingly. Too many efforts.

Jacky

> Regards
> Dong Aisheng
> 
> > ---
> >  change from v3->v4:
> >  - no
> >  change from v4->5:
> >  - optimize commit subject
> > ---
> >  drivers/clk/imx/clk.h | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index
> > d69c4bb..8076ec0 100644
> > --- a/drivers/clk/imx/clk.h
> > +++ b/drivers/clk/imx/clk.h
> > @@ -123,6 +123,13 @@ static inline struct clk *imx_clk_gate(const char
> > *name, const char *parent,
> >  			shift, 0, &imx_ccm_lock);
> >  }
> >
> > +static inline struct clk *imx_clk_gate_flags(const char *name, const
> > +char
> > *parent,
> > +		void __iomem *reg, u8 shift, unsigned long flags) {
> > +	return clk_register_gate(NULL, name, parent, flags |
> > CLK_SET_RATE_PARENT, reg,
> > +			shift, 0, &imx_ccm_lock);
> > +}
> > +
> >  static inline struct clk *imx_clk_gate_dis(const char *name, const
> > char *parent,
> >  		void __iomem *reg, u8 shift)
> >  {
> > @@ -137,6 +144,13 @@ static inline struct clk *imx_clk_gate2(const
> > char *name, const char *parent,
> >  			shift, 0x3, 0, &imx_ccm_lock, NULL);  }
> >
> > +static inline struct clk *imx_clk_gate2_flags(const char *name, const
> > +char
> > *parent,
> > +		void __iomem *reg, u8 shift, unsigned long flags) {
> > +	return clk_register_gate2(NULL, name, parent, flags |
> > CLK_SET_RATE_PARENT, reg,
> > +			shift, 0x3, 0, &imx_ccm_lock, NULL); }
> > +
> >  static inline struct clk *imx_clk_gate2_shared(const char *name,
> >  		const char *parent, void __iomem *reg, u8 shift,
> >  		unsigned int *share_count)
> > --
> > 1.9.1

  reply	other threads:[~2018-03-19  7:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  9:29 [PATCH v5 1/4] clk: imx: Add CLK_IS_CRITICAL flag for busy divider and busy mux Bai Ping
2018-03-12  9:29 ` Bai Ping
2018-03-12  9:29 ` [PATCH v5 2/4] clk: imx: add new gate/gate2 wrapper funtion Bai Ping
2018-03-12  9:29   ` Bai Ping
2018-03-16  6:30   ` A.s. Dong
2018-03-16  6:30     ` A.s. Dong
2018-03-19  7:46     ` Jacky Bai [this message]
2018-03-19  7:46       ` Jacky Bai
2018-03-19 20:48     ` Stephen Boyd
2018-03-19 20:48       ` Stephen Boyd
2018-03-12  9:29 ` [PATCH v5 3/4] dt-bindings: imx: update clock doc for imx6sll Bai Ping
2018-03-12  9:29   ` Bai Ping
2018-03-13  0:59   ` Shawn Guo
2018-03-13  0:59     ` Shawn Guo
2018-03-16  6:53   ` A.s. Dong
2018-03-16  6:53     ` A.s. Dong
2018-03-12  9:29 ` [PATCH v5 4/4] clk: imx: add clock driver " Bai Ping
2018-03-12  9:29   ` Bai Ping
2018-03-16 10:16   ` A.s. Dong
2018-03-16 10:16     ` A.s. Dong
2018-03-19  2:20     ` Jacky Bai
2018-03-19  2:20       ` Jacky Bai
2018-03-16  6:26 ` [PATCH v5 1/4] clk: imx: Add CLK_IS_CRITICAL flag for busy divider and busy mux A.s. Dong
2018-03-16  6:26   ` A.s. Dong

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=HE1PR04MB311383FB9988727A63ED3A3587D40@HE1PR04MB3113.eurprd04.prod.outlook.com \
    --to=ping.bai@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=fabio.estevam@nxp.com \
    --cc=jacky.baip@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=robh+dt@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.