]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/include/asm/arch-ixp/ixp425.h
IXP: Fix GPIO_INT_ACT_LOW_SET()
[karo-tx-uboot.git] / arch / arm / include / asm / arch-ixp / ixp425.h
index 5132607c6a74a408bd085d649d6fa48a848b9317..c2e9c820495a43c626884eae075e52e5f53244cb 100644 (file)
 #define IXP425_GPIO_GPCLKR      IXP425_GPIO_REG(IXP425_GPIO_GPCLKR_OFFSET)
 #define IXP425_GPIO_GPDBSELR    IXP425_GPIO_REG(IXP425_GPIO_GPDBSELR_OFFSET)
 
+#define IXP425_GPIO_GPITR(line)        (((line) >= 8) ? \
+                               IXP425_GPIO_GPIT2R : IXP425_GPIO_GPIT1R)
+
 /*
  * Macros to make it easy to access the GPIO registers
  */
 #define GPIO_OUTPUT_DISABLE(line)      *IXP425_GPIO_GPOER |= (1 << (line))
 #define GPIO_OUTPUT_SET(line)          *IXP425_GPIO_GPOUTR |= (1 << (line))
 #define GPIO_OUTPUT_CLEAR(line)                *IXP425_GPIO_GPOUTR &= ~(1 << (line))
-#define GPIO_INT_ACT_LOW_SET(line)     *IXP425_GPIO_GPIT1R = \
-               (*IXP425_GPIO_GPIT1R & ~(0x7 << (line * 3))) | (0x1 << (line * 3))
+#define GPIO_INT_ACT_LOW_SET(line)                             \
+       *IXP425_GPIO_GPITR(line) =                              \
+                       (*IXP425_GPIO_GPITR(line) &             \
+                       ~(0x7 << (((line) & 0x7) * 3))) |       \
+                       (0x1 << (((line) & 0x7) * 3))           \
 
 /*
  * Constants to make it easy to access Timer Control/Status registers