MIPS: ralink: add rt_sysc_m32 helper
authorJohn Crispin <blogic@openwrt.org>
Sat, 18 May 2013 22:42:23 +0000 (00:42 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:19 +0000 (07:45 +0100)
We already have a read and write wrapper. This adds the missing mask wrapper.

Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/8001/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/mach-ralink/ralink_regs.h

index 5a508f9f94320ed6776d8dc5216b294ab4011905..bd93014490df39eebce2df057d5b3e84f2130aeb 100644 (file)
@@ -26,6 +26,13 @@ static inline u32 rt_sysc_r32(unsigned reg)
        return __raw_readl(rt_sysc_membase + reg);
 }
 
+static inline void rt_sysc_m32(u32 clr, u32 set, unsigned reg)
+{
+       u32 val = rt_sysc_r32(reg) & ~clr;
+
+       __raw_writel(val | set, rt_sysc_membase + reg);
+}
+
 static inline void rt_memc_w32(u32 val, unsigned reg)
 {
        __raw_writel(val, rt_memc_membase + reg);