summaryrefslogtreecommitdiffstats
path: root/drivers/clk/imx
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2019-05-29 14:26:39 +0200
committerShawn Guo <shawnguo@kernel.org>2019-06-07 02:35:50 +0200
commita4a4069f4523a9ec6ee2741b9f3f3243b65594ba (patch)
tree2acb95155addb41c1787b066fb298f7cdf0f84ab /drivers/clk/imx
parentclk: imx: imx8mm: correct audio_pll2_clk to audio_pll2_out (diff)
downloadlinux-a4a4069f4523a9ec6ee2741b9f3f3243b65594ba.tar.xz
linux-a4a4069f4523a9ec6ee2741b9f3f3243b65594ba.zip
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: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/clk/imx')
-rw-r--r--drivers/clk/imx/clk.c11
-rw-r--r--drivers/clk/imx/clk.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
index 9cd709787ea6..0ecb67a9494a 100644
--- a/drivers/clk/imx/clk.c
+++ b/drivers/clk/imx/clk.c
@@ -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)
{
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 6dcdc91cbba8..77c2ce8f41f7 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -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);