xref: /freebsd/sys/dev/sound/usb/uaudio.h (revision 3a3f90c6c3cc3124c6f4df8a11b57c8a36a2d13c)
13a3f90c6SAndrew Thompson /* $FreeBSD$ */
23a3f90c6SAndrew Thompson 
33a3f90c6SAndrew Thompson /*-
43a3f90c6SAndrew Thompson  * Copyright (c) 2000-2002 Hiroyuki Aizu <aizu@navi.org>
53a3f90c6SAndrew Thompson  *
63a3f90c6SAndrew Thompson  * Redistribution and use in source and binary forms, with or without
73a3f90c6SAndrew Thompson  * modification, are permitted provided that the following conditions
83a3f90c6SAndrew Thompson  * are met:
93a3f90c6SAndrew Thompson  * 1. Redistributions of source code must retain the above copyright
103a3f90c6SAndrew Thompson  *    notice, this list of conditions and the following disclaimer.
113a3f90c6SAndrew Thompson  * 2. Redistributions in binary form must reproduce the above copyright
123a3f90c6SAndrew Thompson  *    notice, this list of conditions and the following disclaimer in the
133a3f90c6SAndrew Thompson  *    documentation and/or other materials provided with the distribution.
143a3f90c6SAndrew Thompson  *
153a3f90c6SAndrew Thompson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
163a3f90c6SAndrew Thompson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173a3f90c6SAndrew Thompson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183a3f90c6SAndrew Thompson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
193a3f90c6SAndrew Thompson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
203a3f90c6SAndrew Thompson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
213a3f90c6SAndrew Thompson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
223a3f90c6SAndrew Thompson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
233a3f90c6SAndrew Thompson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
243a3f90c6SAndrew Thompson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
253a3f90c6SAndrew Thompson  * SUCH DAMAGE.
263a3f90c6SAndrew Thompson  */
273a3f90c6SAndrew Thompson 
283a3f90c6SAndrew Thompson /* prototypes from "uaudio.c" used by "uaudio_pcm.c" */
293a3f90c6SAndrew Thompson 
303a3f90c6SAndrew Thompson struct uaudio_chan;
313a3f90c6SAndrew Thompson struct uaudio_softc;
323a3f90c6SAndrew Thompson struct snd_dbuf;
333a3f90c6SAndrew Thompson struct snd_mixer;
343a3f90c6SAndrew Thompson struct pcm_channel;
353a3f90c6SAndrew Thompson 
363a3f90c6SAndrew Thompson extern int	uaudio_attach_sub(device_t dev, kobj_class_t mixer_class,
373a3f90c6SAndrew Thompson 		    kobj_class_t chan_class);
383a3f90c6SAndrew Thompson extern int	uaudio_detach_sub(device_t dev);
393a3f90c6SAndrew Thompson extern void	*uaudio_chan_init(struct uaudio_softc *sc, struct snd_dbuf *b,
403a3f90c6SAndrew Thompson 		    struct pcm_channel *c, int dir);
413a3f90c6SAndrew Thompson extern int	uaudio_chan_free(struct uaudio_chan *ch);
423a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
433a3f90c6SAndrew Thompson 		    uint32_t blocksize);
443a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
453a3f90c6SAndrew Thompson 		    uint32_t blocksize, uint32_t blockcount);
463a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_speed(struct uaudio_chan *ch,
473a3f90c6SAndrew Thompson 		    uint32_t speed);
483a3f90c6SAndrew Thompson extern int	uaudio_chan_getptr(struct uaudio_chan *ch);
493a3f90c6SAndrew Thompson extern struct	pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
503a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_format(struct uaudio_chan *ch,
513a3f90c6SAndrew Thompson 		    uint32_t format);
523a3f90c6SAndrew Thompson extern int	uaudio_chan_start(struct uaudio_chan *ch);
533a3f90c6SAndrew Thompson extern int	uaudio_chan_stop(struct uaudio_chan *ch);
543a3f90c6SAndrew Thompson extern int	uaudio_mixer_init_sub(struct uaudio_softc *sc,
553a3f90c6SAndrew Thompson 		    struct snd_mixer *m);
563a3f90c6SAndrew Thompson extern int	uaudio_mixer_uninit_sub(struct uaudio_softc *sc);
573a3f90c6SAndrew Thompson extern void	uaudio_mixer_set(struct uaudio_softc *sc, unsigned type,
583a3f90c6SAndrew Thompson 		    unsigned left, unsigned right);
593a3f90c6SAndrew Thompson extern uint32_t	uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src);
603a3f90c6SAndrew Thompson 
613a3f90c6SAndrew Thompson int	uaudio_get_vendor(device_t dev);
623a3f90c6SAndrew Thompson int	uaudio_get_product(device_t dev);
633a3f90c6SAndrew Thompson int	uaudio_get_release(device_t dev);
64