Lines Matching +full:lan966x +full:- +full:oic
1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for the Microchip LAN966x outbound interrupt controller
71 struct lan966x_oic_chip_regs *chip_regs = gc->private; in lan966x_oic_irq_startup()
77 map = irq_reg_readl(gc, chip_regs->reg_off_map); in lan966x_oic_irq_startup()
78 map |= data->mask; in lan966x_oic_irq_startup()
79 irq_reg_writel(gc, map, chip_regs->reg_off_map); in lan966x_oic_irq_startup()
83 ct->chip.irq_ack(data); in lan966x_oic_irq_startup()
84 ct->chip.irq_unmask(data); in lan966x_oic_irq_startup()
93 struct lan966x_oic_chip_regs *chip_regs = gc->private; in lan966x_oic_irq_shutdown()
96 ct->chip.irq_mask(data); in lan966x_oic_irq_shutdown()
101 map = irq_reg_readl(gc, chip_regs->reg_off_map); in lan966x_oic_irq_shutdown()
102 map &= ~data->mask; in lan966x_oic_irq_shutdown()
103 irq_reg_writel(gc, map, chip_regs->reg_off_map); in lan966x_oic_irq_shutdown()
112 pr_err("lan966x oic doesn't support flow type %d\n", flow_type); in lan966x_oic_irq_set_type()
113 return -EINVAL; in lan966x_oic_irq_set_type()
122 struct lan966x_oic_chip_regs *chip_regs = gc->private; in lan966x_oic_irq_handler_domain()
126 ident = irq_reg_readl(gc, chip_regs->reg_off_ident); in lan966x_oic_irq_handler_domain()
170 struct lan966x_oic_data *lan966x_oic = gc->domain->host_data; in lan966x_oic_chip_init()
173 chip_regs = &lan966x_oic_chip_regs[gc->irq_base / 32]; in lan966x_oic_chip_init()
175 gc->reg_base = lan966x_oic->regs; in lan966x_oic_chip_init()
176 gc->chip_types[0].regs.enable = chip_regs->reg_off_ena_set; in lan966x_oic_chip_init()
177 gc->chip_types[0].regs.disable = chip_regs->reg_off_ena_clr; in lan966x_oic_chip_init()
178 gc->chip_types[0].regs.ack = chip_regs->reg_off_sticky; in lan966x_oic_chip_init()
179 gc->chip_types[0].chip.irq_startup = lan966x_oic_irq_startup; in lan966x_oic_chip_init()
180 gc->chip_types[0].chip.irq_shutdown = lan966x_oic_irq_shutdown; in lan966x_oic_chip_init()
181 gc->chip_types[0].chip.irq_set_type = lan966x_oic_irq_set_type; in lan966x_oic_chip_init()
182 gc->chip_types[0].chip.irq_mask = irq_gc_mask_disable_reg; in lan966x_oic_chip_init()
183 gc->chip_types[0].chip.irq_unmask = irq_gc_unmask_enable_reg; in lan966x_oic_chip_init()
184 gc->chip_types[0].chip.irq_ack = irq_gc_ack_set_bit; in lan966x_oic_chip_init()
185 gc->private = chip_regs; in lan966x_oic_chip_init()
188 irq_reg_writel(gc, ~0U, chip_regs->reg_off_ena_clr); in lan966x_oic_chip_init()
196 irq_reg_writel(gc, ~0U, gc->chip_types[0].regs.disable); in lan966x_oic_chip_exit()
197 irq_reg_writel(gc, ~0U, gc->chip_types[0].regs.ack); in lan966x_oic_chip_exit()
202 struct lan966x_oic_data *lan966x_oic = d->host_data; in lan966x_oic_domain_init()
204 irq_set_chained_handler_and_data(lan966x_oic->irq, lan966x_oic_irq_handler, d); in lan966x_oic_domain_init()
211 struct lan966x_oic_data *lan966x_oic = d->host_data; in lan966x_oic_domain_exit()
213 irq_set_chained_handler_and_data(lan966x_oic->irq, NULL, NULL); in lan966x_oic_domain_exit()
219 .name = "lan966x-oic", in lan966x_oic_probe()
227 .fwnode = of_node_to_fwnode(pdev->dev.of_node), in lan966x_oic_probe()
237 struct device *dev = &pdev->dev; in lan966x_oic_probe()
242 return -ENOMEM; in lan966x_oic_probe()
244 lan966x_oic->regs = devm_platform_ioremap_resource(pdev, 0); in lan966x_oic_probe()
245 if (IS_ERR(lan966x_oic->regs)) in lan966x_oic_probe()
246 return dev_err_probe(dev, PTR_ERR(lan966x_oic->regs), in lan966x_oic_probe()
249 lan966x_oic->irq = platform_get_irq(pdev, 0); in lan966x_oic_probe()
250 if (lan966x_oic->irq < 0) in lan966x_oic_probe()
251 return dev_err_probe(dev, lan966x_oic->irq, "failed to get the IRQ\n"); in lan966x_oic_probe()
262 { .compatible = "microchip,lan966x-oic" },
270 .name = "lan966x-oic",
277 MODULE_DESCRIPTION("Microchip LAN966x OIC driver");