uaudio.h revision 185948
159769Sgrog/* $FreeBSD: head/sys/dev/usb2/sound/uaudio2.h 185948 2008-12-11 23:13:02Z thompsa $ */
259769Sgrog
324424Swosch/*-
424424Swosch * Copyright (c) 2000-2002 Hiroyuki Aizu <aizu@navi.org>
524424Swosch *
624424Swosch * Redistribution and use in source and binary forms, with or without
724424Swosch * modification, are permitted provided that the following conditions
824424Swosch * are met:
924424Swosch * 1. Redistributions of source code must retain the above copyright
1024424Swosch *    notice, this list of conditions and the following disclaimer.
1124424Swosch * 2. Redistributions in binary form must reproduce the above copyright
1224424Swosch *    notice, this list of conditions and the following disclaimer in the
1324424Swosch *    documentation and/or other materials provided with the distribution.
1424424Swosch *
1542704Swosch * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1642704Swosch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1742704Swosch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1824424Swosch * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1942704Swosch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2042704Swosch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2142704Swosch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2242704Swosch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2342704Swosch * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2442704Swosch * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2542704Swosch * SUCH DAMAGE.
2642704Swosch */
2742704Swosch
2842704Swosch/* prototypes from "uaudio.c" used by "uaudio_pcm.c" */
2942704Swosch
3059769Sgrogstruct uaudio_chan;
3159769Sgrogstruct uaudio_softc;
3259769Sgrogstruct snd_dbuf;
3359769Sgrogstruct snd_mixer;
3459769Sgrogstruct pcm_channel;
3559769Sgrog
3659769Sgrogextern int	uaudio_attach_sub(device_t dev, kobj_class_t mixer_class,
3759769Sgrog		    kobj_class_t chan_class);
3859769Sgrogextern int	uaudio_detach_sub(device_t dev);
3924424Swoschextern void	*uaudio_chan_init(struct uaudio_softc *sc, struct snd_dbuf *b,
4042704Swosch		    struct pcm_channel *c, int dir);
4124424Swoschextern int	uaudio_chan_free(struct uaudio_chan *ch);
4242704Swoschextern int	uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
4324424Swosch		    uint32_t blocksize);
4442704Swoschextern int	uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
4524424Swosch		    uint32_t blocksize, uint32_t blockcount);
4624424Swoschextern int	uaudio_chan_set_param_speed(struct uaudio_chan *ch,
4724424Swosch		    uint32_t speed);
4842704Swoschextern int	uaudio_chan_getptr(struct uaudio_chan *ch);
4925031Swoschextern struct	pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
5059156Swoschextern int	uaudio_chan_set_param_format(struct uaudio_chan *ch,
5125031Swosch		    uint32_t format);
5225031Swoschextern int	uaudio_chan_start(struct uaudio_chan *ch);
5324424Swoschextern int	uaudio_chan_stop(struct uaudio_chan *ch);
5424424Swoschextern int	uaudio_mixer_init_sub(struct uaudio_softc *sc,
5524424Swosch		    struct snd_mixer *m);
5624424Swoschextern int	uaudio_mixer_uninit_sub(struct uaudio_softc *sc);
5771231Sitojunextern void	uaudio_mixer_set(struct uaudio_softc *sc, unsigned type,
5824424Swosch		    unsigned left, unsigned right);
5971231Sitojunextern uint32_t	uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src);
6025031Swosch
6171231Sitojunint	uaudio_get_vendor(device_t dev);
6224424Swoschint	uaudio_get_product(device_t dev);
6325031Swoschint	uaudio_get_release(device_t dev);
6425031Swosch