diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-12 21:04:03 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:57:22 -0400 |
commit | 1ab7ef158dfbaf6314b6660a3e3fb037cba2a1ca (patch) | |
tree | 185ffbcf9922139023bcc282ac37b2626a79facb /arch/arm/mach-imx/imx51-dt.c | |
parent | 438196c371cb32f0eacaf2a44166d9a0cf37c4a8 (diff) |
gpio/mxc: move irq_domain_add_legacy call into gpio driver
Move irq_domain_add_legacy call from imx*-dt.c into gpio driver and
have the gpio driver adopt irqdomain support for both DT and non-DT
boot.
With all imx platform code converted from static gpio irq number
computation to use run-time gpio_to_irq call, we can now use
irq_alloc_descs and irqdomain support to dynamically get irq_base
and have the mapping between gpio and irq number available without
using virtual_irq_start and MXC_GPIO_IRQ_START.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/imx51-dt.c')
-rw-r--r-- | arch/arm/mach-imx/imx51-dt.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c index 18e78dba4298..3bdabbc64f43 100644 --- a/arch/arm/mach-imx/imx51-dt.c +++ b/arch/arm/mach-imx/imx51-dt.c | |||
@@ -52,20 +52,8 @@ static int __init imx51_tzic_add_irq_domain(struct device_node *np, | |||
52 | return 0; | 52 | return 0; |
53 | } | 53 | } |
54 | 54 | ||
55 | static int __init imx51_gpio_add_irq_domain(struct device_node *np, | ||
56 | struct device_node *interrupt_parent) | ||
57 | { | ||
58 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; | ||
59 | |||
60 | gpio_irq_base -= 32; | ||
61 | irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL); | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | static const struct of_device_id imx51_irq_match[] __initconst = { | 55 | static const struct of_device_id imx51_irq_match[] __initconst = { |
67 | { .compatible = "fsl,imx51-tzic", .data = imx51_tzic_add_irq_domain, }, | 56 | { .compatible = "fsl,imx51-tzic", .data = imx51_tzic_add_irq_domain, }, |
68 | { .compatible = "fsl,imx51-gpio", .data = imx51_gpio_add_irq_domain, }, | ||
69 | { /* sentinel */ } | 57 | { /* sentinel */ } |
70 | }; | 58 | }; |
71 | 59 | ||