diff options
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/mach-systemh/irq.c | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c index 523aea5dc94e..e5ee13adeff4 100644 --- a/arch/sh/boards/mach-systemh/irq.c +++ b/arch/sh/boards/mach-systemh/irq.c | |||
@@ -23,54 +23,39 @@ | |||
23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; | 23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; |
24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; | 24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; |
25 | 25 | ||
26 | /* forward declaration */ | 26 | static void disable_systemh_irq(struct irq_data *data) |
27 | static void enable_systemh_irq(unsigned int irq); | ||
28 | static void disable_systemh_irq(unsigned int irq); | ||
29 | static void mask_and_ack_systemh(unsigned int); | ||
30 | |||
31 | static struct irq_chip systemh_irq_type = { | ||
32 | .name = " SystemH Register", | ||
33 | .unmask = enable_systemh_irq, | ||
34 | .mask = disable_systemh_irq, | ||
35 | .ack = mask_and_ack_systemh, | ||
36 | }; | ||
37 | |||
38 | static void disable_systemh_irq(unsigned int irq) | ||
39 | { | 27 | { |
40 | if (systemh_irq_mask_register) { | 28 | unsigned long val, mask = 0x01 << 1; |
41 | unsigned long val, mask = 0x01 << 1; | ||
42 | 29 | ||
43 | /* Clear the "irq"th bit in the mask and set it in the request */ | 30 | /* Clear the "irq"th bit in the mask and set it in the request */ |
44 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 31 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
45 | val &= ~mask; | 32 | val &= ~mask; |
46 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 33 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
47 | 34 | ||
48 | val = __raw_readl((unsigned long)systemh_irq_request_register); | 35 | val = __raw_readl((unsigned long)systemh_irq_request_register); |
49 | val |= mask; | 36 | val |= mask; |
50 | __raw_writel(val, (unsigned long)systemh_irq_request_register); | 37 | __raw_writel(val, (unsigned long)systemh_irq_request_register); |
51 | } | ||
52 | } | 38 | } |
53 | 39 | ||
54 | static void enable_systemh_irq(unsigned int irq) | 40 | static void enable_systemh_irq(struct irq_data *data) |
55 | { | 41 | { |
56 | if (systemh_irq_mask_register) { | 42 | unsigned long val, mask = 0x01 << 1; |
57 | unsigned long val, mask = 0x01 << 1; | ||
58 | 43 | ||
59 | /* Set "irq"th bit in the mask register */ | 44 | /* Set "irq"th bit in the mask register */ |
60 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 45 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
61 | val |= mask; | 46 | val |= mask; |
62 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 47 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
63 | } | ||
64 | } | 48 | } |
65 | 49 | ||
66 | static void mask_and_ack_systemh(unsigned int irq) | 50 | static struct irq_chip systemh_irq_type = { |
67 | { | 51 | .name = "SystemH Register", |
68 | disable_systemh_irq(irq); | 52 | .irq_unmask = enable_systemh_irq, |
69 | } | 53 | .irq_mask = disable_systemh_irq, |
54 | }; | ||
70 | 55 | ||
71 | void make_systemh_irq(unsigned int irq) | 56 | void make_systemh_irq(unsigned int irq) |
72 | { | 57 | { |
73 | disable_irq_nosync(irq); | 58 | disable_irq_nosync(irq); |
74 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); | 59 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); |
75 | disable_systemh_irq(irq); | 60 | disable_systemh_irq(irq_get_irq_data(irq)); |
76 | } | 61 | } |