ar71xx: add support for ar7241 and ar7242
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / gpio.c
index 1b5da4dc400563fd31e0db8cea8c0e85ec90a2bd..cdb614bbe1e50081e0cb7e45d54b855fbcb65a15 100644 (file)
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(__ar71xx_gpio_set_value);
 
 int __ar71xx_gpio_get_value(unsigned gpio)
 {
-       return !!(__raw_readl(ar71xx_gpio_base + GPIO_REG_IN) & (1 << gpio));
+       return (__raw_readl(ar71xx_gpio_base + GPIO_REG_IN) >> gpio) & 1;
 }
 EXPORT_SYMBOL(__ar71xx_gpio_get_value);
 
@@ -162,6 +162,8 @@ void __init ar71xx_gpio_init(void)
                break;
 
        case AR71XX_SOC_AR7240:
+       case AR71XX_SOC_AR7241:
+       case AR71XX_SOC_AR7242:
                ar71xx_gpio_chip.ngpio = AR724X_GPIO_COUNT;
                break;