diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-09-26 13:03:51 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-10-10 02:57:26 -0400 |
commit | 6054b9cae24f7ff09e502cea408dad140210681a (patch) | |
tree | a23f1b32d668dab5a1ef02cd3f519c365d43d0b6 /drivers/pinctrl | |
parent | 2854d167cc545d0642277bf8b77f972a91146fc6 (diff) |
pinctrl/nomadik: use simple or linear IRQ domain
This alters the Nomadik pinctrl driver to:
- Call irqdomain_add_linear() for the DT case so we get
all independent from IRQ numbers in this case.
- Call irqdomain_add_simple() for the legacy case, which
allocates the IRQ descriptors for the Nomadik pin controller
dynamically.
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 67a5ef637ea7..fec9c30133d4 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -1371,9 +1371,19 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) | |||
1371 | 1371 | ||
1372 | platform_set_drvdata(dev, nmk_chip); | 1372 | platform_set_drvdata(dev, nmk_chip); |
1373 | 1373 | ||
1374 | nmk_chip->domain = irq_domain_add_legacy(np, NMK_GPIO_PER_CHIP, | 1374 | if (np) { |
1375 | NOMADIK_GPIO_TO_IRQ(pdata->first_gpio), | 1375 | /* The DT case will just grab a set of IRQ numbers */ |
1376 | 0, &nmk_gpio_irq_simple_ops, nmk_chip); | 1376 | nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP, |
1377 | &nmk_gpio_irq_simple_ops, nmk_chip); | ||
1378 | } else { | ||
1379 | /* Non-DT legacy mode, use hardwired IRQ numbers */ | ||
1380 | int irq_start; | ||
1381 | |||
1382 | irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio); | ||
1383 | nmk_chip->domain = irq_domain_add_simple(NULL, | ||
1384 | NMK_GPIO_PER_CHIP, irq_start, | ||
1385 | &nmk_gpio_irq_simple_ops, nmk_chip); | ||
1386 | } | ||
1377 | if (!nmk_chip->domain) { | 1387 | if (!nmk_chip->domain) { |
1378 | dev_err(&dev->dev, "failed to create irqdomain\n"); | 1388 | dev_err(&dev->dev, "failed to create irqdomain\n"); |
1379 | ret = -ENOSYS; | 1389 | ret = -ENOSYS; |