aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-omap.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 5e667ff91dc3..3a0c1606f885 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1090,6 +1090,8 @@ static int omap_gpio_irq_map(struct irq_domain *d, unsigned int virq,
1090 irq_hw_number_t hwirq) 1090 irq_hw_number_t hwirq)
1091{ 1091{
1092 struct gpio_bank *bank = d->host_data; 1092 struct gpio_bank *bank = d->host_data;
1093 int gpio;
1094 int ret;
1093 1095
1094 if (!bank) 1096 if (!bank)
1095 return -EINVAL; 1097 return -EINVAL;
@@ -1104,6 +1106,22 @@ static int omap_gpio_irq_map(struct irq_domain *d, unsigned int virq,
1104 set_irq_flags(virq, IRQF_VALID); 1106 set_irq_flags(virq, IRQF_VALID);
1105 } 1107 }
1106 1108
1109 /*
1110 * REVISIT most GPIO IRQ chip drivers need to call
1111 * gpio_request() before a GPIO line can be used as an
1112 * IRQ. Ideally this should be handled by the IRQ core
1113 * but until then this has to be done on a per driver
1114 * basis. Remove this once this is managed by the core.
1115 */
1116 if (bank->chip.of_node) {
1117 gpio = irq_to_gpio(bank, hwirq);
1118 ret = gpio_request_one(gpio, GPIOF_IN, NULL);
1119 if (ret) {
1120 dev_err(bank->dev, "Could not request GPIO%d\n", gpio);
1121 return ret;
1122 }
1123 }
1124
1107 return 0; 1125 return 0;
1108} 1126}
1109 1127