Lines Matching refs:dma
1072 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setfirstbuffer() local
1075 dma->dma_ctrl); in vortex_adbdma_setfirstbuffer()
1080 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setstartbuffer() local
1084 dma->period_real = dma->period_virt = sb; in vortex_adbdma_setstartbuffer()
1091 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setbuffers() local
1093 dma->period_bytes = psize; in vortex_adbdma_setbuffers()
1094 dma->nr_periods = count; in vortex_adbdma_setbuffers()
1096 dma->cfg0 = 0; in vortex_adbdma_setbuffers()
1097 dma->cfg1 = 0; in vortex_adbdma_setbuffers()
1102 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); in vortex_adbdma_setbuffers()
1105 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_adbdma_setbuffers()
1109 dma->cfg0 |= 0x12000000; in vortex_adbdma_setbuffers()
1110 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1113 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_adbdma_setbuffers()
1117 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); in vortex_adbdma_setbuffers()
1120 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_adbdma_setbuffers()
1124 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); in vortex_adbdma_setbuffers()
1127 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_adbdma_setbuffers()
1134 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0); in vortex_adbdma_setbuffers()
1135 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1); in vortex_adbdma_setbuffers()
1145 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_setmode() local
1147 dma->dma_unknown = stereo; in vortex_adbdma_setmode()
1148 dma->dma_ctrl = in vortex_adbdma_setmode()
1149 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_adbdma_setmode()
1151 dma->dma_ctrl = in vortex_adbdma_setmode()
1152 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_adbdma_setmode()
1154 dma->dma_ctrl = in vortex_adbdma_setmode()
1155 (dma->dma_ctrl & ~DIR_MASK) | ((dir << DIR_SHIFT) & DIR_MASK); in vortex_adbdma_setmode()
1156 dma->dma_ctrl = in vortex_adbdma_setmode()
1157 (dma->dma_ctrl & ~FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_adbdma_setmode()
1160 dma->dma_ctrl); in vortex_adbdma_setmode()
1166 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_bufshift() local
1172 if (dma->nr_periods >= 4) in vortex_adbdma_bufshift()
1173 delta = (page - dma->period_real) & 3; in vortex_adbdma_bufshift()
1175 delta = (page - dma->period_real); in vortex_adbdma_bufshift()
1177 delta += dma->nr_periods; in vortex_adbdma_bufshift()
1183 if (dma->nr_periods > 4) { in vortex_adbdma_bufshift()
1186 p = dma->period_virt + i + 4; in vortex_adbdma_bufshift()
1187 if (p >= dma->nr_periods) in vortex_adbdma_bufshift()
1188 p -= dma->nr_periods; in vortex_adbdma_bufshift()
1190 pp = dma->period_real + i; in vortex_adbdma_bufshift()
1196 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_bufshift()
1197 dma->period_bytes * p)); in vortex_adbdma_bufshift()
1203 dma->period_virt += delta; in vortex_adbdma_bufshift()
1204 dma->period_real = page; in vortex_adbdma_bufshift()
1205 if (dma->period_virt >= dma->nr_periods) in vortex_adbdma_bufshift()
1206 dma->period_virt -= dma->nr_periods; in vortex_adbdma_bufshift()
1210 adbdma, dma->period_virt, dma->period_real, delta); in vortex_adbdma_bufshift()
1217 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resetup() local
1221 for (i=0 ; i < 4 && i < dma->nr_periods; i++) { in vortex_adbdma_resetup()
1223 p = dma->period_virt + i; in vortex_adbdma_resetup()
1224 if (p >= dma->nr_periods) in vortex_adbdma_resetup()
1225 p -= dma->nr_periods; in vortex_adbdma_resetup()
1227 pp = dma->period_real + i; in vortex_adbdma_resetup()
1228 if (dma->nr_periods < 4) { in vortex_adbdma_resetup()
1229 if (pp >= dma->nr_periods) in vortex_adbdma_resetup()
1230 pp -= dma->nr_periods; in vortex_adbdma_resetup()
1238 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_adbdma_resetup()
1239 dma->period_bytes * p)); in vortex_adbdma_resetup()
1247 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_getlinearpos() local
1252 if (dma->nr_periods >= 4) in vortex_adbdma_getlinearpos()
1253 delta = (page - dma->period_real) & 3; in vortex_adbdma_getlinearpos()
1255 delta = (page - dma->period_real); in vortex_adbdma_getlinearpos()
1257 delta += dma->nr_periods; in vortex_adbdma_getlinearpos()
1259 return (dma->period_virt + delta) * dma->period_bytes in vortex_adbdma_getlinearpos()
1260 + (temp & (dma->period_bytes - 1)); in vortex_adbdma_getlinearpos()
1266 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_startfifo() local
1268 switch (dma->fifo_status) { in vortex_adbdma_startfifo()
1271 dma->fifo_enabled ? 1 : 0); in vortex_adbdma_startfifo()
1276 dma->dma_ctrl); in vortex_adbdma_startfifo()
1277 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1279 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1282 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_startfifo()
1284 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_startfifo()
1287 dma->fifo_status = FIFO_START; in vortex_adbdma_startfifo()
1292 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_resumefifo() local
1295 switch (dma->fifo_status) { in vortex_adbdma_resumefifo()
1298 dma->dma_ctrl); in vortex_adbdma_resumefifo()
1299 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1301 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1304 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_resumefifo()
1306 dma->fifo_enabled ? 1 : 0, 0); in vortex_adbdma_resumefifo()
1309 dma->fifo_status = FIFO_START; in vortex_adbdma_resumefifo()
1314 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_pausefifo() local
1317 switch (dma->fifo_status) { in vortex_adbdma_pausefifo()
1319 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1324 dma->dma_ctrl); in vortex_adbdma_pausefifo()
1325 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_pausefifo()
1329 dma->fifo_status = FIFO_PAUSE; in vortex_adbdma_pausefifo()
1334 stream_t *dma = &vortex->dma_adb[adbdma]; in vortex_adbdma_stopfifo() local
1337 if (dma->fifo_status == FIFO_START) in vortex_adbdma_stopfifo()
1338 vortex_fifo_setadbctrl(vortex, adbdma, dma->dma_unknown, in vortex_adbdma_stopfifo()
1340 else if (dma->fifo_status == FIFO_STOP) in vortex_adbdma_stopfifo()
1342 dma->fifo_status = FIFO_STOP; in vortex_adbdma_stopfifo()
1343 dma->fifo_enabled = 0; in vortex_adbdma_stopfifo()
1352 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setfirstbuffer() local
1354 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setfirstbuffer()
1359 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setstartbuffer() local
1363 dma->period_real = dma->period_virt = sb; in vortex_wtdma_setstartbuffer()
1370 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setbuffers() local
1372 dma->period_bytes = psize; in vortex_wtdma_setbuffers()
1373 dma->nr_periods = count; in vortex_wtdma_setbuffers()
1375 dma->cfg0 = 0; in vortex_wtdma_setbuffers()
1376 dma->cfg1 = 0; in vortex_wtdma_setbuffers()
1381 dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); in vortex_wtdma_setbuffers()
1383 snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); in vortex_wtdma_setbuffers()
1387 dma->cfg0 |= 0x12000000; in vortex_wtdma_setbuffers()
1388 dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1390 snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); in vortex_wtdma_setbuffers()
1394 dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); in vortex_wtdma_setbuffers()
1396 snd_pcm_sgbuf_get_addr(dma->substream, psize)); in vortex_wtdma_setbuffers()
1400 dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); in vortex_wtdma_setbuffers()
1402 snd_pcm_sgbuf_get_addr(dma->substream, 0)); in vortex_wtdma_setbuffers()
1405 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0); in vortex_wtdma_setbuffers()
1406 hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG1 + (wtdma << 3), dma->cfg1); in vortex_wtdma_setbuffers()
1416 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_setmode() local
1419 dma->dma_unknown = d; in vortex_wtdma_setmode()
1420 dma->dma_ctrl = 0; in vortex_wtdma_setmode()
1421 dma->dma_ctrl = in vortex_wtdma_setmode()
1422 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); in vortex_wtdma_setmode()
1424 dma->dma_ctrl = in vortex_wtdma_setmode()
1425 (dma->dma_ctrl & ~IE_MASK) | ((ie << IE_SHIFT) & IE_MASK); in vortex_wtdma_setmode()
1427 dma->dma_ctrl |= (1 << DIR_SHIFT); in vortex_wtdma_setmode()
1429 dma->dma_ctrl = in vortex_wtdma_setmode()
1430 (dma->dma_ctrl & FMT_MASK) | ((fmt << FMT_SHIFT) & FMT_MASK); in vortex_wtdma_setmode()
1432 hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl); in vortex_wtdma_setmode()
1437 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_bufshift() local
1443 if (dma->nr_periods >= 4) in vortex_wtdma_bufshift()
1444 delta = (page - dma->period_real) & 3; in vortex_wtdma_bufshift()
1446 delta = (page - dma->period_real); in vortex_wtdma_bufshift()
1448 delta += dma->nr_periods; in vortex_wtdma_bufshift()
1454 if (dma->nr_periods > 4) { in vortex_wtdma_bufshift()
1457 p = dma->period_virt + i + 4; in vortex_wtdma_bufshift()
1458 if (p >= dma->nr_periods) in vortex_wtdma_bufshift()
1459 p -= dma->nr_periods; in vortex_wtdma_bufshift()
1461 pp = dma->period_real + i; in vortex_wtdma_bufshift()
1467 snd_pcm_sgbuf_get_addr(dma->substream, in vortex_wtdma_bufshift()
1468 dma->period_bytes * p)); in vortex_wtdma_bufshift()
1474 dma->period_virt += delta; in vortex_wtdma_bufshift()
1475 if (dma->period_virt >= dma->nr_periods) in vortex_wtdma_bufshift()
1476 dma->period_virt -= dma->nr_periods; in vortex_wtdma_bufshift()
1477 dma->period_real = page; in vortex_wtdma_bufshift()
1481 dma->period_virt, delta); in vortex_wtdma_bufshift()
1504 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_getlinearpos() local
1508 temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); in vortex_wtdma_getlinearpos()
1514 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_startfifo() local
1517 switch (dma->fifo_status) { in vortex_wtdma_startfifo()
1520 dma->fifo_enabled ? 1 : 0); in vortex_wtdma_startfifo()
1525 dma->dma_ctrl); in vortex_wtdma_startfifo()
1526 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1528 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1531 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_startfifo()
1533 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_startfifo()
1536 dma->fifo_status = FIFO_START; in vortex_wtdma_startfifo()
1541 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_resumefifo() local
1544 switch (dma->fifo_status) { in vortex_wtdma_resumefifo()
1547 dma->dma_ctrl); in vortex_wtdma_resumefifo()
1548 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1550 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1553 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_resumefifo()
1555 dma->fifo_enabled ? 1 : 0, 0); in vortex_wtdma_resumefifo()
1558 dma->fifo_status = FIFO_START; in vortex_wtdma_resumefifo()
1563 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_pausefifo() local
1566 switch (dma->fifo_status) { in vortex_wtdma_pausefifo()
1568 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1573 dma->dma_ctrl); in vortex_wtdma_pausefifo()
1574 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_pausefifo()
1578 dma->fifo_status = FIFO_PAUSE; in vortex_wtdma_pausefifo()
1583 stream_t *dma = &vortex->dma_wt[wtdma]; in vortex_wtdma_stopfifo() local
1586 if (dma->fifo_status == FIFO_START) in vortex_wtdma_stopfifo()
1587 vortex_fifo_setwtctrl(vortex, wtdma, dma->dma_unknown, in vortex_wtdma_stopfifo()
1589 else if (dma->fifo_status == FIFO_STOP) in vortex_wtdma_stopfifo()
1591 dma->fifo_status = FIFO_STOP; in vortex_wtdma_stopfifo()
1592 dma->fifo_enabled = 0; in vortex_wtdma_stopfifo()
2109 vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir, in vortex_adb_allocroute() argument
2116 if (dma >= 0) { in vortex_adb_allocroute()
2119 vortex->dma_adb[dma].resources, en, in vortex_adb_allocroute()
2123 if ((dma = in vortex_adb_allocroute()
2129 stream = &vortex->dma_adb[dma]; in vortex_adb_allocroute()
2130 stream->dma = dma; in vortex_adb_allocroute()
2194 dma, in vortex_adb_allocroute()
2216 dma, in vortex_adb_allocroute()
2225 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2248 p->dma = dma; in vortex_adb_allocroute()
2259 ADB_DMA(stream->dma), in vortex_adb_allocroute()
2308 src[0], dma); in vortex_adb_allocroute()
2316 src[1], dma); in vortex_adb_allocroute()
2319 vortex->dma_adb[dma].nr_ch = nr_ch; in vortex_adb_allocroute()
2340 return dma; in vortex_adb_allocroute()