diff options
Diffstat (limited to 'sound/pci/au88x0')
-rw-r--r-- | sound/pci/au88x0/au88x0.h | 7 | ||||
-rw-r--r-- | sound/pci/au88x0/au88x0_core.c | 40 | ||||
-rw-r--r-- | sound/pci/au88x0/au88x0_pcm.c | 14 |
3 files changed, 22 insertions, 39 deletions
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h index 4aad35bba11a..cf46bba563cf 100644 --- a/sound/pci/au88x0/au88x0.h +++ b/sound/pci/au88x0/au88x0.h | |||
@@ -125,7 +125,6 @@ typedef struct { | |||
125 | /* Virtual page extender stuff */ | 125 | /* Virtual page extender stuff */ |
126 | int nr_periods; | 126 | int nr_periods; |
127 | int period_bytes; | 127 | int period_bytes; |
128 | struct snd_sg_buf *sgbuf; /* DMA Scatter Gather struct */ | ||
129 | int period_real; | 128 | int period_real; |
130 | int period_virt; | 129 | int period_virt; |
131 | 130 | ||
@@ -195,16 +194,14 @@ static void vortex_adb_setsrc(vortex_t * vortex, int adbdma, | |||
195 | 194 | ||
196 | /* DMA Engines. */ | 195 | /* DMA Engines. */ |
197 | static void vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, | 196 | static void vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, |
198 | struct snd_sg_buf * sgbuf, int size, | 197 | int size, int count); |
199 | int count); | ||
200 | static void vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, | 198 | static void vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, |
201 | int dir, int fmt, int d, | 199 | int dir, int fmt, int d, |
202 | u32 offset); | 200 | u32 offset); |
203 | static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb); | 201 | static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb); |
204 | #ifndef CHIP_AU8810 | 202 | #ifndef CHIP_AU8810 |
205 | static void vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, | 203 | static void vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma, |
206 | struct snd_sg_buf * sgbuf, int size, | 204 | int size, int count); |
207 | int count); | ||
208 | static void vortex_wtdma_setmode(vortex_t * vortex, int wtdma, int ie, int fmt, int d, /*int e, */ | 205 | static void vortex_wtdma_setmode(vortex_t * vortex, int wtdma, int ie, int fmt, int d, /*int e, */ |
209 | u32 offset); | 206 | u32 offset); |
210 | static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb); | 207 | static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb); |
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 333c62de8620..b070e5714514 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c | |||
@@ -427,7 +427,7 @@ static void vortex_mixer_init(vortex_t * vortex) | |||
427 | 427 | ||
428 | /* Set clipping ceiling (this may be all wrong). */ | 428 | /* Set clipping ceiling (this may be all wrong). */ |
429 | /* | 429 | /* |
430 | for (x = 0; x > 0x80; x++) { | 430 | for (x = 0; x < 0x80; x++) { |
431 | hwwrite(vortex->mmio, VORTEX_MIXER_CLIP + (x << 2), 0x3ffff); | 431 | hwwrite(vortex->mmio, VORTEX_MIXER_CLIP + (x << 2), 0x3ffff); |
432 | } | 432 | } |
433 | */ | 433 | */ |
@@ -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)); |
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index f9a58b4a30eb..b9d2f202cf9b 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c | |||
@@ -189,7 +189,6 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, | |||
189 | { | 189 | { |
190 | vortex_t *chip = snd_pcm_substream_chip(substream); | 190 | vortex_t *chip = snd_pcm_substream_chip(substream); |
191 | stream_t *stream = (stream_t *) (substream->runtime->private_data); | 191 | stream_t *stream = (stream_t *) (substream->runtime->private_data); |
192 | struct snd_sg_buf *sgbuf; | ||
193 | int err; | 192 | int err; |
194 | 193 | ||
195 | // Alloc buffer memory. | 194 | // Alloc buffer memory. |
@@ -199,8 +198,6 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, | |||
199 | printk(KERN_ERR "Vortex: pcm page alloc failed!\n"); | 198 | printk(KERN_ERR "Vortex: pcm page alloc failed!\n"); |
200 | return err; | 199 | return err; |
201 | } | 200 | } |
202 | //sgbuf = (struct snd_sg_buf *) substream->runtime->dma_private; | ||
203 | sgbuf = snd_pcm_substream_sgbuf(substream); | ||
204 | /* | 201 | /* |
205 | printk(KERN_INFO "Vortex: periods %d, period_bytes %d, channels = %d\n", params_periods(hw_params), | 202 | printk(KERN_INFO "Vortex: periods %d, period_bytes %d, channels = %d\n", params_periods(hw_params), |
206 | params_period_bytes(hw_params), params_channels(hw_params)); | 203 | params_period_bytes(hw_params), params_channels(hw_params)); |
@@ -226,7 +223,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, | |||
226 | stream = substream->runtime->private_data = &chip->dma_adb[dma]; | 223 | stream = substream->runtime->private_data = &chip->dma_adb[dma]; |
227 | stream->substream = substream; | 224 | stream->substream = substream; |
228 | /* Setup Buffers. */ | 225 | /* Setup Buffers. */ |
229 | vortex_adbdma_setbuffers(chip, dma, sgbuf, | 226 | vortex_adbdma_setbuffers(chip, dma, |
230 | params_period_bytes(hw_params), | 227 | params_period_bytes(hw_params), |
231 | params_periods(hw_params)); | 228 | params_periods(hw_params)); |
232 | } | 229 | } |
@@ -240,7 +237,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, | |||
240 | &chip->dma_wt[substream->number]; | 237 | &chip->dma_wt[substream->number]; |
241 | stream->dma = substream->number; | 238 | stream->dma = substream->number; |
242 | stream->substream = substream; | 239 | stream->substream = substream; |
243 | vortex_wtdma_setbuffers(chip, substream->number, sgbuf, | 240 | vortex_wtdma_setbuffers(chip, substream->number, |
244 | params_period_bytes(hw_params), | 241 | params_period_bytes(hw_params), |
245 | params_periods(hw_params)); | 242 | params_periods(hw_params)); |
246 | } | 243 | } |
@@ -392,13 +389,6 @@ static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substr | |||
392 | return (bytes_to_frames(substream->runtime, current_ptr)); | 389 | return (bytes_to_frames(substream->runtime, current_ptr)); |
393 | } | 390 | } |
394 | 391 | ||
395 | /* Page callback. */ | ||
396 | /* | ||
397 | static struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) { | ||
398 | |||
399 | |||
400 | } | ||
401 | */ | ||
402 | /* operators */ | 392 | /* operators */ |
403 | static struct snd_pcm_ops snd_vortex_playback_ops = { | 393 | static struct snd_pcm_ops snd_vortex_playback_ops = { |
404 | .open = snd_vortex_pcm_open, | 394 | .open = snd_vortex_pcm_open, |