ralink: add helper that identifies the mt7620 ECO
[openwrt.git] / target / linux / ramips / patches-3.10 / 800-eco.patch
1 Index: linux-3.10.18/arch/mips/include/asm/mach-ralink/mt7620.h
2 ===================================================================
3 --- linux-3.10.18.orig/arch/mips/include/asm/mach-ralink/mt7620.h       2013-12-06 16:20:27.753388970 +0100
4 +++ linux-3.10.18/arch/mips/include/asm/mach-ralink/mt7620.h    2013-12-06 16:21:14.021390074 +0100
5 @@ -101,4 +101,9 @@
6  #define MT7620_GPIO_MODE_EPHY          15
7  #define MT7620_GPIO_MODE_PA            20
8  
9 +static inline int mt7620_get_eco(void)
10 +{
11 +       return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
12 +}
13 +
14  #endif