Lines Matching refs:hsu
151 if (nr >= chip->hsu->nr_channels) in hsu_dma_get_status()
154 hsuc = &chip->hsu->chan[nr]; in hsu_dma_get_status()
209 if (nr >= chip->hsu->nr_channels) in hsu_dma_do_irq()
212 hsuc = &chip->hsu->chan[nr]; in hsu_dma_do_irq()
418 struct hsu_dma *hsu; in hsu_dma_probe() local
423 hsu = devm_kzalloc(chip->dev, sizeof(*hsu), GFP_KERNEL); in hsu_dma_probe()
424 if (!hsu) in hsu_dma_probe()
427 chip->hsu = hsu; in hsu_dma_probe()
430 hsu->nr_channels = (chip->length - chip->offset) / HSU_DMA_CHAN_LENGTH; in hsu_dma_probe()
432 hsu->chan = devm_kcalloc(chip->dev, hsu->nr_channels, in hsu_dma_probe()
433 sizeof(*hsu->chan), GFP_KERNEL); in hsu_dma_probe()
434 if (!hsu->chan) in hsu_dma_probe()
437 INIT_LIST_HEAD(&hsu->dma.channels); in hsu_dma_probe()
438 for (i = 0; i < hsu->nr_channels; i++) { in hsu_dma_probe()
439 struct hsu_dma_chan *hsuc = &hsu->chan[i]; in hsu_dma_probe()
442 vchan_init(&hsuc->vchan, &hsu->dma); in hsu_dma_probe()
448 dma_cap_set(DMA_SLAVE, hsu->dma.cap_mask); in hsu_dma_probe()
449 dma_cap_set(DMA_PRIVATE, hsu->dma.cap_mask); in hsu_dma_probe()
451 hsu->dma.device_free_chan_resources = hsu_dma_free_chan_resources; in hsu_dma_probe()
453 hsu->dma.device_prep_slave_sg = hsu_dma_prep_slave_sg; in hsu_dma_probe()
455 hsu->dma.device_issue_pending = hsu_dma_issue_pending; in hsu_dma_probe()
456 hsu->dma.device_tx_status = hsu_dma_tx_status; in hsu_dma_probe()
458 hsu->dma.device_config = hsu_dma_slave_config; in hsu_dma_probe()
459 hsu->dma.device_pause = hsu_dma_pause; in hsu_dma_probe()
460 hsu->dma.device_resume = hsu_dma_resume; in hsu_dma_probe()
461 hsu->dma.device_terminate_all = hsu_dma_terminate_all; in hsu_dma_probe()
462 hsu->dma.device_synchronize = hsu_dma_synchronize; in hsu_dma_probe()
464 hsu->dma.src_addr_widths = HSU_DMA_BUSWIDTHS; in hsu_dma_probe()
465 hsu->dma.dst_addr_widths = HSU_DMA_BUSWIDTHS; in hsu_dma_probe()
466 hsu->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in hsu_dma_probe()
467 hsu->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in hsu_dma_probe()
469 hsu->dma.dev = chip->dev; in hsu_dma_probe()
471 dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK); in hsu_dma_probe()
473 ret = dma_async_device_register(&hsu->dma); in hsu_dma_probe()
477 dev_info(chip->dev, "Found HSU DMA, %d channels\n", hsu->nr_channels); in hsu_dma_probe()
484 struct hsu_dma *hsu = chip->hsu; in hsu_dma_remove() local
487 dma_async_device_unregister(&hsu->dma); in hsu_dma_remove()
489 for (i = 0; i < hsu->nr_channels; i++) { in hsu_dma_remove()
490 struct hsu_dma_chan *hsuc = &hsu->chan[i]; in hsu_dma_remove()