diff options
| -rw-r--r-- | drivers/gpio/gpio-omap.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d3f7d2db870f..4a430360af5a 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
| @@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
| 1094 | const struct omap_gpio_platform_data *pdata; | 1094 | const struct omap_gpio_platform_data *pdata; |
| 1095 | struct resource *res; | 1095 | struct resource *res; |
| 1096 | struct gpio_bank *bank; | 1096 | struct gpio_bank *bank; |
| 1097 | #ifdef CONFIG_ARCH_OMAP1 | ||
| 1098 | int irq_base; | ||
| 1099 | #endif | ||
| 1097 | 1100 | ||
| 1098 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); | 1101 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); |
| 1099 | 1102 | ||
| @@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
| 1135 | pdata->get_context_loss_count; | 1138 | pdata->get_context_loss_count; |
| 1136 | } | 1139 | } |
| 1137 | 1140 | ||
| 1141 | #ifdef CONFIG_ARCH_OMAP1 | ||
| 1142 | /* | ||
| 1143 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop | ||
| 1144 | * irq_alloc_descs() and irq_domain_add_legacy() and just use a | ||
| 1145 | * linear IRQ domain mapping for all OMAP platforms. | ||
| 1146 | */ | ||
| 1147 | irq_base = irq_alloc_descs(-1, 0, bank->width, 0); | ||
| 1148 | if (irq_base < 0) { | ||
| 1149 | dev_err(dev, "Couldn't allocate IRQ numbers\n"); | ||
| 1150 | return -ENODEV; | ||
| 1151 | } | ||
| 1138 | 1152 | ||
| 1153 | bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, | ||
| 1154 | 0, &irq_domain_simple_ops, NULL); | ||
| 1155 | #else | ||
| 1139 | bank->domain = irq_domain_add_linear(node, bank->width, | 1156 | bank->domain = irq_domain_add_linear(node, bank->width, |
| 1140 | &irq_domain_simple_ops, NULL); | 1157 | &irq_domain_simple_ops, NULL); |
| 1141 | if (!bank->domain) | 1158 | #endif |
| 1159 | if (!bank->domain) { | ||
| 1160 | dev_err(dev, "Couldn't register an IRQ domain\n"); | ||
| 1142 | return -ENODEV; | 1161 | return -ENODEV; |
| 1162 | } | ||
| 1143 | 1163 | ||
| 1144 | if (bank->regs->set_dataout && bank->regs->clr_dataout) | 1164 | if (bank->regs->set_dataout && bank->regs->clr_dataout) |
| 1145 | bank->set_dataout = _set_gpio_dataout_reg; | 1165 | bank->set_dataout = _set_gpio_dataout_reg; |
