From c8cc7213a5fd6e8dc3429fc1c3513b3de99e211e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 18 Mar 2016 16:41:50 +0900 Subject: [PATCH] ARM: uniphier: add sg_set_iectrl() function This helper function would be useful for new SoCs with per-pin input enable controlling, such as PH1-LD20, PH1-LD11, etc. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/sg-regs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-uniphier/sg-regs.h b/arch/arm/mach-uniphier/sg-regs.h index 3a535c70b2..2cdc2db26e 100644 --- a/arch/arm/mach-uniphier/sg-regs.h +++ b/arch/arm/mach-uniphier/sg-regs.h @@ -115,6 +115,17 @@ static inline void sg_set_pinsel(unsigned pin, unsigned muxval, writel(tmp, reg); } +static inline void sg_set_iectrl(unsigned pin) +{ + unsigned bit = pin % 32; + unsigned long reg = SG_IECTRL + pin / 32 * 4; + u32 tmp; + + tmp = readl(reg); + tmp |= 1 << bit; + writel(tmp, reg); +} + #endif /* __ASSEMBLY__ */ #endif /* ARCH_SG_REGS_H */ -- 2.25.1