Lines Matching refs:dma
192 struct pch_spi_dma_ctrl dma; member
764 rx_dma_buf = data->dma.rx_buf_virt; in pch_spi_copy_rx_data_for_dma()
770 rx_dma_sbuf = data->dma.rx_buf_virt; in pch_spi_copy_rx_data_for_dma()
779 struct pch_spi_dma_ctrl *dma; in pch_spi_start_transfer() local
783 dma = &data->dma; in pch_spi_start_transfer()
803 dma_sync_sg_for_cpu(&data->master->dev, dma->sg_rx_p, dma->nent, in pch_spi_start_transfer()
806 dma_sync_sg_for_cpu(&data->master->dev, dma->sg_tx_p, dma->nent, in pch_spi_start_transfer()
808 memset(data->dma.tx_buf_virt, 0, PAGE_SIZE); in pch_spi_start_transfer()
810 async_tx_ack(dma->desc_rx); in pch_spi_start_transfer()
811 async_tx_ack(dma->desc_tx); in pch_spi_start_transfer()
812 kfree(dma->sg_tx_p); in pch_spi_start_transfer()
813 kfree(dma->sg_rx_p); in pch_spi_start_transfer()
860 struct pch_spi_dma_ctrl *dma; in pch_spi_request_dma() local
868 dma = &data->dma; in pch_spi_request_dma()
877 param = &dma->param_tx; in pch_spi_request_dma()
889 dma->chan_tx = chan; in pch_spi_request_dma()
892 param = &dma->param_rx; in pch_spi_request_dma()
901 dma_release_channel(dma->chan_tx); in pch_spi_request_dma()
902 dma->chan_tx = NULL; in pch_spi_request_dma()
906 dma->chan_rx = chan; in pch_spi_request_dma()
911 struct pch_spi_dma_ctrl *dma; in pch_spi_release_dma() local
913 dma = &data->dma; in pch_spi_release_dma()
914 if (dma->chan_tx) { in pch_spi_release_dma()
915 dma_release_channel(dma->chan_tx); in pch_spi_release_dma()
916 dma->chan_tx = NULL; in pch_spi_release_dma()
918 if (dma->chan_rx) { in pch_spi_release_dma()
919 dma_release_channel(dma->chan_rx); in pch_spi_release_dma()
920 dma->chan_rx = NULL; in pch_spi_release_dma()
940 struct pch_spi_dma_ctrl *dma; in pch_spi_handle_dma() local
942 dma = &data->dma; in pch_spi_handle_dma()
976 tx_dma_buf = dma->tx_buf_virt; in pch_spi_handle_dma()
981 tx_dma_sbuf = dma->tx_buf_virt; in pch_spi_handle_dma()
1015 dma->sg_rx_p = kzalloc(sizeof(struct scatterlist)*num, GFP_ATOMIC); in pch_spi_handle_dma()
1016 sg_init_table(dma->sg_rx_p, num); /* Initialize SG table */ in pch_spi_handle_dma()
1018 sg = dma->sg_rx_p; in pch_spi_handle_dma()
1023 sg_set_page(sg, virt_to_page(dma->rx_buf_virt), rem, in pch_spi_handle_dma()
1029 sg_set_page(sg, virt_to_page(dma->rx_buf_virt), size, in pch_spi_handle_dma()
1035 sg_set_page(sg, virt_to_page(dma->rx_buf_virt), size, in pch_spi_handle_dma()
1039 sg_dma_address(sg) = dma->rx_buf_dma + sg->offset; in pch_spi_handle_dma()
1041 sg = dma->sg_rx_p; in pch_spi_handle_dma()
1042 desc_rx = dmaengine_prep_slave_sg(dma->chan_rx, sg, in pch_spi_handle_dma()
1053 dma->nent = num; in pch_spi_handle_dma()
1054 dma->desc_rx = desc_rx; in pch_spi_handle_dma()
1075 dma->sg_tx_p = kzalloc(sizeof(struct scatterlist)*num, GFP_ATOMIC); in pch_spi_handle_dma()
1076 sg_init_table(dma->sg_tx_p, num); /* Initialize SG table */ in pch_spi_handle_dma()
1078 sg = dma->sg_tx_p; in pch_spi_handle_dma()
1082 sg_set_page(sg, virt_to_page(dma->tx_buf_virt), size + head, in pch_spi_handle_dma()
1088 sg_set_page(sg, virt_to_page(dma->tx_buf_virt), rem, in pch_spi_handle_dma()
1094 sg_set_page(sg, virt_to_page(dma->tx_buf_virt), size, in pch_spi_handle_dma()
1098 sg_dma_address(sg) = dma->tx_buf_dma + sg->offset; in pch_spi_handle_dma()
1100 sg = dma->sg_tx_p; in pch_spi_handle_dma()
1101 desc_tx = dmaengine_prep_slave_sg(dma->chan_tx, in pch_spi_handle_dma()
1112 dma->nent = num; in pch_spi_handle_dma()
1113 dma->desc_tx = desc_tx; in pch_spi_handle_dma()
1317 struct pch_spi_dma_ctrl *dma; in pch_free_dma_buf() local
1319 dma = &data->dma; in pch_free_dma_buf()
1320 if (dma->tx_buf_dma) in pch_free_dma_buf()
1322 dma->tx_buf_virt, dma->tx_buf_dma); in pch_free_dma_buf()
1323 if (dma->rx_buf_dma) in pch_free_dma_buf()
1325 dma->rx_buf_virt, dma->rx_buf_dma); in pch_free_dma_buf()
1332 struct pch_spi_dma_ctrl *dma; in pch_alloc_dma_buf() local
1334 dma = &data->dma; in pch_alloc_dma_buf()
1336 dma->tx_buf_virt = dma_alloc_coherent(&board_dat->pdev->dev, in pch_alloc_dma_buf()
1337 PCH_BUF_SIZE, &dma->tx_buf_dma, GFP_KERNEL); in pch_alloc_dma_buf()
1339 dma->rx_buf_virt = dma_alloc_coherent(&board_dat->pdev->dev, in pch_alloc_dma_buf()
1340 PCH_BUF_SIZE, &dma->rx_buf_dma, GFP_KERNEL); in pch_alloc_dma_buf()