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