blob: 587974b6a367a39ea10a5acd636b79c09f6658e0 [file] [log] [blame]
From 5ae5bb067186f8c29c8ef2a45418a68def37c347 Mon Sep 17 00:00:00 2001
From: Gerhard Sittig <gsi@denx.de>
Date: Mon, 22 Jul 2013 14:14:40 +0200
Subject: 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>
(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 --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 11860985fecb..67edd5f448df 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 */
--
1.8.5.rc3