Skip to content

Commit

Permalink
clk: imx: Add imx_obtain_fixed_clock clk_hw based variant
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Abel Vesa authored and Shawn Guo committed Jun 7, 2019
1 parent 5b933e2 commit a4a4069
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/clk/imx/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 3 additions & 0 deletions drivers/clk/imx/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a4a4069

Please sign in to comment.