aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-10-27 02:09:31 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-27 02:09:31 -0400
commit5f0103847325dc22fda8749626b56f8b71b98440 (patch)
treeab60539083786d5cb80e200d78d6ad015f105ddb /arch/sh
parent949bf16648ff657839893f88ce296a3c4d89cd1a (diff)
sh: mach-systemh: irq_data conversion.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/boards/mach-systemh/irq.c57
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 @@
23static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; 23static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004;
24static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; 24static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000;
25 25
26/* forward declaration */ 26static void disable_systemh_irq(struct irq_data *data)
27static void enable_systemh_irq(unsigned int irq);
28static void disable_systemh_irq(unsigned int irq);
29static void mask_and_ack_systemh(unsigned int);
30
31static 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
38static 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
54static void enable_systemh_irq(unsigned int irq) 40static 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
66static void mask_and_ack_systemh(unsigned int irq) 50static 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
71void make_systemh_irq(unsigned int irq) 56void 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}