1184610Salfred/* $FreeBSD: releng/11.0/sys/dev/sound/usb/uaudio.h 280322 2015-03-21 09:45:45Z hselasky $ */
2184610Salfred
3184610Salfred/*-
4184610Salfred * Copyright (c) 2000-2002 Hiroyuki Aizu <aizu@navi.org>
5184610Salfred *
6184610Salfred * Redistribution and use in source and binary forms, with or without
7184610Salfred * modification, are permitted provided that the following conditions
8184610Salfred * are met:
9184610Salfred * 1. Redistributions of source code must retain the above copyright
10184610Salfred *    notice, this list of conditions and the following disclaimer.
11184610Salfred * 2. Redistributions in binary form must reproduce the above copyright
12184610Salfred *    notice, this list of conditions and the following disclaimer in the
13184610Salfred *    documentation and/or other materials provided with the distribution.
14184610Salfred *
15184610Salfred * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16184610Salfred * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17184610Salfred * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18184610Salfred * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19184610Salfred * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20184610Salfred * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21184610Salfred * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22184610Salfred * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23184610Salfred * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24184610Salfred * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25184610Salfred * SUCH DAMAGE.
26184610Salfred */
27184610Salfred
28184610Salfred/* prototypes from "uaudio.c" used by "uaudio_pcm.c" */
29184610Salfred
30228484Shselasky#ifndef _UAUDIO_H_
31228484Shselasky#define	_UAUDIO_H_
32228484Shselasky
33184610Salfredstruct uaudio_chan;
34184610Salfredstruct uaudio_softc;
35184610Salfredstruct snd_dbuf;
36184610Salfredstruct snd_mixer;
37184610Salfredstruct pcm_channel;
38184610Salfred
39185948Sthompsaextern int	uaudio_attach_sub(device_t dev, kobj_class_t mixer_class,
40185948Sthompsa		    kobj_class_t chan_class);
41185948Sthompsaextern int	uaudio_detach_sub(device_t dev);
42185948Sthompsaextern void	*uaudio_chan_init(struct uaudio_softc *sc, struct snd_dbuf *b,
43185948Sthompsa		    struct pcm_channel *c, int dir);
44185948Sthompsaextern int	uaudio_chan_free(struct uaudio_chan *ch);
45185948Sthompsaextern int	uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
46185948Sthompsa		    uint32_t blocksize);
47185948Sthompsaextern int	uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
48185948Sthompsa		    uint32_t blocksize, uint32_t blockcount);
49185948Sthompsaextern int	uaudio_chan_set_param_speed(struct uaudio_chan *ch,
50185948Sthompsa		    uint32_t speed);
51185948Sthompsaextern int	uaudio_chan_getptr(struct uaudio_chan *ch);
52185948Sthompsaextern struct	pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
53193640Sariffextern struct	pcmchan_matrix *uaudio_chan_getmatrix(struct uaudio_chan *ch,
54193640Sariff		    uint32_t format);
55185948Sthompsaextern int	uaudio_chan_set_param_format(struct uaudio_chan *ch,
56185948Sthompsa		    uint32_t format);
57280322Shselaskyextern void	uaudio_chan_start(struct uaudio_chan *ch);
58280322Shselaskyextern void	uaudio_chan_stop(struct uaudio_chan *ch);
59185948Sthompsaextern int	uaudio_mixer_init_sub(struct uaudio_softc *sc,
60185948Sthompsa		    struct snd_mixer *m);
61185948Sthompsaextern int	uaudio_mixer_uninit_sub(struct uaudio_softc *sc);
62185948Sthompsaextern void	uaudio_mixer_set(struct uaudio_softc *sc, unsigned type,
63185948Sthompsa		    unsigned left, unsigned right);
64185948Sthompsaextern uint32_t	uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src);
65184610Salfred
66184610Salfredint	uaudio_get_vendor(device_t dev);
67184610Salfredint	uaudio_get_product(device_t dev);
68184610Salfredint	uaudio_get_release(device_t dev);
69228484Shselasky
70228484Shselasky#endif			/* _UAUDIO_H_ */
71