summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/setup-r8a7779.c
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2014-05-15 15:32:01 +0400
committerSimon Horman <horms+renesas@verge.net.au>2014-06-17 14:56:18 +0400
commit3e05f24aa95bb043f1103b41392b61ce83d2675e (patch)
treefabff2f4596eeec7f4eb0b6baf2a88b172143a9f /arch/arm/mach-shmobile/setup-r8a7779.c
parent3325cbe8ab74731c88e70d172ffef74cbca13f18 (diff)
downloadlinux-3e05f24aa95bb043f1103b41392b61ce83d2675e.tar.xz
ARM: shmobile: r8a7779: Add helper to read mode pins
Add and use helper to read mode pins. This will be re-used when moving marzen-reference to the common clock framework. Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 86ec4b625a78..25e1d0b72463 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -762,6 +762,24 @@ void __init r8a7779_add_standard_devices_dt(void)
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
+#define MODEMR 0xffcc0020
+
+u32 __init r8a7779_read_mode_pins(void)
+{
+ static u32 mode;
+ static bool mode_valid;
+
+ if (!mode_valid) {
+ void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
+ BUG_ON(!modemr);
+ mode = ioread32(modemr);
+ iounmap(modemr);
+ mode_valid = true;
+ }
+
+ return mode;
+}
+
static const char *r8a7779_compat_dt[] __initdata = {
"renesas,r8a7779",
NULL,