diff options
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r-- | drivers/macintosh/via-pmu.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index c1193d34ec9e..06ca80bfd6b9 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -64,10 +64,6 @@ | |||
64 | #include <asm/backlight.h> | 64 | #include <asm/backlight.h> |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #ifdef CONFIG_PPC32 | ||
68 | #include <asm/open_pic.h> | ||
69 | #endif | ||
70 | |||
71 | #include "via-pmu-event.h" | 67 | #include "via-pmu-event.h" |
72 | 68 | ||
73 | /* Some compile options */ | 69 | /* Some compile options */ |
@@ -151,7 +147,7 @@ static int pmu_fully_inited = 0; | |||
151 | static int pmu_has_adb; | 147 | static int pmu_has_adb; |
152 | static struct device_node *gpio_node; | 148 | static struct device_node *gpio_node; |
153 | static unsigned char __iomem *gpio_reg = NULL; | 149 | static unsigned char __iomem *gpio_reg = NULL; |
154 | static int gpio_irq = -1; | 150 | static int gpio_irq = NO_IRQ; |
155 | static int gpio_irq_enabled = -1; | 151 | static int gpio_irq_enabled = -1; |
156 | static volatile int pmu_suspended = 0; | 152 | static volatile int pmu_suspended = 0; |
157 | static spinlock_t pmu_lock; | 153 | static spinlock_t pmu_lock; |
@@ -403,22 +399,21 @@ static int __init pmu_init(void) | |||
403 | */ | 399 | */ |
404 | static int __init via_pmu_start(void) | 400 | static int __init via_pmu_start(void) |
405 | { | 401 | { |
402 | unsigned int irq; | ||
403 | |||
406 | if (vias == NULL) | 404 | if (vias == NULL) |
407 | return -ENODEV; | 405 | return -ENODEV; |
408 | 406 | ||
409 | batt_req.complete = 1; | 407 | batt_req.complete = 1; |
410 | 408 | ||
411 | #ifndef CONFIG_PPC_MERGE | 409 | irq = irq_of_parse_and_map(vias, 0); |
412 | if (pmu_kind == PMU_KEYLARGO_BASED) | 410 | if (irq == NO_IRQ) { |
413 | openpic_set_irq_priority(vias->intrs[0].line, | 411 | printk(KERN_ERR "via-pmu: can't map interruptn"); |
414 | OPENPIC_PRIORITY_DEFAULT + 1); | 412 | return -ENODEV; |
415 | #endif | 413 | } |
416 | 414 | if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { | |
417 | if (request_irq(vias->intrs[0].line, via_pmu_interrupt, 0, "VIA-PMU", | 415 | printk(KERN_ERR "via-pmu: can't request irq %d\n", irq); |
418 | (void *)0)) { | 416 | return -ENODEV; |
419 | printk(KERN_ERR "VIA-PMU: can't get irq %d\n", | ||
420 | vias->intrs[0].line); | ||
421 | return -EAGAIN; | ||
422 | } | 417 | } |
423 | 418 | ||
424 | if (pmu_kind == PMU_KEYLARGO_BASED) { | 419 | if (pmu_kind == PMU_KEYLARGO_BASED) { |
@@ -426,10 +421,10 @@ static int __init via_pmu_start(void) | |||
426 | if (gpio_node == NULL) | 421 | if (gpio_node == NULL) |
427 | gpio_node = of_find_node_by_name(NULL, | 422 | gpio_node = of_find_node_by_name(NULL, |
428 | "pmu-interrupt"); | 423 | "pmu-interrupt"); |
429 | if (gpio_node && gpio_node->n_intrs > 0) | 424 | if (gpio_node) |
430 | gpio_irq = gpio_node->intrs[0].line; | 425 | gpio_irq = irq_of_parse_and_map(gpio_node, 0); |
431 | 426 | ||
432 | if (gpio_irq != -1) { | 427 | if (gpio_irq != NO_IRQ) { |
433 | if (request_irq(gpio_irq, gpio1_interrupt, 0, | 428 | if (request_irq(gpio_irq, gpio1_interrupt, 0, |
434 | "GPIO1 ADB", (void *)0)) | 429 | "GPIO1 ADB", (void *)0)) |
435 | printk(KERN_ERR "pmu: can't get irq %d" | 430 | printk(KERN_ERR "pmu: can't get irq %d" |