diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-01-31 10:57:52 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-02-10 15:44:33 +0100 |
commit | a6a16d274e734afa769a9651dfaf8315d404c116 (patch) | |
tree | 123e91e276d7b6b77f362cc1b59fb0fe78447bb5 /drivers/pinctrl/pinctrl-abx500.c | |
parent | pinctrl/abx500: move IRQ handling to ab8500-core (diff) | |
download | linux-a6a16d274e734afa769a9651dfaf8315d404c116.tar.xz linux-a6a16d274e734afa769a9651dfaf8315d404c116.zip |
pinctrl/abx500: replace IRQ offsets with table read-in values
The ABx500 GPIO controller used to provide a set of virtual contiguous
IRQs for use by sub-devices, but they have been removed after a request
from Mainline Maintainers. Now the AB8500 core driver deals with almost
all IRQ related issues instead.
The ABx500 GPIO driver is now only used to convert between GPIO and IRQ
numbers which is actually quite difficult, as the ABx500 GPIO's
associated IRQs are clustered together throughout the interrupt number
space at irregular intervals. To solve this quandary, we have placed the
read-in values into the existing cluster information table to use during
conversion.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Moved irq_base removal into this patch]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-abx500.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-abx500.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c index b8f6c7597d53..720e77998e64 100644 --- a/drivers/pinctrl/pinctrl-abx500.c +++ b/drivers/pinctrl/pinctrl-abx500.c @@ -100,7 +100,6 @@ struct abx500_pinctrl { struct gpio_chip chip; struct ab8500 *parent; struct mutex lock; - u32 irq_base; struct abx500_gpio_irq_cluster *irq_cluster; int irq_cluster_size; }; @@ -262,18 +261,24 @@ static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset) struct abx500_pinctrl *pct = to_abx500_pinctrl(chip); /* The AB8500 GPIO numbers are off by one */ int gpio = offset + 1; - int base = pct->irq_base; + int hwirq; int i; for (i = 0; i < pct->irq_cluster_size; i++) { struct abx500_gpio_irq_cluster *cluster = &pct->irq_cluster[i]; - if (gpio >= cluster->start && gpio <= cluster->end) - return base + gpio - cluster->start; + if (gpio >= cluster->start && gpio <= cluster->end) { + /* + * The ABx500 GPIO's associated IRQs are clustered together + * throughout the interrupt numbers at irregular intervals. + * To solve this quandry, we have placed the read-in values + * into the cluster information table. + */ + hwirq = gpio + cluster->to_irq; - /* Advance by the number of gpios in this cluster */ - base += cluster->end + cluster->offset - cluster->start + 1; + return irq_create_mapping(pct->parent->domain, hwirq); + } } return -EINVAL; @@ -876,7 +881,6 @@ static int abx500_gpio_probe(struct platform_device *pdev) pct->chip = abx500gpio_chip; pct->chip.dev = &pdev->dev; pct->chip.base = pdata->gpio_base; - pct->irq_base = pdata->irq_base; pct->chip.base = (np) ? -1 : pdata->gpio_base; /* initialize the lock */ |