Lines Matching refs:dma

1084 	stream_t *dma = &vortex->dma_adb[adbdma];  in vortex_adbdma_setfirstbuffer()  local
1087 dma->dma_ctrl); in vortex_adbdma_setfirstbuffer()
1092 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setstartbuffer() local
1096 dma->period_real = dma->period_virt = sb; in vortex_adbdma_setstartbuffer()
1103 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setbuffers() local
1105 dma->period_bytes = psize; in vortex_adbdma_setbuffers()
1106 dma->nr_periods = count; in vortex_adbdma_setbuffers()
1108 dma->cfg0 = 0; in vortex_adbdma_setbuffers()
1109 dma->cfg1 = 0; in vortex_adbdma_setbuffers()
1114 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); in vortex_adbdma_setbuffers()
1117 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_adbdma_setbuffers()
1120 dma->cfg0 |= 0x12000000; in vortex_adbdma_setbuffers()
1121 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1124 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_adbdma_setbuffers()
1127 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); in vortex_adbdma_setbuffers()
1130 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_adbdma_setbuffers()
1133 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1136 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_adbdma_setbuffers()
1143 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0); in vortex_adbdma_setbuffers()
1144 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1); in vortex_adbdma_setbuffers()
1154 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setmode() local
1156 dma->dma_unknown = stereo; in vortex_adbdma_setmode()
1157 dma->dma_ctrl = in vortex_adbdma_setmode()
1158 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_adbdma_setmode()
1160 dma->dma_ctrl = in vortex_adbdma_setmode()
1161 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_adbdma_setmode()
1163 dma->dma_ctrl = in vortex_adbdma_setmode()
1164 (dma->dma_ctrl & ~DIR_MASK) | ((dir << DIR_SHIFT) & DIR_MASK); in vortex_adbdma_setmode()
1165 dma->dma_ctrl = in vortex_adbdma_setmode()
1166 (dma->dma_ctrl & ~FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_adbdma_setmode()
1169 dma->dma_ctrl); in vortex_adbdma_setmode()
1175 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_bufshift() local
1181 if (dma->nr_periods >= 4) in vortex_adbdma_bufshift()
1182 delta = (page - dma->period_real) & 3; in vortex_adbdma_bufshift()
1184 delta = (page - dma->period_real); in vortex_adbdma_bufshift()
1186 delta += dma->nr_periods; in vortex_adbdma_bufshift()
1192 if (dma->nr_periods > 4) { in vortex_adbdma_bufshift()
1195 p = dma->period_virt + i + 4; in vortex_adbdma_bufshift()
1196 if (p >= dma->nr_periods) in vortex_adbdma_bufshift()
1197 p -= dma->nr_periods; in vortex_adbdma_bufshift()
1199 pp = dma->period_real + i; in vortex_adbdma_bufshift()
1205 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_bufshift()
1206 dma->period_bytes * p)); in vortex_adbdma_bufshift()
1212 dma->period_virt += delta; in vortex_adbdma_bufshift()
1213 dma->period_real = page; in vortex_adbdma_bufshift()
1214 if (dma->period_virt >= dma->nr_periods) in vortex_adbdma_bufshift()
1215 dma->period_virt -= dma->nr_periods; in vortex_adbdma_bufshift()
1219 adbdma, dma->period_virt, dma->period_real, delta); in vortex_adbdma_bufshift()
1226 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resetup() local
1230 for (i=0 ; i < 4 && i < dma->nr_periods; i++) { in vortex_adbdma_resetup()
1232 p = dma->period_virt + i; in vortex_adbdma_resetup()
1233 if (p >= dma->nr_periods) in vortex_adbdma_resetup()
1234 p -= dma->nr_periods; in vortex_adbdma_resetup()
1236 pp = dma->period_real + i; in vortex_adbdma_resetup()
1237 if (dma->nr_periods < 4) { in vortex_adbdma_resetup()
1238 if (pp >= dma->nr_periods) in vortex_adbdma_resetup()
1239 pp -= dma->nr_periods; in vortex_adbdma_resetup()
1247 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_resetup()
1248 dma->period_bytes * p)); in vortex_adbdma_resetup()
1256 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_getlinearpos() local
1261 if (dma->nr_periods >= 4) in vortex_adbdma_getlinearpos()
1262 delta = (page - dma->period_real) & 3; in vortex_adbdma_getlinearpos()
1264 delta = (page - dma->period_real); in vortex_adbdma_getlinearpos()
1266 delta += dma->nr_periods; in vortex_adbdma_getlinearpos()
1268 return (dma->period_virt + delta) * dma->period_bytes in vortex_adbdma_getlinearpos()
1269 + (temp & (dma->period_bytes - 1)); in vortex_adbdma_getlinearpos()
1275 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_startfifo() local
1277 switch (dma->fifo_status) { in vortex_adbdma_startfifo()
1280 dma->fifo_enabled ? 1 : 0); in vortex_adbdma_startfifo()
1285 dma->dma_ctrl); in vortex_adbdma_startfifo()
1286 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1288 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1291 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1293 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1296 dma->fifo_status = FIFO_START; in vortex_adbdma_startfifo()
1301 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resumefifo() local
1304 switch (dma->fifo_status) { in vortex_adbdma_resumefifo()
1307 dma->dma_ctrl); in vortex_adbdma_resumefifo()
1308 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1310 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1313 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1315 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1318 dma->fifo_status = FIFO_START; in vortex_adbdma_resumefifo()
1323 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_pausefifo() local
1326 switch (dma->fifo_status) { in vortex_adbdma_pausefifo()
1328 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1333 dma->dma_ctrl); in vortex_adbdma_pausefifo()
1334 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1338 dma->fifo_status = FIFO_PAUSE; in vortex_adbdma_pausefifo()
1343 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_stopfifo() local
1346 if (dma->fifo_status == FIFO_START) in vortex_adbdma_stopfifo()
1347 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_stopfifo()
1349 else if (dma->fifo_status == FIFO_STOP) in vortex_adbdma_stopfifo()
1351 dma->fifo_status = FIFO_STOP; in vortex_adbdma_stopfifo()
1352 dma->fifo_enabled = 0; in vortex_adbdma_stopfifo()
1361 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setfirstbuffer() local
1363 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setfirstbuffer()
1368 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setstartbuffer() local
1372 dma->period_real = dma->period_virt = sb; in vortex_wtdma_setstartbuffer()
1379 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setbuffers() local
1381 dma->period_bytes = psize; in vortex_wtdma_setbuffers()
1382 dma->nr_periods = count; in vortex_wtdma_setbuffers()
1384 dma->cfg0 = 0; in vortex_wtdma_setbuffers()
1385 dma->cfg1 = 0; in vortex_wtdma_setbuffers()
1390 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); in vortex_wtdma_setbuffers()
1392 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_wtdma_setbuffers()
1395 dma->cfg0 |= 0x12000000; in vortex_wtdma_setbuffers()
1396 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1398 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_wtdma_setbuffers()
1401 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); in vortex_wtdma_setbuffers()
1403 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_wtdma_setbuffers()
1406 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1408 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_wtdma_setbuffers()
1411 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0); in vortex_wtdma_setbuffers()
1412 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG1 + (wtdma << 3), dma->cfg1); in vortex_wtdma_setbuffers()
1422 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setmode() local
1425 dma->dma_unknown = d; in vortex_wtdma_setmode()
1426 dma->dma_ctrl = 0; in vortex_wtdma_setmode()
1427 dma->dma_ctrl = in vortex_wtdma_setmode()
1428 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_wtdma_setmode()
1430 dma->dma_ctrl = in vortex_wtdma_setmode()
1431 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_wtdma_setmode()
1433 dma->dma_ctrl |= (1 << DIR_SHIFT); in vortex_wtdma_setmode()
1435 dma->dma_ctrl = in vortex_wtdma_setmode()
1436 (dma->dma_ctrl & FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_wtdma_setmode()
1438 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setmode()
1443 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_bufshift() local
1450 if (dma->nr_periods >= 4) in vortex_wtdma_bufshift()
1451 delta = (page - dma->period_real) & 3; in vortex_wtdma_bufshift()
1453 delta = (page - dma->period_real); in vortex_wtdma_bufshift()
1455 delta += dma->nr_periods; in vortex_wtdma_bufshift()
1461 if (dma->nr_periods > 4) { in vortex_wtdma_bufshift()
1464 p = dma->period_virt + i + 4; in vortex_wtdma_bufshift()
1465 if (p >= dma->nr_periods) in vortex_wtdma_bufshift()
1466 p -= dma->nr_periods; in vortex_wtdma_bufshift()
1468 pp = dma->period_real + i; in vortex_wtdma_bufshift()
1474 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_wtdma_bufshift()
1475 dma->period_bytes * p)); in vortex_wtdma_bufshift()
1481 dma->period_virt += delta; in vortex_wtdma_bufshift()
1482 if (dma->period_virt >= dma->nr_periods) in vortex_wtdma_bufshift()
1483 dma->period_virt -= dma->nr_periods; in vortex_wtdma_bufshift()
1484 dma->period_real = page; in vortex_wtdma_bufshift()
1488 dma->period_virt, delta); in vortex_wtdma_bufshift()
1511 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_getlinearpos() local
1515 temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); in vortex_wtdma_getlinearpos()
1521 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_startfifo() local
1524 switch (dma->fifo_status) { in vortex_wtdma_startfifo()
1527 dma->fifo_enabled ? 1 : 0); in vortex_wtdma_startfifo()
1532 dma->dma_ctrl); in vortex_wtdma_startfifo()
1533 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1535 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1538 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1540 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1543 dma->fifo_status = FIFO_START; in vortex_wtdma_startfifo()
1548 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_resumefifo() local
1551 switch (dma->fifo_status) { in vortex_wtdma_resumefifo()
1554 dma->dma_ctrl); in vortex_wtdma_resumefifo()
1555 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1557 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1560 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1562 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1565 dma->fifo_status = FIFO_START; in vortex_wtdma_resumefifo()
1570 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_pausefifo() local
1573 switch (dma->fifo_status) { in vortex_wtdma_pausefifo()
1575 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1580 dma->dma_ctrl); in vortex_wtdma_pausefifo()
1581 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1585 dma->fifo_status = FIFO_PAUSE; in vortex_wtdma_pausefifo()
1590 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_stopfifo() local
1593 if (dma->fifo_status == FIFO_START) in vortex_wtdma_stopfifo()
1594 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_stopfifo()
1596 else if (dma->fifo_status == FIFO_STOP) in vortex_wtdma_stopfifo()
1598 dma->fifo_status = FIFO_STOP; in vortex_wtdma_stopfifo()
1599 dma->fifo_enabled = 0; in vortex_wtdma_stopfifo()
2116 vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir, in vortex_adb_allocroute() argument
2123 if (dma >= 0) { in vortex_adb_allocroute()
2126 vortex->dma_adb[dma].resources, en, in vortex_adb_allocroute()
2130 if ((dma = in vortex_adb_allocroute()
2136 stream = &vortex->dma_adb[dma]; in vortex_adb_allocroute()
2137 stream->dma = dma; in vortex_adb_allocroute()
2203 dma, in vortex_adb_allocroute()
2225 dma, in vortex_adb_allocroute()
2234 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2257 p->dma = dma; in vortex_adb_allocroute()
2268 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2316 src[0], dma); in vortex_adb_allocroute()
2324 src[1], dma); in vortex_adb_allocroute()
2327 vortex->dma_adb[dma].nr_ch = nr_ch; in vortex_adb_allocroute()
2348 return dma; in vortex_adb_allocroute()