aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-20 01:10:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-20 01:10:05 -0400
commit47126d807ab1ef24e0f02dcca20883e275198fe2 (patch)
treec17b93db77d14239d0dd2d25b084394a645c9733
parent4746efded84d7c5a9c8d64d4c6e814ff0cf9fb42 (diff)
parent9daedd833a38edd90cf7baa1b1fcf61c3a0721e3 (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: davinci: DM365 EVM: fix video input mux bits ARM: davinci: Check for NULL return from irq_alloc_generic_chip arm: davinci: Fix low level gpio irq handlers' argument
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c4
-rw-r--r--arch/arm/mach-davinci/gpio.c21
-rw-r--r--arch/arm/mach-davinci/irq.c6
3 files changed, 24 insertions, 7 deletions
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index c67f684ee3e5..09a87e61ffcf 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -520,7 +520,7 @@ fail:
520 */ 520 */
521 if (have_imager()) { 521 if (have_imager()) {
522 label = "HD imager"; 522 label = "HD imager";
523 mux |= 1; 523 mux |= 2;
524 524
525 /* externally mux MMC1/ENET/AIC33 to imager */ 525 /* externally mux MMC1/ENET/AIC33 to imager */
526 mux |= BIT(6) | BIT(5) | BIT(3); 526 mux |= BIT(6) | BIT(5) | BIT(3);
@@ -540,7 +540,7 @@ fail:
540 resets &= ~BIT(1); 540 resets &= ~BIT(1);
541 541
542 if (have_tvp7002()) { 542 if (have_tvp7002()) {
543 mux |= 2; 543 mux |= 1;
544 resets &= ~BIT(2); 544 resets &= ~BIT(2);
545 label = "tvp7002 HD"; 545 label = "tvp7002 HD";
546 } else { 546 } else {
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c
index e7221398e5af..cafbe13a82a5 100644
--- a/arch/arm/mach-davinci/gpio.c
+++ b/arch/arm/mach-davinci/gpio.c
@@ -254,8 +254,10 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
254{ 254{
255 struct davinci_gpio_regs __iomem *g; 255 struct davinci_gpio_regs __iomem *g;
256 u32 mask = 0xffff; 256 u32 mask = 0xffff;
257 struct davinci_gpio_controller *d;
257 258
258 g = (__force struct davinci_gpio_regs __iomem *) irq_desc_get_handler_data(desc); 259 d = (struct davinci_gpio_controller *)irq_desc_get_handler_data(desc);
260 g = (struct davinci_gpio_regs __iomem *)d->regs;
259 261
260 /* we only care about one bank */ 262 /* we only care about one bank */
261 if (irq & 1) 263 if (irq & 1)
@@ -274,11 +276,14 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
274 if (!status) 276 if (!status)
275 break; 277 break;
276 __raw_writel(status, &g->intstat); 278 __raw_writel(status, &g->intstat);
277 if (irq & 1)
278 status >>= 16;
279 279
280 /* now demux them to the right lowlevel handler */ 280 /* now demux them to the right lowlevel handler */
281 n = (int)irq_get_handler_data(irq); 281 n = d->irq_base;
282 if (irq & 1) {
283 n += 16;
284 status >>= 16;
285 }
286
282 while (status) { 287 while (status) {
283 res = ffs(status); 288 res = ffs(status);
284 n += res; 289 n += res;
@@ -424,7 +429,13 @@ static int __init davinci_gpio_irq_setup(void)
424 429
425 /* set up all irqs in this bank */ 430 /* set up all irqs in this bank */
426 irq_set_chained_handler(bank_irq, gpio_irq_handler); 431 irq_set_chained_handler(bank_irq, gpio_irq_handler);
427 irq_set_handler_data(bank_irq, (__force void *)g); 432
433 /*
434 * Each chip handles 32 gpios, and each irq bank consists of 16
435 * gpio irqs. Pass the irq bank's corresponding controller to
436 * the chained irq handler.
437 */
438 irq_set_handler_data(bank_irq, &chips[gpio / 32]);
428 439
429 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) { 440 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) {
430 irq_set_chip(irq, &gpio_irqchip); 441 irq_set_chip(irq, &gpio_irqchip);
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c
index d8c1af025931..952dc126c390 100644
--- a/arch/arm/mach-davinci/irq.c
+++ b/arch/arm/mach-davinci/irq.c
@@ -52,6 +52,12 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
52 struct irq_chip_type *ct; 52 struct irq_chip_type *ct;
53 53
54 gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); 54 gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq);
55 if (!gc) {
56 pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n",
57 __func__, irq_start);
58 return;
59 }
60
55 ct = gc->chip_types; 61 ct = gc->chip_types;
56 ct->chip.irq_ack = irq_gc_ack_set_bit; 62 ct->chip.irq_ack = irq_gc_ack_set_bit;
57 ct->chip.irq_mask = irq_gc_mask_clr_bit; 63 ct->chip.irq_mask = irq_gc_mask_clr_bit;