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