xref: /csrg-svn/sys/sparc/dev/bsd_audioreg.h (revision 55103)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * %sccs.include.redist.c%
10  *
11  *	@(#)bsd_audioreg.h	7.1 (Berkeley) 07/13/92
12  *
13  * from: $Header: bsd_audioreg.h,v 1.3 92/06/07 21:12:50 mccanne Exp $ (LBL)
14  */
15 
16 /*
17  * Bit encodings for chip commands from "Microprocessor Access Guide for
18  * Indirect Registers", p.19 Am79C30A/32A Advanced Micro Devices spec
19  * sheet (preliminary).
20  *
21  * Indirect register numbers (the value written into cr to select a given
22  * chip registers) have the form AMDR_*.  Register fields look like AMD_*.
23  */
24 
25 struct amd7930 {
26 	u_char	cr;		/* command register (wo) */
27 #define ir cr			/* interrupt register (ro) */
28 	u_char	dr;		/* data register (rw) */
29 	u_char	dsr1;		/* D-channel status register 1 (ro) */
30 	u_char	der;		/* D-channel error register (ro) */
31 	u_char	dctb;		/* D-channel transmit register (wo) */
32 #define dcrb dctb		/* D-channel receive register (ro) */
33 	u_char	bbtb;		/* Bb-channel transmit register (wo) */
34 #define bbrb bbtb		/* Bb-channel receive register (ro) */
35 	u_char	bctb;		/* Bc-channel transmit register (wo) */
36 #define bcrb bctb		/* Bc-channel receive register (ro) */
37 	u_char	dsr2;		/* D-channel status register 2 (ro) */
38 };
39 
40 #define AMDR_INIT	0x21
41 #define 	AMD_INIT_PMS_IDLE		0x00
42 #define 	AMD_INIT_PMS_ACTIVE		0x01
43 #define 	AMD_INIT_PMS_ACTIVE_DATA	0x02
44 #define 	AMD_INIT_INT_DISABLE		(0x01 << 2)
45 #define 	AMD_INIT_CDS_DIV2		(0x00 << 3)
46 #define 	AMD_INIT_CDS_DIV1		(0x01 << 3)
47 #define 	AMD_INIT_CDS_DIV4		(0x02 << 3)
48 #define 	AMD_INIT_AS_RX			(0x01 << 6)
49 #define 	AMD_INIT_AS_TX			(0x01 << 7)
50 
51 #define AMDR_LIU_LSR	0xa1
52 #define AMDR_LIU_LPR	0xa2
53 #define AMDR_LIU_LMR1	0xa3
54 #define AMDR_LIU_LMR2	0xa4
55 #define AMDR_LIU_2_4	0xa5
56 #define AMDR_LIU_MF	0xa6
57 #define AMDR_LIU_MFSB	0xa7
58 #define AMDR_LIU_MFQB	0xa8
59 
60 #define AMDR_MUX_MCR1	0x41
61 #define AMDR_MUX_MCR2	0x42
62 #define AMDR_MUX_MCR3	0x43
63 #define 	AMD_MCRCHAN_NC		0x00
64 #define 	AMD_MCRCHAN_B1		0x01
65 #define 	AMD_MCRCHAN_B2		0x02
66 #define 	AMD_MCRCHAN_BA		0x03
67 #define 	AMD_MCRCHAN_BB		0x04
68 #define 	AMD_MCRCHAN_BC		0x05
69 #define 	AMD_MCRCHAN_BD		0x06
70 #define 	AMD_MCRCHAN_BE		0x07
71 #define 	AMD_MCRCHAN_BF		0x08
72 #define AMDR_MUX_MCR4	0x44
73 #define		AMD_MCR4_INT_ENABLE	(1 << 3)
74 #define		AMD_MCR4_SWAPBB		(1 << 4)
75 #define		AMD_MCR4_SWAPBC		(1 << 5)
76 
77 #define AMDR_MUX_1_4	0x45
78 
79 #define AMDR_MAP_X	0x61
80 #define AMDR_MAP_R	0x62
81 #define AMDR_MAP_GX	0x63
82 #define AMDR_MAP_GR	0x64
83 #define AMDR_MAP_GER	0x65
84 #define AMDR_MAP_STG	0x66
85 #define AMDR_MAP_FTGR	0x67
86 #define AMDR_MAP_ATGR	0x68
87 #define AMDR_MAP_MMR1	0x69
88 #define		AMD_MMR1_ALAW	0x01
89 #define		AMD_MMR1_GX	0x02
90 #define		AMD_MMR1_GR	0x04
91 #define		AMD_MMR1_GER	0x08
92 #define		AMD_MMR1_X	0x10
93 #define		AMD_MMR1_R	0x20
94 #define		AMD_MMR1_STG	0x40
95 #define		AMD_MMR1_LOOP	0x80
96 #define AMDR_MAP_MMR2	0x6a
97 #define		AMD_MMR2_AINB	0x01
98 #define		AMD_MMR2_LS	0x02
99 #define		AMD_MMR2_DTMF	0x04
100 #define		AMD_MMR2_GEN	0x08
101 #define		AMD_MMR2_RNG		0x10
102 #define		AMD_MMR2_DIS_HPF	0x20
103 #define		AMD_MMR2_DIS_AZ		0x40
104 #define AMDR_MAP_1_10	0x6b
105 
106 #define AMDR_DLC_FRAR123 0x81
107 #define AMDR_DLC_SRAR123 0x82
108 #define AMDR_DLC_TAR	0x83
109 #define AMDR_DLC_DRLR	0x84
110 #define AMDR_DLC_DTCR	0x85
111 #define AMDR_DLC_DMR1	0x86
112 #define AMDR_DLC_DMR2	0x87
113 #define AMDR_DLC_1_7	0x88
114 #define AMDR_DLC_DRCR	0x89
115 #define AMDR_DLC_RNGR1	0x8a
116 #define AMDR_DLC_RNGR2	0x8b
117 #define AMDR_DLC_FRAR4	0x8c
118 #define AMDR_DLC_SRAR4	0x8d
119 #define AMDR_DLC_DMR3	0x8e
120 #define AMDR_DLC_DMR4	0x8f
121 #define AMDR_DLC_12_15	0x90
122 #define AMDR_DLC_ASR	0x91
123