summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-04-21 14:43:15 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-04-24 09:53:57 +0900
commit612ccd90012d7c77bbe67ec65f770b9e82fe4a35 (patch)
treef95e04d454f99db06ec891ec2db2ca8d14fa9fb5
parent6c64d50e47cbb9f68f53cc67f178d1a09f63b369 (diff)
downloadu-boot-612ccd90012d7c77bbe67ec65f770b9e82fe4a35.tar.gz
u-boot-612ccd90012d7c77bbe67ec65f770b9e82fe4a35.tar.bz2
u-boot-612ccd90012d7c77bbe67ec65f770b9e82fe4a35.zip
ARM: uniphier: add sg_set_iectrl_range()
For PH1-LD20 or later, per-pin input-enable control is supported, that is, we need to set-up IECTRL registers for a group of pins. This helper function will be useful for a bunch of register settings. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--arch/arm/mach-uniphier/sg-regs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/sg-regs.h b/arch/arm/mach-uniphier/sg-regs.h
index 2cdc2db26e..4044245ee1 100644
--- a/arch/arm/mach-uniphier/sg-regs.h
+++ b/arch/arm/mach-uniphier/sg-regs.h
@@ -126,6 +126,14 @@ static inline void sg_set_iectrl(unsigned pin)
writel(tmp, reg);
}
+static inline void sg_set_iectrl_range(unsigned min, unsigned max)
+{
+ int i;
+
+ for (i = min; i <= max; i++)
+ sg_set_iectrl(i);
+}
+
#endif /* __ASSEMBLY__ */
#endif /* ARCH_SG_REGS_H */