diff options
Diffstat (limited to 'sound/pci/au88x0/au88x0_core.c')
-rw-r--r-- | sound/pci/au88x0/au88x0_core.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 1900fa6bc51..b070e571451 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c | |||
@@ -1097,19 +1097,12 @@ static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb) | |||
1097 | 1097 | ||
1098 | static void | 1098 | static void |
1099 | vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, | 1099 | vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, |
1100 | struct snd_sg_buf * sgbuf, int psize, int count) | 1100 | int psize, int count) |
1101 | { | 1101 | { |
1102 | stream_t *dma = &vortex->dma_adb[adbdma]; | 1102 | stream_t *dma = &vortex->dma_adb[adbdma]; |
1103 | 1103 | ||
1104 | if (sgbuf == NULL) { | ||
1105 | printk(KERN_INFO "vortex: FATAL: sgbuf is NULL!\n"); | ||
1106 | return; | ||
1107 | } | ||
1108 | //printk(KERN_INFO "vortex: page count = %d, tblcount = %d\n", count, sgbuf->tblsize); | ||
1109 | |||
1110 | dma->period_bytes = psize; | 1104 | dma->period_bytes = psize; |
1111 | dma->nr_periods = count; | 1105 | dma->nr_periods = count; |
1112 | dma->sgbuf = sgbuf; | ||
1113 | 1106 | ||
1114 | dma->cfg0 = 0; | 1107 | dma->cfg0 = 0; |
1115 | dma->cfg1 = 0; | 1108 | dma->cfg1 = 0; |
@@ -1120,26 +1113,26 @@ vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, | |||
1120 | dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); | 1113 | dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize - 1); |
1121 | hwwrite(vortex->mmio, | 1114 | hwwrite(vortex->mmio, |
1122 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0xc, | 1115 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0xc, |
1123 | snd_sgbuf_get_addr(sgbuf, psize * 3)); | 1116 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); |
1124 | /* 3 pages */ | 1117 | /* 3 pages */ |
1125 | case 3: | 1118 | case 3: |
1126 | dma->cfg0 |= 0x12000000; | 1119 | dma->cfg0 |= 0x12000000; |
1127 | dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); | 1120 | dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); |
1128 | hwwrite(vortex->mmio, | 1121 | hwwrite(vortex->mmio, |
1129 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x8, | 1122 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x8, |
1130 | snd_sgbuf_get_addr(sgbuf, psize * 2)); | 1123 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); |
1131 | /* 2 pages */ | 1124 | /* 2 pages */ |
1132 | case 2: | 1125 | case 2: |
1133 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); | 1126 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); |
1134 | hwwrite(vortex->mmio, | 1127 | hwwrite(vortex->mmio, |
1135 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x4, | 1128 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x4, |
1136 | snd_sgbuf_get_addr(sgbuf, psize)); | 1129 | snd_pcm_sgbuf_get_addr(dma->substream, psize)); |
1137 | /* 1 page */ | 1130 | /* 1 page */ |
1138 | case 1: | 1131 | case 1: |
1139 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); | 1132 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); |
1140 | hwwrite(vortex->mmio, | 1133 | hwwrite(vortex->mmio, |
1141 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4), | 1134 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4), |
1142 | snd_sgbuf_get_addr(sgbuf, 0)); | 1135 | snd_pcm_sgbuf_get_addr(dma->substream, 0)); |
1143 | break; | 1136 | break; |
1144 | } | 1137 | } |
1145 | //printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); | 1138 | //printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); |
@@ -1205,7 +1198,7 @@ static int vortex_adbdma_bufshift(vortex_t * vortex, int adbdma) | |||
1205 | //hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr); | 1198 | //hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr); |
1206 | hwwrite(vortex->mmio, | 1199 | hwwrite(vortex->mmio, |
1207 | VORTEX_ADBDMA_BUFBASE + (((adbdma << 2) + pp) << 2), | 1200 | VORTEX_ADBDMA_BUFBASE + (((adbdma << 2) + pp) << 2), |
1208 | snd_sgbuf_get_addr(dma->sgbuf, | 1201 | snd_pcm_sgbuf_get_addr(dma->substream, |
1209 | dma->period_bytes * p)); | 1202 | dma->period_bytes * p)); |
1210 | /* Force write thru cache. */ | 1203 | /* Force write thru cache. */ |
1211 | hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + | 1204 | hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + |
@@ -1244,7 +1237,10 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) { | |||
1244 | if (pp >= 4) | 1237 | if (pp >= 4) |
1245 | pp -= 4; | 1238 | pp -= 4; |
1246 | } | 1239 | } |
1247 | hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), snd_sgbuf_get_addr(dma->sgbuf, dma->period_bytes * p)); | 1240 | hwwrite(vortex->mmio, |
1241 | VORTEX_ADBDMA_BUFBASE + (((adbdma << 2) + pp) << 2), | ||
1242 | snd_pcm_sgbuf_get_addr(dma->substream, | ||
1243 | dma->period_bytes * p)); | ||
1248 | /* Force write thru cache. */ | 1244 | /* Force write thru cache. */ |
1249 | hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2)); | 1245 | hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2)); |
1250 | } | 1246 | } |
@@ -1367,13 +1363,12 @@ static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb) | |||
1367 | 1363 | ||
1368 | static void | 1364 | static void |
1369 | vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, | 1365 | vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, |
1370 | struct snd_sg_buf * sgbuf, int psize, int count) | 1366 | int psize, int count) |
1371 | { | 1367 | { |
1372 | stream_t *dma = &vortex->dma_wt[wtdma]; | 1368 | stream_t *dma = &vortex->dma_wt[wtdma]; |
1373 | 1369 | ||
1374 | dma->period_bytes = psize; | 1370 | dma->period_bytes = psize; |
1375 | dma->nr_periods = count; | 1371 | dma->nr_periods = count; |
1376 | dma->sgbuf = sgbuf; | ||
1377 | 1372 | ||
1378 | dma->cfg0 = 0; | 1373 | dma->cfg0 = 0; |
1379 | dma->cfg1 = 0; | 1374 | dma->cfg1 = 0; |
@@ -1383,23 +1378,23 @@ vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, | |||
1383 | case 4: | 1378 | case 4: |
1384 | dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); | 1379 | dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); |
1385 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc, | 1380 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc, |
1386 | snd_sgbuf_get_addr(sgbuf, psize * 3)); | 1381 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); |
1387 | /* 3 pages */ | 1382 | /* 3 pages */ |
1388 | case 3: | 1383 | case 3: |
1389 | dma->cfg0 |= 0x12000000; | 1384 | dma->cfg0 |= 0x12000000; |
1390 | dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); | 1385 | dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); |
1391 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x8, | 1386 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x8, |
1392 | snd_sgbuf_get_addr(sgbuf, psize * 2)); | 1387 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); |
1393 | /* 2 pages */ | 1388 | /* 2 pages */ |
1394 | case 2: | 1389 | case 2: |
1395 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); | 1390 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); |
1396 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4, | 1391 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4, |
1397 | snd_sgbuf_get_addr(sgbuf, psize)); | 1392 | snd_pcm_sgbuf_get_addr(dma->substream, psize)); |
1398 | /* 1 page */ | 1393 | /* 1 page */ |
1399 | case 1: | 1394 | case 1: |
1400 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); | 1395 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); |
1401 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4), | 1396 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4), |
1402 | snd_sgbuf_get_addr(sgbuf, 0)); | 1397 | snd_pcm_sgbuf_get_addr(dma->substream, 0)); |
1403 | break; | 1398 | break; |
1404 | } | 1399 | } |
1405 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0); | 1400 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0); |
@@ -1465,7 +1460,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma) | |||
1465 | hwwrite(vortex->mmio, | 1460 | hwwrite(vortex->mmio, |
1466 | VORTEX_WTDMA_BUFBASE + | 1461 | VORTEX_WTDMA_BUFBASE + |
1467 | (((wtdma << 2) + pp) << 2), | 1462 | (((wtdma << 2) + pp) << 2), |
1468 | snd_sgbuf_get_addr(dma->sgbuf, dma->period_bytes * p)); | 1463 | snd_pcm_sgbuf_get_addr(dma->substream, |
1464 | dma->period_bytes * p)); | ||
1469 | /* Force write thru cache. */ | 1465 | /* Force write thru cache. */ |
1470 | hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE + | 1466 | hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE + |
1471 | (((wtdma << 2) + pp) << 2)); | 1467 | (((wtdma << 2) + pp) << 2)); |