aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-omap.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-04-06 10:58:13 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-04-28 15:35:08 -0400
commitcaebd9db7677166994570db69210cdaa3e30e1fb (patch)
tree9108e44c69001ff2e4b1e51a92bc01d350efd0ca /drivers/gpio/gpio-omap.c
parent0815c2c0934feb0a99e24bddb8b319f94ae22c9e (diff)
gpio: omap: convert to use irq_domain_add_simple()
The GPIO OMAP driver supports different OMAP SoC families and not all of them have the needed support to use the linear IRQ domain mapping like OMAP1 that use the legacy domain mapping. But this special check is not necessary since the simple IRQ domain mapping is able to handle both cases. Having a zero IRQ offset will be interpreted as a linear domain case while a non-zero value will be interpreted as a legacy domain case. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r--drivers/gpio/gpio-omap.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 19b886c21b1d..3ee9b8d26f71 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1138,9 +1138,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
1138 const struct omap_gpio_platform_data *pdata; 1138 const struct omap_gpio_platform_data *pdata;
1139 struct resource *res; 1139 struct resource *res;
1140 struct gpio_bank *bank; 1140 struct gpio_bank *bank;
1141#ifdef CONFIG_ARCH_OMAP1 1141 int irq_base = 0;
1142 int irq_base;
1143#endif
1144 1142
1145 match = of_match_device(of_match_ptr(omap_gpio_match), dev); 1143 match = of_match_device(of_match_ptr(omap_gpio_match), dev);
1146 1144
@@ -1185,21 +1183,16 @@ static int omap_gpio_probe(struct platform_device *pdev)
1185#ifdef CONFIG_ARCH_OMAP1 1183#ifdef CONFIG_ARCH_OMAP1
1186 /* 1184 /*
1187 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop 1185 * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
1188 * irq_alloc_descs() and irq_domain_add_legacy() and just use a 1186 * irq_alloc_descs() since a base IRQ offset will no longer be needed.
1189 * linear IRQ domain mapping for all OMAP platforms.
1190 */ 1187 */
1191 irq_base = irq_alloc_descs(-1, 0, bank->width, 0); 1188 irq_base = irq_alloc_descs(-1, 0, bank->width, 0);
1192 if (irq_base < 0) { 1189 if (irq_base < 0) {
1193 dev_err(dev, "Couldn't allocate IRQ numbers\n"); 1190 dev_err(dev, "Couldn't allocate IRQ numbers\n");
1194 return -ENODEV; 1191 return -ENODEV;
1195 } 1192 }
1196
1197 bank->domain = irq_domain_add_legacy(node, bank->width, irq_base,
1198 0, &irq_domain_simple_ops, NULL);
1199#else
1200 bank->domain = irq_domain_add_linear(node, bank->width,
1201 &irq_domain_simple_ops, NULL);
1202#endif 1193#endif
1194 bank->domain = irq_domain_add_simple(node, bank->width, irq_base,
1195 &irq_domain_simple_ops, NULL);
1203 if (!bank->domain) { 1196 if (!bank->domain) {
1204 dev_err(dev, "Couldn't register an IRQ domain\n"); 1197 dev_err(dev, "Couldn't register an IRQ domain\n");
1205 return -ENODEV; 1198 return -ENODEV;