summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-03-16 04:53:02 +0000
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 07:45:19 +0100
commit2920b83d35e24ec80777625ab809ce7dcf08a84a (patch)
tree8711ce73814f76ed61db1d8d97572c8d115c0163
parent2adf550f2669645eaca7559c9ce7fc2e1dbfc636 (diff)
downloadlinux-2920b83d35e24ec80777625ab809ce7dcf08a84a.tar.gz
MIPS: ralink: add a helper for reading the ECO version
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/8000/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/mach-ralink/mt7620.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-ralink/mt7620.h b/arch/mips/include/asm/mach-ralink/mt7620.h
index 6f9b24f51157..7ff929005d15 100644
--- a/arch/mips/include/asm/mach-ralink/mt7620.h
+++ b/arch/mips/include/asm/mach-ralink/mt7620.h
@@ -105,4 +105,9 @@
 #define MT7620_GPIO_MODE_EPHY		BIT(15)
 #define MT7620_GPIO_MODE_WDT		BIT(22)
 
+static inline int mt7620_get_eco(void)
+{
+	return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
+}
+
 #endif