Lines Matching refs:xbar

66 	struct ti_am335x_xbar_data *xbar = dev_get_drvdata(dev);  in ti_am335x_xbar_free()  local
72 ti_am335x_xbar_write(xbar->iomem, map->dma_line, 0); in ti_am335x_xbar_free()
80 struct ti_am335x_xbar_data *xbar = platform_get_drvdata(pdev); in ti_am335x_xbar_route_allocate() local
86 if (dma_spec->args[2] >= xbar->xbar_events) { in ti_am335x_xbar_route_allocate()
92 if (dma_spec->args[0] >= xbar->dma_requests) { in ti_am335x_xbar_route_allocate()
120 ti_am335x_xbar_write(xbar->iomem, map->dma_line, map->mux_val); in ti_am335x_xbar_route_allocate()
135 struct ti_am335x_xbar_data *xbar; in ti_am335x_xbar_probe() local
142 xbar = devm_kzalloc(&pdev->dev, sizeof(*xbar), GFP_KERNEL); in ti_am335x_xbar_probe()
143 if (!xbar) in ti_am335x_xbar_probe()
160 &xbar->dma_requests)) { in ti_am335x_xbar_probe()
164 xbar->dma_requests = TI_AM335X_XBAR_LINES; in ti_am335x_xbar_probe()
168 if (of_property_read_u32(node, "dma-requests", &xbar->xbar_events)) { in ti_am335x_xbar_probe()
172 xbar->xbar_events = TI_AM335X_XBAR_LINES; in ti_am335x_xbar_probe()
179 xbar->iomem = iomem; in ti_am335x_xbar_probe()
181 xbar->dmarouter.dev = &pdev->dev; in ti_am335x_xbar_probe()
182 xbar->dmarouter.route_free = ti_am335x_xbar_free; in ti_am335x_xbar_probe()
184 platform_set_drvdata(pdev, xbar); in ti_am335x_xbar_probe()
187 for (i = 0; i < xbar->dma_requests; i++) in ti_am335x_xbar_probe()
188 ti_am335x_xbar_write(xbar->iomem, i, 0); in ti_am335x_xbar_probe()
191 &xbar->dmarouter); in ti_am335x_xbar_probe()
218 static inline void ti_dra7_xbar_write(void __iomem *iomem, int xbar, u16 val) in ti_dra7_xbar_write() argument
220 writew_relaxed(val, iomem + (xbar * 2)); in ti_dra7_xbar_write()
225 struct ti_dra7_xbar_data *xbar = dev_get_drvdata(dev); in ti_dra7_xbar_free() local
231 ti_dra7_xbar_write(xbar->iomem, map->xbar_out, xbar->safe_val); in ti_dra7_xbar_free()
232 mutex_lock(&xbar->mutex); in ti_dra7_xbar_free()
233 clear_bit(map->xbar_out, xbar->dma_inuse); in ti_dra7_xbar_free()
234 mutex_unlock(&xbar->mutex); in ti_dra7_xbar_free()
242 struct ti_dra7_xbar_data *xbar = platform_get_drvdata(pdev); in ti_dra7_xbar_route_allocate() local
245 if (dma_spec->args[0] >= xbar->xbar_requests) { in ti_dra7_xbar_route_allocate()
264 mutex_lock(&xbar->mutex); in ti_dra7_xbar_route_allocate()
265 map->xbar_out = find_first_zero_bit(xbar->dma_inuse, in ti_dra7_xbar_route_allocate()
266 xbar->dma_requests); in ti_dra7_xbar_route_allocate()
267 if (map->xbar_out == xbar->dma_requests) { in ti_dra7_xbar_route_allocate()
268 mutex_unlock(&xbar->mutex); in ti_dra7_xbar_route_allocate()
273 set_bit(map->xbar_out, xbar->dma_inuse); in ti_dra7_xbar_route_allocate()
274 mutex_unlock(&xbar->mutex); in ti_dra7_xbar_route_allocate()
278 dma_spec->args[0] = map->xbar_out + xbar->dma_offset; in ti_dra7_xbar_route_allocate()
283 ti_dra7_xbar_write(xbar->iomem, map->xbar_out, map->xbar_in); in ti_dra7_xbar_route_allocate()
322 struct ti_dra7_xbar_data *xbar; in ti_dra7_xbar_probe() local
332 xbar = devm_kzalloc(&pdev->dev, sizeof(*xbar), GFP_KERNEL); in ti_dra7_xbar_probe()
333 if (!xbar) in ti_dra7_xbar_probe()
350 &xbar->dma_requests)) { in ti_dra7_xbar_probe()
354 xbar->dma_requests = TI_DRA7_XBAR_OUTPUTS; in ti_dra7_xbar_probe()
358 xbar->dma_inuse = devm_kcalloc(&pdev->dev, in ti_dra7_xbar_probe()
359 BITS_TO_LONGS(xbar->dma_requests), in ti_dra7_xbar_probe()
361 if (!xbar->dma_inuse) in ti_dra7_xbar_probe()
364 if (of_property_read_u32(node, "dma-requests", &xbar->xbar_requests)) { in ti_dra7_xbar_probe()
368 xbar->xbar_requests = TI_DRA7_XBAR_INPUTS; in ti_dra7_xbar_probe()
372 xbar->safe_val = (u16)safe_val; in ti_dra7_xbar_probe()
398 xbar->dma_inuse); in ti_dra7_xbar_probe()
407 xbar->iomem = iomem; in ti_dra7_xbar_probe()
409 xbar->dmarouter.dev = &pdev->dev; in ti_dra7_xbar_probe()
410 xbar->dmarouter.route_free = ti_dra7_xbar_free; in ti_dra7_xbar_probe()
411 xbar->dma_offset = *(u32 *)match->data; in ti_dra7_xbar_probe()
413 mutex_init(&xbar->mutex); in ti_dra7_xbar_probe()
414 platform_set_drvdata(pdev, xbar); in ti_dra7_xbar_probe()
417 for (i = 0; i < xbar->dma_requests; i++) { in ti_dra7_xbar_probe()
418 if (!test_bit(i, xbar->dma_inuse)) in ti_dra7_xbar_probe()
419 ti_dra7_xbar_write(xbar->iomem, i, xbar->safe_val); in ti_dra7_xbar_probe()
423 &xbar->dmarouter); in ti_dra7_xbar_probe()
426 for (i = 0; i < xbar->dma_requests; i++) { in ti_dra7_xbar_probe()
427 if (!test_bit(i, xbar->dma_inuse)) in ti_dra7_xbar_probe()
428 ti_dra7_xbar_write(xbar->iomem, i, i); in ti_dra7_xbar_probe()