clk: imx: Trivial cleanups for clk_hw based API
Subsystems (3)
v2 cover clk: imx: Trivial cleanups for clk_hw based API
Shawn, just rebased on your clk/imx branch as requested.
Abel Vesa (11):
clk: imx: Add correct failure handling for clk based helpers
clk: imx: Rename the SCCG to SSCG
clk: imx: Replace all the clk based helpers with macros
clk: imx: pllv1: Switch to clk_hw based API
clk: imx: pllv2: Switch to clk_hw based API
clk: imx: imx7ulp composite: Rename to show is clk_hw based
clk: imx: Rename sccg and frac pll register to suggest clk_hw
clk: imx: Rename the imx_clk_pllv4 to imply it's clk_hw based
clk: imx: Rename the imx_clk_pfdv2 to imply it's clk_hw based
clk: imx: Rename the imx_clk_divider_gate to imply it's clk_hw based
clk: imx7up: Rename the clks to hws
drivers/clk/imx/Makefile | 2 +- drivers/clk/imx/clk-composite-7ulp.c | 2 +- drivers/clk/imx/clk-divider-gate.c | 2 +- drivers/clk/imx/clk-frac-pll.c | 7 +- drivers/clk/imx/clk-imx7ulp.c | 182 ++++++------ drivers/clk/imx/clk-imx8mq.c | 6 +- drivers/clk/imx/clk-pfdv2.c | 2 +- drivers/clk/imx/clk-pllv1.c | 14 +- drivers/clk/imx/clk-pllv2.c | 14 +- drivers/clk/imx/clk-pllv4.c | 2 +- drivers/clk/imx/clk-sccg-pll.c | 549 ----------------------------------- drivers/clk/imx/clk-sscg-pll.c | 549 +++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 102 ++++--- 13 files changed, 724 insertions(+), 709 deletions(-) delete mode 100644 drivers/clk/imx/clk-sccg-pll.c create mode 100644 drivers/clk/imx/clk-sscg-pll.c
Signature · 1 line
2.7.4
PATCH RESEND v2 1/11 clk: imx: Add correct failure handling for clk based helpers
If the clk_hw based API returns an error, trying to return the clk from hw will end up in a NULL pointer dereference. So adding the to_clk checker and using it inside every clk based macro helper we handle that case correctly.
This to_clk is also temporary and will go away along with the clk based macro helpers once there is no user that need them anymore.
--- drivers/clk/imx/clk.h | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-)
drivers/clk/imx/clk.h +22 -15
@@ -55,48 +55,48 @@ extern struct imx_pll14xx_clk imx_1443x_pll;extern struct imx_pll14xx_clk imx_1443x_dram_pll;#define imx_clk_cpu (name, parent_name, div, mux, pll, step) \ - imx_clk_hw_cpu(name, parent_name, div, mux, pll, step)->clk + to_clk(imx_clk_hw_cpu(name, parent_name, div, mux, pll, step))#define clk_register_gate2 (dev, name, parent_name, flags, reg, bit_idx, \ cgr_val, clk_gate_flags, lock, share_count) \ - clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ - cgr_val, clk_gate_flags, lock, share_count)->clk + to_clk(clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ + cgr_val, clk_gate_flags, lock, share_count))#define imx_clk_pllv3 (type, name, parent_name, base, div_mask) \ - imx_clk_hw_pllv3(type, name, parent_name, base, div_mask)->clk + to_clk(imx_clk_hw_pllv3(type, name, parent_name, base, div_mask))#define imx_clk_pfd (name, parent_name, reg, idx) \ - imx_clk_hw_pfd(name, parent_name, reg, idx)->clk + to_clk(imx_clk_hw_pfd(name, parent_name, reg, idx))#define imx_clk_gate_exclusive (name, parent, reg, shift, exclusive_mask) \ - imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask)->clk + to_clk(imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask))#define imx_clk_fixed_factor (name, parent, mult, div) \ - imx_clk_hw_fixed_factor(name, parent, mult, div)->clk + to_clk(imx_clk_hw_fixed_factor(name, parent, mult, div))#define imx_clk_divider2 (name, parent, reg, shift, width) \ - imx_clk_hw_divider2(name, parent, reg, shift, width)->clk + to_clk(imx_clk_hw_divider2(name, parent, reg, shift, width))#define imx_clk_gate_dis (name, parent, reg, shift) \ - imx_clk_hw_gate_dis(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate_dis(name, parent, reg, shift))#define imx_clk_gate2 (name, parent, reg, shift) \ - imx_clk_hw_gate2(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate2(name, parent, reg, shift))#define imx_clk_gate2_flags (name, parent, reg, shift, flags) \ - imx_clk_hw_gate2_flags(name, parent, reg, shift, flags)->clk + to_clk(imx_clk_hw_gate2_flags(name, parent, reg, shift, flags))#define imx_clk_gate2_shared2 (name, parent, reg, shift, share_count) \ - imx_clk_hw_gate2_shared2(name, parent, reg, shift, share_count)->clk + to_clk(imx_clk_hw_gate2_shared2(name, parent, reg, shift, share_count))#define imx_clk_gate3 (name, parent, reg, shift) \ - imx_clk_hw_gate3(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate3(name, parent, reg, shift))#define imx_clk_gate4 (name, parent, reg, shift) \ - imx_clk_hw_gate4(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate4(name, parent, reg, shift))#define imx_clk_mux (name, reg, shift, width, parents, num_parents) \ - imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)->clk + to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents))struct clk *imx_clk_pll14xx (const char *name,const char *parent_name,void __iomem *base,const struct imx_pll14xx_clk *pll_clk);
@@ -199,6 +199,13 @@ struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg, u8 shift, u8 width, const char * const *parents, int num_parents, void (*fixup)(u32 *val)); +static inline struct clk *to_clk (struct clk_hw *hw) +{ +if (IS_ERR_OR_NULL (hw)) +return ERR_CAST (hw); +return hw->clk; +} +static inline struct clk *imx_clk_fixed (const char *name,int rate) {return clk_register_fixed_rate (NULL , name,NULL ,0 , rate);
Signature · 1 line
2.7.4
PATCH RESEND v2 2/11 clk: imx: Rename the SCCG to SSCG
In reply to Abel VesaAccording to the manual the acronym stands for
Spread Sprectum Clock Generator.
--- drivers/clk/imx/Makefile | 2 +- drivers/clk/imx/clk-imx8mq.c | 6 +- drivers/clk/imx/clk-sccg-pll.c | 549 ----------------------------------------- drivers/clk/imx/clk-sscg-pll.c | 549 +++++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 4 +- 5 files changed, 555 insertions(+), 555 deletions(-) delete mode 100644 drivers/clk/imx/clk-sccg-pll.c create mode 100644 drivers/clk/imx/clk-sscg-pll.c
drivers/clk/imx/Makefile +1 -1
@@ -18,7 +18,7 @@ obj-$(CONFIG_MXC_CLK) += \ clk-pllv2.o \ clk-pllv3.o \ clk-pllv4.o \ - clk-sccg-pll.o \ + clk-sscg-pll.o \ clk-pll14xx.o obj-$(CONFIG_MXC_CLK_SCU) += \
drivers/clk/imx/clk-imx8mq.c +3 -3
@@ -342,9 +342,9 @@ static int imx8mq_clocks_probe(struct platform_device *pdev) clks[IMX8MQ_SYS1_PLL_OUT ] =imx_clk_fixed ("sys1_pll_out" ,800000000 ); clks[IMX8MQ_SYS2_PLL_OUT ] =imx_clk_fixed ("sys2_pll_out" ,1000000000 ); - clks[IMX8MQ_SYS3_PLL_OUT ] =imx_clk_sccg_pll ("sys3_pll_out" , sys3_pll_out_sels,ARRAY_SIZE (sys3_pll_out_sels),0 ,0 ,0 , base +0x48 ,CLK_IS_CRITICAL ); - clks[IMX8MQ_DRAM_PLL_OUT ] =imx_clk_sccg_pll ("dram_pll_out" , dram_pll_out_sels,ARRAY_SIZE (dram_pll_out_sels),0 ,0 ,0 , base +0x60 ,CLK_IS_CRITICAL |CLK_GET_RATE_NOCACHE ); - clks[IMX8MQ_VIDEO2_PLL_OUT ] =imx_clk_sccg_pll ("video2_pll_out" , video2_pll_out_sels,ARRAY_SIZE (video2_pll_out_sels),0 ,0 ,0 , base +0x54 ,0 ); + clks[IMX8MQ_SYS3_PLL_OUT ] =imx_clk_sscg_pll ("sys3_pll_out" , sys3_pll_out_sels,ARRAY_SIZE (sys3_pll_out_sels),0 ,0 ,0 , base +0x48 ,CLK_IS_CRITICAL ); + clks[IMX8MQ_DRAM_PLL_OUT ] =imx_clk_sscg_pll ("dram_pll_out" , dram_pll_out_sels,ARRAY_SIZE (dram_pll_out_sels),0 ,0 ,0 , base +0x60 ,CLK_IS_CRITICAL |CLK_GET_RATE_NOCACHE ); + clks[IMX8MQ_VIDEO2_PLL_OUT ] =imx_clk_sscg_pll ("video2_pll_out" , video2_pll_out_sels,ARRAY_SIZE (video2_pll_out_sels),0 ,0 ,0 , base +0x54 ,0 );/* SYS PLL1 fixed output */ clks[IMX8MQ_SYS1_PLL_40M_CG ] =imx_clk_gate ("sys1_pll_40m_cg" ,"sys1_pll_out" , base +0x30 ,9 );
drivers/clk/imx/clk-sccg-pll.c deleted +0 -549
549 lines not on this page · raw message
drivers/clk/imx/clk-sscg-pll.c new file +549 -0
549 lines not on this page · raw message
drivers/clk/imx/clk.h +2 -2
@@ -24,7 +24,7 @@ enum imx_pllv1_type { IMX_PLLV1_IMX35, }; -enum imx_sccg_pll_type { +enum imx_sscg_pll_type {SCCG_PLL1 ,SCCG_PLL2 , };
@@ -110,7 +110,7 @@ struct clk *imx_clk_pllv2(const char *name, const char *parent,struct clk *imx_clk_frac_pll (const char *name,const char *parent_name,void __iomem *base); -struct clk *imx_clk_sccg_pll(const char *name, +struct clk *imx_clk_sscg_pll(const char *name, const char * const *parent_names, u8 num_parents, u8 parent, u8 bypass1, u8 bypass2,
Signature · 1 line
2.7.4
PATCH RESEND v2 3/11 clk: imx: Replace all the clk based helpers with macros
In reply to Abel VesaReplacing with macros all the clk based API helpers we reduce the code duplication. The end goal is to get rid of all these macros when there will be no more users of the clk based API, that is, when all the i.MX clock provider drivers will be switched completely to the clk_hw based API.
This is another step in moving away from the non clk_hw based API usage throughout the i.MX clock drivers. The reason for doing that is to have a clear split between the clock provider and the clock consumer API.
--- drivers/clk/imx/clk.h | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-)
drivers/clk/imx/clk.h +12 -27
@@ -71,12 +71,24 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll;#define imx_clk_gate_exclusive (name, parent, reg, shift, exclusive_mask) \ to_clk(imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask)) +#define imx_clk_fixed (name, rate) \ + to_clk(imx_clk_hw_fixed(name, rate)) +#define imx_clk_fixed_factor (name, parent, mult, div) \ to_clk(imx_clk_hw_fixed_factor(name, parent, mult, div)) +#define imx_clk_divider (name, parent, reg, shift, width) \ + to_clk(imx_clk_hw_divider(name, parent, reg, shift, width)) +#define imx_clk_divider2 (name, parent, reg, shift, width) \ to_clk(imx_clk_hw_divider2(name, parent, reg, shift, width)) +#define imx_clk_divider_flags (name, parent, reg, shift, width, flags) \ + to_clk(imx_clk_hw_divider_flags(name, parent, reg, shift, width, flags)) + +#define imx_clk_gate (name, parent, reg, shift) \ + to_clk(imx_clk_hw_gate(name, parent, reg, shift)) +#define imx_clk_gate_dis (name, parent, reg, shift) \ to_clk(imx_clk_hw_gate_dis(name, parent, reg, shift))
@@ -206,11 +218,6 @@ static inline struct clk *to_clk(struct clk_hw *hw)return hw->clk; } -static inline struct clk *imx_clk_fixed (const char *name,int rate) -{ -return clk_register_fixed_rate (NULL , name,NULL ,0 , rate); -} -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);
@@ -232,13 +239,6 @@ static inline struct clk_hw *imx_clk_hw_fixed_factor(const char *name, CLK_SET_RATE_PARENT, mult, div); } -static inline struct clk *imx_clk_divider (const char *name,const char *parent, -void __iomem *reg,u8 shift,u8 width) -{ -return clk_register_divider (NULL , name, parent,CLK_SET_RATE_PARENT , - reg, shift, width,0 , &imx_ccm_lock); -} - static inline struct clk_hw *imx_clk_hw_divider(const char *name, const char *parent, void __iomem *reg, u8 shift,
@@ -248,14 +248,6 @@ static inline struct clk_hw *imx_clk_hw_divider(const char *name, reg, shift, width, 0, &imx_ccm_lock); } -static inline struct clk *imx_clk_divider_flags (const char *name, -const char *parent,void __iomem *reg,u8 shift,u8 width, -unsigned long flags) -{ -return clk_register_divider (NULL , name, parent, flags, - reg, shift, width,0 , &imx_ccm_lock); -} - static inline struct clk_hw *imx_clk_hw_divider_flags(const char *name, const char *parent, void __iomem *reg, u8 shift,
@@ -282,13 +274,6 @@ static inline struct clk *imx_clk_divider2_flags(const char *name, reg, shift, width, 0, &imx_ccm_lock); } -static inline struct clk *imx_clk_gate (const char *name,const char *parent, -void __iomem *reg,u8 shift) -{ -return clk_register_gate (NULL , name, parent,CLK_SET_RATE_PARENT , reg, - shift,0 , &imx_ccm_lock); -} -static inline struct clk_hw *imx_clk_hw_gate_flags (const char *name,const char *parent,void __iomem *reg,u8 shift,unsigned long flags) {
Signature · 1 line
2.7.4
PATCH RESEND v2 4/11 clk: imx: pllv1: Switch to clk_hw based API
In reply to Abel VesaSwitch the imx_clk_pllv1 register function to clk_hw based API, rename accordingly and add a macro for clk based legacy. This allows us to move closer to a clear split between consumer and provider clk APIs.
--- drivers/clk/imx/clk-pllv1.c | 14 +++++++++----- drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/clk/imx/clk-pllv1.c +9 -5
@@ -111,12 +111,13 @@ static const struct clk_ops clk_pllv1_ops = { .recalc_rate = clk_pllv1_recalc_rate, }; -struct clk *imx_clk_pllv1 (enum imx_pllv1_type type,const char *name, +struct clk_hw *imx_clk_hw_pllv1 (enum imx_pllv1_type type,const char *name,const char *parent,void __iomem *base) {struct clk_pllv1 *pll; -struct clk *clk; +struct clk_hw *hw;struct clk_init_data init; +int ret; pll =kmalloc (sizeof (*pll),GFP_KERNEL );if (!pll)
@@ -132,10 +133,13 @@ struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, init.num_parents =1 ; pll->hw.init = &init; + hw = &pll->hw; - clk =clk_register (NULL , &pll->hw); -if (IS_ERR (clk)) + ret =clk_hw_register (NULL , hw); +if (ret) {kfree (pll); +return ERR_PTR (ret); + } -return clk; +return hw; }
drivers/clk/imx/clk.h +4 -1
@@ -110,10 +110,13 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll;#define imx_clk_mux (name, reg, shift, width, parents, num_parents) \ to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)) +#define imx_clk_pllv1 (type, name, parent, base) \ + to_clk(imx_clk_hw_pllv1(type, name, parent, base)) +struct clk *imx_clk_pll14xx (const char *name,const char *parent_name,void __iomem *base,const struct imx_pll14xx_clk *pll_clk); -struct clk *imx_clk_pllv1 (enum imx_pllv1_type type,const char *name, +struct clk_hw *imx_clk_hw_pllv1 (enum imx_pllv1_type type,const char *name,const char *parent,void __iomem *base); struct clk *imx_clk_pllv2(const char *name, const char *parent,
Signature · 1 line
2.7.4
PATCH RESEND v2 5/11 clk: imx: pllv2: Switch to clk_hw based API
In reply to Abel VesaSwitch the imx_clk_pllv2 register function to clk_hw based API, rename accordingly and add a macro for clk based legacy. This allows us to move closer to a clear split between consumer and provider clk APIs.
--- drivers/clk/imx/clk-pllv2.c | 14 +++++++++----- drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/clk/imx/clk-pllv2.c +9 -5
@@ -239,12 +239,13 @@ static const struct clk_ops clk_pllv2_ops = { .set_rate = clk_pllv2_set_rate, }; -struct clk *imx_clk_pllv2 (const char *name,const char *parent, +struct clk_hw *imx_clk_hw_pllv2 (const char *name,const char *parent,void __iomem *base) {struct clk_pllv2 *pll; -struct clk *clk; +struct clk_hw *hw;struct clk_init_data init; +int ret; pll =kzalloc (sizeof (*pll),GFP_KERNEL );if (!pll)
@@ -259,10 +260,13 @@ struct clk *imx_clk_pllv2(const char *name, const char *parent, init.num_parents =1 ; pll->hw.init = &init; + hw = &pll->hw; - clk =clk_register (NULL , &pll->hw); -if (IS_ERR (clk)) + ret =clk_hw_register (NULL , hw); +if (ret) {kfree (pll); +return ERR_PTR (ret); + } -return clk; +return hw; }
drivers/clk/imx/clk.h +4 -1
@@ -113,13 +113,16 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll;#define imx_clk_pllv1 (type, name, parent, base) \ to_clk(imx_clk_hw_pllv1(type, name, parent, base)) +#define imx_clk_pllv2 (name, parent, base) \ + to_clk(imx_clk_hw_pllv2(name, parent, base)) +struct clk *imx_clk_pll14xx (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); -struct clk *imx_clk_pllv2 (const char *name,const char *parent, +struct clk_hw *imx_clk_hw_pllv2 (const char *name,const char *parent,void __iomem *base); struct clk *imx_clk_frac_pll(const char *name, const char *parent_name,
Signature · 1 line
2.7.4
PATCH RESEND v2 6/11 clk: imx: imx7ulp composite: Rename to show is clk_hw based
In reply to Abel VesaRenaming the imx7ulp_clk_composite register function to imx7ulp_clk_hw_composite to show it is clk_hw based.
--- drivers/clk/imx/clk-composite-7ulp.c | 2 +- drivers/clk/imx/clk-imx7ulp.c | 52 ++++++++++++++++++------------------ drivers/clk/imx/clk.h | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-)
drivers/clk/imx/clk-composite-7ulp.c +1 -1
@@ -21,7 +21,7 @@#define PCG_PCD_WIDTH 3#define PCG_PCD_MASK 0x7 -struct clk_hw *imx7ulp_clk_composite(const char *name, +struct clk_hw *imx7ulp_clk_hw_composite(const char *name, const char * const *parent_names, int num_parents, bool mux_present, bool rate_present, bool gate_present,
drivers/clk/imx/clk-imx7ulp.c +26 -26
74 lines not on this page · raw message
drivers/clk/imx/clk.h +1 -1
@@ -203,7 +203,7 @@ struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift u8 width, void __iomem *busy_reg, u8 busy_shift, const char * const *parent_names, int num_parents); -struct clk_hw *imx7ulp_clk_composite(const char *name, +struct clk_hw *imx7ulp_clk_hw_composite(const char *name, const char * const *parent_names, int num_parents, bool mux_present, bool rate_present, bool gate_present,
Signature · 1 line
2.7.4
PATCH RESEND v2 7/11 clk: imx: Rename sccg and frac pll register to suggest clk_hw
In reply to Abel VesaRenaming the imx_clk_frac_pll and imx_clk_sccg_pll register functions to imx_clk_hw_frac_pll, respectively imx_clk_hw_sccg_pll to be more obvious that they are clk_hw based.
--- drivers/clk/imx/clk-frac-pll.c | 7 ++++--- drivers/clk/imx/clk-sscg-pll.c | 4 ++-- drivers/clk/imx/clk.h | 12 ++++++++++-- 3 files changed, 16 insertions(+), 7 deletions(-)
drivers/clk/imx/clk-frac-pll.c +4 -3
@@ -201,8 +201,9 @@ static const struct clk_ops clk_frac_pll_ops = { .set_rate = clk_pll_set_rate, }; -struct clk *imx_clk_frac_pll (const char *name,const char *parent_name, -void __iomem *base) +struct clk_hw *imx_clk_hw_frac_pll (const char *name, +const char *parent_name, +void __iomem *base) {struct clk_init_data init;struct clk_frac_pll *pll;
@@ -230,5 +231,5 @@ struct clk *imx_clk_frac_pll(const char *name, const char *parent_name,return ERR_PTR (ret); } -return hw->clk; +return hw; }
drivers/clk/imx/clk-sscg-pll.c +2 -2
@@ -506,7 +506,7 @@ static const struct clk_ops clk_sscg_pll_ops = { .determine_rate = clk_sscg_pll_determine_rate, }; -struct clk *imx_clk_sscg_pll(const char *name, +struct clk_hw *imx_clk_hw_sscg_pll(const char *name, const char * const *parent_names, u8 num_parents, u8 parent, u8 bypass1, u8 bypass2,
@@ -545,5 +545,5 @@ struct clk *imx_clk_sscg_pll(const char *name,return ERR_PTR (ret); } -return hw->clk; +return hw; }
drivers/clk/imx/clk.h +10 -2
@@ -116,6 +116,14 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll;#define imx_clk_pllv2 (name, parent, base) \ to_clk(imx_clk_hw_pllv2(name, parent, base)) +#define imx_clk_frac_pll (name, parent_name, base) \ + to_clk(imx_clk_hw_frac_pll(name, parent_name, base)) + +#define imx_clk_sscg_pll (name, parent_names, num_parents, parent,\ + bypass1, bypass2, base, flags) \ + to_clk(imx_clk_hw_sscg_pll(name, parent_names, num_parents, parent,\ + bypass1, bypass2, base, flags)) +struct clk *imx_clk_pll14xx (const char *name,const char *parent_name,void __iomem *base,const struct imx_pll14xx_clk *pll_clk);
@@ -125,10 +133,10 @@ struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name,struct clk_hw *imx_clk_hw_pllv2 (const char *name,const char *parent,void __iomem *base); -struct clk *imx_clk_frac_pll (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_frac_pll (const char *name,const char *parent_name,void __iomem *base); -struct clk *imx_clk_sscg_pll(const char *name, +struct clk_hw *imx_clk_hw_sscg_pll(const char *name, const char * const *parent_names, u8 num_parents, u8 parent, u8 bypass1, u8 bypass2,
Signature · 1 line
2.7.4
PATCH RESEND v2 8/11 clk: imx: Rename the imx_clk_pllv4 to imply it's clk_hw based
In reply to Abel VesaRenaming the imx_clk_pllv4 register function to imx_clk_hw_pllv4 to be more obvious it is clk_hw based.
--- drivers/clk/imx/clk-imx7ulp.c | 4 ++-- drivers/clk/imx/clk-pllv4.c | 2 +- drivers/clk/imx/clk.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/clk/imx/clk-imx7ulp.c +2 -2
@@ -90,8 +90,8 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) clks[IMX7ULP_CLK_SPLL_PRE_DIV ] =imx_clk_hw_divider_flags ("spll_pre_div" ,"spll_pre_sel" , base +0x608 ,8 ,3 ,CLK_SET_RATE_GATE );/* name parent_name base */ - clks[IMX7ULP_CLK_APLL ] =imx_clk_pllv4 ("apll" ,"apll_pre_div" , base +0x500 ); - clks[IMX7ULP_CLK_SPLL ] =imx_clk_pllv4 ("spll" ,"spll_pre_div" , base +0x600 ); + clks[IMX7ULP_CLK_APLL ] =imx_clk_hw_pllv4 ("apll" ,"apll_pre_div" , base +0x500 ); + clks[IMX7ULP_CLK_SPLL ] =imx_clk_hw_pllv4 ("spll" ,"spll_pre_div" , base +0x600 );/* APLL PFDs */ clks[IMX7ULP_CLK_APLL_PFD0 ] =imx_clk_pfdv2 ("apll_pfd0" ,"apll" , base +0x50c ,0 );
drivers/clk/imx/clk-pllv4.c +1 -1
@@ -206,7 +206,7 @@ static const struct clk_ops clk_pllv4_ops = { .is_enabled = clk_pllv4_is_enabled, }; -struct clk_hw *imx_clk_pllv4 (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_pllv4 (const char *name,const char *parent_name,void __iomem *base) {struct clk_pllv4 *pll;
drivers/clk/imx/clk.h +1 -1
@@ -176,7 +176,7 @@ struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name, .kdiv = (_k), \ } -struct clk_hw *imx_clk_pllv4 (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_pllv4 (const char *name,const char *parent_name,void __iomem *base); struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name,
Signature · 1 line
2.7.4
PATCH RESEND v2 9/11 clk: imx: Rename the imx_clk_pfdv2 to imply it's clk_hw based
In reply to Abel VesaRenaming the imx_clk_pfdv2 register function to imx_clk_hw_pfdv2 to be more obvious it is clk_hw based.
--- drivers/clk/imx/clk-imx7ulp.c | 16 ++++++++-------- drivers/clk/imx/clk-pfdv2.c | 2 +- drivers/clk/imx/clk.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/clk/imx/clk-imx7ulp.c +8 -8
@@ -94,16 +94,16 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) clks[IMX7ULP_CLK_SPLL ] =imx_clk_hw_pllv4 ("spll" ,"spll_pre_div" , base +0x600 );/* APLL PFDs */ - clks[IMX7ULP_CLK_APLL_PFD0 ] =imx_clk_pfdv2 ("apll_pfd0" ,"apll" , base +0x50c ,0 ); - clks[IMX7ULP_CLK_APLL_PFD1 ] =imx_clk_pfdv2 ("apll_pfd1" ,"apll" , base +0x50c ,1 ); - clks[IMX7ULP_CLK_APLL_PFD2 ] =imx_clk_pfdv2 ("apll_pfd2" ,"apll" , base +0x50c ,2 ); - clks[IMX7ULP_CLK_APLL_PFD3 ] =imx_clk_pfdv2 ("apll_pfd3" ,"apll" , base +0x50c ,3 ); + clks[IMX7ULP_CLK_APLL_PFD0 ] =imx_clk_hw_pfdv2 ("apll_pfd0" ,"apll" , base +0x50c ,0 ); + clks[IMX7ULP_CLK_APLL_PFD1 ] =imx_clk_hw_pfdv2 ("apll_pfd1" ,"apll" , base +0x50c ,1 ); + clks[IMX7ULP_CLK_APLL_PFD2 ] =imx_clk_hw_pfdv2 ("apll_pfd2" ,"apll" , base +0x50c ,2 ); + clks[IMX7ULP_CLK_APLL_PFD3 ] =imx_clk_hw_pfdv2 ("apll_pfd3" ,"apll" , base +0x50c ,3 );/* SPLL PFDs */ - clks[IMX7ULP_CLK_SPLL_PFD0 ] =imx_clk_pfdv2 ("spll_pfd0" ,"spll" , base +0x60C ,0 ); - clks[IMX7ULP_CLK_SPLL_PFD1 ] =imx_clk_pfdv2 ("spll_pfd1" ,"spll" , base +0x60C ,1 ); - clks[IMX7ULP_CLK_SPLL_PFD2 ] =imx_clk_pfdv2 ("spll_pfd2" ,"spll" , base +0x60C ,2 ); - clks[IMX7ULP_CLK_SPLL_PFD3 ] =imx_clk_pfdv2 ("spll_pfd3" ,"spll" , base +0x60C ,3 ); + clks[IMX7ULP_CLK_SPLL_PFD0 ] =imx_clk_hw_pfdv2 ("spll_pfd0" ,"spll" , base +0x60C ,0 ); + clks[IMX7ULP_CLK_SPLL_PFD1 ] =imx_clk_hw_pfdv2 ("spll_pfd1" ,"spll" , base +0x60C ,1 ); + clks[IMX7ULP_CLK_SPLL_PFD2 ] =imx_clk_hw_pfdv2 ("spll_pfd2" ,"spll" , base +0x60C ,2 ); + clks[IMX7ULP_CLK_SPLL_PFD3 ] =imx_clk_hw_pfdv2 ("spll_pfd3" ,"spll" , base +0x60C ,3 );/* PLL Mux */ clks[IMX7ULP_CLK_APLL_PFD_SEL ] =imx_clk_hw_mux_flags ("apll_pfd_sel" , base +0x508 ,14 ,2 , apll_pfd_sels,ARRAY_SIZE (apll_pfd_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE );
drivers/clk/imx/clk-pfdv2.c +1 -1
@@ -166,7 +166,7 @@ static const struct clk_ops clk_pfdv2_ops = { .is_enabled = clk_pfdv2_is_enabled, }; -struct clk_hw *imx_clk_pfdv2 (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_pfdv2 (const char *name,const char *parent_name,void __iomem *reg,u8 idx) {struct clk_init_data init;
drivers/clk/imx/clk.h +1 -1
@@ -200,7 +200,7 @@ struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent,struct clk_hw *imx_clk_hw_pfd (const char *name,const char *parent_name,void __iomem *reg,u8 idx); -struct clk_hw *imx_clk_pfdv2 (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_pfdv2 (const char *name,const char *parent_name,void __iomem *reg,u8 idx); struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name,
Signature · 1 line
2.7.4
PATCH RESEND v2 10/11 clk: imx: Rename the imx_clk_divider_gate to imply it's clk_hw based
In reply to Abel VesaRenaming the imx_clk_divider_gate register function to imx_clk_hw_divider_gate to be more obvious it is clk_hw based.
--- drivers/clk/imx/clk-divider-gate.c | 2 +- drivers/clk/imx/clk-imx7ulp.c | 8 ++++---- drivers/clk/imx/clk.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/clk/imx/clk-divider-gate.c +1 -1
@@ -173,7 +173,7 @@ static const struct clk_ops clk_divider_gate_ops = {* default as our HW is. Besides that it supports only CLK_DIVIDER_READ_ONLY * flag which can be specified by user flexibly. */ -struct clk_hw *imx_clk_divider_gate(const char *name, const char *parent_name, +struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, const struct clk_div_table *table,
drivers/clk/imx/clk-imx7ulp.c +4 -4
@@ -111,7 +111,7 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) clks[IMX7ULP_CLK_APLL_SEL ] =imx_clk_hw_mux_flags ("apll_sel" , base +0x508 ,1 ,1 , apll_sels,ARRAY_SIZE (apll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); clks[IMX7ULP_CLK_SPLL_SEL ] =imx_clk_hw_mux_flags ("spll_sel" , base +0x608 ,1 ,1 , spll_sels,ARRAY_SIZE (spll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_SPLL_BUS_CLK ] =imx_clk_divider_gate ("spll_bus_clk" ,"spll_sel" ,CLK_SET_RATE_GATE , base +0x604 ,8 ,3 ,0 , ulp_div_table, &imx_ccm_lock); + clks[IMX7ULP_CLK_SPLL_BUS_CLK ] =imx_clk_hw_divider_gate ("spll_bus_clk" ,"spll_sel" ,CLK_SET_RATE_GATE , base +0x604 ,8 ,3 ,0 , ulp_div_table, &imx_ccm_lock);/* scs/ddr/nic select different clock source requires that clock to be enabled first */ clks[IMX7ULP_CLK_SYS_SEL ] =imx_clk_hw_mux2 ("scs_sel" , base +0x14 ,24 ,4 , scs_sels,ARRAY_SIZE (scs_sels));
@@ -122,7 +122,7 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) clks[IMX7ULP_CLK_CORE_DIV ] =imx_clk_hw_divider_flags ("divcore" ,"scs_sel" , base +0x14 ,16 ,4 ,CLK_SET_RATE_PARENT ); clks[IMX7ULP_CLK_HSRUN_CORE_DIV ] =imx_clk_hw_divider_flags ("hsrun_divcore" ,"hsrun_scs_sel" , base +0x1c ,16 ,4 ,CLK_SET_RATE_PARENT ); - clks[IMX7ULP_CLK_DDR_DIV ] =imx_clk_divider_gate ("ddr_clk" ,"ddr_sel" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , base +0x30 ,0 ,3 , + clks[IMX7ULP_CLK_DDR_DIV ] =imx_clk_hw_divider_gate ("ddr_clk" ,"ddr_sel" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , base +0x30 ,0 ,3 ,0 , ulp_div_table, &imx_ccm_lock); clks[IMX7ULP_CLK_NIC0_DIV ] =imx_clk_hw_divider_flags ("nic0_clk" ,"nic_sel" , base +0x40 ,24 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL );
@@ -131,9 +131,9 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) clks[IMX7ULP_CLK_GPU_DIV ] =imx_clk_hw_divider ("gpu_clk" ,"nic0_clk" , base +0x40 ,20 ,4 ); - clks[IMX7ULP_CLK_SOSC_BUS_CLK ] =imx_clk_divider_gate ("sosc_bus_clk" ,"sosc" ,0 , base +0x104 ,8 ,3 , + clks[IMX7ULP_CLK_SOSC_BUS_CLK ] =imx_clk_hw_divider_gate ("sosc_bus_clk" ,"sosc" ,0 , base +0x104 ,8 ,3 ,CLK_DIVIDER_READ_ONLY , ulp_div_table, &imx_ccm_lock); - clks[IMX7ULP_CLK_FIRC_BUS_CLK ] =imx_clk_divider_gate ("firc_bus_clk" ,"firc" ,0 , base +0x304 ,8 ,3 , + clks[IMX7ULP_CLK_FIRC_BUS_CLK ] =imx_clk_hw_divider_gate ("firc_bus_clk" ,"firc" ,0 , base +0x304 ,8 ,3 ,CLK_DIVIDER_READ_ONLY , ulp_div_table, &imx_ccm_lock);imx_check_clk_hws (clks, clk_data->num);
drivers/clk/imx/clk.h +1 -1
@@ -469,7 +469,7 @@ struct clk *imx8m_clk_composite_flags(const char *name,#define imx8m_clk_composite_critical (name, parent_names, reg) \ __imx8m_clk_composite(name, parent_names, reg, CLK_IS_CRITICAL) -struct clk_hw *imx_clk_divider_gate (const char *name,const char *parent_name, +struct clk_hw *imx_clk_hw_divider_gate (const char *name,const char *parent_name,unsigned long flags,void __iomem *reg,u8 shift,u8 width,u8 clk_divider_flags,const struct clk_div_table *table,spinlock_t *lock);
Signature · 1 line
2.7.4
PATCH RESEND v2 11/11 clk: imx7up: Rename the clks to hws
In reply to Abel VesaThis is just to keep in line with the other i.MX clock drivers that are clk_hw based. Plus, it makes more sense to be called hws since its type is clk_hw not clk.
--- drivers/clk/imx/clk-imx7ulp.c | 182 +++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 91 deletions(-)
drivers/clk/imx/clk-imx7ulp.c +91 -91
@@ -58,7 +58,7 @@ static struct clk **pcc3_uart_clks[ARRAY_SIZE(pcc3_uart_clk_ids) + 1] __initdatastatic void __init imx7ulp_clk_scg1_init (struct device_node *np) {struct clk_hw_onecell_data *clk_data; -struct clk_hw **clks; +struct clk_hw **hws;void __iomem *base; clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_SCG1_END),
@@ -67,76 +67,76 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np)return ; clk_data->num =IMX7ULP_CLK_SCG1_END ; - clks = clk_data->hws; + hws = clk_data->hws; - clks[IMX7ULP_CLK_DUMMY ] =imx_clk_hw_fixed ("dummy" ,0 ); + hws[IMX7ULP_CLK_DUMMY ] =imx_clk_hw_fixed ("dummy" ,0 ); - clks[IMX7ULP_CLK_ROSC ] =imx_obtain_fixed_clk_hw (np,"rosc" ); - clks[IMX7ULP_CLK_SOSC ] =imx_obtain_fixed_clk_hw (np,"sosc" ); - clks[IMX7ULP_CLK_SIRC ] =imx_obtain_fixed_clk_hw (np,"sirc" ); - clks[IMX7ULP_CLK_FIRC ] =imx_obtain_fixed_clk_hw (np,"firc" ); - clks[IMX7ULP_CLK_UPLL ] =imx_obtain_fixed_clk_hw (np,"upll" ); + hws[IMX7ULP_CLK_ROSC ] =imx_obtain_fixed_clk_hw (np,"rosc" ); + hws[IMX7ULP_CLK_SOSC ] =imx_obtain_fixed_clk_hw (np,"sosc" ); + hws[IMX7ULP_CLK_SIRC ] =imx_obtain_fixed_clk_hw (np,"sirc" ); + hws[IMX7ULP_CLK_FIRC ] =imx_obtain_fixed_clk_hw (np,"firc" ); + hws[IMX7ULP_CLK_UPLL ] =imx_obtain_fixed_clk_hw (np,"upll" );/* SCG1 */ base =of_iomap (np,0 );WARN_ON (!base);/* NOTE: xPLL config can't be changed when xPLL is enabled */ - clks[IMX7ULP_CLK_APLL_PRE_SEL ] =imx_clk_hw_mux_flags ("apll_pre_sel" , base +0x508 ,0 ,1 , pll_pre_sels,ARRAY_SIZE (pll_pre_sels),CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_SPLL_PRE_SEL ] =imx_clk_hw_mux_flags ("spll_pre_sel" , base +0x608 ,0 ,1 , pll_pre_sels,ARRAY_SIZE (pll_pre_sels),CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_APLL_PRE_SEL ] =imx_clk_hw_mux_flags ("apll_pre_sel" , base +0x508 ,0 ,1 , pll_pre_sels,ARRAY_SIZE (pll_pre_sels),CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_SPLL_PRE_SEL ] =imx_clk_hw_mux_flags ("spll_pre_sel" , base +0x608 ,0 ,1 , pll_pre_sels,ARRAY_SIZE (pll_pre_sels),CLK_SET_PARENT_GATE );/* name parent_name reg shift width flags */ - clks[IMX7ULP_CLK_APLL_PRE_DIV ] =imx_clk_hw_divider_flags ("apll_pre_div" ,"apll_pre_sel" , base +0x508 ,8 ,3 ,CLK_SET_RATE_GATE ); - clks[IMX7ULP_CLK_SPLL_PRE_DIV ] =imx_clk_hw_divider_flags ("spll_pre_div" ,"spll_pre_sel" , base +0x608 ,8 ,3 ,CLK_SET_RATE_GATE ); + hws[IMX7ULP_CLK_APLL_PRE_DIV ] =imx_clk_hw_divider_flags ("apll_pre_div" ,"apll_pre_sel" , base +0x508 ,8 ,3 ,CLK_SET_RATE_GATE ); + hws[IMX7ULP_CLK_SPLL_PRE_DIV ] =imx_clk_hw_divider_flags ("spll_pre_div" ,"spll_pre_sel" , base +0x608 ,8 ,3 ,CLK_SET_RATE_GATE );/* name parent_name base */ - clks[IMX7ULP_CLK_APLL ] =imx_clk_hw_pllv4 ("apll" ,"apll_pre_div" , base +0x500 ); - clks[IMX7ULP_CLK_SPLL ] =imx_clk_hw_pllv4 ("spll" ,"spll_pre_div" , base +0x600 ); + hws[IMX7ULP_CLK_APLL ] =imx_clk_hw_pllv4 ("apll" ,"apll_pre_div" , base +0x500 ); + hws[IMX7ULP_CLK_SPLL ] =imx_clk_hw_pllv4 ("spll" ,"spll_pre_div" , base +0x600 );/* APLL PFDs */ - clks[IMX7ULP_CLK_APLL_PFD0 ] =imx_clk_hw_pfdv2 ("apll_pfd0" ,"apll" , base +0x50c ,0 ); - clks[IMX7ULP_CLK_APLL_PFD1 ] =imx_clk_hw_pfdv2 ("apll_pfd1" ,"apll" , base +0x50c ,1 ); - clks[IMX7ULP_CLK_APLL_PFD2 ] =imx_clk_hw_pfdv2 ("apll_pfd2" ,"apll" , base +0x50c ,2 ); - clks[IMX7ULP_CLK_APLL_PFD3 ] =imx_clk_hw_pfdv2 ("apll_pfd3" ,"apll" , base +0x50c ,3 ); + hws[IMX7ULP_CLK_APLL_PFD0 ] =imx_clk_hw_pfdv2 ("apll_pfd0" ,"apll" , base +0x50c ,0 ); + hws[IMX7ULP_CLK_APLL_PFD1 ] =imx_clk_hw_pfdv2 ("apll_pfd1" ,"apll" , base +0x50c ,1 ); + hws[IMX7ULP_CLK_APLL_PFD2 ] =imx_clk_hw_pfdv2 ("apll_pfd2" ,"apll" , base +0x50c ,2 ); + hws[IMX7ULP_CLK_APLL_PFD3 ] =imx_clk_hw_pfdv2 ("apll_pfd3" ,"apll" , base +0x50c ,3 );/* SPLL PFDs */ - clks[IMX7ULP_CLK_SPLL_PFD0 ] =imx_clk_hw_pfdv2 ("spll_pfd0" ,"spll" , base +0x60C ,0 ); - clks[IMX7ULP_CLK_SPLL_PFD1 ] =imx_clk_hw_pfdv2 ("spll_pfd1" ,"spll" , base +0x60C ,1 ); - clks[IMX7ULP_CLK_SPLL_PFD2 ] =imx_clk_hw_pfdv2 ("spll_pfd2" ,"spll" , base +0x60C ,2 ); - clks[IMX7ULP_CLK_SPLL_PFD3 ] =imx_clk_hw_pfdv2 ("spll_pfd3" ,"spll" , base +0x60C ,3 ); + hws[IMX7ULP_CLK_SPLL_PFD0 ] =imx_clk_hw_pfdv2 ("spll_pfd0" ,"spll" , base +0x60C ,0 ); + hws[IMX7ULP_CLK_SPLL_PFD1 ] =imx_clk_hw_pfdv2 ("spll_pfd1" ,"spll" , base +0x60C ,1 ); + hws[IMX7ULP_CLK_SPLL_PFD2 ] =imx_clk_hw_pfdv2 ("spll_pfd2" ,"spll" , base +0x60C ,2 ); + hws[IMX7ULP_CLK_SPLL_PFD3 ] =imx_clk_hw_pfdv2 ("spll_pfd3" ,"spll" , base +0x60C ,3 );/* PLL Mux */ - clks[IMX7ULP_CLK_APLL_PFD_SEL ] =imx_clk_hw_mux_flags ("apll_pfd_sel" , base +0x508 ,14 ,2 , apll_pfd_sels,ARRAY_SIZE (apll_pfd_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_SPLL_PFD_SEL ] =imx_clk_hw_mux_flags ("spll_pfd_sel" , base +0x608 ,14 ,2 , spll_pfd_sels,ARRAY_SIZE (spll_pfd_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_APLL_SEL ] =imx_clk_hw_mux_flags ("apll_sel" , base +0x508 ,1 ,1 , apll_sels,ARRAY_SIZE (apll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_SPLL_SEL ] =imx_clk_hw_mux_flags ("spll_sel" , base +0x608 ,1 ,1 , spll_sels,ARRAY_SIZE (spll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_APLL_PFD_SEL ] =imx_clk_hw_mux_flags ("apll_pfd_sel" , base +0x508 ,14 ,2 , apll_pfd_sels,ARRAY_SIZE (apll_pfd_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_SPLL_PFD_SEL ] =imx_clk_hw_mux_flags ("spll_pfd_sel" , base +0x608 ,14 ,2 , spll_pfd_sels,ARRAY_SIZE (spll_pfd_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_APLL_SEL ] =imx_clk_hw_mux_flags ("apll_sel" , base +0x508 ,1 ,1 , apll_sels,ARRAY_SIZE (apll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); + hws[IMX7ULP_CLK_SPLL_SEL ] =imx_clk_hw_mux_flags ("spll_sel" , base +0x608 ,1 ,1 , spll_sels,ARRAY_SIZE (spll_sels),CLK_SET_RATE_PARENT |CLK_SET_PARENT_GATE ); - clks[IMX7ULP_CLK_SPLL_BUS_CLK ] =imx_clk_hw_divider_gate ("spll_bus_clk" ,"spll_sel" ,CLK_SET_RATE_GATE , base +0x604 ,8 ,3 ,0 , ulp_div_table, &imx_ccm_lock); + hws[IMX7ULP_CLK_SPLL_BUS_CLK ] =imx_clk_hw_divider_gate ("spll_bus_clk" ,"spll_sel" ,CLK_SET_RATE_GATE , base +0x604 ,8 ,3 ,0 , ulp_div_table, &imx_ccm_lock);/* scs/ddr/nic select different clock source requires that clock to be enabled first */ - clks[IMX7ULP_CLK_SYS_SEL ] =imx_clk_hw_mux2 ("scs_sel" , base +0x14 ,24 ,4 , scs_sels,ARRAY_SIZE (scs_sels)); - clks[IMX7ULP_CLK_HSRUN_SYS_SEL ] =imx_clk_hw_mux2 ("hsrun_scs_sel" , base +0x1c ,24 ,4 , scs_sels,ARRAY_SIZE (scs_sels)); - clks[IMX7ULP_CLK_NIC_SEL ] =imx_clk_hw_mux2 ("nic_sel" , base +0x40 ,28 ,1 , nic_sels,ARRAY_SIZE (nic_sels)); - clks[IMX7ULP_CLK_DDR_SEL ] =imx_clk_hw_mux_flags ("ddr_sel" , base +0x30 ,24 ,2 , ddr_sels,ARRAY_SIZE (ddr_sels),CLK_SET_RATE_PARENT |CLK_OPS_PARENT_ENABLE ); + hws[IMX7ULP_CLK_SYS_SEL ] =imx_clk_hw_mux2 ("scs_sel" , base +0x14 ,24 ,4 , scs_sels,ARRAY_SIZE (scs_sels)); + hws[IMX7ULP_CLK_HSRUN_SYS_SEL ] =imx_clk_hw_mux2 ("hsrun_scs_sel" , base +0x1c ,24 ,4 , scs_sels,ARRAY_SIZE (scs_sels)); + hws[IMX7ULP_CLK_NIC_SEL ] =imx_clk_hw_mux2 ("nic_sel" , base +0x40 ,28 ,1 , nic_sels,ARRAY_SIZE (nic_sels)); + hws[IMX7ULP_CLK_DDR_SEL ] =imx_clk_hw_mux_flags ("ddr_sel" , base +0x30 ,24 ,2 , ddr_sels,ARRAY_SIZE (ddr_sels),CLK_SET_RATE_PARENT |CLK_OPS_PARENT_ENABLE ); - clks[IMX7ULP_CLK_CORE_DIV ] =imx_clk_hw_divider_flags ("divcore" ,"scs_sel" , base +0x14 ,16 ,4 ,CLK_SET_RATE_PARENT ); - clks[IMX7ULP_CLK_HSRUN_CORE_DIV ] =imx_clk_hw_divider_flags ("hsrun_divcore" ,"hsrun_scs_sel" , base +0x1c ,16 ,4 ,CLK_SET_RATE_PARENT ); + hws[IMX7ULP_CLK_CORE_DIV ] =imx_clk_hw_divider_flags ("divcore" ,"scs_sel" , base +0x14 ,16 ,4 ,CLK_SET_RATE_PARENT ); + hws[IMX7ULP_CLK_HSRUN_CORE_DIV ] =imx_clk_hw_divider_flags ("hsrun_divcore" ,"hsrun_scs_sel" , base +0x1c ,16 ,4 ,CLK_SET_RATE_PARENT ); - clks[IMX7ULP_CLK_DDR_DIV ] =imx_clk_hw_divider_gate ("ddr_clk" ,"ddr_sel" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , base +0x30 ,0 ,3 , + hws[IMX7ULP_CLK_DDR_DIV ] =imx_clk_hw_divider_gate ("ddr_clk" ,"ddr_sel" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , base +0x30 ,0 ,3 ,0 , ulp_div_table, &imx_ccm_lock); - clks[IMX7ULP_CLK_NIC0_DIV ] =imx_clk_hw_divider_flags ("nic0_clk" ,"nic_sel" , base +0x40 ,24 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); - clks[IMX7ULP_CLK_NIC1_DIV ] =imx_clk_hw_divider_flags ("nic1_clk" ,"nic0_clk" , base +0x40 ,16 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); - clks[IMX7ULP_CLK_NIC1_BUS_DIV ] =imx_clk_hw_divider_flags ("nic1_bus_clk" ,"nic0_clk" , base +0x40 ,4 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); + hws[IMX7ULP_CLK_NIC0_DIV ] =imx_clk_hw_divider_flags ("nic0_clk" ,"nic_sel" , base +0x40 ,24 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); + hws[IMX7ULP_CLK_NIC1_DIV ] =imx_clk_hw_divider_flags ("nic1_clk" ,"nic0_clk" , base +0x40 ,16 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); + hws[IMX7ULP_CLK_NIC1_BUS_DIV ] =imx_clk_hw_divider_flags ("nic1_bus_clk" ,"nic0_clk" , base +0x40 ,4 ,4 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); - clks[IMX7ULP_CLK_GPU_DIV ] =imx_clk_hw_divider ("gpu_clk" ,"nic0_clk" , base +0x40 ,20 ,4 ); + hws[IMX7ULP_CLK_GPU_DIV ] =imx_clk_hw_divider ("gpu_clk" ,"nic0_clk" , base +0x40 ,20 ,4 ); - clks[IMX7ULP_CLK_SOSC_BUS_CLK ] =imx_clk_hw_divider_gate ("sosc_bus_clk" ,"sosc" ,0 , base +0x104 ,8 ,3 , + hws[IMX7ULP_CLK_SOSC_BUS_CLK ] =imx_clk_hw_divider_gate ("sosc_bus_clk" ,"sosc" ,0 , base +0x104 ,8 ,3 ,CLK_DIVIDER_READ_ONLY , ulp_div_table, &imx_ccm_lock); - clks[IMX7ULP_CLK_FIRC_BUS_CLK ] =imx_clk_hw_divider_gate ("firc_bus_clk" ,"firc" ,0 , base +0x304 ,8 ,3 , + hws[IMX7ULP_CLK_FIRC_BUS_CLK ] =imx_clk_hw_divider_gate ("firc_bus_clk" ,"firc" ,0 , base +0x304 ,8 ,3 ,CLK_DIVIDER_READ_ONLY , ulp_div_table, &imx_ccm_lock); -imx_check_clk_hws (clks, clk_data->num); +imx_check_clk_hws (hws, clk_data->num);of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_data); }
@@ -145,7 +145,7 @@ CLK_OF_DECLARE(imx7ulp_clk_scg1, "fsl,imx7ulp-scg1", imx7ulp_clk_scg1_init);static void __init imx7ulp_clk_pcc2_init (struct device_node *np) {struct clk_hw_onecell_data *clk_data; -struct clk_hw **clks; +struct clk_hw **hws;void __iomem *base;int i;
@@ -155,42 +155,42 @@ static void __init imx7ulp_clk_pcc2_init(struct device_node *np)return ; clk_data->num =IMX7ULP_CLK_PCC2_END ; - clks = clk_data->hws; + hws = clk_data->hws;/* PCC2 */ base =of_iomap (np,0 );WARN_ON (!base); - clks[IMX7ULP_CLK_DMA1 ] =imx_clk_hw_gate ("dma1" ,"nic1_clk" , base +0x20 ,30 ); - clks[IMX7ULP_CLK_RGPIO2P1 ] =imx_clk_hw_gate ("rgpio2p1" ,"nic1_bus_clk" , base +0x3c ,30 ); - clks[IMX7ULP_CLK_DMA_MUX1 ] =imx_clk_hw_gate ("dma_mux1" ,"nic1_bus_clk" , base +0x84 ,30 ); - clks[IMX7ULP_CLK_CAAM ] =imx_clk_hw_gate ("caam" ,"nic1_clk" , base +0x90 ,30 ); - clks[IMX7ULP_CLK_LPTPM4 ] =imx7ulp_clk_hw_composite ("lptpm4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x94 ); - clks[IMX7ULP_CLK_LPTPM5 ] =imx7ulp_clk_hw_composite ("lptpm5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x98 ); - clks[IMX7ULP_CLK_LPIT1 ] =imx7ulp_clk_hw_composite ("lpit1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x9c ); - clks[IMX7ULP_CLK_LPSPI2 ] =imx7ulp_clk_hw_composite ("lpspi2" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xa4 ); - clks[IMX7ULP_CLK_LPSPI3 ] =imx7ulp_clk_hw_composite ("lpspi3" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xa8 ); - clks[IMX7ULP_CLK_LPI2C4 ] =imx7ulp_clk_hw_composite ("lpi2c4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xac ); - clks[IMX7ULP_CLK_LPI2C5 ] =imx7ulp_clk_hw_composite ("lpi2c5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb0 ); - clks[IMX7ULP_CLK_LPUART4 ] =imx7ulp_clk_hw_composite ("lpuart4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb4 ); - clks[IMX7ULP_CLK_LPUART5 ] =imx7ulp_clk_hw_composite ("lpuart5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb8 ); - clks[IMX7ULP_CLK_FLEXIO1 ] =imx7ulp_clk_hw_composite ("flexio1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xc4 ); - clks[IMX7ULP_CLK_USB0 ] =imx7ulp_clk_hw_composite ("usb0" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xcc ); - clks[IMX7ULP_CLK_USB1 ] =imx7ulp_clk_hw_composite ("usb1" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xd0 ); - clks[IMX7ULP_CLK_USB_PHY ] =imx_clk_hw_gate ("usb_phy" ,"nic1_bus_clk" , base +0xd4 ,30 ); - clks[IMX7ULP_CLK_USDHC0 ] =imx7ulp_clk_hw_composite ("usdhc0" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xdc ); - clks[IMX7ULP_CLK_USDHC1 ] =imx7ulp_clk_hw_composite ("usdhc1" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xe0 ); - clks[IMX7ULP_CLK_WDG1 ] =imx7ulp_clk_hw_composite ("wdg1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0xf4 ); - clks[IMX7ULP_CLK_WDG2 ] =imx7ulp_clk_hw_composite ("wdg2" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0x10c ); - -imx_check_clk_hws (clks, clk_data->num); + hws[IMX7ULP_CLK_DMA1 ] =imx_clk_hw_gate ("dma1" ,"nic1_clk" , base +0x20 ,30 ); + hws[IMX7ULP_CLK_RGPIO2P1 ] =imx_clk_hw_gate ("rgpio2p1" ,"nic1_bus_clk" , base +0x3c ,30 ); + hws[IMX7ULP_CLK_DMA_MUX1 ] =imx_clk_hw_gate ("dma_mux1" ,"nic1_bus_clk" , base +0x84 ,30 ); + hws[IMX7ULP_CLK_CAAM ] =imx_clk_hw_gate ("caam" ,"nic1_clk" , base +0x90 ,30 ); + hws[IMX7ULP_CLK_LPTPM4 ] =imx7ulp_clk_hw_composite ("lptpm4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x94 ); + hws[IMX7ULP_CLK_LPTPM5 ] =imx7ulp_clk_hw_composite ("lptpm5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x98 ); + hws[IMX7ULP_CLK_LPIT1 ] =imx7ulp_clk_hw_composite ("lpit1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x9c ); + hws[IMX7ULP_CLK_LPSPI2 ] =imx7ulp_clk_hw_composite ("lpspi2" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xa4 ); + hws[IMX7ULP_CLK_LPSPI3 ] =imx7ulp_clk_hw_composite ("lpspi3" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xa8 ); + hws[IMX7ULP_CLK_LPI2C4 ] =imx7ulp_clk_hw_composite ("lpi2c4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xac ); + hws[IMX7ULP_CLK_LPI2C5 ] =imx7ulp_clk_hw_composite ("lpi2c5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb0 ); + hws[IMX7ULP_CLK_LPUART4 ] =imx7ulp_clk_hw_composite ("lpuart4" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb4 ); + hws[IMX7ULP_CLK_LPUART5 ] =imx7ulp_clk_hw_composite ("lpuart5" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xb8 ); + hws[IMX7ULP_CLK_FLEXIO1 ] =imx7ulp_clk_hw_composite ("flexio1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0xc4 ); + hws[IMX7ULP_CLK_USB0 ] =imx7ulp_clk_hw_composite ("usb0" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xcc ); + hws[IMX7ULP_CLK_USB1 ] =imx7ulp_clk_hw_composite ("usb1" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xd0 ); + hws[IMX7ULP_CLK_USB_PHY ] =imx_clk_hw_gate ("usb_phy" ,"nic1_bus_clk" , base +0xd4 ,30 ); + hws[IMX7ULP_CLK_USDHC0 ] =imx7ulp_clk_hw_composite ("usdhc0" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xdc ); + hws[IMX7ULP_CLK_USDHC1 ] =imx7ulp_clk_hw_composite ("usdhc1" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xe0 ); + hws[IMX7ULP_CLK_WDG1 ] =imx7ulp_clk_hw_composite ("wdg1" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0xf4 ); + hws[IMX7ULP_CLK_WDG2 ] =imx7ulp_clk_hw_composite ("wdg2" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0x10c ); + +imx_check_clk_hws (hws, clk_data->num);of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_data);for (i =0 ; i <ARRAY_SIZE (pcc2_uart_clk_ids); i++) {int index = pcc2_uart_clk_ids[i]; - pcc2_uart_clks[i] = &clks[index]->clk; + pcc2_uart_clks[i] = &hws[index]->clk; }imx_register_uart_clocks (pcc2_uart_clks);
@@ -200,7 +200,7 @@ CLK_OF_DECLARE(imx7ulp_clk_pcc2, "fsl,imx7ulp-pcc2", imx7ulp_clk_pcc2_init);static void __init imx7ulp_clk_pcc3_init (struct device_node *np) {struct clk_hw_onecell_data *clk_data; -struct clk_hw **clks; +struct clk_hw **hws;void __iomem *base;int i;
@@ -210,41 +210,41 @@ static void __init imx7ulp_clk_pcc3_init(struct device_node *np)return ; clk_data->num =IMX7ULP_CLK_PCC3_END ; - clks = clk_data->hws; + hws = clk_data->hws;/* PCC3 */ base =of_iomap (np,0 );WARN_ON (!base); - clks[IMX7ULP_CLK_LPTPM6 ] =imx7ulp_clk_hw_composite ("lptpm6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x84 ); - clks[IMX7ULP_CLK_LPTPM7 ] =imx7ulp_clk_hw_composite ("lptpm7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x88 ); + hws[IMX7ULP_CLK_LPTPM6 ] =imx7ulp_clk_hw_composite ("lptpm6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x84 ); + hws[IMX7ULP_CLK_LPTPM7 ] =imx7ulp_clk_hw_composite ("lptpm7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x88 ); - clks[IMX7ULP_CLK_MMDC ] =clk_hw_register_gate (NULL ,"mmdc" ,"nic1_clk" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , + hws[IMX7ULP_CLK_MMDC ] =clk_hw_register_gate (NULL ,"mmdc" ,"nic1_clk" ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , base +0xac ,30 ,0 , &imx_ccm_lock); - clks[IMX7ULP_CLK_LPI2C6 ] =imx7ulp_clk_hw_composite ("lpi2c6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x90 ); - clks[IMX7ULP_CLK_LPI2C7 ] =imx7ulp_clk_hw_composite ("lpi2c7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x94 ); - clks[IMX7ULP_CLK_LPUART6 ] =imx7ulp_clk_hw_composite ("lpuart6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x98 ); - clks[IMX7ULP_CLK_LPUART7 ] =imx7ulp_clk_hw_composite ("lpuart7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x9c ); - clks[IMX7ULP_CLK_DSI ] =imx7ulp_clk_hw_composite ("dsi" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0xa4 ); - clks[IMX7ULP_CLK_LCDIF ] =imx7ulp_clk_hw_composite ("lcdif" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xa8 ); + hws[IMX7ULP_CLK_LPI2C6 ] =imx7ulp_clk_hw_composite ("lpi2c6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x90 ); + hws[IMX7ULP_CLK_LPI2C7 ] =imx7ulp_clk_hw_composite ("lpi2c7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x94 ); + hws[IMX7ULP_CLK_LPUART6 ] =imx7ulp_clk_hw_composite ("lpuart6" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x98 ); + hws[IMX7ULP_CLK_LPUART7 ] =imx7ulp_clk_hw_composite ("lpuart7" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, false, true, base +0x9c ); + hws[IMX7ULP_CLK_DSI ] =imx7ulp_clk_hw_composite ("dsi" , periph_bus_sels,ARRAY_SIZE (periph_bus_sels), true, true, true, base +0xa4 ); + hws[IMX7ULP_CLK_LCDIF ] =imx7ulp_clk_hw_composite ("lcdif" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, true, true, base +0xa8 ); - clks[IMX7ULP_CLK_VIU ] =imx_clk_hw_gate ("viu" ,"nic1_clk" , base +0xa0 ,30 ); - clks[IMX7ULP_CLK_PCTLC ] =imx_clk_hw_gate ("pctlc" ,"nic1_bus_clk" , base +0xb8 ,30 ); - clks[IMX7ULP_CLK_PCTLD ] =imx_clk_hw_gate ("pctld" ,"nic1_bus_clk" , base +0xbc ,30 ); - clks[IMX7ULP_CLK_PCTLE ] =imx_clk_hw_gate ("pctle" ,"nic1_bus_clk" , base +0xc0 ,30 ); - clks[IMX7ULP_CLK_PCTLF ] =imx_clk_hw_gate ("pctlf" ,"nic1_bus_clk" , base +0xc4 ,30 ); + hws[IMX7ULP_CLK_VIU ] =imx_clk_hw_gate ("viu" ,"nic1_clk" , base +0xa0 ,30 ); + hws[IMX7ULP_CLK_PCTLC ] =imx_clk_hw_gate ("pctlc" ,"nic1_bus_clk" , base +0xb8 ,30 ); + hws[IMX7ULP_CLK_PCTLD ] =imx_clk_hw_gate ("pctld" ,"nic1_bus_clk" , base +0xbc ,30 ); + hws[IMX7ULP_CLK_PCTLE ] =imx_clk_hw_gate ("pctle" ,"nic1_bus_clk" , base +0xc0 ,30 ); + hws[IMX7ULP_CLK_PCTLF ] =imx_clk_hw_gate ("pctlf" ,"nic1_bus_clk" , base +0xc4 ,30 ); - clks[IMX7ULP_CLK_GPU3D ] =imx7ulp_clk_hw_composite ("gpu3d" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, false, true, base +0x140 ); - clks[IMX7ULP_CLK_GPU2D ] =imx7ulp_clk_hw_composite ("gpu2d" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, false, true, base +0x144 ); + hws[IMX7ULP_CLK_GPU3D ] =imx7ulp_clk_hw_composite ("gpu3d" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, false, true, base +0x140 ); + hws[IMX7ULP_CLK_GPU2D ] =imx7ulp_clk_hw_composite ("gpu2d" , periph_plat_sels,ARRAY_SIZE (periph_plat_sels), true, false, true, base +0x144 ); -imx_check_clk_hws (clks, clk_data->num); +imx_check_clk_hws (hws, clk_data->num);of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_data);for (i =0 ; i <ARRAY_SIZE (pcc3_uart_clk_ids); i++) {int index = pcc3_uart_clk_ids[i]; - pcc3_uart_clks[i] = &clks[index]->clk; + pcc3_uart_clks[i] = &hws[index]->clk; }imx_register_uart_clocks (pcc3_uart_clks);
@@ -254,7 +254,7 @@ CLK_OF_DECLARE(imx7ulp_clk_pcc3, "fsl,imx7ulp-pcc3", imx7ulp_clk_pcc3_init);static void __init imx7ulp_clk_smc1_init (struct device_node *np) {struct clk_hw_onecell_data *clk_data; -struct clk_hw **clks; +struct clk_hw **hws;void __iomem *base; clk_data = kzalloc(struct_size(clk_data, hws, IMX7ULP_CLK_SMC1_END),
@@ -263,15 +263,15 @@ static void __init imx7ulp_clk_smc1_init(struct device_node *np)return ; clk_data->num =IMX7ULP_CLK_SMC1_END ; - clks = clk_data->hws; + hws = clk_data->hws;/* SMC1 */ base =of_iomap (np,0 );WARN_ON (!base); - clks[IMX7ULP_CLK_ARM ] =imx_clk_hw_mux_flags ("arm" , base +0x10 ,8 ,2 , arm_sels,ARRAY_SIZE (arm_sels),CLK_IS_CRITICAL ); + hws[IMX7ULP_CLK_ARM ] =imx_clk_hw_mux_flags ("arm" , base +0x10 ,8 ,2 , arm_sels,ARRAY_SIZE (arm_sels),CLK_IS_CRITICAL ); -imx_check_clk_hws (clks, clk_data->num); +imx_check_clk_hws (hws, clk_data->num);of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_data); }
Signature · 1 line
2.7.4
Shawn Guo
AppliedQuoted 14 lines · Abel Vesa
Shawn, just rebased on your clk/imx branch as requested.
Abel Vesa (11):
clk: imx: Add correct failure handling for clk based helpers
clk: imx: Rename the SCCG to SSCG
clk: imx: Replace all the clk based helpers with macros
clk: imx: pllv1: Switch toclk_hwbased API
clk: imx: pllv2: Switch toclk_hwbased API
clk: imx: imx7ulp composite: Rename to show isclk_hwbased
clk: imx: Rename sccg and frac pll register to suggestclk_hw
clk: imx: Rename theimx_clk_pllv4to imply it'sclk_hwbased
clk: imx: Rename theimx_clk_pfdv2to imply it'sclk_hwbased
clk: imx: Rename theimx_clk_divider_gateto imply it'sclk_hwbased
clk: imx7up: Rename the clks to hws
Applied all, thanks.