aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/core.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-11 04:26:26 +0100
committerLinus Walleij <linus.walleij@linaro.org>2013-12-12 22:07:28 +0100
commit70c8f01a357ac74d223a632659787396fef1e649 (patch)
treeaff7db7fdcc8bdb3fe74f6313c2b8701cfdc9d0b /drivers/pinctrl/sh-pfc/core.h
parentsh-pfc: Rename sh_pfc window field to windows (diff)
downloadlinux-dev-70c8f01a357ac74d223a632659787396fef1e649.tar.xz
linux-dev-70c8f01a357ac74d223a632659787396fef1e649.zip
sh-pfc: Support GPIO to IRQ mapping specified IRQ resources
On non-DT platforms IRQ controllers associated with the GPIOs have a fixed IRQ base value known at compile time. The sh-pfc driver translates GPIO number to IRQ numbers using a hardcoded table. This mechanism breaks on DT platforms, as the IRQ base values are dynamic in that case. Fix this by specifying IRQs associated with GPIOs in IRQ resources, populated automatically from the device tree. When IRQ resources are specified the driver requires one IRQ resource per GPIO able to generate an interrupt, and uses the translation table to compute the IRQ resource offset instead of the IRQ number. Cc: devicetree@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/core.h')
-rw-r--r--drivers/pinctrl/sh-pfc/core.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/sh-pfc/core.h b/drivers/pinctrl/sh-pfc/core.h
index a83b7472e674..b7b0e6ccf305 100644
--- a/drivers/pinctrl/sh-pfc/core.h
+++ b/drivers/pinctrl/sh-pfc/core.h
@@ -38,6 +38,8 @@ struct sh_pfc {
unsigned int num_windows;
struct sh_pfc_window *windows;
+ unsigned int num_irqs;
+ unsigned int *irqs;
struct sh_pfc_pin_range *ranges;
unsigned int nr_ranges;