1 /* $NetBSD: auixpvar.h,v 1.5 2007/03/04 06:02:16 christos Exp $*/
4 * Copyright (c) 2004, 2005 Reinoud Zandijk <reinoud@netbsd.org>
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.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by the NetBSD
17 * Foundation, Inc. and its contributors.
18 * 4. Neither the name of The NetBSD Foundation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * NetBSD audio driver for ATI IXP-{150,200,...} audio driver hardware.
40 #define DMA_DESC_CHAIN 255
43 /* audio format structure describing our hardware capabilities */
44 /* XXX min and max sample rates are for AD1888 codec XXX */
45 #define AUIXP_NFORMATS 6
48 #define AUIXP_MINRATE 7000
49 #define AUIXP_MAXRATE 48000
52 /* current AC'97 driver only supports SPDIF outputting channel 3&4 i.e. STEREO */
53 static const struct audio_format auixp_formats
[AUIXP_NFORMATS
] = {
54 {NULL
, AUMODE_PLAY
| AUMODE_RECORD
, AUDIO_ENCODING_SLINEAR_LE
, 16, 16, 2, AUFMT_STEREO
, 0, {7000, 48000}},
55 {NULL
, AUMODE_PLAY
| AUMODE_RECORD
, AUDIO_ENCODING_SLINEAR_LE
, 32, 32, 2, AUFMT_STEREO
, 0, {7000, 48000}},
56 {NULL
, AUMODE_PLAY
, AUDIO_ENCODING_SLINEAR_LE
, 16, 16, 4, AUFMT_SURROUND4
, 0, {7000, 48000}},
57 {NULL
, AUMODE_PLAY
, AUDIO_ENCODING_SLINEAR_LE
, 32, 32, 4, AUFMT_SURROUND4
, 0, {7000, 48000}},
58 {NULL
, AUMODE_PLAY
, AUDIO_ENCODING_SLINEAR_LE
, 16, 16, 6, AUFMT_DOLBY_5_1
, 0, {7000, 48000}},
59 {NULL
, AUMODE_PLAY
, AUDIO_ENCODING_SLINEAR_LE
, 32, 32, 6, AUFMT_DOLBY_5_1
, 0, {7000, 48000}},
63 /* auixp structures; used to record alloced DMA space */
68 bus_dma_segment_t segs
[1];
73 void (*intr
)(void *); /* function to call when there is space */
76 /* status and setup bits */
79 uint32_t dma_enable_bit
;
81 /* linked list of all mapped area's */
82 SLIST_ENTRY(auixp_dma
) dma_chain
;
87 struct auixp_softc
*sc
;
92 struct ac97_codec_if
*codec_if
;
93 struct ac97_host_if host_if
;
94 enum ac97_host_flags codec_flags
;
103 int delay1
, delay2
; /* nessisary? */
105 /* card properties */
106 int has_4ch
, has_6ch
, is_fixed
, has_spdif
;
109 bus_space_tag_t sc_iot
;
110 bus_space_handle_t sc_ioh
;
115 pci_chipset_tag_t sc_pct
;
117 bus_dma_tag_t sc_dmat
;
123 struct auixp_dma
*sc_output_dma
; /* contains dma-safe chain */
124 struct auixp_dma
*sc_input_dma
;
126 /* list of allocated DMA pieces */
127 SLIST_HEAD(auixp_dma_list
, auixp_dma
) sc_dma_list
;
129 /* audio formats supported */
130 struct audio_format sc_formats
[AUIXP_NFORMATS
];
131 struct audio_encoding_set
*sc_encodings
;
135 struct auixp_codec sc_codec
[ATI_IXP_CODECS
];
136 int sc_codec_not_ready_bits
;
138 /* last set audio parameters */
139 struct audio_params sc_play_params
;
140 struct audio_params sc_rec_params
;