Message ID | 1520846957-22348-2-git-send-email-ping.bai@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> -----Original Message----- > From: Jacky Bai > Sent: Monday, March 12, 2018 5:29 PM > To: sboyd@kernel.org; robh+dt@kernel.org; shawnguo@kernel.org; > kernel@pengutronix.de > Cc: Fabio Estevam <fabio.estevam@nxp.com>; linux-clk@vger.kernel.org; > linux-arm-kernel@lists.infradead.org; dl-linux-imx <linux-imx@nxp.com>; > A.s. Dong <aisheng.dong@nxp.com>; jacky.baip@gmail.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? 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
> > 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
Quoting A.s. Dong (2018-03-15 23:30:13) > > -----Original Message----- > > From: Jacky Bai > > Sent: Monday, March 12, 2018 5:29 PM > > To: sboyd@kernel.org; robh+dt@kernel.org; shawnguo@kernel.org; > > kernel@pengutronix.de > > Cc: Fabio Estevam <fabio.estevam@nxp.com>; linux-clk@vger.kernel.org; > > linux-arm-kernel@lists.infradead.org; dl-linux-imx <linux-imx@nxp.com>; > > A.s. Dong <aisheng.dong@nxp.com>; jacky.baip@gmail.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? > Using clk_hw based APIs is preferred. If there's existing usage of non-hw based APIs then it's OK to keep same style and change later.
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)
Add new gate/gate2 wrapper function to register clocks with optional flags. Signed-off-by: Bai Ping <ping.bai@nxp.com> --- change from v3->v4: - no change from v4->5: - optimize commit subject --- drivers/clk/imx/clk.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)