summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-19 10:15:56 -0600
committerTom Rini <trini@konsulko.com>2020-08-03 22:19:54 -0400
commitfb989e0c6ce019466f24fbd529890d89a21c8472 (patch)
tree986fd6e48d250408d7de5a2e9edc7aeff5b5f4a0 /drivers
parent161786259ca43dc4cad40755b48f868768577270 (diff)
downloadu-boot-fb989e0c6ce019466f24fbd529890d89a21c8472.tar.gz
clk: Drop dm.h header file in clk-provider.h
This header file should not be included in other header files. Remove it and use a forward declaration and un-inlining of dev_get_clk_ptr() instead. Fix up the kendryte header files to avoid build errors. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-uclass.c5
-rw-r--r--drivers/clk/kendryte/bypass.c7
-rw-r--r--drivers/clk/kendryte/pll.c10
3 files changed, 16 insertions, 6 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 15656f5973..934cd5787a 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -25,6 +25,11 @@ static inline const struct clk_ops *clk_dev_ops(struct udevice *dev)
return (const struct clk_ops *)dev->driver->ops;
}
+struct clk *dev_get_clk_ptr(struct udevice *dev)
+{
+ return (struct clk *)dev_get_uclass_priv(dev);
+}
+
#if CONFIG_IS_ENABLED(OF_CONTROL)
# if CONFIG_IS_ENABLED(OF_PLATDATA)
int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells,
diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c
index d1fd28175b..5f1986f2cb 100644
--- a/drivers/clk/kendryte/bypass.c
+++ b/drivers/clk/kendryte/bypass.c
@@ -4,12 +4,15 @@
*/
#define LOG_CATEGORY UCLASS_CLK
-#include <kendryte/bypass.h>
+#include <common.h>
+#include <clk.h>
#include <clk-uclass.h>
+#include <dm.h>
+#include <log.h>
+#include <kendryte/bypass.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
-#include <log.h>
#define CLK_K210_BYPASS "k210_clk_bypass"
diff --git a/drivers/clk/kendryte/pll.c b/drivers/clk/kendryte/pll.c
index 19e358856a..ab6d75d585 100644
--- a/drivers/clk/kendryte/pll.c
+++ b/drivers/clk/kendryte/pll.c
@@ -3,18 +3,20 @@
* Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com>
*/
#define LOG_CATEGORY UCLASS_CLK
-#include <kendryte/pll.h>
-#include <asm/io.h>
+#include <common.h>
+#include <dm.h>
/* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */
#include <div64.h>
+#include <log.h>
+#include <serial.h>
+#include <asm/io.h>
#include <dt-bindings/clock/k210-sysctl.h>
+#include <kendryte/pll.h>
#include <linux/bitfield.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/err.h>
-#include <log.h>
-#include <serial.h>
#define CLK_K210_PLL "k210_clk_pll"