aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/uic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/uic.c')
-rw-r--r--arch/powerpc/sysdev/uic.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 063c901b1265..92033936a8f7 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -49,7 +49,7 @@ struct uic {
49 raw_spinlock_t lock; 49 raw_spinlock_t lock;
50 50
51 /* The remapper for this UIC */ 51 /* The remapper for this UIC */
52 struct irq_host *irqhost; 52 struct irq_domain *irqhost;
53}; 53};
54 54
55static void uic_unmask_irq(struct irq_data *d) 55static void uic_unmask_irq(struct irq_data *d)
@@ -174,7 +174,7 @@ static struct irq_chip uic_irq_chip = {
174 .irq_set_type = uic_set_irq_type, 174 .irq_set_type = uic_set_irq_type,
175}; 175};
176 176
177static int uic_host_map(struct irq_host *h, unsigned int virq, 177static int uic_host_map(struct irq_domain *h, unsigned int virq,
178 irq_hw_number_t hw) 178 irq_hw_number_t hw)
179{ 179{
180 struct uic *uic = h->host_data; 180 struct uic *uic = h->host_data;
@@ -190,21 +190,9 @@ static int uic_host_map(struct irq_host *h, unsigned int virq,
190 return 0; 190 return 0;
191} 191}
192 192
193static int uic_host_xlate(struct irq_host *h, struct device_node *ct, 193static struct irq_domain_ops uic_host_ops = {
194 const u32 *intspec, unsigned int intsize,
195 irq_hw_number_t *out_hwirq, unsigned int *out_type)
196
197{
198 /* UIC intspecs must have 2 cells */
199 BUG_ON(intsize != 2);
200 *out_hwirq = intspec[0];
201 *out_type = intspec[1];
202 return 0;
203}
204
205static struct irq_host_ops uic_host_ops = {
206 .map = uic_host_map, 194 .map = uic_host_map,
207 .xlate = uic_host_xlate, 195 .xlate = irq_domain_xlate_twocell,
208}; 196};
209 197
210void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) 198void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
@@ -270,13 +258,11 @@ static struct uic * __init uic_init_one(struct device_node *node)
270 } 258 }
271 uic->dcrbase = *dcrreg; 259 uic->dcrbase = *dcrreg;
272 260
273 uic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 261 uic->irqhost = irq_domain_add_linear(node, NR_UIC_INTS, &uic_host_ops,
274 NR_UIC_INTS, &uic_host_ops, -1); 262 uic);
275 if (! uic->irqhost) 263 if (! uic->irqhost)
276 return NULL; /* FIXME: panic? */ 264 return NULL; /* FIXME: panic? */
277 265
278 uic->irqhost->host_data = uic;
279
280 /* Start with all interrupts disabled, level and non-critical */ 266 /* Start with all interrupts disabled, level and non-critical */
281 mtdcr(uic->dcrbase + UIC_ER, 0); 267 mtdcr(uic->dcrbase + UIC_ER, 0);
282 mtdcr(uic->dcrbase + UIC_CR, 0); 268 mtdcr(uic->dcrbase + UIC_CR, 0);