diff options
Diffstat (limited to 'arch/m68k/mac/baboon.c')
-rw-r--r-- | arch/m68k/mac/baboon.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index c7b25b0aacff..245d16d078ad 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c | |||
@@ -18,11 +18,14 @@ | |||
18 | #include <asm/macints.h> | 18 | #include <asm/macints.h> |
19 | #include <asm/mac_baboon.h> | 19 | #include <asm/mac_baboon.h> |
20 | 20 | ||
21 | /* #define DEBUG_BABOON */ | ||
22 | /* #define DEBUG_IRQS */ | 21 | /* #define DEBUG_IRQS */ |
23 | 22 | ||
23 | extern void mac_enable_irq(unsigned int); | ||
24 | extern void mac_disable_irq(unsigned int); | ||
25 | |||
24 | int baboon_present; | 26 | int baboon_present; |
25 | static volatile struct baboon *baboon; | 27 | static volatile struct baboon *baboon; |
28 | static unsigned char baboon_disabled; | ||
26 | 29 | ||
27 | #if 0 | 30 | #if 0 |
28 | extern int macide_ack_intr(struct ata_channel *); | 31 | extern int macide_ack_intr(struct ata_channel *); |
@@ -88,34 +91,51 @@ static irqreturn_t baboon_irq(int irq, void *dev_id) | |||
88 | 91 | ||
89 | void __init baboon_register_interrupts(void) | 92 | void __init baboon_register_interrupts(void) |
90 | { | 93 | { |
91 | request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | 94 | baboon_disabled = 0; |
92 | "baboon", (void *) baboon); | 95 | request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon); |
93 | } | 96 | } |
94 | 97 | ||
95 | void baboon_irq_enable(int irq) { | 98 | /* |
99 | * The means for masking individual baboon interrupts remains a mystery, so | ||
100 | * enable the umbrella interrupt only when no baboon interrupt is disabled. | ||
101 | */ | ||
102 | |||
103 | void baboon_irq_enable(int irq) | ||
104 | { | ||
105 | int irq_idx = IRQ_IDX(irq); | ||
106 | |||
96 | #ifdef DEBUG_IRQUSE | 107 | #ifdef DEBUG_IRQUSE |
97 | printk("baboon_irq_enable(%d)\n", irq); | 108 | printk("baboon_irq_enable(%d)\n", irq); |
98 | #endif | 109 | #endif |
99 | /* FIXME: figure out how to mask and unmask baboon interrupt sources */ | 110 | |
100 | enable_irq(IRQ_NUBUS_C); | 111 | baboon_disabled &= ~(1 << irq_idx); |
112 | if (!baboon_disabled) | ||
113 | mac_enable_irq(IRQ_NUBUS_C); | ||
101 | } | 114 | } |
102 | 115 | ||
103 | void baboon_irq_disable(int irq) { | 116 | void baboon_irq_disable(int irq) |
117 | { | ||
118 | int irq_idx = IRQ_IDX(irq); | ||
119 | |||
104 | #ifdef DEBUG_IRQUSE | 120 | #ifdef DEBUG_IRQUSE |
105 | printk("baboon_irq_disable(%d)\n", irq); | 121 | printk("baboon_irq_disable(%d)\n", irq); |
106 | #endif | 122 | #endif |
107 | disable_irq(IRQ_NUBUS_C); | 123 | |
124 | baboon_disabled |= 1 << irq_idx; | ||
125 | if (baboon_disabled) | ||
126 | mac_disable_irq(IRQ_NUBUS_C); | ||
108 | } | 127 | } |
109 | 128 | ||
110 | void baboon_irq_clear(int irq) { | 129 | void baboon_irq_clear(int irq) |
111 | int irq_idx = IRQ_IDX(irq); | 130 | { |
131 | int irq_idx = IRQ_IDX(irq); | ||
112 | 132 | ||
113 | baboon->mb_ifr &= ~(1 << irq_idx); | 133 | baboon->mb_ifr &= ~(1 << irq_idx); |
114 | } | 134 | } |
115 | 135 | ||
116 | int baboon_irq_pending(int irq) | 136 | int baboon_irq_pending(int irq) |
117 | { | 137 | { |
118 | int irq_idx = IRQ_IDX(irq); | 138 | int irq_idx = IRQ_IDX(irq); |
119 | 139 | ||
120 | return baboon->mb_ifr & (1 << irq_idx); | 140 | return baboon->mb_ifr & (1 << irq_idx); |
121 | } | 141 | } |