xref: /freebsd/sys/dev/sound/usb/uaudio.h (revision 352aa9ad1d77a8ea8e4afef66691dc1a06344618)
13a3f90c6SAndrew Thompson 
23a3f90c6SAndrew Thompson /*-
3*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
4718cf2ccSPedro F. Giffuni  *
53a3f90c6SAndrew Thompson  * Copyright (c) 2000-2002 Hiroyuki Aizu <aizu@navi.org>
63a3f90c6SAndrew Thompson  *
73a3f90c6SAndrew Thompson  * Redistribution and use in source and binary forms, with or without
83a3f90c6SAndrew Thompson  * modification, are permitted provided that the following conditions
93a3f90c6SAndrew Thompson  * are met:
103a3f90c6SAndrew Thompson  * 1. Redistributions of source code must retain the above copyright
113a3f90c6SAndrew Thompson  *    notice, this list of conditions and the following disclaimer.
123a3f90c6SAndrew Thompson  * 2. Redistributions in binary form must reproduce the above copyright
133a3f90c6SAndrew Thompson  *    notice, this list of conditions and the following disclaimer in the
143a3f90c6SAndrew Thompson  *    documentation and/or other materials provided with the distribution.
153a3f90c6SAndrew Thompson  *
163a3f90c6SAndrew Thompson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
173a3f90c6SAndrew Thompson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
183a3f90c6SAndrew Thompson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
193a3f90c6SAndrew Thompson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
203a3f90c6SAndrew Thompson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
213a3f90c6SAndrew Thompson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
223a3f90c6SAndrew Thompson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
233a3f90c6SAndrew Thompson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
243a3f90c6SAndrew Thompson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
253a3f90c6SAndrew Thompson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
263a3f90c6SAndrew Thompson  * SUCH DAMAGE.
273a3f90c6SAndrew Thompson  */
283a3f90c6SAndrew Thompson 
293a3f90c6SAndrew Thompson /* prototypes from "uaudio.c" used by "uaudio_pcm.c" */
303a3f90c6SAndrew Thompson 
31a6ed4937SHans Petter Selasky #ifndef _UAUDIO_H_
32a6ed4937SHans Petter Selasky #define	_UAUDIO_H_
33a6ed4937SHans Petter Selasky 
343a3f90c6SAndrew Thompson struct uaudio_chan;
353a3f90c6SAndrew Thompson struct uaudio_softc;
363a3f90c6SAndrew Thompson struct snd_dbuf;
373a3f90c6SAndrew Thompson struct snd_mixer;
383a3f90c6SAndrew Thompson struct pcm_channel;
393a3f90c6SAndrew Thompson 
403a3f90c6SAndrew Thompson extern int	uaudio_attach_sub(device_t dev, kobj_class_t mixer_class,
413a3f90c6SAndrew Thompson 		    kobj_class_t chan_class);
423a3f90c6SAndrew Thompson extern int	uaudio_detach_sub(device_t dev);
4386c9b3f3SHans Petter Selasky extern void	*uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b,
443a3f90c6SAndrew Thompson 		    struct pcm_channel *c, int dir);
453a3f90c6SAndrew Thompson extern int	uaudio_chan_free(struct uaudio_chan *ch);
463a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
473a3f90c6SAndrew Thompson 		    uint32_t blocksize);
483a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
493a3f90c6SAndrew Thompson 		    uint32_t blocksize, uint32_t blockcount);
503a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_speed(struct uaudio_chan *ch,
513a3f90c6SAndrew Thompson 		    uint32_t speed);
523a3f90c6SAndrew Thompson extern int	uaudio_chan_getptr(struct uaudio_chan *ch);
533a3f90c6SAndrew Thompson extern struct	pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
5490da2b28SAriff Abdullah extern struct	pcmchan_matrix *uaudio_chan_getmatrix(struct uaudio_chan *ch,
5590da2b28SAriff Abdullah 		    uint32_t format);
563a3f90c6SAndrew Thompson extern int	uaudio_chan_set_param_format(struct uaudio_chan *ch,
573a3f90c6SAndrew Thompson 		    uint32_t format);
5885bad582SHans Petter Selasky extern void	uaudio_chan_start(struct uaudio_chan *ch);
5985bad582SHans Petter Selasky extern void	uaudio_chan_stop(struct uaudio_chan *ch);
6086c9b3f3SHans Petter Selasky extern int	uaudio_mixer_init_sub(struct uaudio_softc *, struct snd_mixer *);
6186c9b3f3SHans Petter Selasky extern int	uaudio_mixer_uninit_sub(struct uaudio_softc *, struct snd_mixer *);
6286c9b3f3SHans Petter Selasky extern void	uaudio_mixer_set(struct uaudio_softc *, struct snd_mixer *,
6386c9b3f3SHans Petter Selasky 		    unsigned type, unsigned left, unsigned right);
6486c9b3f3SHans Petter Selasky extern uint32_t	uaudio_mixer_setrecsrc(struct uaudio_softc *, struct snd_mixer *,
6586c9b3f3SHans Petter Selasky 		    uint32_t src);
663a3f90c6SAndrew Thompson 
67a6ed4937SHans Petter Selasky #endif			/* _UAUDIO_H_ */
68