Commit a4a4069f authored by Abel Vesa's avatar Abel Vesa Committed by Shawn Guo

clk: imx: Add imx_obtain_fixed_clock clk_hw based variant

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: default avatarAbel Vesa <abel.vesa@nxp.com>
Reviewed-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 5b933e28
...@@ -74,6 +74,17 @@ struct clk * __init imx_obtain_fixed_clock( ...@@ -74,6 +74,17 @@ struct clk * __init imx_obtain_fixed_clock(
return clk; 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, struct clk_hw * __init imx_obtain_fixed_clk_hw(struct device_node *np,
const char *name) const char *name)
{ {
......
...@@ -96,6 +96,9 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, ...@@ -96,6 +96,9 @@ struct clk *clk_register_gate2(struct device *dev, const char *name,
struct clk * imx_obtain_fixed_clock( struct clk * imx_obtain_fixed_clock(
const char *name, unsigned long rate); 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, struct clk_hw *imx_obtain_fixed_clk_hw(struct device_node *np,
const char *name); const char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment