static unsigned char gpio_int_type1[3];
           static unsigned char gpio_int_type2[3];
           
-- --------static void update_gpio_int_params(int abf)
++ ++++++++/* Port ordering is: A B F */
++ ++++++++static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
++ ++++++++static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
++ ++++++++static const u8 eoi_register_offset[3]               = { 0x98, 0xb4, 0x54 };
++ ++++++++static const u8 int_en_register_offset[3]    = { 0x9c, 0xb8, 0x5c };
++ ++++++++
++ ++++++++static void update_gpio_int_params(unsigned port)
           {
-- --------     if (abf == 0) {
-- --------             __raw_writeb(0, EP93XX_GPIO_A_INT_ENABLE);
-- --------             __raw_writeb(gpio_int_type2[0], EP93XX_GPIO_A_INT_TYPE2);
-- --------             __raw_writeb(gpio_int_type1[0], EP93XX_GPIO_A_INT_TYPE1);
-- --------             __raw_writeb(gpio_int_unmasked[0] & gpio_int_enabled[0], EP93XX_GPIO_A_INT_ENABLE);
-- --------     } else if (abf == 1) {
-- --------             __raw_writeb(0, EP93XX_GPIO_B_INT_ENABLE);
-- --------             __raw_writeb(gpio_int_type2[1], EP93XX_GPIO_B_INT_TYPE2);
-- --------             __raw_writeb(gpio_int_type1[1], EP93XX_GPIO_B_INT_TYPE1);
-- --------             __raw_writeb(gpio_int_unmasked[1] & gpio_int_enabled[1], EP93XX_GPIO_B_INT_ENABLE);
-- --------     } else if (abf == 2) {
-- --------             __raw_writeb(0, EP93XX_GPIO_F_INT_ENABLE);
-- --------             __raw_writeb(gpio_int_type2[2], EP93XX_GPIO_F_INT_TYPE2);
-- --------             __raw_writeb(gpio_int_type1[2], EP93XX_GPIO_F_INT_TYPE1);
-- --------             __raw_writeb(gpio_int_unmasked[2] & gpio_int_enabled[2], EP93XX_GPIO_F_INT_ENABLE);
-- --------     } else {
-- --------             BUG();
-- --------     }
-- --------}
++ ++++++++     BUG_ON(port > 2);
++ +++ ++++
++ ++++++++     __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
 + +++ ++++
      -    static unsigned char data_register_offset[8] = {
      -         0x00, 0x04, 0x08, 0x0c, 0x20, 0x30, 0x38, 0x40,
++ ++++++++     __raw_writeb(gpio_int_type2[port],
++ ++++++++             EP93XX_GPIO_REG(int_type2_register_offset[port]));
      +    
-          static unsigned char data_register_offset[8] = {
-               0x00, 0x04, 0x08, 0x0c, 0x20, 0x30, 0x38, 0x40,
++ ++++++++     __raw_writeb(gpio_int_type1[port],
++ ++++++++             EP93XX_GPIO_REG(int_type1_register_offset[port]));
++ ++++++++
++ ++++++++     __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
++ ++++++++             EP93XX_GPIO_REG(int_en_register_offset[port]));
++ ++++++++}
+     +    
 - --- ----static unsigned char data_register_offset[8] = {
 - --- ----     0x00, 0x04, 0x08, 0x0c, 0x20, 0x30, 0x38, 0x40,
++ ++++++++/* Port ordering is: A B F D E C G H */
++ ++++++++static const u8 data_register_offset[8] = {
++ ++++++++     0x00, 0x04, 0x30, 0x0c, 0x20, 0x08, 0x38, 0x40,
           };
           
-- --------static unsigned char data_direction_register_offset[8] = {
-- --------     0x10, 0x14, 0x18, 0x1c, 0x24, 0x34, 0x3c, 0x44,
++ ++++++++static const u8 data_direction_register_offset[8] = {
++ ++++++++     0x10, 0x14, 0x34, 0x1c, 0x24, 0x18, 0x3c, 0x44,
           };
           
-- --------void gpio_line_config(int line, int direction)
++ ++++++++#define GPIO_IN              0
++ ++++++++#define GPIO_OUT     1
++ ++++++++
++ ++++++++static void ep93xx_gpio_set_direction(unsigned line, int direction)
           {
                unsigned int data_direction_register;
                unsigned long flags;