1 /* $OpenBSD: cs4231reg.h,v 1.5 2001/10/01 03:21:10 jason Exp $ */
2 /* $NetBSD: cs4231reg.h,v 1.4 1996/02/16 08:12:33 mycroft Exp $ */
3
4 /*-
5 * Copyright (c) 1996 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Ken Hornstein and John Kohl.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40 /*
41 * Register defs for Crystal Semiconductor CS4231 Audio Codec/mixer
42 * chip, used on Gravis UltraSound MAX cards.
43 *
44 * Block diagram:
45 * +----------------------------------------------------+
46 * | |
47 * | +----------------------------------------------+ |
48 * | |mixed in +-+ | |
49 * | +------------>--| | | |
50 * | mic in | | | |
51 * Mic --+-->| --------- GAIN ->-| | | |
52 * | | AUX 1 in |M| | |
53 * GF1 --)-->| -------------+-->-|U| | |
54 * | | Line in | |X|---- GAIN ----------+ | |
55 * Line --)-->| ---------+---)-->-| | | | |
56 * | | | | | | | | |
57 * | | | | +-+ ADC | |
58 * | | | | | | |
59 * | | | | | | |
60 * | | | +--- L/M --\ | | | AMP-->
61 * | | | \ | | | |
62 * | | | \ | | | |
63 * | | +---- L/M -------O-->--+--------)-------+-|--+-> line
64 * | | mono in /| | | |
65 * +---|-->------------ L/M -----/ | | | |
66 * | AUX 2 in | | | |
67 * CD --------|-->------------ L/M -------+ L/M | |
68 * | | v |
69 * | | | |
70 * | DAC | |
71 * | | | |
72 * +----------------------------------------------------+
73 * | |
74 * | |
75 * v v
76 * Pc BUS (DISK) ???
77 *
78 * Documentation for this chip can be found at:
79 * http://www.cirrus.com/products/overviews/cs4231.html
80 */
81
82 /* CS4231/AD1845 mode2 registers; added to AD1848 registers */
83 #define CS_ALT_FEATURE1 0x10
84 #define CS_ALT_FEATURE2 0x11
85 #define CS_LEFT_LINE_CONTROL 0x12
86 #define CS_RIGHT_LINE_CONTROL 0x13
87 #define CS_TIMER_LOW 0x14
88 #define CS_TIMER_HIGH 0x15
89 #define CS_UPPER_FREQUENCY_SEL 0x16
90 #define CS_LOWER_FREQUENCY_SEL 0x17
91 #define CS_IRQ_STATUS 0x18
92 #define CS_VERSION_ID 0x19
93 #define CS_MONO_IO_CONTROL 0x1A
94 #define CS_POWERDOWN_CONTROL 0x1B
95 #define CS_REC_FORMAT 0x1C
96 #define CS_XTAL_SELECT 0x1D
97 #define CS_UPPER_REC_CNT 0x1E
98 #define CS_LOWER_REC_CNT 0x1F
99
100 #define MONO_INPUT_ATTEN_BITS 0x0f
101 #define MONO_INPUT_ATTEN_MASK 0xf0
102 #define MONO_OUTPUT_MUTE 0x40
103 #define MONO_INPUT_MUTE 0x80
104 #define MONO_INPUT_MUTE_MASK 0x7f
105
106 #define LINE_INPUT_ATTEN_BITS 0x1f
107 #define LINE_INPUT_ATTEN_MASK 0xe0
108 #define LINE_INPUT_MUTE 0x80
109 #define LINE_INPUT_MUTE_MASK 0x7f