tag | line | file | source code |
dmap | 133 | drivers/sound/audio.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 144 | drivers/sound/audio.c | p = dmap->qtail; |
dmap | 146 | drivers/sound/audio.c | for (i = dmap->qlen; i < dmap->nbufs; i++) |
dmap | 148 | drivers/sound/audio.c | memset (dmap->raw_buf + p * dmap->fragment_size, |
dmap | 149 | drivers/sound/audio.c | dmap->neutral_byte, |
dmap | 150 | drivers/sound/audio.c | dmap->fragment_size); |
dmap | 152 | drivers/sound/audio.c | p = (p + 1) % dmap->nbufs; |
dmap | 155 | drivers/sound/audio.c | dmap->flags |= DMA_CLEAN; |
dmap | 522 | drivers/sound/dev_table.h | int sound_alloc_dmap (int dev, struct dma_buffparms *dmap, int chan); |
dmap | 523 | drivers/sound/dev_table.h | void sound_free_dmap (int dev, struct dma_buffparms *dmap); |
dmap | 524 | drivers/sound/dev_table.h | extern int sound_map_buffer (int dev, struct dma_buffparms *dmap, buffmem_desc *info); |
dmap | 529 | drivers/sound/dev_table.h | int sound_start_dma ( int dev, struct dma_buffparms *dmap, int chan, |
dmap | 532 | drivers/sound/dev_table.h | void sound_dma_intr (int dev, struct dma_buffparms *dmap, int chan); |
dmap | 64 | drivers/sound/dmabuf.c | reorganize_buffers (int dev, struct dma_buffparms *dmap, int recording) |
dmap | 75 | drivers/sound/dmabuf.c | if (dmap->fragment_size == 0) |
dmap | 83 | drivers/sound/dmabuf.c | dmap->neutral_byte = NEUTRAL8; |
dmap | 85 | drivers/sound/dmabuf.c | dmap->neutral_byte = NEUTRAL16; |
dmap | 119 | drivers/sound/dmabuf.c | if (dmap->subdivision == 0) /* Not already set */ |
dmap | 121 | drivers/sound/dmabuf.c | dmap->subdivision = 1; /* Init to the default value */ |
dmap | 124 | drivers/sound/dmabuf.c | dmap->subdivision = 4; /* Use shorter fragments when recording */ |
dmap | 128 | drivers/sound/dmabuf.c | bsz /= dmap->subdivision; |
dmap | 133 | drivers/sound/dmabuf.c | dmap->fragment_size = bsz; |
dmap | 141 | drivers/sound/dmabuf.c | if (dmap->fragment_size > (audio_devs[dev]->buffsize / 2)) |
dmap | 142 | drivers/sound/dmabuf.c | dmap->fragment_size = (audio_devs[dev]->buffsize / 2); |
dmap | 143 | drivers/sound/dmabuf.c | bsz = dmap->fragment_size; |
dmap | 154 | drivers/sound/dmabuf.c | if (n > dmap->max_fragments) |
dmap | 155 | drivers/sound/dmabuf.c | n = dmap->max_fragments; |
dmap | 156 | drivers/sound/dmabuf.c | dmap->nbufs = n; |
dmap | 157 | drivers/sound/dmabuf.c | dmap->bytes_in_use = n * bsz; |
dmap | 159 | drivers/sound/dmabuf.c | memset (dmap->raw_buf, |
dmap | 160 | drivers/sound/dmabuf.c | dmap->neutral_byte, |
dmap | 161 | drivers/sound/dmabuf.c | dmap->bytes_in_use); |
dmap | 163 | drivers/sound/dmabuf.c | for (i = 0; i < dmap->nbufs; i++) |
dmap | 165 | drivers/sound/dmabuf.c | dmap->counts[i] = 0; |
dmap | 168 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ALLOC_DONE | DMA_EMPTY; |
dmap | 172 | drivers/sound/dmabuf.c | dma_init_buffers (int dev, struct dma_buffparms *dmap) |
dmap | 174 | drivers/sound/dmabuf.c | if (dmap == audio_devs[dev]->dmap_out) |
dmap | 183 | drivers/sound/dmabuf.c | dmap->flags = DMA_BUSY; /* Other flags off */ |
dmap | 184 | drivers/sound/dmabuf.c | dmap->qlen = dmap->qhead = dmap->qtail = 0; |
dmap | 185 | drivers/sound/dmabuf.c | dmap->nbufs = 1; |
dmap | 186 | drivers/sound/dmabuf.c | dmap->bytes_in_use = audio_devs[dev]->buffsize; |
dmap | 188 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_NONE; |
dmap | 189 | drivers/sound/dmabuf.c | dmap->mapping_flags = 0; |
dmap | 190 | drivers/sound/dmabuf.c | dmap->neutral_byte = NEUTRAL8; |
dmap | 191 | drivers/sound/dmabuf.c | dmap->cfrag = -1; |
dmap | 192 | drivers/sound/dmabuf.c | dmap->closing = 0; |
dmap | 196 | drivers/sound/dmabuf.c | open_dmap (int dev, int mode, struct dma_buffparms *dmap, int chan) |
dmap | 198 | drivers/sound/dmabuf.c | if (dmap->flags & DMA_BUSY) |
dmap | 204 | drivers/sound/dmabuf.c | if ((err = sound_alloc_dmap (dev, dmap, chan)) < 0) |
dmap | 208 | drivers/sound/dmabuf.c | if (dmap->raw_buf == NULL) |
dmap | 217 | drivers/sound/dmabuf.c | dmap->open_mode = mode; |
dmap | 218 | drivers/sound/dmabuf.c | dmap->subdivision = dmap->underrun_count = 0; |
dmap | 219 | drivers/sound/dmabuf.c | dmap->fragment_size = 0; |
dmap | 220 | drivers/sound/dmabuf.c | dmap->max_fragments = 65536; /* Just a large value */ |
dmap | 221 | drivers/sound/dmabuf.c | dmap->byte_counter = 0; |
dmap | 223 | drivers/sound/dmabuf.c | dma_init_buffers (dev, dmap); |
dmap | 229 | drivers/sound/dmabuf.c | close_dmap (int dev, struct dma_buffparms *dmap, int chan) |
dmap | 233 | drivers/sound/dmabuf.c | if (dmap->flags & DMA_BUSY) |
dmap | 234 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_NONE; |
dmap | 235 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_BUSY; |
dmap | 238 | drivers/sound/dmabuf.c | sound_free_dmap (dev, dmap); |
dmap | 468 | drivers/sound/dmabuf.c | activate_recording (int dev, struct dma_buffparms *dmap) |
dmap | 473 | drivers/sound/dmabuf.c | if (dmap->flags & DMA_RESTART) |
dmap | 476 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_RESTART; |
dmap | 479 | drivers/sound/dmabuf.c | if (dmap->dma_mode == DMODE_OUTPUT) /* Direction change */ |
dmap | 483 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_NONE; |
dmap | 486 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ALLOC_DONE)) |
dmap | 487 | drivers/sound/dmabuf.c | reorganize_buffers (dev, dmap, 1); |
dmap | 489 | drivers/sound/dmabuf.c | if (!dmap->dma_mode) |
dmap | 494 | drivers/sound/dmabuf.c | dmap->fragment_size, dmap->nbufs)) < 0) |
dmap | 498 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_INPUT; |
dmap | 501 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ACTIVE)) |
dmap | 503 | drivers/sound/dmabuf.c | audio_devs[dev]->start_input (dev, dmap->raw_buf_phys + |
dmap | 504 | drivers/sound/dmabuf.c | dmap->qtail * dmap->fragment_size, |
dmap | 505 | drivers/sound/dmabuf.c | dmap->fragment_size, 0, |
dmap | 507 | drivers/sound/dmabuf.c | !(dmap->flags & DMA_STARTED)); |
dmap | 508 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE | DMA_STARTED; |
dmap | 521 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; |
dmap | 530 | drivers/sound/dmabuf.c | else if (!dmap->qlen) |
dmap | 534 | drivers/sound/dmabuf.c | if ((err = activate_recording (dev, dmap)) < 0) |
dmap | 589 | drivers/sound/dmabuf.c | if (!dmap->qlen) |
dmap | 592 | drivers/sound/dmabuf.c | *buf = &dmap->raw_buf[dmap->qhead * dmap->fragment_size + dmap->counts[dmap->qhead]]; |
dmap | 593 | drivers/sound/dmabuf.c | *len = dmap->fragment_size - dmap->counts[dmap->qhead]; |
dmap | 595 | drivers/sound/dmabuf.c | return dmap->qhead; |
dmap | 601 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; |
dmap | 603 | drivers/sound/dmabuf.c | int p = dmap->counts[dmap->qhead] + c; |
dmap | 610 | drivers/sound/dmabuf.c | else if (p >= dmap->fragment_size) |
dmap | 612 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead] = 0; |
dmap | 613 | drivers/sound/dmabuf.c | if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) |
dmap | 615 | drivers/sound/dmabuf.c | dev, dmap->qlen, dmap->nbufs); |
dmap | 616 | drivers/sound/dmabuf.c | dmap->qlen--; |
dmap | 617 | drivers/sound/dmabuf.c | dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; |
dmap | 620 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead] = p; |
dmap | 626 | drivers/sound/dmabuf.c | dma_subdivide (int dev, struct dma_buffparms *dmap, caddr_t arg, int fact) |
dmap | 630 | drivers/sound/dmabuf.c | fact = dmap->subdivision; |
dmap | 636 | drivers/sound/dmabuf.c | if (dmap->subdivision != 0 || |
dmap | 637 | drivers/sound/dmabuf.c | dmap->fragment_size) /* Too late to change */ |
dmap | 646 | drivers/sound/dmabuf.c | dmap->subdivision = fact; |
dmap | 651 | drivers/sound/dmabuf.c | dma_set_fragment (int dev, struct dma_buffparms *dmap, caddr_t arg, int fact) |
dmap | 658 | drivers/sound/dmabuf.c | if (dmap->subdivision != 0 || |
dmap | 659 | drivers/sound/dmabuf.c | dmap->fragment_size) /* Too late to change */ |
dmap | 679 | drivers/sound/dmabuf.c | dmap->fragment_size = (1 << bytes); |
dmap | 680 | drivers/sound/dmabuf.c | dmap->max_fragments = count; |
dmap | 682 | drivers/sound/dmabuf.c | if (dmap->fragment_size > audio_devs[dev]->buffsize) |
dmap | 683 | drivers/sound/dmabuf.c | dmap->fragment_size = audio_devs[dev]->buffsize; |
dmap | 685 | drivers/sound/dmabuf.c | if (dmap->fragment_size == audio_devs[dev]->buffsize && |
dmap | 687 | drivers/sound/dmabuf.c | dmap->fragment_size /= 2; /* Needs at least 2 buffers */ |
dmap | 689 | drivers/sound/dmabuf.c | dmap->subdivision = 1; /* Disable SNDCTL_DSP_SUBDIVIDE */ |
dmap | 694 | drivers/sound/dmabuf.c | get_buffer_pointer (int dev, int chan, struct dma_buffparms *dmap) |
dmap | 701 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ACTIVE)) |
dmap | 714 | drivers/sound/dmabuf.c | return dmap->bytes_in_use - pos; |
dmap | 717 | drivers/sound/dmabuf.c | pos = dmap->fragment_size - pos; |
dmap | 802 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = dmap_out; |
dmap | 807 | drivers/sound/dmabuf.c | dmap = dmap_in; |
dmap | 809 | drivers/sound/dmabuf.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 812 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ALLOC_DONE)) |
dmap | 813 | drivers/sound/dmabuf.c | reorganize_buffers (dev, dmap, (cmd == SNDCTL_DSP_GETISPACE)); |
dmap | 815 | drivers/sound/dmabuf.c | info->fragstotal = dmap->nbufs; |
dmap | 818 | drivers/sound/dmabuf.c | info->fragments = dmap->qlen; |
dmap | 825 | drivers/sound/dmabuf.c | info->fragments = dmap->nbufs - dmap->qlen; |
dmap | 841 | drivers/sound/dmabuf.c | else if (info->fragments > dmap->nbufs) |
dmap | 842 | drivers/sound/dmabuf.c | info->fragments = dmap->nbufs; |
dmap | 844 | drivers/sound/dmabuf.c | info->fragsize = dmap->fragment_size; |
dmap | 845 | drivers/sound/dmabuf.c | info->bytes = info->fragments * dmap->fragment_size; |
dmap | 847 | drivers/sound/dmabuf.c | if (cmd == SNDCTL_DSP_GETISPACE && dmap->qlen) |
dmap | 848 | drivers/sound/dmabuf.c | info->bytes -= dmap->counts[dmap->qhead]; |
dmap | 1002 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1004 | drivers/sound/dmabuf.c | if (dmap->qlen >= dmap->nbufs) /* No space at all */ |
dmap | 1012 | drivers/sound/dmabuf.c | max = dmap->max_fragments; |
dmap | 1013 | drivers/sound/dmabuf.c | len = dmap->qlen; |
dmap | 1035 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1037 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_CLEAN; |
dmap | 1045 | drivers/sound/dmabuf.c | if (dmap->dma_mode == DMODE_INPUT) /* Direction change */ |
dmap | 1048 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_NONE; |
dmap | 1050 | drivers/sound/dmabuf.c | else if (dmap->flags & DMA_RESTART) /* Restart buffering */ |
dmap | 1056 | drivers/sound/dmabuf.c | dmap->flags &= ~(DMA_RESTART | DMA_EMPTY); |
dmap | 1058 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ALLOC_DONE)) |
dmap | 1059 | drivers/sound/dmabuf.c | reorganize_buffers (dev, dmap, 0); |
dmap | 1061 | drivers/sound/dmabuf.c | if (!dmap->dma_mode) |
dmap | 1065 | drivers/sound/dmabuf.c | dmap->dma_mode = DMODE_OUTPUT; |
dmap | 1067 | drivers/sound/dmabuf.c | dmap->fragment_size, dmap->nbufs)) < 0) |
dmap | 1139 | drivers/sound/dmabuf.c | *buf = dmap->raw_buf + dmap->qtail * dmap->fragment_size; |
dmap | 1140 | drivers/sound/dmabuf.c | *size = dmap->fragment_size; |
dmap | 1141 | drivers/sound/dmabuf.c | dmap->counts[dmap->qtail] = 0; |
dmap | 1143 | drivers/sound/dmabuf.c | return dmap->qtail; |
dmap | 1149 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1151 | drivers/sound/dmabuf.c | if (dmap->cfrag < 0) |
dmap | 1154 | drivers/sound/dmabuf.c | *dma_buf = dmap->raw_buf + dmap->qtail * dmap->fragment_size; |
dmap | 1155 | drivers/sound/dmabuf.c | *buf_ptr = dmap->counts[dmap->qtail]; |
dmap | 1156 | drivers/sound/dmabuf.c | *buf_size = dmap->fragment_size; |
dmap | 1157 | drivers/sound/dmabuf.c | return *buf_no = dmap->cfrag; |
dmap | 1163 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1165 | drivers/sound/dmabuf.c | if (buff_no == dmap->qtail) |
dmap | 1167 | drivers/sound/dmabuf.c | dmap->cfrag = buff_no; |
dmap | 1168 | drivers/sound/dmabuf.c | dmap->counts[buff_no] = l; |
dmap | 1171 | drivers/sound/dmabuf.c | dmap->cfrag = -1; |
dmap | 1178 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1180 | drivers/sound/dmabuf.c | dmap->cfrag = -1; |
dmap | 1188 | drivers/sound/dmabuf.c | l = dmap->fragment_size; |
dmap | 1189 | drivers/sound/dmabuf.c | dmap->counts[dmap->qtail] = l; |
dmap | 1190 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_RESTART; |
dmap | 1191 | drivers/sound/dmabuf.c | dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; |
dmap | 1197 | drivers/sound/dmabuf.c | dmap->qlen++; |
dmap | 1198 | drivers/sound/dmabuf.c | if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) |
dmap | 1200 | drivers/sound/dmabuf.c | dev, dmap->qlen, dmap->nbufs); |
dmap | 1202 | drivers/sound/dmabuf.c | dmap->counts[dmap->qtail] = l; |
dmap | 1203 | drivers/sound/dmabuf.c | if (l < dmap->fragment_size) |
dmap | 1205 | drivers/sound/dmabuf.c | int p = dmap->fragment_size * dmap->qtail; |
dmap | 1207 | drivers/sound/dmabuf.c | memset (dmap->raw_buf + p + l, |
dmap | 1208 | drivers/sound/dmabuf.c | dmap->neutral_byte, |
dmap | 1209 | drivers/sound/dmabuf.c | dmap->fragment_size - l); |
dmap | 1212 | drivers/sound/dmabuf.c | if ((l != dmap->fragment_size) && |
dmap | 1215 | drivers/sound/dmabuf.c | dmap->flags |= DMA_RESTART; |
dmap | 1217 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_RESTART; |
dmap | 1219 | drivers/sound/dmabuf.c | dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; |
dmap | 1222 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_ACTIVE)) |
dmap | 1224 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE; |
dmap | 1225 | drivers/sound/dmabuf.c | audio_devs[dev]->output_block (dev, dmap->raw_buf_phys + |
dmap | 1226 | drivers/sound/dmabuf.c | dmap->qhead * dmap->fragment_size, |
dmap | 1227 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead], 0, |
dmap | 1229 | drivers/sound/dmabuf.c | !(dmap->flags & DMA_STARTED)); |
dmap | 1230 | drivers/sound/dmabuf.c | dmap->flags |= DMA_STARTED; |
dmap | 1243 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap; |
dmap | 1249 | drivers/sound/dmabuf.c | dmap = audio_devs[dev]->dmap_out; |
dmap | 1254 | drivers/sound/dmabuf.c | dmap = audio_devs[dev]->dmap_in; |
dmap | 1272 | drivers/sound/dmabuf.c | set_dma_addr (chan, dmap->raw_buf_phys); |
dmap | 1273 | drivers/sound/dmabuf.c | set_dma_count (chan, dmap->bytes_in_use); |
dmap | 1318 | drivers/sound/dmabuf.c | polish_buffers (struct dma_buffparms *dmap) |
dmap | 1323 | drivers/sound/dmabuf.c | i = dmap->qhead; |
dmap | 1325 | drivers/sound/dmabuf.c | p = dmap->fragment_size * i; |
dmap | 1327 | drivers/sound/dmabuf.c | if (i == dmap->cfrag) |
dmap | 1329 | drivers/sound/dmabuf.c | l = dmap->fragment_size - dmap->counts[i]; |
dmap | 1332 | drivers/sound/dmabuf.c | l = dmap->fragment_size; |
dmap | 1336 | drivers/sound/dmabuf.c | memset (dmap->raw_buf + p, |
dmap | 1337 | drivers/sound/dmabuf.c | dmap->neutral_byte, |
dmap | 1343 | drivers/sound/dmabuf.c | force_restart (int dev, struct dma_buffparms *dmap) |
dmap | 1351 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_ACTIVE; |
dmap | 1353 | drivers/sound/dmabuf.c | dmap->flags |= DMA_RESTART; |
dmap | 1355 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_RESTART; |
dmap | 1372 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; |
dmap | 1374 | drivers/sound/dmabuf.c | dmap->byte_counter += dmap->counts[dmap->qhead]; |
dmap | 1380 | drivers/sound/dmabuf.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 1384 | drivers/sound/dmabuf.c | dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; |
dmap | 1385 | drivers/sound/dmabuf.c | dmap->qlen++; /* Yes increment it (don't decrement) */ |
dmap | 1386 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_ACTIVE; |
dmap | 1387 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead] = dmap->fragment_size; |
dmap | 1391 | drivers/sound/dmabuf.c | audio_devs[dev]->output_block (dev, dmap->raw_buf_phys + |
dmap | 1392 | drivers/sound/dmabuf.c | dmap->qhead * dmap->fragment_size, |
dmap | 1393 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead], 1, |
dmap | 1399 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE; |
dmap | 1403 | drivers/sound/dmabuf.c | if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) |
dmap | 1406 | drivers/sound/dmabuf.c | dev, dmap->qlen, dmap->nbufs); |
dmap | 1410 | drivers/sound/dmabuf.c | dmap->qlen--; |
dmap | 1411 | drivers/sound/dmabuf.c | dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; |
dmap | 1412 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_ACTIVE; |
dmap | 1414 | drivers/sound/dmabuf.c | if (event_type == 1 && dmap->qlen < 1) |
dmap | 1416 | drivers/sound/dmabuf.c | dmap->underrun_count++; |
dmap | 1418 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_CLEAN) && |
dmap | 1419 | drivers/sound/dmabuf.c | (audio_devs[dev]->flags & DMA_SYNCING || dmap->underrun_count > 5 || dmap->flags & DMA_EMPTY)) |
dmap | 1421 | drivers/sound/dmabuf.c | dmap->qlen = 0; |
dmap | 1422 | drivers/sound/dmabuf.c | force_restart (dev, dmap); |
dmap | 1426 | drivers/sound/dmabuf.c | if (dmap->closing) |
dmap | 1428 | drivers/sound/dmabuf.c | polish_buffers (dmap); |
dmap | 1433 | drivers/sound/dmabuf.c | dmap->qlen++; |
dmap | 1434 | drivers/sound/dmabuf.c | dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; |
dmap | 1436 | drivers/sound/dmabuf.c | if (!(dmap->flags & DMA_EMPTY)) |
dmap | 1437 | drivers/sound/dmabuf.c | polish_buffers (dmap); |
dmap | 1439 | drivers/sound/dmabuf.c | dmap->cfrag = -1; |
dmap | 1440 | drivers/sound/dmabuf.c | dmap->flags |= DMA_EMPTY; |
dmap | 1441 | drivers/sound/dmabuf.c | dmap->counts[dmap->qtail] = dmap->fragment_size; |
dmap | 1445 | drivers/sound/dmabuf.c | if (dmap->qlen) |
dmap | 1450 | drivers/sound/dmabuf.c | if (dmap->counts[dmap->qhead] == 0) |
dmap | 1451 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead] = dmap->fragment_size; |
dmap | 1453 | drivers/sound/dmabuf.c | audio_devs[dev]->output_block (dev, dmap->raw_buf_phys + |
dmap | 1454 | drivers/sound/dmabuf.c | dmap->qhead * dmap->fragment_size, |
dmap | 1455 | drivers/sound/dmabuf.c | dmap->counts[dmap->qhead], 1, |
dmap | 1461 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE; |
dmap | 1481 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap = audio_devs[dev]->dmap_in; |
dmap | 1483 | drivers/sound/dmabuf.c | dmap->byte_counter += dmap->fragment_size; |
dmap | 1489 | drivers/sound/dmabuf.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 1491 | drivers/sound/dmabuf.c | dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; |
dmap | 1492 | drivers/sound/dmabuf.c | dmap->qlen++; |
dmap | 1496 | drivers/sound/dmabuf.c | audio_devs[dev]->start_input (dev, dmap->raw_buf_phys + |
dmap | 1497 | drivers/sound/dmabuf.c | dmap->qtail * dmap->fragment_size, |
dmap | 1498 | drivers/sound/dmabuf.c | dmap->fragment_size, 1, |
dmap | 1505 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE; |
dmap | 1507 | drivers/sound/dmabuf.c | else if (dmap->qlen == (dmap->nbufs - 1)) |
dmap | 1510 | drivers/sound/dmabuf.c | dmap->underrun_count++; |
dmap | 1521 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_ACTIVE; |
dmap | 1523 | drivers/sound/dmabuf.c | dmap->flags |= DMA_RESTART; |
dmap | 1525 | drivers/sound/dmabuf.c | dmap->flags &= ~DMA_RESTART; |
dmap | 1530 | drivers/sound/dmabuf.c | dmap->qlen++; |
dmap | 1531 | drivers/sound/dmabuf.c | if (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs) |
dmap | 1533 | drivers/sound/dmabuf.c | dev, dmap->qlen, dmap->nbufs); |
dmap | 1534 | drivers/sound/dmabuf.c | dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; |
dmap | 1539 | drivers/sound/dmabuf.c | audio_devs[dev]->start_input (dev, dmap->raw_buf_phys + |
dmap | 1540 | drivers/sound/dmabuf.c | dmap->qtail * dmap->fragment_size, |
dmap | 1541 | drivers/sound/dmabuf.c | dmap->fragment_size, 1, |
dmap | 1548 | drivers/sound/dmabuf.c | dmap->flags |= DMA_ACTIVE; |
dmap | 1627 | drivers/sound/dmabuf.c | struct dma_buffparms *dmap; |
dmap | 1633 | drivers/sound/dmabuf.c | dmap = audio_devs[dev]->dmap_in; |
dmap | 1635 | drivers/sound/dmabuf.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 1637 | drivers/sound/dmabuf.c | if (dmap->qlen) |
dmap | 1649 | drivers/sound/dmabuf.c | if (dmap->dma_mode != DMODE_INPUT) |
dmap | 1651 | drivers/sound/dmabuf.c | if ((audio_devs[dev]->flags & DMA_DUPLEX) && !dmap->qlen && |
dmap | 1659 | drivers/sound/dmabuf.c | activate_recording (dev, dmap); |
dmap | 1665 | drivers/sound/dmabuf.c | if (!dmap->qlen) |
dmap | 1679 | drivers/sound/dmabuf.c | dmap = audio_devs[dev]->dmap_out; |
dmap | 1681 | drivers/sound/dmabuf.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 1683 | drivers/sound/dmabuf.c | if (dmap->qlen) |
dmap | 1695 | drivers/sound/dmabuf.c | if (dmap->dma_mode == DMODE_INPUT) |
dmap | 1700 | drivers/sound/dmabuf.c | if (dmap->dma_mode == DMODE_NONE) |
dmap | 238 | drivers/sound/soundcard.c | struct dma_buffparms *dmap = NULL; |
dmap | 261 | drivers/sound/soundcard.c | dmap = audio_devs[dev]->dmap_in; |
dmap | 265 | drivers/sound/soundcard.c | dmap = audio_devs[dev]->dmap_out; |
dmap | 273 | drivers/sound/soundcard.c | if (dmap == NULL) |
dmap | 279 | drivers/sound/soundcard.c | if (dmap->raw_buf == NULL) |
dmap | 285 | drivers/sound/soundcard.c | if (dmap->mapping_flags) |
dmap | 299 | drivers/sound/soundcard.c | if (size != dmap->bytes_in_use) |
dmap | 302 | drivers/sound/soundcard.c | size, dmap->bytes_in_use); |
dmap | 306 | drivers/sound/soundcard.c | if (remap_page_range (vma_get_start (vma), dmap->raw_buf_phys, |
dmap | 314 | drivers/sound/soundcard.c | dmap->mapping_flags |= DMA_MAP_MAPPED; |
dmap | 316 | drivers/sound/soundcard.c | memset (dmap->raw_buf, |
dmap | 317 | drivers/sound/soundcard.c | dmap->neutral_byte, |
dmap | 318 | drivers/sound/soundcard.c | dmap->bytes_in_use); |
dmap | 611 | drivers/sound/soundcard.c | sound_alloc_dmap (int dev, struct dma_buffparms *dmap, int chan) |
dmap | 616 | drivers/sound/soundcard.c | dmap->mapping_flags &= ~DMA_MAP_MAPPED; |
dmap | 618 | drivers/sound/soundcard.c | if (dmap->raw_buf != NULL) |
dmap | 629 | drivers/sound/soundcard.c | dmap->raw_buf = NULL; |
dmap | 687 | drivers/sound/soundcard.c | dmap->raw_buf = start_addr; |
dmap | 688 | drivers/sound/soundcard.c | dmap->raw_buf_phys = virt_to_bus (start_addr); |
dmap | 699 | drivers/sound/soundcard.c | sound_free_dmap (int dev, struct dma_buffparms *dmap) |
dmap | 701 | drivers/sound/soundcard.c | if (dmap->raw_buf == NULL) |
dmap | 704 | drivers/sound/soundcard.c | if (dmap->mapping_flags & DMA_MAP_MAPPED) |
dmap | 715 | drivers/sound/soundcard.c | start_addr = (unsigned long) dmap->raw_buf; |
dmap | 723 | drivers/sound/soundcard.c | free_pages ((unsigned long) dmap->raw_buf, sz); |
dmap | 725 | drivers/sound/soundcard.c | dmap->raw_buf = NULL; |
dmap | 729 | drivers/sound/soundcard.c | sound_map_buffer (int dev, struct dma_buffparms *dmap, buffmem_desc * info) |