aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-09-26 03:21:28 -0400
committerRobert Jarzmik <robert.jarzmik@free.fr>2016-10-18 03:12:37 -0400
commit3738ca1b2a7bae482e2d29485414a1dc1a946153 (patch)
tree9ea273d2dd7943bd290447e1cb9db9e75d75b899
parentd3570e3c5002d514582cad09d6892a4c78c3781b (diff)
ARM: pxa: pxa_cplds: honor probe deferral
The method to acquire the input interrupt was working in a platform data based board, but was failing in a device-tree one when the gpio controller was probed after pxa_cplds. Use platform_get_irq() to benefit from the probe deferral mechanism. Moreover, as seen in dm9000.c development, platform_get_irq() doesn't honor the irq type IO resource (ie. edge rising for example), and it must be passed again at irq request in a not device-tree build, hence the irq_get_trigger_type() call. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
-rw-r--r--arch/arm/mach-pxa/pxa_cplds_irqs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c
index e362f865fcd2..941508585e34 100644
--- a/arch/arm/mach-pxa/pxa_cplds_irqs.c
+++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c
@@ -120,13 +120,9 @@ static int cplds_probe(struct platform_device *pdev)
120 if (!fpga) 120 if (!fpga)
121 return -ENOMEM; 121 return -ENOMEM;
122 122
123 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 123 fpga->irq = platform_get_irq(pdev, 0);
124 if (res) { 124 if (fpga->irq <= 0)
125 fpga->irq = (unsigned int)res->start; 125 return fpga->irq;
126 irqflags = res->flags;
127 }
128 if (!fpga->irq)
129 return -ENODEV;
130 126
131 base_irq = platform_get_irq(pdev, 1); 127 base_irq = platform_get_irq(pdev, 1);
132 if (base_irq < 0) 128 if (base_irq < 0)
@@ -142,6 +138,7 @@ static int cplds_probe(struct platform_device *pdev)
142 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); 138 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
143 writel(0, fpga->base + FPGA_IRQ_SET_CLR); 139 writel(0, fpga->base + FPGA_IRQ_SET_CLR);
144 140
141 irqflags = irq_get_trigger_type(fpga->irq);
145 ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler, 142 ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler,
146 irqflags, dev_name(&pdev->dev), fpga); 143 irqflags, dev_name(&pdev->dev), fpga);
147 if (ret == -ENOSYS) 144 if (ret == -ENOSYS)