diff options
Diffstat (limited to 'arch/powerpc/sysdev')
| -rw-r--r-- | arch/powerpc/sysdev/cpm1.c | 9 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/cpm2_pic.c | 23 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/ehv_pic.c | 14 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_msi.c | 10 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_msi.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/i8259.c | 15 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/ipic.c | 31 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/ipic.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mpc8xx_pic.c | 11 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mpic.c | 17 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mpic_msi.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mv64x60_pic.c | 11 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe_ic.c | 26 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe_ic.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/tsi108_pci.c | 13 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/uic.c | 26 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xics/xics-common.c | 25 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xilinx_intc.c | 19 |
18 files changed, 92 insertions, 166 deletions
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index 5d7d59a43c4c..d4fa03f2b6ac 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c | |||
| @@ -54,7 +54,7 @@ cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ | |||
| 54 | immap_t __iomem *mpc8xx_immr; | 54 | immap_t __iomem *mpc8xx_immr; |
| 55 | static cpic8xx_t __iomem *cpic_reg; | 55 | static cpic8xx_t __iomem *cpic_reg; |
| 56 | 56 | ||
| 57 | static struct irq_host *cpm_pic_host; | 57 | static struct irq_domain *cpm_pic_host; |
| 58 | 58 | ||
| 59 | static void cpm_mask_irq(struct irq_data *d) | 59 | static void cpm_mask_irq(struct irq_data *d) |
| 60 | { | 60 | { |
| @@ -98,7 +98,7 @@ int cpm_get_irq(void) | |||
| 98 | return irq_linear_revmap(cpm_pic_host, cpm_vec); | 98 | return irq_linear_revmap(cpm_pic_host, cpm_vec); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, | 101 | static int cpm_pic_host_map(struct irq_domain *h, unsigned int virq, |
| 102 | irq_hw_number_t hw) | 102 | irq_hw_number_t hw) |
| 103 | { | 103 | { |
| 104 | pr_debug("cpm_pic_host_map(%d, 0x%lx)\n", virq, hw); | 104 | pr_debug("cpm_pic_host_map(%d, 0x%lx)\n", virq, hw); |
| @@ -123,7 +123,7 @@ static struct irqaction cpm_error_irqaction = { | |||
| 123 | .name = "error", | 123 | .name = "error", |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | static struct irq_host_ops cpm_pic_host_ops = { | 126 | static const struct irq_domain_ops cpm_pic_host_ops = { |
| 127 | .map = cpm_pic_host_map, | 127 | .map = cpm_pic_host_map, |
| 128 | }; | 128 | }; |
| 129 | 129 | ||
| @@ -164,8 +164,7 @@ unsigned int cpm_pic_init(void) | |||
| 164 | 164 | ||
| 165 | out_be32(&cpic_reg->cpic_cimr, 0); | 165 | out_be32(&cpic_reg->cpic_cimr, 0); |
| 166 | 166 | ||
| 167 | cpm_pic_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, | 167 | cpm_pic_host = irq_domain_add_linear(np, 64, &cpm_pic_host_ops, NULL); |
| 168 | 64, &cpm_pic_host_ops, 64); | ||
| 169 | if (cpm_pic_host == NULL) { | 168 | if (cpm_pic_host == NULL) { |
| 170 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); | 169 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); |
| 171 | sirq = NO_IRQ; | 170 | sirq = NO_IRQ; |
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index bcab50e2a9eb..d3be961e2ae7 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | 50 | ||
| 51 | static intctl_cpm2_t __iomem *cpm2_intctl; | 51 | static intctl_cpm2_t __iomem *cpm2_intctl; |
| 52 | 52 | ||
| 53 | static struct irq_host *cpm2_pic_host; | 53 | static struct irq_domain *cpm2_pic_host; |
| 54 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 54 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) |
| 55 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 55 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; |
| 56 | 56 | ||
| @@ -214,7 +214,7 @@ unsigned int cpm2_get_irq(void) | |||
| 214 | return irq_linear_revmap(cpm2_pic_host, irq); | 214 | return irq_linear_revmap(cpm2_pic_host, irq); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, | 217 | static int cpm2_pic_host_map(struct irq_domain *h, unsigned int virq, |
| 218 | irq_hw_number_t hw) | 218 | irq_hw_number_t hw) |
| 219 | { | 219 | { |
| 220 | pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw); | 220 | pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw); |
| @@ -224,21 +224,9 @@ static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, | |||
| 224 | return 0; | 224 | return 0; |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | static int cpm2_pic_host_xlate(struct irq_host *h, struct device_node *ct, | 227 | static const struct irq_domain_ops cpm2_pic_host_ops = { |
| 228 | const u32 *intspec, unsigned int intsize, | ||
| 229 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | ||
| 230 | { | ||
| 231 | *out_hwirq = intspec[0]; | ||
| 232 | if (intsize > 1) | ||
| 233 | *out_flags = intspec[1]; | ||
| 234 | else | ||
| 235 | *out_flags = IRQ_TYPE_NONE; | ||
| 236 | return 0; | ||
| 237 | } | ||
| 238 | |||
| 239 | static struct irq_host_ops cpm2_pic_host_ops = { | ||
| 240 | .map = cpm2_pic_host_map, | 228 | .map = cpm2_pic_host_map, |
| 241 | .xlate = cpm2_pic_host_xlate, | 229 | .xlate = irq_domain_xlate_onetwocell, |
| 242 | }; | 230 | }; |
| 243 | 231 | ||
| 244 | void cpm2_pic_init(struct device_node *node) | 232 | void cpm2_pic_init(struct device_node *node) |
| @@ -275,8 +263,7 @@ void cpm2_pic_init(struct device_node *node) | |||
| 275 | out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); | 263 | out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); |
| 276 | 264 | ||
| 277 | /* create a legacy host */ | 265 | /* create a legacy host */ |
| 278 | cpm2_pic_host = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | 266 | cpm2_pic_host = irq_domain_add_linear(node, 64, &cpm2_pic_host_ops, NULL); |
| 279 | 64, &cpm2_pic_host_ops, 64); | ||
| 280 | if (cpm2_pic_host == NULL) { | 267 | if (cpm2_pic_host == NULL) { |
| 281 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); | 268 | printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); |
| 282 | return; | 269 | return; |
diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c index b6731e4a6646..6e0e1005227f 100644 --- a/arch/powerpc/sysdev/ehv_pic.c +++ b/arch/powerpc/sysdev/ehv_pic.c | |||
| @@ -182,13 +182,13 @@ unsigned int ehv_pic_get_irq(void) | |||
| 182 | return irq_linear_revmap(global_ehv_pic->irqhost, irq); | 182 | return irq_linear_revmap(global_ehv_pic->irqhost, irq); |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | static int ehv_pic_host_match(struct irq_host *h, struct device_node *node) | 185 | static int ehv_pic_host_match(struct irq_domain *h, struct device_node *node) |
| 186 | { | 186 | { |
| 187 | /* Exact match, unless ehv_pic node is NULL */ | 187 | /* Exact match, unless ehv_pic node is NULL */ |
| 188 | return h->of_node == NULL || h->of_node == node; | 188 | return h->of_node == NULL || h->of_node == node; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | static int ehv_pic_host_map(struct irq_host *h, unsigned int virq, | 191 | static int ehv_pic_host_map(struct irq_domain *h, unsigned int virq, |
| 192 | irq_hw_number_t hw) | 192 | irq_hw_number_t hw) |
| 193 | { | 193 | { |
| 194 | struct ehv_pic *ehv_pic = h->host_data; | 194 | struct ehv_pic *ehv_pic = h->host_data; |
| @@ -217,7 +217,7 @@ static int ehv_pic_host_map(struct irq_host *h, unsigned int virq, | |||
| 217 | return 0; | 217 | return 0; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static int ehv_pic_host_xlate(struct irq_host *h, struct device_node *ct, | 220 | static int ehv_pic_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 221 | const u32 *intspec, unsigned int intsize, | 221 | const u32 *intspec, unsigned int intsize, |
| 222 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 222 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 223 | 223 | ||
| @@ -248,7 +248,7 @@ static int ehv_pic_host_xlate(struct irq_host *h, struct device_node *ct, | |||
| 248 | return 0; | 248 | return 0; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static struct irq_host_ops ehv_pic_host_ops = { | 251 | static const struct irq_domain_ops ehv_pic_host_ops = { |
| 252 | .match = ehv_pic_host_match, | 252 | .match = ehv_pic_host_match, |
| 253 | .map = ehv_pic_host_map, | 253 | .map = ehv_pic_host_map, |
| 254 | .xlate = ehv_pic_host_xlate, | 254 | .xlate = ehv_pic_host_xlate, |
| @@ -275,9 +275,8 @@ void __init ehv_pic_init(void) | |||
| 275 | return; | 275 | return; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | ehv_pic->irqhost = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, | 278 | ehv_pic->irqhost = irq_domain_add_linear(np, NR_EHV_PIC_INTS, |
| 279 | NR_EHV_PIC_INTS, &ehv_pic_host_ops, 0); | 279 | &ehv_pic_host_ops, ehv_pic); |
| 280 | |||
| 281 | if (!ehv_pic->irqhost) { | 280 | if (!ehv_pic->irqhost) { |
| 282 | of_node_put(np); | 281 | of_node_put(np); |
| 283 | kfree(ehv_pic); | 282 | kfree(ehv_pic); |
| @@ -293,7 +292,6 @@ void __init ehv_pic_init(void) | |||
| 293 | of_node_put(np2); | 292 | of_node_put(np2); |
| 294 | } | 293 | } |
| 295 | 294 | ||
| 296 | ehv_pic->irqhost->host_data = ehv_pic; | ||
| 297 | ehv_pic->hc_irq = ehv_pic_irq_chip; | 295 | ehv_pic->hc_irq = ehv_pic_irq_chip; |
| 298 | ehv_pic->hc_irq.irq_set_affinity = ehv_pic_set_affinity; | 296 | ehv_pic->hc_irq.irq_set_affinity = ehv_pic_set_affinity; |
| 299 | ehv_pic->coreint_flag = coreint_flag; | 297 | ehv_pic->coreint_flag = coreint_flag; |
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index ecb5c1946d22..0c01debe963b 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
| @@ -60,7 +60,7 @@ static struct irq_chip fsl_msi_chip = { | |||
| 60 | .name = "FSL-MSI", | 60 | .name = "FSL-MSI", |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static int fsl_msi_host_map(struct irq_host *h, unsigned int virq, | 63 | static int fsl_msi_host_map(struct irq_domain *h, unsigned int virq, |
| 64 | irq_hw_number_t hw) | 64 | irq_hw_number_t hw) |
| 65 | { | 65 | { |
| 66 | struct fsl_msi *msi_data = h->host_data; | 66 | struct fsl_msi *msi_data = h->host_data; |
| @@ -74,7 +74,7 @@ static int fsl_msi_host_map(struct irq_host *h, unsigned int virq, | |||
| 74 | return 0; | 74 | return 0; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static struct irq_host_ops fsl_msi_host_ops = { | 77 | static const struct irq_domain_ops fsl_msi_host_ops = { |
| 78 | .map = fsl_msi_host_map, | 78 | .map = fsl_msi_host_map, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| @@ -387,8 +387,8 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) | |||
| 387 | } | 387 | } |
| 388 | platform_set_drvdata(dev, msi); | 388 | platform_set_drvdata(dev, msi); |
| 389 | 389 | ||
| 390 | msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR, | 390 | msi->irqhost = irq_domain_add_linear(dev->dev.of_node, |
| 391 | NR_MSI_IRQS, &fsl_msi_host_ops, 0); | 391 | NR_MSI_IRQS, &fsl_msi_host_ops, msi); |
| 392 | 392 | ||
| 393 | if (msi->irqhost == NULL) { | 393 | if (msi->irqhost == NULL) { |
| 394 | dev_err(&dev->dev, "No memory for MSI irqhost\n"); | 394 | dev_err(&dev->dev, "No memory for MSI irqhost\n"); |
| @@ -420,8 +420,6 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) | |||
| 420 | 420 | ||
| 421 | msi->feature = features->fsl_pic_ip; | 421 | msi->feature = features->fsl_pic_ip; |
| 422 | 422 | ||
| 423 | msi->irqhost->host_data = msi; | ||
| 424 | |||
| 425 | /* | 423 | /* |
| 426 | * Remember the phandle, so that we can match with any PCI nodes | 424 | * Remember the phandle, so that we can match with any PCI nodes |
| 427 | * that have an "fsl,msi" property. | 425 | * that have an "fsl,msi" property. |
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h index f6c646a52541..8225f8653f78 100644 --- a/arch/powerpc/sysdev/fsl_msi.h +++ b/arch/powerpc/sysdev/fsl_msi.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #define FSL_PIC_IP_VMPIC 0x00000003 | 26 | #define FSL_PIC_IP_VMPIC 0x00000003 |
| 27 | 27 | ||
| 28 | struct fsl_msi { | 28 | struct fsl_msi { |
| 29 | struct irq_host *irqhost; | 29 | struct irq_domain *irqhost; |
| 30 | 30 | ||
| 31 | unsigned long cascade_irq; | 31 | unsigned long cascade_irq; |
| 32 | 32 | ||
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index d18bb27e4df9..997df6a7ab5d 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
| @@ -25,7 +25,7 @@ static unsigned char cached_8259[2] = { 0xff, 0xff }; | |||
| 25 | 25 | ||
| 26 | static DEFINE_RAW_SPINLOCK(i8259_lock); | 26 | static DEFINE_RAW_SPINLOCK(i8259_lock); |
| 27 | 27 | ||
| 28 | static struct irq_host *i8259_host; | 28 | static struct irq_domain *i8259_host; |
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | * Acknowledge the IRQ using either the PCI host bridge's interrupt | 31 | * Acknowledge the IRQ using either the PCI host bridge's interrupt |
| @@ -163,12 +163,12 @@ static struct resource pic_edgectrl_iores = { | |||
| 163 | .flags = IORESOURCE_BUSY, | 163 | .flags = IORESOURCE_BUSY, |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| 166 | static int i8259_host_match(struct irq_host *h, struct device_node *node) | 166 | static int i8259_host_match(struct irq_domain *h, struct device_node *node) |
| 167 | { | 167 | { |
| 168 | return h->of_node == NULL || h->of_node == node; | 168 | return h->of_node == NULL || h->of_node == node; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | static int i8259_host_map(struct irq_host *h, unsigned int virq, | 171 | static int i8259_host_map(struct irq_domain *h, unsigned int virq, |
| 172 | irq_hw_number_t hw) | 172 | irq_hw_number_t hw) |
| 173 | { | 173 | { |
| 174 | pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); | 174 | pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); |
| @@ -185,7 +185,7 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq, | |||
| 185 | return 0; | 185 | return 0; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, | 188 | static int i8259_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 189 | const u32 *intspec, unsigned int intsize, | 189 | const u32 *intspec, unsigned int intsize, |
| 190 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 190 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 191 | { | 191 | { |
| @@ -205,13 +205,13 @@ static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, | |||
| 205 | return 0; | 205 | return 0; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | static struct irq_host_ops i8259_host_ops = { | 208 | static struct irq_domain_ops i8259_host_ops = { |
| 209 | .match = i8259_host_match, | 209 | .match = i8259_host_match, |
| 210 | .map = i8259_host_map, | 210 | .map = i8259_host_map, |
| 211 | .xlate = i8259_host_xlate, | 211 | .xlate = i8259_host_xlate, |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | struct irq_host *i8259_get_host(void) | 214 | struct irq_domain *i8259_get_host(void) |
| 215 | { | 215 | { |
| 216 | return i8259_host; | 216 | return i8259_host; |
| 217 | } | 217 | } |
| @@ -263,8 +263,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr) | |||
| 263 | raw_spin_unlock_irqrestore(&i8259_lock, flags); | 263 | raw_spin_unlock_irqrestore(&i8259_lock, flags); |
| 264 | 264 | ||
| 265 | /* create a legacy host */ | 265 | /* create a legacy host */ |
| 266 | i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY, | 266 | i8259_host = irq_domain_add_legacy_isa(node, &i8259_host_ops, NULL); |
| 267 | 0, &i8259_host_ops, 0); | ||
| 268 | if (i8259_host == NULL) { | 267 | if (i8259_host == NULL) { |
| 269 | printk(KERN_ERR "i8259: failed to allocate irq host !\n"); | 268 | printk(KERN_ERR "i8259: failed to allocate irq host !\n"); |
| 270 | return; | 269 | return; |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 95da897f05a7..b50f97811c25 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
| @@ -672,13 +672,13 @@ static struct irq_chip ipic_edge_irq_chip = { | |||
| 672 | .irq_set_type = ipic_set_irq_type, | 672 | .irq_set_type = ipic_set_irq_type, |
| 673 | }; | 673 | }; |
| 674 | 674 | ||
| 675 | static int ipic_host_match(struct irq_host *h, struct device_node *node) | 675 | static int ipic_host_match(struct irq_domain *h, struct device_node *node) |
| 676 | { | 676 | { |
| 677 | /* Exact match, unless ipic node is NULL */ | 677 | /* Exact match, unless ipic node is NULL */ |
| 678 | return h->of_node == NULL || h->of_node == node; | 678 | return h->of_node == NULL || h->of_node == node; |
| 679 | } | 679 | } |
| 680 | 680 | ||
| 681 | static int ipic_host_map(struct irq_host *h, unsigned int virq, | 681 | static int ipic_host_map(struct irq_domain *h, unsigned int virq, |
| 682 | irq_hw_number_t hw) | 682 | irq_hw_number_t hw) |
| 683 | { | 683 | { |
| 684 | struct ipic *ipic = h->host_data; | 684 | struct ipic *ipic = h->host_data; |
| @@ -692,26 +692,10 @@ static int ipic_host_map(struct irq_host *h, unsigned int virq, | |||
| 692 | return 0; | 692 | return 0; |
| 693 | } | 693 | } |
| 694 | 694 | ||
| 695 | static int ipic_host_xlate(struct irq_host *h, struct device_node *ct, | 695 | static struct irq_domain_ops ipic_host_ops = { |
| 696 | const u32 *intspec, unsigned int intsize, | ||
| 697 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | ||
| 698 | |||
| 699 | { | ||
| 700 | /* interrupt sense values coming from the device tree equal either | ||
| 701 | * LEVEL_LOW (low assertion) or EDGE_FALLING (high-to-low change) | ||
| 702 | */ | ||
| 703 | *out_hwirq = intspec[0]; | ||
| 704 | if (intsize > 1) | ||
| 705 | *out_flags = intspec[1]; | ||
| 706 | else | ||
| 707 | *out_flags = IRQ_TYPE_NONE; | ||
| 708 | return 0; | ||
| 709 | } | ||
| 710 | |||
| 711 | static struct irq_host_ops ipic_host_ops = { | ||
| 712 | .match = ipic_host_match, | 696 | .match = ipic_host_match, |
| 713 | .map = ipic_host_map, | 697 | .map = ipic_host_map, |
| 714 | .xlate = ipic_host_xlate, | 698 | .xlate = irq_domain_xlate_onetwocell, |
| 715 | }; | 699 | }; |
| 716 | 700 | ||
| 717 | struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | 701 | struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) |
| @@ -728,9 +712,8 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
| 728 | if (ipic == NULL) | 712 | if (ipic == NULL) |
| 729 | return NULL; | 713 | return NULL; |
| 730 | 714 | ||
| 731 | ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | 715 | ipic->irqhost = irq_domain_add_linear(node, NR_IPIC_INTS, |
| 732 | NR_IPIC_INTS, | 716 | &ipic_host_ops, ipic); |
| 733 | &ipic_host_ops, 0); | ||
| 734 | if (ipic->irqhost == NULL) { | 717 | if (ipic->irqhost == NULL) { |
| 735 | kfree(ipic); | 718 | kfree(ipic); |
| 736 | return NULL; | 719 | return NULL; |
| @@ -738,8 +721,6 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
| 738 | 721 | ||
| 739 | ipic->regs = ioremap(res.start, resource_size(&res)); | 722 | ipic->regs = ioremap(res.start, resource_size(&res)); |
| 740 | 723 | ||
| 741 | ipic->irqhost->host_data = ipic; | ||
| 742 | |||
| 743 | /* init hw */ | 724 | /* init hw */ |
| 744 | ipic_write(ipic->regs, IPIC_SICNR, 0x0); | 725 | ipic_write(ipic->regs, IPIC_SICNR, 0x0); |
| 745 | 726 | ||
diff --git a/arch/powerpc/sysdev/ipic.h b/arch/powerpc/sysdev/ipic.h index 9391c57b0c51..90031d1282e1 100644 --- a/arch/powerpc/sysdev/ipic.h +++ b/arch/powerpc/sysdev/ipic.h | |||
| @@ -43,7 +43,7 @@ struct ipic { | |||
| 43 | volatile u32 __iomem *regs; | 43 | volatile u32 __iomem *regs; |
| 44 | 44 | ||
| 45 | /* The remapper for this IPIC */ | 45 | /* The remapper for this IPIC */ |
| 46 | struct irq_host *irqhost; | 46 | struct irq_domain *irqhost; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | struct ipic_info { | 49 | struct ipic_info { |
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 2ca0a85fcce9..d5f5416be310 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | extern int cpm_get_irq(struct pt_regs *regs); | 18 | extern int cpm_get_irq(struct pt_regs *regs); |
| 19 | 19 | ||
| 20 | static struct irq_host *mpc8xx_pic_host; | 20 | static struct irq_domain *mpc8xx_pic_host; |
| 21 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 21 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) |
| 22 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 22 | static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; |
| 23 | static sysconf8xx_t __iomem *siu_reg; | 23 | static sysconf8xx_t __iomem *siu_reg; |
| @@ -110,7 +110,7 @@ unsigned int mpc8xx_get_irq(void) | |||
| 110 | 110 | ||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, | 113 | static int mpc8xx_pic_host_map(struct irq_domain *h, unsigned int virq, |
| 114 | irq_hw_number_t hw) | 114 | irq_hw_number_t hw) |
| 115 | { | 115 | { |
| 116 | pr_debug("mpc8xx_pic_host_map(%d, 0x%lx)\n", virq, hw); | 116 | pr_debug("mpc8xx_pic_host_map(%d, 0x%lx)\n", virq, hw); |
| @@ -121,7 +121,7 @@ static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, | |||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | 123 | ||
| 124 | static int mpc8xx_pic_host_xlate(struct irq_host *h, struct device_node *ct, | 124 | static int mpc8xx_pic_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 125 | const u32 *intspec, unsigned int intsize, | 125 | const u32 *intspec, unsigned int intsize, |
| 126 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 126 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 127 | { | 127 | { |
| @@ -142,7 +142,7 @@ static int mpc8xx_pic_host_xlate(struct irq_host *h, struct device_node *ct, | |||
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | static struct irq_host_ops mpc8xx_pic_host_ops = { | 145 | static struct irq_domain_ops mpc8xx_pic_host_ops = { |
| 146 | .map = mpc8xx_pic_host_map, | 146 | .map = mpc8xx_pic_host_map, |
| 147 | .xlate = mpc8xx_pic_host_xlate, | 147 | .xlate = mpc8xx_pic_host_xlate, |
| 148 | }; | 148 | }; |
| @@ -171,8 +171,7 @@ int mpc8xx_pic_init(void) | |||
| 171 | goto out; | 171 | goto out; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | mpc8xx_pic_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, | 174 | mpc8xx_pic_host = irq_domain_add_linear(np, 64, &mpc8xx_pic_host_ops, NULL); |
| 175 | 64, &mpc8xx_pic_host_ops, 64); | ||
| 176 | if (mpc8xx_pic_host == NULL) { | 175 | if (mpc8xx_pic_host == NULL) { |
| 177 | printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); | 176 | printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); |
| 178 | ret = -ENOMEM; | 177 | ret = -ENOMEM; |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 4e9ccb1015de..c83a512fa175 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
| @@ -965,13 +965,13 @@ static struct irq_chip mpic_irq_ht_chip = { | |||
| 965 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ | 965 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ |
| 966 | 966 | ||
| 967 | 967 | ||
| 968 | static int mpic_host_match(struct irq_host *h, struct device_node *node) | 968 | static int mpic_host_match(struct irq_domain *h, struct device_node *node) |
| 969 | { | 969 | { |
| 970 | /* Exact match, unless mpic node is NULL */ | 970 | /* Exact match, unless mpic node is NULL */ |
| 971 | return h->of_node == NULL || h->of_node == node; | 971 | return h->of_node == NULL || h->of_node == node; |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | static int mpic_host_map(struct irq_host *h, unsigned int virq, | 974 | static int mpic_host_map(struct irq_domain *h, unsigned int virq, |
| 975 | irq_hw_number_t hw) | 975 | irq_hw_number_t hw) |
| 976 | { | 976 | { |
| 977 | struct mpic *mpic = h->host_data; | 977 | struct mpic *mpic = h->host_data; |
| @@ -1041,7 +1041,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
| 1041 | return 0; | 1041 | return 0; |
| 1042 | } | 1042 | } |
| 1043 | 1043 | ||
| 1044 | static int mpic_host_xlate(struct irq_host *h, struct device_node *ct, | 1044 | static int mpic_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 1045 | const u32 *intspec, unsigned int intsize, | 1045 | const u32 *intspec, unsigned int intsize, |
| 1046 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 1046 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 1047 | 1047 | ||
| @@ -1121,13 +1121,13 @@ static void mpic_cascade(unsigned int irq, struct irq_desc *desc) | |||
| 1121 | BUG_ON(!(mpic->flags & MPIC_SECONDARY)); | 1121 | BUG_ON(!(mpic->flags & MPIC_SECONDARY)); |
| 1122 | 1122 | ||
| 1123 | virq = mpic_get_one_irq(mpic); | 1123 | virq = mpic_get_one_irq(mpic); |
| 1124 | if (virq != NO_IRQ) | 1124 | if (virq) |
| 1125 | generic_handle_irq(virq); | 1125 | generic_handle_irq(virq); |
| 1126 | 1126 | ||
| 1127 | chip->irq_eoi(&desc->irq_data); | 1127 | chip->irq_eoi(&desc->irq_data); |
| 1128 | } | 1128 | } |
| 1129 | 1129 | ||
| 1130 | static struct irq_host_ops mpic_host_ops = { | 1130 | static struct irq_domain_ops mpic_host_ops = { |
| 1131 | .match = mpic_host_match, | 1131 | .match = mpic_host_match, |
| 1132 | .map = mpic_host_map, | 1132 | .map = mpic_host_map, |
| 1133 | .xlate = mpic_host_xlate, | 1133 | .xlate = mpic_host_xlate, |
| @@ -1345,10 +1345,9 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
| 1345 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); | 1345 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); |
| 1346 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; | 1346 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; |
| 1347 | 1347 | ||
| 1348 | mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR, | 1348 | mpic->irqhost = irq_domain_add_linear(mpic->node, |
| 1349 | isu_size ? isu_size : mpic->num_sources, | 1349 | isu_size ? isu_size : mpic->num_sources, |
| 1350 | &mpic_host_ops, | 1350 | &mpic_host_ops, mpic); |
| 1351 | flags & MPIC_LARGE_VECTORS ? 2048 : 256); | ||
| 1352 | 1351 | ||
| 1353 | /* | 1352 | /* |
| 1354 | * FIXME: The code leaks the MPIC object and mappings here; this | 1353 | * FIXME: The code leaks the MPIC object and mappings here; this |
| @@ -1357,8 +1356,6 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
| 1357 | if (mpic->irqhost == NULL) | 1356 | if (mpic->irqhost == NULL) |
| 1358 | return NULL; | 1357 | return NULL; |
| 1359 | 1358 | ||
| 1360 | mpic->irqhost->host_data = mpic; | ||
| 1361 | |||
| 1362 | /* Display version */ | 1359 | /* Display version */ |
| 1363 | switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) { | 1360 | switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) { |
| 1364 | case 1: | 1361 | case 1: |
diff --git a/arch/powerpc/sysdev/mpic_msi.c b/arch/powerpc/sysdev/mpic_msi.c index 0f67cd79d481..0622aa91b18a 100644 --- a/arch/powerpc/sysdev/mpic_msi.c +++ b/arch/powerpc/sysdev/mpic_msi.c | |||
| @@ -32,7 +32,7 @@ void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq) | |||
| 32 | static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic) | 32 | static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic) |
| 33 | { | 33 | { |
| 34 | irq_hw_number_t hwirq; | 34 | irq_hw_number_t hwirq; |
| 35 | struct irq_host_ops *ops = mpic->irqhost->ops; | 35 | const struct irq_domain_ops *ops = mpic->irqhost->ops; |
| 36 | struct device_node *np; | 36 | struct device_node *np; |
| 37 | int flags, index, i; | 37 | int flags, index, i; |
| 38 | struct of_irq oirq; | 38 | struct of_irq oirq; |
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c index 14d130268e7a..8848e99a83f2 100644 --- a/arch/powerpc/sysdev/mv64x60_pic.c +++ b/arch/powerpc/sysdev/mv64x60_pic.c | |||
| @@ -70,7 +70,7 @@ static u32 mv64x60_cached_low_mask; | |||
| 70 | static u32 mv64x60_cached_high_mask = MV64X60_HIGH_GPP_GROUPS; | 70 | static u32 mv64x60_cached_high_mask = MV64X60_HIGH_GPP_GROUPS; |
| 71 | static u32 mv64x60_cached_gpp_mask; | 71 | static u32 mv64x60_cached_gpp_mask; |
| 72 | 72 | ||
| 73 | static struct irq_host *mv64x60_irq_host; | 73 | static struct irq_domain *mv64x60_irq_host; |
| 74 | 74 | ||
| 75 | /* | 75 | /* |
| 76 | * mv64x60_chip_low functions | 76 | * mv64x60_chip_low functions |
| @@ -208,7 +208,7 @@ static struct irq_chip *mv64x60_chips[] = { | |||
| 208 | [MV64x60_LEVEL1_GPP] = &mv64x60_chip_gpp, | 208 | [MV64x60_LEVEL1_GPP] = &mv64x60_chip_gpp, |
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | static int mv64x60_host_map(struct irq_host *h, unsigned int virq, | 211 | static int mv64x60_host_map(struct irq_domain *h, unsigned int virq, |
| 212 | irq_hw_number_t hwirq) | 212 | irq_hw_number_t hwirq) |
| 213 | { | 213 | { |
| 214 | int level1; | 214 | int level1; |
| @@ -223,7 +223,7 @@ static int mv64x60_host_map(struct irq_host *h, unsigned int virq, | |||
| 223 | return 0; | 223 | return 0; |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | static struct irq_host_ops mv64x60_host_ops = { | 226 | static struct irq_domain_ops mv64x60_host_ops = { |
| 227 | .map = mv64x60_host_map, | 227 | .map = mv64x60_host_map, |
| 228 | }; | 228 | }; |
| 229 | 229 | ||
| @@ -250,9 +250,8 @@ void __init mv64x60_init_irq(void) | |||
| 250 | paddr = of_translate_address(np, reg); | 250 | paddr = of_translate_address(np, reg); |
| 251 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); | 251 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); |
| 252 | 252 | ||
| 253 | mv64x60_irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, | 253 | mv64x60_irq_host = irq_domain_add_linear(np, MV64x60_NUM_IRQS, |
| 254 | MV64x60_NUM_IRQS, | 254 | &mv64x60_host_ops, NULL); |
| 255 | &mv64x60_host_ops, MV64x60_NUM_IRQS); | ||
| 256 | 255 | ||
| 257 | spin_lock_irqsave(&mv64x60_lock, flags); | 256 | spin_lock_irqsave(&mv64x60_lock, flags); |
| 258 | out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK, | 257 | out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK, |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 73034bd203c4..2fba6ef2f95e 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
| @@ -245,13 +245,13 @@ static struct irq_chip qe_ic_irq_chip = { | |||
| 245 | .irq_mask_ack = qe_ic_mask_irq, | 245 | .irq_mask_ack = qe_ic_mask_irq, |
| 246 | }; | 246 | }; |
| 247 | 247 | ||
| 248 | static int qe_ic_host_match(struct irq_host *h, struct device_node *node) | 248 | static int qe_ic_host_match(struct irq_domain *h, struct device_node *node) |
| 249 | { | 249 | { |
| 250 | /* Exact match, unless qe_ic node is NULL */ | 250 | /* Exact match, unless qe_ic node is NULL */ |
| 251 | return h->of_node == NULL || h->of_node == node; | 251 | return h->of_node == NULL || h->of_node == node; |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | static int qe_ic_host_map(struct irq_host *h, unsigned int virq, | 254 | static int qe_ic_host_map(struct irq_domain *h, unsigned int virq, |
| 255 | irq_hw_number_t hw) | 255 | irq_hw_number_t hw) |
| 256 | { | 256 | { |
| 257 | struct qe_ic *qe_ic = h->host_data; | 257 | struct qe_ic *qe_ic = h->host_data; |
| @@ -272,23 +272,10 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq, | |||
| 272 | return 0; | 272 | return 0; |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | static int qe_ic_host_xlate(struct irq_host *h, struct device_node *ct, | 275 | static struct irq_domain_ops qe_ic_host_ops = { |
| 276 | const u32 * intspec, unsigned int intsize, | ||
| 277 | irq_hw_number_t * out_hwirq, | ||
| 278 | unsigned int *out_flags) | ||
| 279 | { | ||
| 280 | *out_hwirq = intspec[0]; | ||
| 281 | if (intsize > 1) | ||
| 282 | *out_flags = intspec[1]; | ||
| 283 | else | ||
| 284 | *out_flags = IRQ_TYPE_NONE; | ||
| 285 | return 0; | ||
| 286 | } | ||
| 287 | |||
| 288 | static struct irq_host_ops qe_ic_host_ops = { | ||
| 289 | .match = qe_ic_host_match, | 276 | .match = qe_ic_host_match, |
| 290 | .map = qe_ic_host_map, | 277 | .map = qe_ic_host_map, |
| 291 | .xlate = qe_ic_host_xlate, | 278 | .xlate = irq_domain_xlate_onetwocell, |
| 292 | }; | 279 | }; |
| 293 | 280 | ||
| 294 | /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ | 281 | /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ |
| @@ -339,8 +326,8 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags, | |||
| 339 | if (qe_ic == NULL) | 326 | if (qe_ic == NULL) |
| 340 | return; | 327 | return; |
| 341 | 328 | ||
| 342 | qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | 329 | qe_ic->irqhost = irq_domain_add_linear(node, NR_QE_IC_INTS, |
| 343 | NR_QE_IC_INTS, &qe_ic_host_ops, 0); | 330 | &qe_ic_host_ops, qe_ic); |
| 344 | if (qe_ic->irqhost == NULL) { | 331 | if (qe_ic->irqhost == NULL) { |
| 345 | kfree(qe_ic); | 332 | kfree(qe_ic); |
| 346 | return; | 333 | return; |
| @@ -348,7 +335,6 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags, | |||
| 348 | 335 | ||
| 349 | qe_ic->regs = ioremap(res.start, resource_size(&res)); | 336 | qe_ic->regs = ioremap(res.start, resource_size(&res)); |
| 350 | 337 | ||
| 351 | qe_ic->irqhost->host_data = qe_ic; | ||
| 352 | qe_ic->hc_irq = qe_ic_irq_chip; | 338 | qe_ic->hc_irq = qe_ic_irq_chip; |
| 353 | 339 | ||
| 354 | qe_ic->virq_high = irq_of_parse_and_map(node, 0); | 340 | qe_ic->virq_high = irq_of_parse_and_map(node, 0); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/arch/powerpc/sysdev/qe_lib/qe_ic.h index c1361d005a8a..c327872ed35c 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.h +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.h | |||
| @@ -79,7 +79,7 @@ struct qe_ic { | |||
| 79 | volatile u32 __iomem *regs; | 79 | volatile u32 __iomem *regs; |
| 80 | 80 | ||
| 81 | /* The remapper for this QEIC */ | 81 | /* The remapper for this QEIC */ |
| 82 | struct irq_host *irqhost; | 82 | struct irq_domain *irqhost; |
| 83 | 83 | ||
| 84 | /* The "linux" controller struct */ | 84 | /* The "linux" controller struct */ |
| 85 | struct irq_chip hc_irq; | 85 | struct irq_chip hc_irq; |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 4d18658116e5..188012c58f7f 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
| @@ -51,7 +51,7 @@ | |||
| 51 | u32 tsi108_pci_cfg_base; | 51 | u32 tsi108_pci_cfg_base; |
| 52 | static u32 tsi108_pci_cfg_phys; | 52 | static u32 tsi108_pci_cfg_phys; |
| 53 | u32 tsi108_csr_vir_base; | 53 | u32 tsi108_csr_vir_base; |
| 54 | static struct irq_host *pci_irq_host; | 54 | static struct irq_domain *pci_irq_host; |
| 55 | 55 | ||
| 56 | extern u32 get_vir_csrbase(void); | 56 | extern u32 get_vir_csrbase(void); |
| 57 | extern u32 tsi108_read_reg(u32 reg_offset); | 57 | extern u32 tsi108_read_reg(u32 reg_offset); |
| @@ -376,7 +376,7 @@ static struct irq_chip tsi108_pci_irq = { | |||
| 376 | .irq_unmask = tsi108_pci_irq_unmask, | 376 | .irq_unmask = tsi108_pci_irq_unmask, |
| 377 | }; | 377 | }; |
| 378 | 378 | ||
| 379 | static int pci_irq_host_xlate(struct irq_host *h, struct device_node *ct, | 379 | static int pci_irq_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 380 | const u32 *intspec, unsigned int intsize, | 380 | const u32 *intspec, unsigned int intsize, |
| 381 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 381 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 382 | { | 382 | { |
| @@ -385,7 +385,7 @@ static int pci_irq_host_xlate(struct irq_host *h, struct device_node *ct, | |||
| 385 | return 0; | 385 | return 0; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | static int pci_irq_host_map(struct irq_host *h, unsigned int virq, | 388 | static int pci_irq_host_map(struct irq_domain *h, unsigned int virq, |
| 389 | irq_hw_number_t hw) | 389 | irq_hw_number_t hw) |
| 390 | { unsigned int irq; | 390 | { unsigned int irq; |
| 391 | DBG("%s(%d, 0x%lx)\n", __func__, virq, hw); | 391 | DBG("%s(%d, 0x%lx)\n", __func__, virq, hw); |
| @@ -397,7 +397,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq, | |||
| 397 | return 0; | 397 | return 0; |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | static struct irq_host_ops pci_irq_host_ops = { | 400 | static struct irq_domain_ops pci_irq_domain_ops = { |
| 401 | .map = pci_irq_host_map, | 401 | .map = pci_irq_host_map, |
| 402 | .xlate = pci_irq_host_xlate, | 402 | .xlate = pci_irq_host_xlate, |
| 403 | }; | 403 | }; |
| @@ -419,10 +419,9 @@ void __init tsi108_pci_int_init(struct device_node *node) | |||
| 419 | { | 419 | { |
| 420 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); | 420 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); |
| 421 | 421 | ||
| 422 | pci_irq_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY, | 422 | pci_irq_host = irq_domain_add_legacy_isa(node, &pci_irq_domain_ops, NULL); |
| 423 | 0, &pci_irq_host_ops, 0); | ||
| 424 | if (pci_irq_host == NULL) { | 423 | if (pci_irq_host == NULL) { |
| 425 | printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n"); | 424 | printk(KERN_ERR "pci_irq_host: failed to allocate irq domain!\n"); |
| 426 | return; | 425 | return; |
| 427 | } | 426 | } |
| 428 | 427 | ||
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 | ||
| 55 | static void uic_unmask_irq(struct irq_data *d) | 55 | static 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 | ||
| 177 | static int uic_host_map(struct irq_host *h, unsigned int virq, | 177 | static 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 | ||
| 193 | static int uic_host_xlate(struct irq_host *h, struct device_node *ct, | 193 | static 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 | |||
| 205 | static 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 | ||
| 210 | void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) | 198 | void 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); |
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c index d72eda6a4c05..ea5e204e3450 100644 --- a/arch/powerpc/sysdev/xics/xics-common.c +++ b/arch/powerpc/sysdev/xics/xics-common.c | |||
| @@ -40,7 +40,7 @@ unsigned int xics_interrupt_server_size = 8; | |||
| 40 | 40 | ||
| 41 | DEFINE_PER_CPU(struct xics_cppr, xics_cppr); | 41 | DEFINE_PER_CPU(struct xics_cppr, xics_cppr); |
| 42 | 42 | ||
| 43 | struct irq_host *xics_host; | 43 | struct irq_domain *xics_host; |
| 44 | 44 | ||
| 45 | static LIST_HEAD(ics_list); | 45 | static LIST_HEAD(ics_list); |
| 46 | 46 | ||
| @@ -212,16 +212,16 @@ void xics_migrate_irqs_away(void) | |||
| 212 | /* We can't set affinity on ISA interrupts */ | 212 | /* We can't set affinity on ISA interrupts */ |
| 213 | if (virq < NUM_ISA_INTERRUPTS) | 213 | if (virq < NUM_ISA_INTERRUPTS) |
| 214 | continue; | 214 | continue; |
| 215 | if (!virq_is_host(virq, xics_host)) | ||
| 216 | continue; | ||
| 217 | irq = (unsigned int)virq_to_hw(virq); | ||
| 218 | /* We need to get IPIs still. */ | ||
| 219 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) | ||
| 220 | continue; | ||
| 221 | desc = irq_to_desc(virq); | 215 | desc = irq_to_desc(virq); |
| 222 | /* We only need to migrate enabled IRQS */ | 216 | /* We only need to migrate enabled IRQS */ |
| 223 | if (!desc || !desc->action) | 217 | if (!desc || !desc->action) |
| 224 | continue; | 218 | continue; |
| 219 | if (desc->irq_data.domain != xics_host) | ||
| 220 | continue; | ||
| 221 | irq = desc->irq_data.hwirq; | ||
| 222 | /* We need to get IPIs still. */ | ||
| 223 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) | ||
| 224 | continue; | ||
| 225 | chip = irq_desc_get_chip(desc); | 225 | chip = irq_desc_get_chip(desc); |
| 226 | if (!chip || !chip->irq_set_affinity) | 226 | if (!chip || !chip->irq_set_affinity) |
| 227 | continue; | 227 | continue; |
| @@ -301,7 +301,7 @@ int xics_get_irq_server(unsigned int virq, const struct cpumask *cpumask, | |||
| 301 | } | 301 | } |
| 302 | #endif /* CONFIG_SMP */ | 302 | #endif /* CONFIG_SMP */ |
| 303 | 303 | ||
| 304 | static int xics_host_match(struct irq_host *h, struct device_node *node) | 304 | static int xics_host_match(struct irq_domain *h, struct device_node *node) |
| 305 | { | 305 | { |
| 306 | struct ics *ics; | 306 | struct ics *ics; |
| 307 | 307 | ||
| @@ -323,7 +323,7 @@ static struct irq_chip xics_ipi_chip = { | |||
| 323 | .irq_unmask = xics_ipi_unmask, | 323 | .irq_unmask = xics_ipi_unmask, |
| 324 | }; | 324 | }; |
| 325 | 325 | ||
| 326 | static int xics_host_map(struct irq_host *h, unsigned int virq, | 326 | static int xics_host_map(struct irq_domain *h, unsigned int virq, |
| 327 | irq_hw_number_t hw) | 327 | irq_hw_number_t hw) |
| 328 | { | 328 | { |
| 329 | struct ics *ics; | 329 | struct ics *ics; |
| @@ -351,7 +351,7 @@ static int xics_host_map(struct irq_host *h, unsigned int virq, | |||
| 351 | return -EINVAL; | 351 | return -EINVAL; |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | static int xics_host_xlate(struct irq_host *h, struct device_node *ct, | 354 | static int xics_host_xlate(struct irq_domain *h, struct device_node *ct, |
| 355 | const u32 *intspec, unsigned int intsize, | 355 | const u32 *intspec, unsigned int intsize, |
| 356 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 356 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
| 357 | 357 | ||
| @@ -366,7 +366,7 @@ static int xics_host_xlate(struct irq_host *h, struct device_node *ct, | |||
| 366 | return 0; | 366 | return 0; |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | static struct irq_host_ops xics_host_ops = { | 369 | static struct irq_domain_ops xics_host_ops = { |
| 370 | .match = xics_host_match, | 370 | .match = xics_host_match, |
| 371 | .map = xics_host_map, | 371 | .map = xics_host_map, |
| 372 | .xlate = xics_host_xlate, | 372 | .xlate = xics_host_xlate, |
| @@ -374,8 +374,7 @@ static struct irq_host_ops xics_host_ops = { | |||
| 374 | 374 | ||
| 375 | static void __init xics_init_host(void) | 375 | static void __init xics_init_host(void) |
| 376 | { | 376 | { |
| 377 | xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, &xics_host_ops, | 377 | xics_host = irq_domain_add_tree(NULL, &xics_host_ops, NULL); |
| 378 | XICS_IRQ_SPURIOUS); | ||
| 379 | BUG_ON(xics_host == NULL); | 378 | BUG_ON(xics_host == NULL); |
| 380 | irq_set_default_host(xics_host); | 379 | irq_set_default_host(xics_host); |
| 381 | } | 380 | } |
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c index 6183799754af..8d73c3c0bee6 100644 --- a/arch/powerpc/sysdev/xilinx_intc.c +++ b/arch/powerpc/sysdev/xilinx_intc.c | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | #define XINTC_IVR 24 /* Interrupt Vector */ | 40 | #define XINTC_IVR 24 /* Interrupt Vector */ |
| 41 | #define XINTC_MER 28 /* Master Enable */ | 41 | #define XINTC_MER 28 /* Master Enable */ |
| 42 | 42 | ||
| 43 | static struct irq_host *master_irqhost; | 43 | static struct irq_domain *master_irqhost; |
| 44 | 44 | ||
| 45 | #define XILINX_INTC_MAXIRQS (32) | 45 | #define XILINX_INTC_MAXIRQS (32) |
| 46 | 46 | ||
| @@ -141,7 +141,7 @@ static struct irq_chip xilinx_intc_edge_irqchip = { | |||
| 141 | /** | 141 | /** |
| 142 | * xilinx_intc_xlate - translate virq# from device tree interrupts property | 142 | * xilinx_intc_xlate - translate virq# from device tree interrupts property |
| 143 | */ | 143 | */ |
| 144 | static int xilinx_intc_xlate(struct irq_host *h, struct device_node *ct, | 144 | static int xilinx_intc_xlate(struct irq_domain *h, struct device_node *ct, |
| 145 | const u32 *intspec, unsigned int intsize, | 145 | const u32 *intspec, unsigned int intsize, |
| 146 | irq_hw_number_t *out_hwirq, | 146 | irq_hw_number_t *out_hwirq, |
| 147 | unsigned int *out_flags) | 147 | unsigned int *out_flags) |
| @@ -161,7 +161,7 @@ static int xilinx_intc_xlate(struct irq_host *h, struct device_node *ct, | |||
| 161 | 161 | ||
| 162 | return 0; | 162 | return 0; |
| 163 | } | 163 | } |
| 164 | static int xilinx_intc_map(struct irq_host *h, unsigned int virq, | 164 | static int xilinx_intc_map(struct irq_domain *h, unsigned int virq, |
| 165 | irq_hw_number_t irq) | 165 | irq_hw_number_t irq) |
| 166 | { | 166 | { |
| 167 | irq_set_chip_data(virq, h->host_data); | 167 | irq_set_chip_data(virq, h->host_data); |
| @@ -177,15 +177,15 @@ static int xilinx_intc_map(struct irq_host *h, unsigned int virq, | |||
| 177 | return 0; | 177 | return 0; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | static struct irq_host_ops xilinx_intc_ops = { | 180 | static struct irq_domain_ops xilinx_intc_ops = { |
| 181 | .map = xilinx_intc_map, | 181 | .map = xilinx_intc_map, |
| 182 | .xlate = xilinx_intc_xlate, | 182 | .xlate = xilinx_intc_xlate, |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | struct irq_host * __init | 185 | struct irq_domain * __init |
| 186 | xilinx_intc_init(struct device_node *np) | 186 | xilinx_intc_init(struct device_node *np) |
| 187 | { | 187 | { |
| 188 | struct irq_host * irq; | 188 | struct irq_domain * irq; |
| 189 | void * regs; | 189 | void * regs; |
| 190 | 190 | ||
| 191 | /* Find and map the intc registers */ | 191 | /* Find and map the intc registers */ |
| @@ -200,12 +200,11 @@ xilinx_intc_init(struct device_node *np) | |||
| 200 | out_be32(regs + XINTC_IAR, ~(u32) 0); /* Acknowledge pending irqs */ | 200 | out_be32(regs + XINTC_IAR, ~(u32) 0); /* Acknowledge pending irqs */ |
| 201 | out_be32(regs + XINTC_MER, 0x3UL); /* Turn on the Master Enable. */ | 201 | out_be32(regs + XINTC_MER, 0x3UL); /* Turn on the Master Enable. */ |
| 202 | 202 | ||
| 203 | /* Allocate and initialize an irq_host structure. */ | 203 | /* Allocate and initialize an irq_domain structure. */ |
| 204 | irq = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, XILINX_INTC_MAXIRQS, | 204 | irq = irq_domain_add_linear(np, XILINX_INTC_MAXIRQS, &xilinx_intc_ops, |
| 205 | &xilinx_intc_ops, -1); | 205 | regs); |
| 206 | if (!irq) | 206 | if (!irq) |
| 207 | panic(__FILE__ ": Cannot allocate IRQ host\n"); | 207 | panic(__FILE__ ": Cannot allocate IRQ host\n"); |
| 208 | irq->host_data = regs; | ||
| 209 | 208 | ||
| 210 | return irq; | 209 | return irq; |
| 211 | } | 210 | } |
