xref: /titanic_52/usr/src/uts/common/io/audio/drv/audioemu10k/dsp/emu10k2.mac (revision 992413f4053d9470046876b234fe094062b730b7)
1//
2// Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3// Use is subject to license terms.
4//
5// Copyright (C) 4Front Technologies 1996-2008.
6//
7// CDDL HEADER START
8//
9// The contents of this file are subject to the terms of the
10// Common Development and Distribution License (the "License").
11// You may not use this file except in compliance with the License.
12//
13// You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14// or http://www.opensolaris.org/os/licensing.
15// See the License for the specific language governing permissions
16// and limitations under the License.
17//
18// When distributing Covered Code, include this CDDL HEADER in each
19// file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20// If applicable, add the following below this CDDL HEADER, with the
21// fields enclosed by brackets "[]" replaced with your own identifying
22// information: Portions Copyright [yyyy] [name of copyright owner]
23//
24// CDDL HEADER END
25
26	// Constants for EMU 10k2 (SB Audigy)
27
28	// Inputs
29	.input IN_AC97_L	0
30	.input IN_AC97_R	1
31	.input IN_DIGCD_L	2
32	.input IN_DIGCD_R	3
33	.input IN_SPDIF1_L	4	// TOSLink
34	.input IN_SPDIF1_R	5
35	.input IN_MYSTERY_L	6
36	.input IN_MYSTERY_R	7
37	.input IN_LINE2_L	8	// LiveDrive
38	.input IN_LINE2_R	9
39	.input IN_SPDIF2_L	10	// Coaxial SPDIF
40	.input IN_SPDIF2_R	11
41	.input IN_AUX2_L	12	// LiveDrive
42	.input IN_AUX2_R	13
43
44	// Outputs
45	.output OUT_SPDIF_L	0
46	.output OUT_SPDIF_R	1
47	.output OUT_DCENTER	2	// Digital Center channel
48	.output OUT_DLFE	3	// Digital LFE
49	.output OUT_HEADPH_L	4	// LiveDrive headphone out
50	.output OUT_HEADPH_R	5
51	.output OUT_DSURR_L	6	// Surround output (digital)
52	.output OUT_DSURR_R	7
53	.output OUT_FRONT_L	8
54	.output OUT_FRONT_R	9
55	.output OUT_ACENTER	10	// Analog center channel
56	.output OUT_ALFE	11	// Analog LFE output
57	.output OUT_SIDE_L	12	// Side surround
58	.output OUT_SIDE_R	13
59	.output OUT_SURR_L	14	// Surround output
60	.output OUT_SURR_R	15
61	.output OUT_AC97_L	16	// Send to the AC97 front channel
62	.output OUT_AC97_R	17
63	.output OUT_ADC_L	22	// Send to the ADC recording channel
64	.output OUT_ADC_R	23
65	.output OUT_MICREC_L	24	// Send to the mic recording buffer
66	.output OUT_MICREC_R	25	// ??????? (maybe not in use at all)
67
68	// Temporaries
69	.gpr PCM_FRONT_L
70	.gpr PCM_FRONT_R
71	.gpr PCM_SURR_L
72	.gpr PCM_SURR_R
73	.gpr PCM_SIDE_L
74	.gpr PCM_SIDE_R
75	.gpr PCM_CEN
76	.gpr PCM_LFE
77	.gpr PCM_REC_L
78	.gpr PCM_REC_R
79	.gpr SPDIF_DELAY
80
81	// Code
82
83	// Load up the PCM inputs.
84	// We apply the PCM volume at the same time.
85	MACS(PCM_FRONT_L, 0, FX_FRONT_L, VOL_PCM)
86	MACS(PCM_FRONT_R, 0, FX_FRONT_R, VOL_PCM)
87	MACS(PCM_SURR_L, 0, FX_SURR_L, VOL_PCM)
88	MACS(PCM_SURR_R, 0, FX_SURR_R, VOL_PCM)
89	MACS(PCM_SIDE_L, 0, FX_SIDE_L, VOL_PCM)
90	MACS(PCM_SIDE_R, 0, FX_SIDE_R, VOL_PCM)
91	MACS(PCM_CEN, 0, FX_CEN, VOL_PCM)
92	MACS(PCM_LFE, 0, FX_LFE, VOL_PCM)
93
94	// Mix any monitor sources into the front PCM
95	// AC'97 (includes Line-In, analog CD, and Mic)
96	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_AC97_L, MON_AC97_L)
97	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_AC97_R, MON_AC97_R)
98	// DIGCD
99	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_DIGCD_L, MON_DIGCD_L)
100	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_DIGCD_R, MON_DIGCD_R)
101	// SPDIF1
102	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_SPDIF1_L, MON_SPDIF1_L)
103	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_SPDIF1_R, MON_SPDIF1_R)
104	// SPDIF2
105	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_SPDIF2_L, MON_SPDIF2_L)
106	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_SPDIF2_R, MON_SPDIF2_R)
107	// Line2/Mic2 (Live! Drive)
108	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_LINE2_L, MON_LINE2_L)
109	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_LINE2_R, MON_LINE2_R)
110	// Aux2 (Live! Drive)
111	MACS(PCM_FRONT_L, PCM_FRONT_L, IN_AUX2_L, MON_AUX2_L)
112	MACS(PCM_FRONT_R, PCM_FRONT_R, IN_AUX2_R, MON_AUX2_R)
113
114	// Outputs
115	MACS(OUT_FRONT_L, 0, PCM_FRONT_L, VOL_FRONT_L)
116	MACS(OUT_FRONT_R, 0, PCM_FRONT_R, VOL_FRONT_R)
117	MACS(OUT_SPDIF_L, 0, PCM_FRONT_L, VOL_FRONT_L)
118	// delay SPDIF right channel one sample to fix a bug
119	ACC3(OUT_SPDIF_R, 0, 0, SPDIF_DELAY)
120	MACS(SPDIF_DELAY, 0, PCM_FRONT_R, VOL_FRONT_R)
121	MACS(OUT_HEADPH_L, 0, PCM_FRONT_L, VOL_HEADPH_L)
122	MACS(OUT_HEADPH_R, 0, PCM_FRONT_R, VOL_HEADPH_R)
123	MACS(OUT_SURR_L, 0, PCM_SURR_L, VOL_SURR_L)
124	MACS(OUT_SURR_R, 0, PCM_SURR_R, VOL_SURR_R)
125	MACS(OUT_DSURR_L, 0, PCM_SURR_L, VOL_SURR_L)
126	MACS(OUT_DSURR_R, 0, PCM_SURR_R, VOL_SURR_R)
127	MACS(OUT_SIDE_L, 0, PCM_SIDE_L, VOL_SIDE_L)
128	MACS(OUT_SIDE_R, 0, PCM_SIDE_R, VOL_SIDE_R)
129	MACS(OUT_ACENTER, 0, PCM_CEN, VOL_CEN)
130	MACS(OUT_DCENTER, 0, PCM_CEN, VOL_CEN)
131	MACS(OUT_ALFE, 0, PCM_LFE, VOL_LFE)
132	MACS(OUT_DLFE, 0, PCM_LFE, VOL_LFE)
133
134	// Inputs (Recording) -- the source variables are treated as
135	// simple boolean enables.
136	MACINTS(PCM_REC_L, PCM_REC_R, IN_AC97_L, REC_AC97)
137	MACINTS(PCM_REC_R, PCM_REC_L, IN_AC97_R, REC_AC97)
138
139	MACINTS(PCM_REC_L, PCM_REC_L, IN_DIGCD_L, REC_DIGCD)
140	MACINTS(PCM_REC_R, PCM_REC_R, IN_DIGCD_R, REC_DIGCD)
141
142	MACINTS(PCM_REC_L, PCM_REC_L, IN_SPDIF1_L, REC_SPDIF1)
143	MACINTS(PCM_REC_R, PCM_REC_R, IN_SPDIF1_R, REC_SPDIF1)
144
145	MACINTS(PCM_REC_L, PCM_REC_L, IN_SPDIF2_L, REC_SPDIF2)
146	MACINTS(PCM_REC_R, PCM_REC_R, IN_SPDIF2_R, REC_SPDIF2)
147
148	MACINTS(PCM_REC_L, PCM_REC_L, IN_AUX2_L, REC_AUX2)
149	MACINTS(PCM_REC_R, PCM_REC_R, IN_AUX2_R, REC_AUX2)
150
151	MACINTS(PCM_REC_L, PCM_REC_L, IN_LINE2_L, REC_LINE2)
152	MACINTS(PCM_REC_R, PCM_REC_R, IN_LINE2_R, REC_LINE2)
153
154	MACINTS(PCM_REC_L, PCM_REC_L, PCM_FRONT_L, REC_PCM)
155	MACINTS(PCM_REC_R, PCM_REC_R, PCM_FRONT_R, REC_PCM)
156
157	// Apply master record gain
158	MACS(OUT_ADC_L, 0, PCM_REC_L, VOL_REC_L)
159	MACS(OUT_ADC_R, 0, PCM_REC_R, VOL_REC_R)
160