xref: /freebsd/sys/dev/sound/usb/uaudio.h (revision a6ed493726d5f71dc49159cf6cea867b7b84c00d)
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 
30*a6ed4937SHans Petter Selasky #ifndef _UAUDIO_H_
31*a6ed4937SHans Petter Selasky #define	_UAUDIO_H_
32*a6ed4937SHans Petter Selasky 
333a3f90c6SAndrew Thompson struct uaudio_chan;
343a3f90c6SAndrew Thompson struct uaudio_softc;
353a3f90c6SAndrew Thompson struct snd_dbuf;
363a3f90c6SAndrew Thompson struct snd_mixer;
373a3f90c6SAndrew Thompson struct pcm_channel;
383a3f90c6SAndrew Thompson 
393a3f90c6SAndrew Thompson extern int	uaudio_attach_sub(device_t dev, kobj_class_t mixer_class,
403a3f90c6SAndrew Thompson 		    kobj_class_t chan_class);
413a3f90c6SAndrew Thompson extern int	uaudio_detach_sub(device_t dev);
423a3f90c6SAndrew Thompson extern void	*uaudio_chan_init(struct uaudio_softc *sc, struct snd_dbuf *b,
433a3f90c6SAndrew Thompson 		    struct pcm_channel *c, int dir);
443a3f90c6SAndrew Thompson extern int	uaudio_chan_free(struct uaudio_chan *ch);
453a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
463a3f90c6SAndrew Thompson 		    uint32_t blocksize);
473a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
483a3f90c6SAndrew Thompson 		    uint32_t blocksize, uint32_t blockcount);
493a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_speed(struct uaudio_chan *ch,
503a3f90c6SAndrew Thompson 		    uint32_t speed);
513a3f90c6SAndrew Thompson extern int	uaudio_chan_getptr(struct uaudio_chan *ch);
523a3f90c6SAndrew Thompson extern struct	pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
5390da2b28SAriff Abdullah extern struct	pcmchan_matrix *uaudio_chan_getmatrix(struct uaudio_chan *ch,
5490da2b28SAriff Abdullah 		    uint32_t format);
553a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_format(struct uaudio_chan *ch,
563a3f90c6SAndrew Thompson 		    uint32_t format);
573a3f90c6SAndrew Thompson extern int	uaudio_chan_start(struct uaudio_chan *ch);
583a3f90c6SAndrew Thompson extern int	uaudio_chan_stop(struct uaudio_chan *ch);
593a3f90c6SAndrew Thompson extern int	uaudio_mixer_init_sub(struct uaudio_softc *sc,
603a3f90c6SAndrew Thompson 		    struct snd_mixer *m);
613a3f90c6SAndrew Thompson extern int	uaudio_mixer_uninit_sub(struct uaudio_softc *sc);
623a3f90c6SAndrew Thompson extern void	uaudio_mixer_set(struct uaudio_softc *sc, unsigned type,
633a3f90c6SAndrew Thompson 		    unsigned left, unsigned right);
643a3f90c6SAndrew Thompson extern uint32_t	uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src);
653a3f90c6SAndrew Thompson 
663a3f90c6SAndrew Thompson int	uaudio_get_vendor(device_t dev);
673a3f90c6SAndrew Thompson int	uaudio_get_product(device_t dev);
683a3f90c6SAndrew Thompson int	uaudio_get_release(device_t dev);
69*a6ed4937SHans Petter Selasky 
70*a6ed4937SHans Petter Selasky #endif			/* _UAUDIO_H_ */
71