mtk-hsdma.c (c1144d29f405ce1f4e6ede6482beb3d0d09750c6) mtk-hsdma.c (750afb08ca71310fcf0c4e2cb1565c63b8235b60)
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2017-2018 MediaTek Inc.
3
4/*
5 * Driver for MediaTek High-Speed DMA Controller
6 *
7 * Author: Sean Wang <sean.wang@mediatek.com>
8 *

--- 311 unchanged lines hidden (view full) ---

320
321 memset(pc, 0, sizeof(*pc));
322
323 /*
324 * Allocate ring space where [0 ... MTK_DMA_SIZE - 1] is for TX ring
325 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
326 */
327 pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2017-2018 MediaTek Inc.
3
4/*
5 * Driver for MediaTek High-Speed DMA Controller
6 *
7 * Author: Sean Wang <sean.wang@mediatek.com>
8 *

--- 311 unchanged lines hidden (view full) ---

320
321 memset(pc, 0, sizeof(*pc));
322
323 /*
324 * Allocate ring space where [0 ... MTK_DMA_SIZE - 1] is for TX ring
325 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
326 */
327 pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
328 ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
329 &ring->tphys, GFP_NOWAIT);
328 ring->txd = dma_alloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
329 &ring->tphys, GFP_NOWAIT);
330 if (!ring->txd)
331 return -ENOMEM;
332
333 ring->rxd = &ring->txd[MTK_DMA_SIZE];
334 ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
335 ring->cur_tptr = 0;
336 ring->cur_rptr = MTK_DMA_SIZE - 1;
337

--- 719 unchanged lines hidden ---
330 if (!ring->txd)
331 return -ENOMEM;
332
333 ring->rxd = &ring->txd[MTK_DMA_SIZE];
334 ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
335 ring->cur_tptr = 0;
336 ring->cur_rptr = MTK_DMA_SIZE - 1;
337

--- 719 unchanged lines hidden ---