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

clk: imx: re-order and concentrate the same type of clk api

Re-order and concentrate the same type of clk api for better
code maintenance.

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
5afc9941 fc8726a2

+29 -29
+29 -29
drivers/clk/imx/clk.h
··· 51 51 struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, 52 52 void __iomem *reg, u8 shift, u32 exclusive_mask); 53 53 54 - static inline struct clk *imx_clk_gate2(const char *name, const char *parent, 55 - void __iomem *reg, u8 shift) 56 - { 57 - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 58 - shift, 0x3, 0, &imx_ccm_lock, NULL); 59 - } 60 - 61 - static inline struct clk *imx_clk_gate2_shared(const char *name, 62 - const char *parent, void __iomem *reg, u8 shift, 63 - unsigned int *share_count) 64 - { 65 - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 66 - shift, 0x3, 0, &imx_ccm_lock, share_count); 67 - } 68 - 69 - static inline struct clk *imx_clk_gate2_cgr(const char *name, const char *parent, 70 - void __iomem *reg, u8 shift, u8 cgr_val) 71 - { 72 - return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 73 - shift, cgr_val, 0, &imx_ccm_lock, NULL); 74 - } 75 - 76 54 struct clk *imx_clk_pfd(const char *name, const char *parent_name, 77 55 void __iomem *reg, u8 idx); 78 56 ··· 73 95 static inline struct clk *imx_clk_fixed(const char *name, int rate) 74 96 { 75 97 return clk_register_fixed_rate(NULL, name, NULL, 0, rate); 98 + } 99 + 100 + static inline struct clk *imx_clk_fixed_factor(const char *name, 101 + const char *parent, unsigned int mult, unsigned int div) 102 + { 103 + return clk_register_fixed_factor(NULL, name, parent, 104 + CLK_SET_RATE_PARENT, mult, div); 76 105 } 77 106 78 107 static inline struct clk *imx_clk_divider(const char *name, const char *parent, ··· 111 126 shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock); 112 127 } 113 128 129 + static inline struct clk *imx_clk_gate2(const char *name, const char *parent, 130 + void __iomem *reg, u8 shift) 131 + { 132 + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 133 + shift, 0x3, 0, &imx_ccm_lock, NULL); 134 + } 135 + 136 + static inline struct clk *imx_clk_gate2_shared(const char *name, 137 + const char *parent, void __iomem *reg, u8 shift, 138 + unsigned int *share_count) 139 + { 140 + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 141 + shift, 0x3, 0, &imx_ccm_lock, share_count); 142 + } 143 + 144 + static inline struct clk *imx_clk_gate2_cgr(const char *name, 145 + const char *parent, void __iomem *reg, u8 shift, u8 cgr_val) 146 + { 147 + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, 148 + shift, cgr_val, 0, &imx_ccm_lock, NULL); 149 + } 150 + 114 151 static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, 115 152 u8 shift, u8 width, const char **parents, int num_parents) 116 153 { ··· 148 141 return clk_register_mux(NULL, name, parents, num_parents, 149 142 flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0, 150 143 &imx_ccm_lock); 151 - } 152 - 153 - static inline struct clk *imx_clk_fixed_factor(const char *name, 154 - const char *parent, unsigned int mult, unsigned int div) 155 - { 156 - return clk_register_fixed_factor(NULL, name, parent, 157 - CLK_SET_RATE_PARENT, mult, div); 158 144 } 159 145 160 146 struct clk *imx_clk_cpu(const char *name, const char *parent_name,