diff options
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 1da7a5d1ddd9..14a3f7118c73 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -584,7 +584,7 @@ static int gpio_irq_type(unsigned irq, unsigned type) | |||
584 | && (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))) | 584 | && (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))) |
585 | return -EINVAL; | 585 | return -EINVAL; |
586 | 586 | ||
587 | bank = get_gpio_bank(gpio); | 587 | bank = get_irq_chip_data(irq); |
588 | spin_lock(&bank->lock); | 588 | spin_lock(&bank->lock); |
589 | retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); | 589 | retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); |
590 | if (retval == 0) { | 590 | if (retval == 0) { |
@@ -823,7 +823,7 @@ static int gpio_wake_enable(unsigned int irq, unsigned int enable) | |||
823 | 823 | ||
824 | if (check_gpio(gpio) < 0) | 824 | if (check_gpio(gpio) < 0) |
825 | return -ENODEV; | 825 | return -ENODEV; |
826 | bank = get_gpio_bank(gpio); | 826 | bank = get_irq_chip_data(irq); |
827 | retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable); | 827 | retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable); |
828 | 828 | ||
829 | return retval; | 829 | return retval; |
@@ -1038,7 +1038,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
1038 | static void gpio_irq_shutdown(unsigned int irq) | 1038 | static void gpio_irq_shutdown(unsigned int irq) |
1039 | { | 1039 | { |
1040 | unsigned int gpio = irq - IH_GPIO_BASE; | 1040 | unsigned int gpio = irq - IH_GPIO_BASE; |
1041 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1041 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1042 | 1042 | ||
1043 | _reset_gpio(bank, gpio); | 1043 | _reset_gpio(bank, gpio); |
1044 | } | 1044 | } |
@@ -1046,7 +1046,7 @@ static void gpio_irq_shutdown(unsigned int irq) | |||
1046 | static void gpio_ack_irq(unsigned int irq) | 1046 | static void gpio_ack_irq(unsigned int irq) |
1047 | { | 1047 | { |
1048 | unsigned int gpio = irq - IH_GPIO_BASE; | 1048 | unsigned int gpio = irq - IH_GPIO_BASE; |
1049 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1049 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1050 | 1050 | ||
1051 | _clear_gpio_irqstatus(bank, gpio); | 1051 | _clear_gpio_irqstatus(bank, gpio); |
1052 | } | 1052 | } |
@@ -1054,7 +1054,7 @@ static void gpio_ack_irq(unsigned int irq) | |||
1054 | static void gpio_mask_irq(unsigned int irq) | 1054 | static void gpio_mask_irq(unsigned int irq) |
1055 | { | 1055 | { |
1056 | unsigned int gpio = irq - IH_GPIO_BASE; | 1056 | unsigned int gpio = irq - IH_GPIO_BASE; |
1057 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1057 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1058 | 1058 | ||
1059 | _set_gpio_irqenable(bank, gpio, 0); | 1059 | _set_gpio_irqenable(bank, gpio, 0); |
1060 | } | 1060 | } |
@@ -1063,7 +1063,7 @@ static void gpio_unmask_irq(unsigned int irq) | |||
1063 | { | 1063 | { |
1064 | unsigned int gpio = irq - IH_GPIO_BASE; | 1064 | unsigned int gpio = irq - IH_GPIO_BASE; |
1065 | unsigned int gpio_idx = get_gpio_index(gpio); | 1065 | unsigned int gpio_idx = get_gpio_index(gpio); |
1066 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1066 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1067 | 1067 | ||
1068 | _set_gpio_irqenable(bank, gpio_idx, 1); | 1068 | _set_gpio_irqenable(bank, gpio_idx, 1); |
1069 | } | 1069 | } |
@@ -1092,7 +1092,7 @@ static void mpuio_ack_irq(unsigned int irq) | |||
1092 | static void mpuio_mask_irq(unsigned int irq) | 1092 | static void mpuio_mask_irq(unsigned int irq) |
1093 | { | 1093 | { |
1094 | unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); | 1094 | unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); |
1095 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1095 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1096 | 1096 | ||
1097 | _set_gpio_irqenable(bank, gpio, 0); | 1097 | _set_gpio_irqenable(bank, gpio, 0); |
1098 | } | 1098 | } |
@@ -1100,7 +1100,7 @@ static void mpuio_mask_irq(unsigned int irq) | |||
1100 | static void mpuio_unmask_irq(unsigned int irq) | 1100 | static void mpuio_unmask_irq(unsigned int irq) |
1101 | { | 1101 | { |
1102 | unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); | 1102 | unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); |
1103 | struct gpio_bank *bank = get_gpio_bank(gpio); | 1103 | struct gpio_bank *bank = get_irq_chip_data(irq); |
1104 | 1104 | ||
1105 | _set_gpio_irqenable(bank, gpio, 1); | 1105 | _set_gpio_irqenable(bank, gpio, 1); |
1106 | } | 1106 | } |
@@ -1275,6 +1275,7 @@ static int __init _omap_gpio_init(void) | |||
1275 | #endif | 1275 | #endif |
1276 | for (j = bank->virtual_irq_start; | 1276 | for (j = bank->virtual_irq_start; |
1277 | j < bank->virtual_irq_start + gpio_count; j++) { | 1277 | j < bank->virtual_irq_start + gpio_count; j++) { |
1278 | set_irq_chip_data(j, bank); | ||
1278 | if (bank_is_mpuio(bank)) | 1279 | if (bank_is_mpuio(bank)) |
1279 | set_irq_chip(j, &mpuio_irq_chip); | 1280 | set_irq_chip(j, &mpuio_irq_chip); |
1280 | else | 1281 | else |