aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-microdev/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-microdev/irq.c')
-rw-r--r--arch/sh/boards/mach-microdev/irq.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
index b551963579c1..c35001fd9032 100644
--- a/arch/sh/boards/mach-microdev/irq.c
+++ b/arch/sh/boards/mach-microdev/irq.c
@@ -65,19 +65,9 @@ static const struct {
65# error Inconsistancy in defining the IRQ# for primary IDE! 65# error Inconsistancy in defining the IRQ# for primary IDE!
66#endif 66#endif
67 67
68static void enable_microdev_irq(unsigned int irq); 68static void disable_microdev_irq(struct irq_data *data)
69static void disable_microdev_irq(unsigned int irq);
70static void mask_and_ack_microdev(unsigned int);
71
72static struct irq_chip microdev_irq_type = {
73 .name = "MicroDev-IRQ",
74 .unmask = enable_microdev_irq,
75 .mask = disable_microdev_irq,
76 .ack = mask_and_ack_microdev,
77};
78
79static void disable_microdev_irq(unsigned int irq)
80{ 69{
70 unsigned int irq = data->irq;
81 unsigned int fpgaIrq; 71 unsigned int fpgaIrq;
82 72
83 if (irq >= NUM_EXTERNAL_IRQS) 73 if (irq >= NUM_EXTERNAL_IRQS)
@@ -88,11 +78,12 @@ static void disable_microdev_irq(unsigned int irq)
88 fpgaIrq = fpgaIrqTable[irq].fpgaIrq; 78 fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
89 79
90 /* disable interrupts on the FPGA INTC register */ 80 /* disable interrupts on the FPGA INTC register */
91 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); 81 __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
92} 82}
93 83
94static void enable_microdev_irq(unsigned int irq) 84static void enable_microdev_irq(struct irq_data *data)
95{ 85{
86 unsigned int irq = data->irq;
96 unsigned long priorityReg, priorities, pri; 87 unsigned long priorityReg, priorities, pri;
97 unsigned int fpgaIrq; 88 unsigned int fpgaIrq;
98 89
@@ -107,26 +98,27 @@ static void enable_microdev_irq(unsigned int irq)
107 priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq); 98 priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
108 99
109 /* set priority for the interrupt */ 100 /* set priority for the interrupt */
110 priorities = ctrl_inl(priorityReg); 101 priorities = __raw_readl(priorityReg);
111 priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq); 102 priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
112 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri); 103 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
113 ctrl_outl(priorities, priorityReg); 104 __raw_writel(priorities, priorityReg);
114 105
115 /* enable interrupts on the FPGA INTC register */ 106 /* enable interrupts on the FPGA INTC register */
116 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); 107 __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
117} 108}
118 109
110static struct irq_chip microdev_irq_type = {
111 .name = "MicroDev-IRQ",
112 .irq_unmask = enable_microdev_irq,
113 .irq_mask = disable_microdev_irq,
114};
115
119/* This function sets the desired irq handler to be a MicroDev type */ 116/* This function sets the desired irq handler to be a MicroDev type */
120static void __init make_microdev_irq(unsigned int irq) 117static void __init make_microdev_irq(unsigned int irq)
121{ 118{
122 disable_irq_nosync(irq); 119 disable_irq_nosync(irq);
123 set_irq_chip_and_handler(irq, &microdev_irq_type, handle_level_irq); 120 set_irq_chip_and_handler(irq, &microdev_irq_type, handle_level_irq);
124 disable_microdev_irq(irq); 121 disable_microdev_irq(irq_get_irq_data(irq));
125}
126
127static void mask_and_ack_microdev(unsigned int irq)
128{
129 disable_microdev_irq(irq);
130} 122}
131 123
132extern void __init init_microdev_irq(void) 124extern void __init init_microdev_irq(void)
@@ -134,7 +126,7 @@ extern void __init init_microdev_irq(void)
134 int i; 126 int i;
135 127
136 /* disable interrupts on the FPGA INTC register */ 128 /* disable interrupts on the FPGA INTC register */
137 ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); 129 __raw_writel(~0ul, MICRODEV_FPGA_INTDSB_REG);
138 130
139 for (i = 0; i < NUM_EXTERNAL_IRQS; i++) 131 for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
140 make_microdev_irq(i); 132 make_microdev_irq(i);