summaryrefslogtreecommitdiffstats
path: root/include/linux/clk-provider.h
diff options
context:
space:
mode:
authorGerhard Sittig <gsi@denx.de>2013-07-22 14:14:40 +0200
committerMike Turquette <mturquette@linaro.org>2013-08-27 17:50:38 -0700
commitaa514ce34b65e3dc01f95a0b470b39bbb7e09998 (patch)
tree6d83d3f8e7560e5cd46fafe39960cd78cdfdc815 /include/linux/clk-provider.h
parent29f79cb713c5173457b80602adab357403f22c48 (diff)
downloadop-kernel-dev-aa514ce34b65e3dc01f95a0b470b39bbb7e09998.zip
op-kernel-dev-aa514ce34b65e3dc01f95a0b470b39bbb7e09998.tar.gz
clk: wrap I/O access for improved portability
the common clock drivers were motivated/initiated by ARM development and apparently assume little endian peripherals wrap register/peripherals access in the common code (div, gate, mux) in preparation of adding COMMON_CLK support for other platforms Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r--include/linux/clk-provider.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1f0285b..73bdb69 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -12,6 +12,7 @@
#define __LINUX_CLK_PROVIDER_H
#include <linux/clk.h>
+#include <linux/io.h>
#ifdef CONFIG_COMMON_CLK
@@ -504,5 +505,21 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
#define of_clk_init(matches) \
{ while (0); }
#endif /* CONFIG_OF */
+
+/*
+ * wrap access to peripherals in accessor routines
+ * for improved portability across platforms
+ */
+
+static inline u32 clk_readl(u32 __iomem *reg)
+{
+ return readl(reg);
+}
+
+static inline void clk_writel(u32 val, u32 __iomem *reg)
+{
+ writel(val, reg);
+}
+
#endif /* CONFIG_COMMON_CLK */
#endif /* CLK_PROVIDER_H */
OpenPOWER on IntegriCloud