Lines Matching refs:gicp

40 static int gicp_idx_to_spi(struct mvebu_gicp *gicp, int idx)  in gicp_idx_to_spi()  argument
44 for (i = 0; i < gicp->spi_ranges_cnt; i++) { in gicp_idx_to_spi()
45 struct mvebu_gicp_spi_range *r = &gicp->spi_ranges[i]; in gicp_idx_to_spi()
58 struct mvebu_gicp *gicp = data->chip_data; in gicp_compose_msi_msg() local
59 phys_addr_t setspi = gicp->res->start + GICP_SETSPI_NSR_OFFSET; in gicp_compose_msi_msg()
60 phys_addr_t clrspi = gicp->res->start + GICP_CLRSPI_NSR_OFFSET; in gicp_compose_msi_msg()
83 struct mvebu_gicp *gicp = domain->host_data; in gicp_irq_domain_alloc() local
88 spin_lock(&gicp->spi_lock); in gicp_irq_domain_alloc()
89 hwirq = find_first_zero_bit(gicp->spi_bitmap, gicp->spi_cnt); in gicp_irq_domain_alloc()
90 if (hwirq == gicp->spi_cnt) { in gicp_irq_domain_alloc()
91 spin_unlock(&gicp->spi_lock); in gicp_irq_domain_alloc()
94 __set_bit(hwirq, gicp->spi_bitmap); in gicp_irq_domain_alloc()
95 spin_unlock(&gicp->spi_lock); in gicp_irq_domain_alloc()
100 fwspec.param[1] = gicp_idx_to_spi(gicp, hwirq) - 32; in gicp_irq_domain_alloc()
109 dev_err(gicp->dev, "Cannot allocate parent IRQ\n"); in gicp_irq_domain_alloc()
114 &gicp_irq_chip, gicp); in gicp_irq_domain_alloc()
123 spin_lock(&gicp->spi_lock); in gicp_irq_domain_alloc()
124 __clear_bit(hwirq, gicp->spi_bitmap); in gicp_irq_domain_alloc()
125 spin_unlock(&gicp->spi_lock); in gicp_irq_domain_alloc()
132 struct mvebu_gicp *gicp = domain->host_data; in gicp_irq_domain_free() local
135 if (d->hwirq >= gicp->spi_cnt) { in gicp_irq_domain_free()
136 dev_err(gicp->dev, "Invalid hwirq %lu\n", d->hwirq); in gicp_irq_domain_free()
142 spin_lock(&gicp->spi_lock); in gicp_irq_domain_free()
143 __clear_bit(d->hwirq, gicp->spi_bitmap); in gicp_irq_domain_free()
144 spin_unlock(&gicp->spi_lock); in gicp_irq_domain_free()
170 struct mvebu_gicp *gicp; in mvebu_gicp_probe() local
176 gicp = devm_kzalloc(&pdev->dev, sizeof(*gicp), GFP_KERNEL); in mvebu_gicp_probe()
177 if (!gicp) in mvebu_gicp_probe()
180 gicp->dev = &pdev->dev; in mvebu_gicp_probe()
181 spin_lock_init(&gicp->spi_lock); in mvebu_gicp_probe()
183 gicp->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in mvebu_gicp_probe()
184 if (!gicp->res) in mvebu_gicp_probe()
191 gicp->spi_ranges_cnt = ret / 2; in mvebu_gicp_probe()
193 gicp->spi_ranges = in mvebu_gicp_probe()
195 gicp->spi_ranges_cnt, in mvebu_gicp_probe()
198 if (!gicp->spi_ranges) in mvebu_gicp_probe()
201 for (i = 0; i < gicp->spi_ranges_cnt; i++) { in mvebu_gicp_probe()
204 &gicp->spi_ranges[i].start); in mvebu_gicp_probe()
208 &gicp->spi_ranges[i].count); in mvebu_gicp_probe()
210 gicp->spi_cnt += gicp->spi_ranges[i].count; in mvebu_gicp_probe()
213 gicp->spi_bitmap = devm_kcalloc(&pdev->dev, in mvebu_gicp_probe()
214 BITS_TO_LONGS(gicp->spi_cnt), sizeof(long), in mvebu_gicp_probe()
216 if (!gicp->spi_bitmap) in mvebu_gicp_probe()
233 gicp->spi_cnt, in mvebu_gicp_probe()
235 &gicp_domain_ops, gicp); in mvebu_gicp_probe()
248 platform_set_drvdata(pdev, gicp); in mvebu_gicp_probe()