hsdma 264 drivers/dma/mediatek/mtk-hsdma.c static struct device *hsdma2dev(struct mtk_hsdma_device *hsdma) hsdma 266 drivers/dma/mediatek/mtk-hsdma.c return hsdma->ddev.dev; hsdma 269 drivers/dma/mediatek/mtk-hsdma.c static u32 mtk_dma_read(struct mtk_hsdma_device *hsdma, u32 reg) hsdma 271 drivers/dma/mediatek/mtk-hsdma.c return readl(hsdma->base + reg); hsdma 274 drivers/dma/mediatek/mtk-hsdma.c static void mtk_dma_write(struct mtk_hsdma_device *hsdma, u32 reg, u32 val) hsdma 276 drivers/dma/mediatek/mtk-hsdma.c writel(val, hsdma->base + reg); hsdma 279 drivers/dma/mediatek/mtk-hsdma.c static void mtk_dma_rmw(struct mtk_hsdma_device *hsdma, u32 reg, hsdma 284 drivers/dma/mediatek/mtk-hsdma.c val = mtk_dma_read(hsdma, reg); hsdma 287 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, reg, val); hsdma 290 drivers/dma/mediatek/mtk-hsdma.c static void mtk_dma_set(struct mtk_hsdma_device *hsdma, u32 reg, u32 val) hsdma 292 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_rmw(hsdma, reg, 0, val); hsdma 295 drivers/dma/mediatek/mtk-hsdma.c static void mtk_dma_clr(struct mtk_hsdma_device *hsdma, u32 reg, u32 val) hsdma 297 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_rmw(hsdma, reg, val, 0); hsdma 305 drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_busy_wait(struct mtk_hsdma_device *hsdma) hsdma 309 drivers/dma/mediatek/mtk-hsdma.c return readl_poll_timeout(hsdma->base + MTK_HSDMA_GLO, status, hsdma 315 drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma, hsdma 328 drivers/dma/mediatek/mtk-hsdma.c ring->txd = dma_alloc_coherent(hsdma2dev(hsdma), pc->sz_ring, hsdma 347 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_clr(hsdma, MTK_HSDMA_GLO, MTK_HSDMA_GLO_DMA); hsdma 348 drivers/dma/mediatek/mtk-hsdma.c err = mtk_hsdma_busy_wait(hsdma); hsdma 353 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_set(hsdma, MTK_HSDMA_RESET, hsdma 355 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_clr(hsdma, MTK_HSDMA_RESET, hsdma 359 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_BASE, ring->tphys); hsdma 360 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_CNT, MTK_DMA_SIZE); hsdma 361 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_CPU, ring->cur_tptr); hsdma 362 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_DMA, 0); hsdma 363 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_BASE, ring->rphys); hsdma 364 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_CNT, MTK_DMA_SIZE); hsdma 365 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_CPU, ring->cur_rptr); hsdma 366 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_DMA, 0); hsdma 369 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_set(hsdma, MTK_HSDMA_GLO, MTK_HSDMA_GLO_DMA); hsdma 372 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_DLYINT, MTK_HSDMA_DLYINT_DEFAULT); hsdma 375 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_set(hsdma, MTK_HSDMA_INT_ENABLE, MTK_HSDMA_INT_RXDONE); hsdma 383 drivers/dma/mediatek/mtk-hsdma.c dma_free_coherent(hsdma2dev(hsdma), hsdma 388 drivers/dma/mediatek/mtk-hsdma.c static void mtk_hsdma_free_pchan(struct mtk_hsdma_device *hsdma, hsdma 394 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_clr(hsdma, MTK_HSDMA_GLO, MTK_HSDMA_GLO_DMA); hsdma 395 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_busy_wait(hsdma); hsdma 398 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_clr(hsdma, MTK_HSDMA_INT_ENABLE, MTK_HSDMA_INT_RXDONE); hsdma 399 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_BASE, 0); hsdma 400 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_CNT, 0); hsdma 401 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_CPU, 0); hsdma 402 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_BASE, 0); hsdma 403 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_CNT, 0); hsdma 404 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_CPU, MTK_DMA_SIZE - 1); hsdma 408 drivers/dma/mediatek/mtk-hsdma.c dma_free_coherent(hsdma2dev(hsdma), hsdma 412 drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_issue_pending_vdesc(struct mtk_hsdma_device *hsdma, hsdma 422 drivers/dma/mediatek/mtk-hsdma.c spin_lock_irqsave(&hsdma->lock, flags); hsdma 432 drivers/dma/mediatek/mtk-hsdma.c spin_unlock_irqrestore(&hsdma->lock, flags); hsdma 453 drivers/dma/mediatek/mtk-hsdma.c hsdma->soc->ls0 | MTK_HSDMA_DESC_PLEN(tlen)); hsdma 488 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_TX_CPU, ring->cur_tptr); hsdma 490 drivers/dma/mediatek/mtk-hsdma.c spin_unlock_irqrestore(&hsdma->lock, flags); hsdma 495 drivers/dma/mediatek/mtk-hsdma.c static void mtk_hsdma_issue_vchan_pending(struct mtk_hsdma_device *hsdma, hsdma 509 drivers/dma/mediatek/mtk-hsdma.c err = mtk_hsdma_issue_pending_vdesc(hsdma, hsdma->pc, hvd); hsdma 533 drivers/dma/mediatek/mtk-hsdma.c static void mtk_hsdma_free_rooms_in_ring(struct mtk_hsdma_device *hsdma) hsdma 546 drivers/dma/mediatek/mtk-hsdma.c status = mtk_dma_read(hsdma, MTK_HSDMA_INT_STATUS); hsdma 550 drivers/dma/mediatek/mtk-hsdma.c pc = hsdma->pc; hsdma 569 drivers/dma/mediatek/mtk-hsdma.c if (!(desc2 & hsdma->soc->ddone)) hsdma 574 drivers/dma/mediatek/mtk-hsdma.c dev_err(hsdma2dev(hsdma), "cb->vd cannot be null\n"); hsdma 622 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_RX_CPU, pc->ring.cur_rptr); hsdma 630 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_INT_STATUS, status); hsdma 633 drivers/dma/mediatek/mtk-hsdma.c for (i = 0; i < hsdma->dma_requests; i++) { hsdma 634 drivers/dma/mediatek/mtk-hsdma.c hvc = &hsdma->vc[i]; hsdma 636 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_issue_vchan_pending(hsdma, hvc); hsdma 642 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_set(hsdma, MTK_HSDMA_INT_ENABLE, MTK_HSDMA_INT_RXDONE); hsdma 647 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma = devid; hsdma 653 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_clr(hsdma, MTK_HSDMA_INT_ENABLE, MTK_HSDMA_INT_RXDONE); hsdma 655 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_free_rooms_in_ring(hsdma); hsdma 708 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma = to_hsdma_dev(c); hsdma 715 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_issue_vchan_pending(hsdma, hvc); hsdma 810 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma = to_hsdma_dev(c); hsdma 818 drivers/dma/mediatek/mtk-hsdma.c if (!refcount_read(&hsdma->pc_refcnt)) { hsdma 819 drivers/dma/mediatek/mtk-hsdma.c err = mtk_hsdma_alloc_pchan(hsdma, hsdma->pc); hsdma 826 drivers/dma/mediatek/mtk-hsdma.c refcount_set(&hsdma->pc_refcnt, 1); hsdma 828 drivers/dma/mediatek/mtk-hsdma.c refcount_inc(&hsdma->pc_refcnt); hsdma 836 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma = to_hsdma_dev(c); hsdma 842 drivers/dma/mediatek/mtk-hsdma.c if (!refcount_dec_and_test(&hsdma->pc_refcnt)) hsdma 845 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_free_pchan(hsdma, hsdma->pc); hsdma 848 drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_hw_init(struct mtk_hsdma_device *hsdma) hsdma 852 drivers/dma/mediatek/mtk-hsdma.c pm_runtime_enable(hsdma2dev(hsdma)); hsdma 853 drivers/dma/mediatek/mtk-hsdma.c pm_runtime_get_sync(hsdma2dev(hsdma)); hsdma 855 drivers/dma/mediatek/mtk-hsdma.c err = clk_prepare_enable(hsdma->clk); hsdma 859 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_INT_ENABLE, 0); hsdma 860 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_GLO, MTK_HSDMA_GLO_DEFAULT); hsdma 865 drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_hw_deinit(struct mtk_hsdma_device *hsdma) hsdma 867 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_GLO, 0); hsdma 869 drivers/dma/mediatek/mtk-hsdma.c clk_disable_unprepare(hsdma->clk); hsdma 871 drivers/dma/mediatek/mtk-hsdma.c pm_runtime_put_sync(hsdma2dev(hsdma)); hsdma 872 drivers/dma/mediatek/mtk-hsdma.c pm_runtime_disable(hsdma2dev(hsdma)); hsdma 896 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma; hsdma 902 drivers/dma/mediatek/mtk-hsdma.c hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL); hsdma 903 drivers/dma/mediatek/mtk-hsdma.c if (!hsdma) hsdma 906 drivers/dma/mediatek/mtk-hsdma.c dd = &hsdma->ddev; hsdma 909 drivers/dma/mediatek/mtk-hsdma.c hsdma->base = devm_ioremap_resource(&pdev->dev, res); hsdma 910 drivers/dma/mediatek/mtk-hsdma.c if (IS_ERR(hsdma->base)) hsdma 911 drivers/dma/mediatek/mtk-hsdma.c return PTR_ERR(hsdma->base); hsdma 913 drivers/dma/mediatek/mtk-hsdma.c hsdma->soc = of_device_get_match_data(&pdev->dev); hsdma 914 drivers/dma/mediatek/mtk-hsdma.c if (!hsdma->soc) { hsdma 919 drivers/dma/mediatek/mtk-hsdma.c hsdma->clk = devm_clk_get(&pdev->dev, "hsdma"); hsdma 920 drivers/dma/mediatek/mtk-hsdma.c if (IS_ERR(hsdma->clk)) { hsdma 923 drivers/dma/mediatek/mtk-hsdma.c return PTR_ERR(hsdma->clk); hsdma 932 drivers/dma/mediatek/mtk-hsdma.c hsdma->irq = res->start; hsdma 934 drivers/dma/mediatek/mtk-hsdma.c refcount_set(&hsdma->pc_refcnt, 0); hsdma 935 drivers/dma/mediatek/mtk-hsdma.c spin_lock_init(&hsdma->lock); hsdma 953 drivers/dma/mediatek/mtk-hsdma.c hsdma->dma_requests = MTK_HSDMA_NR_VCHANS; hsdma 956 drivers/dma/mediatek/mtk-hsdma.c &hsdma->dma_requests)) { hsdma 962 drivers/dma/mediatek/mtk-hsdma.c hsdma->pc = devm_kcalloc(&pdev->dev, MTK_HSDMA_NR_MAX_PCHANS, hsdma 963 drivers/dma/mediatek/mtk-hsdma.c sizeof(*hsdma->pc), GFP_KERNEL); hsdma 964 drivers/dma/mediatek/mtk-hsdma.c if (!hsdma->pc) hsdma 967 drivers/dma/mediatek/mtk-hsdma.c hsdma->vc = devm_kcalloc(&pdev->dev, hsdma->dma_requests, hsdma 968 drivers/dma/mediatek/mtk-hsdma.c sizeof(*hsdma->vc), GFP_KERNEL); hsdma 969 drivers/dma/mediatek/mtk-hsdma.c if (!hsdma->vc) hsdma 972 drivers/dma/mediatek/mtk-hsdma.c for (i = 0; i < hsdma->dma_requests; i++) { hsdma 973 drivers/dma/mediatek/mtk-hsdma.c vc = &hsdma->vc[i]; hsdma 985 drivers/dma/mediatek/mtk-hsdma.c of_dma_xlate_by_chan_id, hsdma); hsdma 992 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_hw_init(hsdma); hsdma 994 drivers/dma/mediatek/mtk-hsdma.c err = devm_request_irq(&pdev->dev, hsdma->irq, hsdma 996 drivers/dma/mediatek/mtk-hsdma.c dev_name(&pdev->dev), hsdma); hsdma 1003 drivers/dma/mediatek/mtk-hsdma.c platform_set_drvdata(pdev, hsdma); hsdma 1017 drivers/dma/mediatek/mtk-hsdma.c struct mtk_hsdma_device *hsdma = platform_get_drvdata(pdev); hsdma 1022 drivers/dma/mediatek/mtk-hsdma.c for (i = 0; i < hsdma->dma_requests; i++) { hsdma 1023 drivers/dma/mediatek/mtk-hsdma.c vc = &hsdma->vc[i]; hsdma 1030 drivers/dma/mediatek/mtk-hsdma.c mtk_dma_write(hsdma, MTK_HSDMA_INT_ENABLE, 0); hsdma 1033 drivers/dma/mediatek/mtk-hsdma.c synchronize_irq(hsdma->irq); hsdma 1036 drivers/dma/mediatek/mtk-hsdma.c mtk_hsdma_hw_deinit(hsdma); hsdma 1038 drivers/dma/mediatek/mtk-hsdma.c dma_async_device_unregister(&hsdma->ddev); hsdma 183 drivers/staging/mt7621-dma/mtk-hsdma.c static inline u32 mtk_hsdma_read(struct mtk_hsdam_engine *hsdma, u32 reg) hsdma 185 drivers/staging/mt7621-dma/mtk-hsdma.c return readl(hsdma->base + reg); hsdma 188 drivers/staging/mt7621-dma/mtk-hsdma.c static inline void mtk_hsdma_write(struct mtk_hsdam_engine *hsdma, hsdma 191 drivers/staging/mt7621-dma/mtk-hsdma.c writel(val, hsdma->base + reg); hsdma 194 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_reset_chan(struct mtk_hsdam_engine *hsdma, hsdma 200 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx); hsdma 201 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx); hsdma 203 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG, hsdma 205 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG, hsdma 209 drivers/staging/mt7621-dma/mtk-hsdma.c static void hsdma_dump_reg(struct mtk_hsdam_engine *hsdma) hsdma 211 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "tbase %08x, tcnt %08x, " \ hsdma 214 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_TX_BASE), hsdma 215 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_TX_CNT), hsdma 216 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_TX_CTX), hsdma 217 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_TX_DTX), hsdma 218 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_RX_BASE), hsdma 219 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_RX_CNT), hsdma 220 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_RX_CRX), hsdma 221 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX)); hsdma 223 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "info %08x, glo %08x, delay %08x, " \ hsdma 225 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_INFO), hsdma 226 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG), hsdma 227 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_DELAY_INT), hsdma 228 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS), hsdma 229 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_read(hsdma, HSDMA_REG_INT_MASK)); hsdma 232 drivers/staging/mt7621-dma/mtk-hsdma.c static void hsdma_dump_desc(struct mtk_hsdam_engine *hsdma, hsdma 239 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "tx idx: %d, rx idx: %d\n", hsdma 246 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "%d tx addr0: %08x, flags %08x, " \ hsdma 253 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_reset(struct mtk_hsdam_engine *hsdma, hsdma 259 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0); hsdma 262 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0); hsdma 275 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_reset_chan(hsdma, chan); hsdma 278 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0); hsdma 281 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT); hsdma 287 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan); hsdma 293 drivers/staging/mt7621-dma/mtk-hsdma.c clear_bit(chan->id, &hsdma->chan_issued); hsdma 301 drivers/staging/mt7621-dma/mtk-hsdma.c while (mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG) & hsdma 304 drivers/staging/mt7621-dma/mtk-hsdma.c hsdma_dump_desc(hsdma, chan); hsdma 305 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_reset(hsdma, chan); hsdma 306 drivers/staging/mt7621-dma/mtk-hsdma.c dev_err(hsdma->ddev.dev, "timeout, reset it\n"); hsdma 315 drivers/staging/mt7621-dma/mtk-hsdma.c static int mtk_hsdma_start_transfer(struct mtk_hsdam_engine *hsdma, hsdma 381 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx); hsdma 401 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_chan_done(struct mtk_hsdam_engine *hsdma, hsdma 417 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "no desc to complete\n"); hsdma 421 drivers/staging/mt7621-dma/mtk-hsdma.c set_bit(chan->id, &hsdma->chan_issued); hsdma 427 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma = devid; hsdma 430 drivers/staging/mt7621-dma/mtk-hsdma.c status = mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS); hsdma 435 drivers/staging/mt7621-dma/mtk-hsdma.c tasklet_schedule(&hsdma->task); hsdma 437 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "unhandle irq status %08x\n", status); hsdma 439 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_INT_STATUS, status); hsdma 447 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan); hsdma 452 drivers/staging/mt7621-dma/mtk-hsdma.c set_bit(chan->id, &hsdma->chan_issued); hsdma 453 drivers/staging/mt7621-dma/mtk-hsdma.c tasklet_schedule(&hsdma->task); hsdma 455 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "no desc to issue\n"); hsdma 501 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_tx(struct mtk_hsdam_engine *hsdma) hsdma 505 drivers/staging/mt7621-dma/mtk-hsdma.c if (test_and_clear_bit(0, &hsdma->chan_issued)) { hsdma 506 drivers/staging/mt7621-dma/mtk-hsdma.c chan = &hsdma->chan[0]; hsdma 508 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_start_transfer(hsdma, chan); hsdma 510 drivers/staging/mt7621-dma/mtk-hsdma.c dev_dbg(hsdma->ddev.dev, "chan 0 no desc to issue\n"); hsdma 514 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_rx(struct mtk_hsdam_engine *hsdma) hsdma 519 drivers/staging/mt7621-dma/mtk-hsdma.c chan = &hsdma->chan[0]; hsdma 521 drivers/staging/mt7621-dma/mtk-hsdma.c drx_idx = mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX); hsdma 532 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx); hsdma 534 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_chan_done(hsdma, chan); hsdma 539 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma = (struct mtk_hsdam_engine *)arg; hsdma 541 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_rx(hsdma); hsdma 542 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_tx(hsdma); hsdma 545 drivers/staging/mt7621-dma/mtk-hsdma.c static int mtk_hsdam_alloc_desc(struct mtk_hsdam_engine *hsdma, hsdma 550 drivers/staging/mt7621-dma/mtk-hsdma.c chan->tx_ring = dma_alloc_coherent(hsdma->ddev.dev, hsdma 567 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdam_free_desc(struct mtk_hsdam_engine *hsdma, hsdma 571 drivers/staging/mt7621-dma/mtk-hsdma.c dma_free_coherent(hsdma->ddev.dev, hsdma 579 drivers/staging/mt7621-dma/mtk-hsdma.c static int mtk_hsdma_init(struct mtk_hsdam_engine *hsdma) hsdma 586 drivers/staging/mt7621-dma/mtk-hsdma.c chan = &hsdma->chan[0]; hsdma 587 drivers/staging/mt7621-dma/mtk-hsdma.c ret = mtk_hsdam_alloc_desc(hsdma, chan); hsdma 592 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, chan->desc_addr); hsdma 593 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, HSDMA_DESCS_NUM); hsdma 595 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, chan->desc_addr + hsdma 597 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, HSDMA_DESCS_NUM); hsdma 599 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_reset_chan(hsdma, chan); hsdma 602 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0); hsdma 605 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT); hsdma 608 drivers/staging/mt7621-dma/mtk-hsdma.c reg = mtk_hsdma_read(hsdma, HSDMA_REG_INFO); hsdma 609 drivers/staging/mt7621-dma/mtk-hsdma.c dev_info(hsdma->ddev.dev, "rx: %d, tx: %d\n", hsdma 613 drivers/staging/mt7621-dma/mtk-hsdma.c hsdma_dump_reg(hsdma); hsdma 618 drivers/staging/mt7621-dma/mtk-hsdma.c static void mtk_hsdma_uninit(struct mtk_hsdam_engine *hsdma) hsdma 623 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0); hsdma 626 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0); hsdma 629 drivers/staging/mt7621-dma/mtk-hsdma.c chan = &hsdma->chan[0]; hsdma 630 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdam_free_desc(hsdma, chan); hsdma 633 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, 0); hsdma 634 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, 0); hsdma 636 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, 0); hsdma 637 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, 0); hsdma 639 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_reset_chan(hsdma, chan); hsdma 651 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma; hsdma 666 drivers/staging/mt7621-dma/mtk-hsdma.c hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL); hsdma 667 drivers/staging/mt7621-dma/mtk-hsdma.c if (!hsdma) hsdma 674 drivers/staging/mt7621-dma/mtk-hsdma.c hsdma->base = base + HSDMA_BASE_OFFSET; hsdma 675 drivers/staging/mt7621-dma/mtk-hsdma.c tasklet_init(&hsdma->task, mtk_hsdma_tasklet, (unsigned long)hsdma); hsdma 681 drivers/staging/mt7621-dma/mtk-hsdma.c 0, dev_name(&pdev->dev), hsdma); hsdma 689 drivers/staging/mt7621-dma/mtk-hsdma.c dd = &hsdma->ddev; hsdma 698 drivers/staging/mt7621-dma/mtk-hsdma.c dd->dev->dma_parms = &hsdma->dma_parms; hsdma 702 drivers/staging/mt7621-dma/mtk-hsdma.c chan = &hsdma->chan[0]; hsdma 708 drivers/staging/mt7621-dma/mtk-hsdma.c ret = mtk_hsdma_init(hsdma); hsdma 721 drivers/staging/mt7621-dma/mtk-hsdma.c of_dma_xlate_by_chan_id, hsdma); hsdma 727 drivers/staging/mt7621-dma/mtk-hsdma.c platform_set_drvdata(pdev, hsdma); hsdma 738 drivers/staging/mt7621-dma/mtk-hsdma.c struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev); hsdma 740 drivers/staging/mt7621-dma/mtk-hsdma.c mtk_hsdma_uninit(hsdma); hsdma 743 drivers/staging/mt7621-dma/mtk-hsdma.c dma_async_device_unregister(&hsdma->ddev);