Lines Matching refs:audio_devs
47 audio_devs[dev]->local_conversion = 0; in set_format()
49 if (!(audio_devs[dev]->format_mask & fmt)) /* Not supported */ in set_format()
54 audio_devs[dev]->local_conversion = CNV_MU_LAW; in set_format()
59 audio_devs[dev]->audio_format = audio_devs[dev]->d->set_bits(dev, fmt); in set_format()
60 audio_devs[dev]->local_format = fmt; in set_format()
63 return audio_devs[dev]->local_format; in set_format()
65 if (audio_devs[dev]->local_conversion) in set_format()
66 return audio_devs[dev]->local_conversion; in set_format()
68 return audio_devs[dev]->local_format; in set_format()
90 driver = audio_devs[dev]->d; in audio_open()
97 if ( (coprocessor = audio_devs[dev]->coproc) != NULL ) { in audio_open()
107 audio_devs[dev]->local_conversion = 0; in audio_open()
114 audio_devs[dev]->audio_mode = AM_NONE; in audio_open()
138 struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; in sync_output()
191 audio_devs[dev]->dmap_out->closing = 1; in audio_release()
192 audio_devs[dev]->dmap_in->closing = 1; in audio_release()
201 if ( (coprocessor = audio_devs[dev]->coproc) != NULL ) { in audio_release()
209 if (audio_devs[dev]->d->owner) in audio_release()
210 __MOD_DEC_USE_COUNT (audio_devs[dev]->d->owner); in audio_release()
238 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in audio_write()
241 if (audio_devs[dev]->flags & DMA_DUPLEX) in audio_write()
242 audio_devs[dev]->audio_mode |= AM_WRITE; in audio_write()
244 audio_devs[dev]->audio_mode = AM_WRITE; in audio_write()
268 if (!audio_devs[dev]->d->copy_user) in audio_write()
271 (audio_devs[dev]->dmap_out->raw_buf + audio_devs[dev]->dmap_out->buffsize)) in audio_write()
273 …(%lx,%d), (%lx, %d)\n", (long) dma_buf, l, (long) audio_devs[dev]->dmap_out->raw_buf, (int) audio_… in audio_write()
276 if (dma_buf < audio_devs[dev]->dmap_out->raw_buf) in audio_write()
278 …printk(KERN_ERR "audio: Buffer error 13 (%lx<%lx)\n", (long) dma_buf, (long) audio_devs[dev]->dmap… in audio_write()
284 else audio_devs[dev]->d->copy_user (dev, in audio_write()
292 if (audio_devs[dev]->local_conversion & CNV_MU_LAW) in audio_write()
319 if (!(audio_devs[dev]->open_mode & OPEN_READ)) in audio_read()
322 if ((audio_devs[dev]->audio_mode & AM_WRITE) && !(audio_devs[dev]->flags & DMA_DUPLEX)) in audio_read()
325 if (audio_devs[dev]->flags & DMA_DUPLEX) in audio_read()
326 audio_devs[dev]->audio_mode |= AM_READ; in audio_read()
328 audio_devs[dev]->audio_mode = AM_READ; in audio_read()
353 if (audio_devs[dev]->local_conversion & CNV_MU_LAW) in audio_read()
388 if (audio_devs[dev]->coproc) /* Coprocessor ioctl */ in audio_ioctl()
389 return audio_devs[dev]->coproc->ioctl(audio_devs[dev]->coproc->devc, cmd, arg, 0); in audio_ioctl()
397 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in audio_ioctl()
399 if (audio_devs[dev]->dmap_out->fragment_size == 0) in audio_ioctl()
407 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in audio_ioctl()
409 if (audio_devs[dev]->dmap_out->fragment_size == 0) in audio_ioctl()
411 audio_devs[dev]->dmap_out->flags |= DMA_POST | DMA_DIRTY; in audio_ioctl()
417 audio_devs[dev]->audio_mode = AM_NONE; in audio_ioctl()
422 val = audio_devs[dev]->format_mask | AFMT_MU_LAW; in audio_ioctl()
432 if (!(audio_devs[dev]->open_mode & OPEN_READ)) in audio_ioctl()
434 if ((audio_devs[dev]->audio_mode & AM_WRITE) && !(audio_devs[dev]->flags & DMA_DUPLEX)) in audio_ioctl()
439 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in audio_ioctl()
441 if ((audio_devs[dev]->audio_mode & AM_READ) && !(audio_devs[dev]->flags & DMA_DUPLEX)) in audio_ioctl()
451 if (audio_devs[dev]->flags & DMA_DUPLEX && in audio_ioctl()
452 audio_devs[dev]->open_mode == OPEN_READWRITE) in audio_ioctl()
454 if (audio_devs[dev]->coproc) in audio_ioctl()
456 if (audio_devs[dev]->d->local_qlen) /* Device has hidden buffers */ in audio_ioctl()
458 if (audio_devs[dev]->d->trigger) /* Supports SETTRIGGER */ in audio_ioctl()
465 val = audio_devs[dev]->d->set_speed(dev, val); in audio_ioctl()
469 val = audio_devs[dev]->d->set_speed(dev, 0); in audio_ioctl()
477 val = audio_devs[dev]->d->set_channels(dev, val + 1) - 1; in audio_ioctl()
483 val = audio_devs[dev]->d->set_channels(dev, val); in audio_ioctl()
487 val = audio_devs[dev]->d->set_channels(dev, 0); in audio_ioctl()
491 val = audio_devs[dev]->d->set_bits(dev, 0); in audio_ioctl()
495 if (audio_devs[dev]->open_mode != OPEN_READWRITE) in audio_ioctl()
497 return (audio_devs[dev]->flags & DMA_DUPLEX) ? 0 : -EIO; in audio_ioctl()
502 if (audio_devs[dev]->open_mode & OPEN_WRITE) in audio_ioctl()
503 audio_devs[dev]->dmap_out->applic_profile = val; in audio_ioctl()
504 if (audio_devs[dev]->open_mode & OPEN_READ) in audio_ioctl()
505 audio_devs[dev]->dmap_in->applic_profile = val; in audio_ioctl()
509 dmap = audio_devs[dev]->dmap_out; in audio_ioctl()
510 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in audio_ioctl()
553 struct audio_operations *dsp_dev = audio_devs[dev]; in reorganize_buffers()
634 if (audio_devs[dev]->min_fragment) in reorganize_buffers()
635 if (bsz < (1 << audio_devs[dev]->min_fragment)) in reorganize_buffers()
636 bsz = 1 << audio_devs[dev]->min_fragment; in reorganize_buffers()
637 if (audio_devs[dev]->max_fragment) in reorganize_buffers()
638 if (bsz > (1 << audio_devs[dev]->max_fragment)) in reorganize_buffers()
639 bsz = 1 << audio_devs[dev]->max_fragment; in reorganize_buffers()
722 if (audio_devs[dev]->min_fragment > 0) in dma_set_fragment()
723 if (bytes < audio_devs[dev]->min_fragment) in dma_set_fragment()
724 bytes = audio_devs[dev]->min_fragment; in dma_set_fragment()
726 if (audio_devs[dev]->max_fragment > 0) in dma_set_fragment()
727 if (bytes > audio_devs[dev]->max_fragment) in dma_set_fragment()
728 bytes = audio_devs[dev]->max_fragment; in dma_set_fragment()
742 audio_devs[dev]->flags & DMA_AUTOMODE) in dma_set_fragment()
751 struct dma_buffparms *dmap_out = audio_devs[dev]->dmap_out; in dma_ioctl()
752 struct dma_buffparms *dmap_in = audio_devs[dev]->dmap_in; in dma_ioctl()
765 if (audio_devs[dev]->open_mode & OPEN_WRITE) in dma_ioctl()
769 if (audio_devs[dev]->open_mode != OPEN_WRITE || in dma_ioctl()
770 (audio_devs[dev]->flags & DMA_DUPLEX && in dma_ioctl()
771 audio_devs[dev]->open_mode & OPEN_READ)) in dma_ioctl()
780 if (cmd == SNDCTL_DSP_GETISPACE && !(audio_devs[dev]->open_mode & OPEN_READ)) in dma_ioctl()
782 if (cmd == SNDCTL_DSP_GETOSPACE && !(audio_devs[dev]->open_mode & OPEN_WRITE)) in dma_ioctl()
784 if (cmd == SNDCTL_DSP_GETISPACE && audio_devs[dev]->flags & DMA_DUPLEX) in dma_ioctl()
800 if (audio_devs[dev]->d->local_qlen) in dma_ioctl()
802 int tmp = audio_devs[dev]->d->local_qlen(dev); in dma_ioctl()
833 bits &= audio_devs[dev]->open_mode; in dma_ioctl()
834 if (audio_devs[dev]->d->trigger == NULL) in dma_ioctl()
836 if (!(audio_devs[dev]->flags & DMA_DUPLEX) && (bits & PCM_ENABLE_INPUT) && in dma_ioctl()
841 changed = audio_devs[dev]->enable_bits ^ bits; in dma_ioctl()
842 if ((changed & bits) & PCM_ENABLE_INPUT && audio_devs[dev]->go) in dma_ioctl()
845 if ((err = audio_devs[dev]->d->prepare_for_input(dev, in dma_ioctl()
851 audio_devs[dev]->enable_bits = bits; in dma_ioctl()
856 audio_devs[dev]->go) in dma_ioctl()
861 audio_devs[dev]->enable_bits = bits; in dma_ioctl()
865 audio_devs[dev]->enable_bits = bits; in dma_ioctl()
867 if (changed && audio_devs[dev]->d->trigger) in dma_ioctl()
868 audio_devs[dev]->d->trigger(dev, bits * audio_devs[dev]->go); in dma_ioctl()
874 ret = audio_devs[dev]->enable_bits; in dma_ioctl()
878 if (!audio_devs[dev]->d->trigger) in dma_ioctl()
880 audio_devs[dev]->d->trigger(dev, 0); in dma_ioctl()
881 audio_devs[dev]->go = 0; in dma_ioctl()
885 if (!(audio_devs[dev]->open_mode & OPEN_READ)) in dma_ioctl()
903 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in dma_ioctl()
922 if (!(audio_devs[dev]->open_mode & OPEN_WRITE)) in dma_ioctl()
945 if (audio_devs[dev]->dmap_out->qlen > 0) in dma_ioctl()
946 if (!(audio_devs[dev]->dmap_out->flags & DMA_ACTIVE)) in dma_ioctl()
947 DMAbuf_launch_output(dev, audio_devs[dev]->dmap_out); in dma_ioctl()
952 if (audio_devs[dev]->open_mode & OPEN_WRITE) in dma_ioctl()
953 reorganize_buffers(dev, dmap_out, (audio_devs[dev]->open_mode == OPEN_READ)); in dma_ioctl()
954 if (audio_devs[dev]->open_mode == OPEN_READ || in dma_ioctl()
955 (audio_devs[dev]->flags & DMA_DUPLEX && in dma_ioctl()
956 audio_devs[dev]->open_mode & OPEN_READ)) in dma_ioctl()
957 reorganize_buffers(dev, dmap_in, (audio_devs[dev]->open_mode == OPEN_READ)); in dma_ioctl()
958 if (audio_devs[dev]->open_mode == OPEN_READ) in dma_ioctl()
967 if (audio_devs[dev]->open_mode & OPEN_WRITE) in dma_ioctl()
971 if (audio_devs[dev]->open_mode == OPEN_READ || in dma_ioctl()
972 (audio_devs[dev]->flags & DMA_DUPLEX && in dma_ioctl()
973 audio_devs[dev]->open_mode & OPEN_READ)) in dma_ioctl()
982 if (!audio_devs[dev]->d->ioctl) in dma_ioctl()
984 return audio_devs[dev]->d->ioctl(dev, cmd, arg); in dma_ioctl()