]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: imx: Add imx_obtain_fixed_clock clk_hw based variant
authorAbel Vesa <abel.vesa@nxp.com>
Wed, 29 May 2019 12:26:39 +0000 (12:26 +0000)
committerShawn Guo <shawnguo@kernel.org>
Fri, 7 Jun 2019 00:35:50 +0000 (08:35 +0800)
In order to move to clk_hw based API, imx_obtain_fixed_clock_hw
is added. The end goal here is to have all the clk providers use
the clk_hw based API.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk.c
drivers/clk/imx/clk.h

index 9cd709787ea6f57ef9400df2ef8e886ce042db30..0ecb67a9494a624e7ecb6164083d404532fb9a53 100644 (file)
@@ -74,6 +74,17 @@ struct clk * __init imx_obtain_fixed_clock(
        return clk;
 }
 
+struct clk_hw * __init imx_obtain_fixed_clock_hw(
+                       const char *name, unsigned long rate)
+{
+       struct clk *clk;
+
+       clk = imx_obtain_fixed_clock_from_dt(name);
+       if (IS_ERR(clk))
+               clk = imx_clk_fixed(name, rate);
+       return __clk_get_hw(clk);
+}
+
 struct clk_hw * __init imx_obtain_fixed_clk_hw(struct device_node *np,
                                               const char *name)
 {
index 6dcdc91cbba892d7650495ac6136ce49c5ed3444..77c2ce8f41f71a01bd03ce4519c0afa74445eff0 100644 (file)
@@ -96,6 +96,9 @@ struct clk *clk_register_gate2(struct device *dev, const char *name,
 struct clk * imx_obtain_fixed_clock(
                        const char *name, unsigned long rate);
 
+struct clk_hw *imx_obtain_fixed_clock_hw(
+                       const char *name, unsigned long rate);
+
 struct clk_hw *imx_obtain_fixed_clk_hw(struct device_node *np,
                                       const char *name);