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