diff options
author | A.s. Dong <aisheng.dong@nxp.com> | 2018-11-14 14:02:04 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-12-03 20:31:36 +0100 |
commit | 3b315214e09167c2dbcc5d9d5c999237e47ed182 (patch) | |
tree | ea9c0e4d2996362d56791ee1b8dfbe31219ab911 /drivers/clk/imx/clk.c | |
parent | clk: imx: make mux parent strings const (diff) | |
download | linux-3b315214e09167c2dbcc5d9d5c999237e47ed182.tar.xz linux-3b315214e09167c2dbcc5d9d5c999237e47ed182.zip |
clk: imx: implement new clk_hw based APIs
Clock providers are recommended to use the new struct clk_hw based API,
so implement IMX clk_hw based provider helpers functions to the new
approach.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/imx/clk.c')
-rw-r--r-- | drivers/clk/imx/clk.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 9074e6974b6d..1efed86217f7 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -18,6 +18,16 @@ void __init imx_check_clocks(struct clk *clks[], unsigned int count) i, PTR_ERR(clks[i])); } +void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count) +{ + unsigned int i; + + for (i = 0; i < count; i++) + if (IS_ERR(clks[i])) + pr_err("i.MX clk %u: register failed with %ld\n", + i, PTR_ERR(clks[i])); +} + static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name) { struct of_phandle_args phandle; @@ -49,6 +59,18 @@ struct clk * __init imx_obtain_fixed_clock( return clk; } +struct clk_hw * __init imx_obtain_fixed_clk_hw(struct device_node *np, + const char *name) +{ + struct clk *clk; + + clk = of_clk_get_by_name(np, name); + if (IS_ERR(clk)) + return ERR_PTR(-ENOENT); + + return __clk_get_hw(clk); +} + /* * This fixups the register CCM_CSCMR1 write value. * The write/read/divider values of the aclk_podf field |