1 /* $NetBSD: esavar.h,v 1.9 2007/12/09 20:28:07 jmcneill Exp $ */
4 * Copyright (c) 2001, 2002 Jared D. McNeill <jmcneill@invisible.ca>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * ESS Allegro-1 / Maestro3 Audio Driver
31 * Based on the FreeBSD maestro3 driver
36 * Number of simultaneous voices
38 * NOTE: The current code attaches audio0 thru audioESA_NUM_VOICES-1
39 * to this driver, and a lot of people probably don't want that.
40 * So, we'll default to 1 but we'll allow for the possibility of
43 * The current MINISRC image limits us to a maximum of 4 simultaneous voices.
45 #ifndef ESA_NUM_VOICES
46 #define ESA_NUM_VOICES 1
49 #define KERNADDR(p) ((void *)((p)->addr))
50 #define DMAADDR(p) ((p)->map->dm_segs[0].ds_addr)
52 #define ESA_MINRATE 8000
53 #define ESA_MAXRATE 48000
59 int indexmap
[ESA_NUM_VOICES
* 2];
65 bus_dma_segment_t segs
[1];
83 struct audio_params mode
;
90 device_t parent
; /* pointer to our parent */
91 struct esa_channel play
;
92 struct esa_channel rec
;
95 int index
; /* 0: play, 1: record */
101 bus_space_tag_t sc_iot
;
102 bus_space_handle_t sc_ioh
;
107 pci_chipset_tag_t sc_pct
;
108 bus_dma_tag_t sc_dmat
;
113 struct ac97_codec_if
*codec_if
;
114 struct ac97_host_if host_if
;
115 enum ac97_host_flags codec_flags
;
117 struct device
*sc_audiodev
[ESA_NUM_VOICES
];
119 struct esa_voice voice
[ESA_NUM_VOICES
];
120 struct esa_dma
*sc_dmas
;
123 /* timer management */
126 /* packed list structures */
127 struct esa_list mixer_list
;
128 struct esa_list adc1_list
;
129 struct esa_list dma_list
;
130 struct esa_list msrc_list
;
132 int type
; /* Allegro-1 or Maestro 3? */