Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: add clk api for supporting CLK_OPS_PARENT_ENABLE clocks

IMX SoCs like i.MX7D requires using CLK_OPS_PARENT_ENABLE flags,
adding the corresponding clock APIs variants for easily to use.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Dong Aisheng and committed by
Stephen Boyd
39c29498 5afc9941

+32
+32
drivers/clk/imx/clk.h
··· 97 97 reg, shift, width, 0, &imx_ccm_lock); 98 98 } 99 99 100 + static inline struct clk *imx_clk_divider2(const char *name, const char *parent, 101 + void __iomem *reg, u8 shift, u8 width) 102 + { 103 + return clk_register_divider(NULL, name, parent, 104 + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 105 + reg, shift, width, 0, &imx_ccm_lock); 106 + } 107 + 100 108 static inline struct clk *imx_clk_gate(const char *name, const char *parent, 101 109 void __iomem *reg, u8 shift) 102 110 { ··· 141 133 shift, cgr_val, 0, &imx_ccm_lock, NULL); 142 134 } 143 135 136 + static inline struct clk *imx_clk_gate3(const char *name, const char *parent, 137 + void __iomem *reg, u8 shift) 138 + { 139 + return clk_register_gate(NULL, name, parent, 140 + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 141 + reg, shift, 0, &imx_ccm_lock); 142 + } 143 + 144 + static inline struct clk *imx_clk_gate4(const char *name, const char *parent, 145 + void __iomem *reg, u8 shift) 146 + { 147 + return clk_register_gate2(NULL, name, parent, 148 + CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 149 + reg, shift, 0x3, 0, &imx_ccm_lock, NULL); 150 + } 151 + 144 152 static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, 145 153 u8 shift, u8 width, const char **parents, int num_parents) 146 154 { 147 155 return clk_register_mux(NULL, name, parents, num_parents, 148 156 CLK_SET_RATE_NO_REPARENT, reg, shift, 149 157 width, 0, &imx_ccm_lock); 158 + } 159 + 160 + static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg, 161 + u8 shift, u8 width, const char **parents, int num_parents) 162 + { 163 + return clk_register_mux(NULL, name, parents, num_parents, 164 + CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE, 165 + reg, shift, width, 0, &imx_ccm_lock); 150 166 } 151 167 152 168 static inline struct clk *imx_clk_mux_flags(const char *name,