diff mbox

[ltsi-3.10,036/286] clk: wrap I/O access for improved portability

Message ID 1388135720-12832-37-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman Dec. 27, 2013, 9:11 a.m. UTC
From: Gerhard Sittig <gsi@denx.de>

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>
(cherry picked from commit aa514ce34b65e3dc01f95a0b470b39bbb7e09998)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	drivers/clk/clk-divider.c
	drivers/clk/clk-gate.c
	drivers/clk/clk-mux.c
	include/linux/clk-provider.h
---
 include/linux/clk-provider.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox

Patch

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1186098..67edd5f 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
 
@@ -444,5 +445,20 @@  void of_clk_init(const struct of_device_id *matches);
 		__used __section(__clk_of_table)		\
 		= { .compatible = compat, .data = fn };
 
+/*
+ * 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 */