clk: imx: add hw API imx_clk_hw_mux2_flags
authorPeng Fan <peng.fan@nxp.com>
Thu, 12 Dec 2019 02:59:00 +0000 (02:59 +0000)
committerShawn Guo <shawnguo@kernel.org>
Mon, 23 Dec 2019 03:50:49 +0000 (11:50 +0800)
Introduce hw based API imx_clk_hw_mux2_flags, then we could
convert i.MX8MN clk driver to use hw based APIs.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk.h

index 20dc9a1fcd6cc347bf70ccebef0ec60f4d04291b..e28166a638946021a75c9ff21c5824b1a574de2f 100644 (file)
@@ -435,6 +435,16 @@ static inline struct clk *imx_clk_mux_flags(const char *name,
                        &imx_ccm_lock);
 }
 
+static inline struct clk_hw *imx_clk_hw_mux2_flags(const char *name,
+               void __iomem *reg, u8 shift, u8 width,
+               const char * const *parents,
+               int num_parents, unsigned long flags)
+{
+       return clk_hw_register_mux(NULL, name, parents, num_parents,
+                       flags | CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE,
+                       reg, shift, width, 0, &imx_ccm_lock);
+}
+
 static inline struct clk *imx_clk_mux2_flags(const char *name,
                void __iomem *reg, u8 shift, u8 width,
                const char * const *parents,