Lines Matching +full:ls1x +full:- +full:intc
1 // SPDX-License-Identifier: GPL-2.0
4 * Loongson-1 platform IRQ support
26 * struct ls1x_intc_priv - private ls1x-intc data.
28 * @intc_base: IO Base of intc registers.
44 pending = readl(priv->intc_base + LS_REG_INTC_STATUS) & in ls1x_chained_handle_irq()
45 readl(priv->intc_base + LS_REG_INTC_EN); in ls1x_chained_handle_irq()
53 generic_handle_domain_irq(priv->domain, bit); in ls1x_chained_handle_irq()
65 writel(readl(gc->reg_base + offset) | mask, in ls_intc_set_bit()
66 gc->reg_base + offset); in ls_intc_set_bit()
68 writel(readl(gc->reg_base + offset) & ~mask, in ls_intc_set_bit()
69 gc->reg_base + offset); in ls_intc_set_bit()
75 u32 mask = data->mask; in ls_intc_set_type()
95 return -EINVAL; in ls_intc_set_type()
113 return -ENOMEM; in ls1x_intc_of_init()
115 priv->intc_base = of_iomap(node, 0); in ls1x_intc_of_init()
116 if (!priv->intc_base) { in ls1x_intc_of_init()
117 err = -ENODEV; in ls1x_intc_of_init()
123 pr_err("ls1x-irq: unable to get parent irq\n"); in ls1x_intc_of_init()
124 err = -ENODEV; in ls1x_intc_of_init()
129 priv->domain = irq_domain_add_linear(node, 32, &irq_generic_chip_ops, in ls1x_intc_of_init()
131 if (!priv->domain) { in ls1x_intc_of_init()
132 pr_err("ls1x-irq: cannot add IRQ domain\n"); in ls1x_intc_of_init()
133 err = -ENOMEM; in ls1x_intc_of_init()
137 err = irq_alloc_domain_generic_chips(priv->domain, 32, 2, in ls1x_intc_of_init()
138 node->full_name, handle_level_irq, in ls1x_intc_of_init()
142 pr_err("ls1x-irq: unable to register IRQ domain\n"); in ls1x_intc_of_init()
147 writel(0x0, priv->intc_base + LS_REG_INTC_EN); in ls1x_intc_of_init()
150 writel(0xffffffff, priv->intc_base + LS_REG_INTC_CLR); in ls1x_intc_of_init()
153 writel(0xffffffff, priv->intc_base + LS_REG_INTC_POL); in ls1x_intc_of_init()
155 gc = irq_get_domain_generic_chip(priv->domain, 0); in ls1x_intc_of_init()
157 gc->reg_base = priv->intc_base; in ls1x_intc_of_init()
159 ct = gc->chip_types; in ls1x_intc_of_init()
184 irq_domain_remove(priv->domain); in ls1x_intc_of_init()
186 iounmap(priv->intc_base); in ls1x_intc_of_init()
193 IRQCHIP_DECLARE(ls1x_intc, "loongson,ls1x-intc", ls1x_intc_of_init);