xref: /linux/sound/spi/at73c213.h (revision eafe57084786d5711e434165297f13864697f9f9)
1*eafe5708SHans-Christian Egtvedt /*
2*eafe5708SHans-Christian Egtvedt  * Driver for the AT73C213 16-bit stereo DAC on Atmel ATSTK1000
3*eafe5708SHans-Christian Egtvedt  *
4*eafe5708SHans-Christian Egtvedt  * Copyright (C) 2006 - 2007 Atmel Corporation
5*eafe5708SHans-Christian Egtvedt  *
6*eafe5708SHans-Christian Egtvedt  * This program is free software; you can redistribute it and/or
7*eafe5708SHans-Christian Egtvedt  * modify it under the terms of the GNU General Public License as
8*eafe5708SHans-Christian Egtvedt  * published by the Free Software Foundation; either version 2 of the
9*eafe5708SHans-Christian Egtvedt  * License, or (at your option) any later version.
10*eafe5708SHans-Christian Egtvedt  *
11*eafe5708SHans-Christian Egtvedt  * This program is distributed in the hope that it will be useful, but
12*eafe5708SHans-Christian Egtvedt  * WITHOUT ANY WARRANTY; without even the implied warranty of
13*eafe5708SHans-Christian Egtvedt  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*eafe5708SHans-Christian Egtvedt  * General Public License for more details.
15*eafe5708SHans-Christian Egtvedt  *
16*eafe5708SHans-Christian Egtvedt  * You should have received a copy of the GNU General Public License
17*eafe5708SHans-Christian Egtvedt  * along with this program; if not, write to the Free Software
18*eafe5708SHans-Christian Egtvedt  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19*eafe5708SHans-Christian Egtvedt  * 02111-1307, USA.
20*eafe5708SHans-Christian Egtvedt  *
21*eafe5708SHans-Christian Egtvedt  * The full GNU General Public License is included in this
22*eafe5708SHans-Christian Egtvedt  * distribution in the file called COPYING.
23*eafe5708SHans-Christian Egtvedt  */
24*eafe5708SHans-Christian Egtvedt 
25*eafe5708SHans-Christian Egtvedt #ifndef _SND_AT73C213_H
26*eafe5708SHans-Christian Egtvedt #define _SND_AT73C213_H
27*eafe5708SHans-Christian Egtvedt 
28*eafe5708SHans-Christian Egtvedt /* DAC control register */
29*eafe5708SHans-Christian Egtvedt #define DAC_CTRL		0x00
30*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONPADRV	7
31*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONAUXIN	6
32*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONDACR		5
33*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONDACL		4
34*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONLNOR		3
35*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONLNOL		2
36*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONLNIR		1
37*eafe5708SHans-Christian Egtvedt #define DAC_CTRL_ONLNIL		0
38*eafe5708SHans-Christian Egtvedt 
39*eafe5708SHans-Christian Egtvedt /* DAC left line in gain register */
40*eafe5708SHans-Christian Egtvedt #define DAC_LLIG		0x01
41*eafe5708SHans-Christian Egtvedt #define DAC_LLIG_LLIG		0
42*eafe5708SHans-Christian Egtvedt 
43*eafe5708SHans-Christian Egtvedt /* DAC right line in gain register */
44*eafe5708SHans-Christian Egtvedt #define DAC_RLIG		0x02
45*eafe5708SHans-Christian Egtvedt #define DAC_RLIG_RLIG		0
46*eafe5708SHans-Christian Egtvedt 
47*eafe5708SHans-Christian Egtvedt /* DAC Left Master Playback Gain Register */
48*eafe5708SHans-Christian Egtvedt #define DAC_LMPG		0x03
49*eafe5708SHans-Christian Egtvedt #define DAC_LMPG_LMPG		0
50*eafe5708SHans-Christian Egtvedt 
51*eafe5708SHans-Christian Egtvedt /* DAC Right Master Playback Gain Register */
52*eafe5708SHans-Christian Egtvedt #define DAC_RMPG		0x04
53*eafe5708SHans-Christian Egtvedt #define DAC_RMPG_RMPG		0
54*eafe5708SHans-Christian Egtvedt 
55*eafe5708SHans-Christian Egtvedt /* DAC Left Line Out Gain Register */
56*eafe5708SHans-Christian Egtvedt #define DAC_LLOG		0x05
57*eafe5708SHans-Christian Egtvedt #define DAC_LLOG_LLOG		0
58*eafe5708SHans-Christian Egtvedt 
59*eafe5708SHans-Christian Egtvedt /* DAC Right Line Out Gain Register */
60*eafe5708SHans-Christian Egtvedt #define DAC_RLOG		0x06
61*eafe5708SHans-Christian Egtvedt #define DAC_RLOG_RLOG		0
62*eafe5708SHans-Christian Egtvedt 
63*eafe5708SHans-Christian Egtvedt /* DAC Output Level Control Register */
64*eafe5708SHans-Christian Egtvedt #define DAC_OLC			0x07
65*eafe5708SHans-Christian Egtvedt #define DAC_OLC_RSHORT		7
66*eafe5708SHans-Christian Egtvedt #define DAC_OLC_ROLC		4
67*eafe5708SHans-Christian Egtvedt #define DAC_OLC_LSHORT		3
68*eafe5708SHans-Christian Egtvedt #define DAC_OLC_LOLC		0
69*eafe5708SHans-Christian Egtvedt 
70*eafe5708SHans-Christian Egtvedt /* DAC Mixer Control Register */
71*eafe5708SHans-Christian Egtvedt #define DAC_MC			0x08
72*eafe5708SHans-Christian Egtvedt #define DAC_MC_INVR		5
73*eafe5708SHans-Christian Egtvedt #define DAC_MC_INVL		4
74*eafe5708SHans-Christian Egtvedt #define DAC_MC_RMSMIN2		3
75*eafe5708SHans-Christian Egtvedt #define DAC_MC_RMSMIN1		2
76*eafe5708SHans-Christian Egtvedt #define DAC_MC_LMSMIN2		1
77*eafe5708SHans-Christian Egtvedt #define DAC_MC_LMSMIN1		0
78*eafe5708SHans-Christian Egtvedt 
79*eafe5708SHans-Christian Egtvedt /* DAC Clock and Sampling Frequency Control Register */
80*eafe5708SHans-Christian Egtvedt #define DAC_CSFC		0x09
81*eafe5708SHans-Christian Egtvedt #define DAC_CSFC_OVRSEL		4
82*eafe5708SHans-Christian Egtvedt 
83*eafe5708SHans-Christian Egtvedt /* DAC Miscellaneous Register */
84*eafe5708SHans-Christian Egtvedt #define DAC_MISC		0x0A
85*eafe5708SHans-Christian Egtvedt #define DAC_MISC_VCMCAPSEL	7
86*eafe5708SHans-Christian Egtvedt #define DAC_MISC_DINTSEL	4
87*eafe5708SHans-Christian Egtvedt #define DAC_MISC_DITHEN		3
88*eafe5708SHans-Christian Egtvedt #define DAC_MISC_DEEMPEN	2
89*eafe5708SHans-Christian Egtvedt #define DAC_MISC_NBITS		0
90*eafe5708SHans-Christian Egtvedt 
91*eafe5708SHans-Christian Egtvedt /* DAC Precharge Control Register */
92*eafe5708SHans-Christian Egtvedt #define DAC_PRECH		0x0C
93*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGPDRV	7
94*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGAUX1	6
95*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGLNOR	5
96*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGLNOL	4
97*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGLNIR	3
98*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHGLNIL	2
99*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_PRCHG		1
100*eafe5708SHans-Christian Egtvedt #define DAC_PRECH_ONMSTR	0
101*eafe5708SHans-Christian Egtvedt 
102*eafe5708SHans-Christian Egtvedt /* DAC Auxiliary Input Gain Control Register */
103*eafe5708SHans-Christian Egtvedt #define DAC_AUXG		0x0D
104*eafe5708SHans-Christian Egtvedt #define DAC_AUXG_AUXG		0
105*eafe5708SHans-Christian Egtvedt 
106*eafe5708SHans-Christian Egtvedt /* DAC Reset Register */
107*eafe5708SHans-Christian Egtvedt #define DAC_RST			0x10
108*eafe5708SHans-Christian Egtvedt #define DAC_RST_RESMASK		2
109*eafe5708SHans-Christian Egtvedt #define DAC_RST_RESFILZ		1
110*eafe5708SHans-Christian Egtvedt #define DAC_RST_RSTZ		0
111*eafe5708SHans-Christian Egtvedt 
112*eafe5708SHans-Christian Egtvedt /* Power Amplifier Control Register */
113*eafe5708SHans-Christian Egtvedt #define PA_CTRL			0x11
114*eafe5708SHans-Christian Egtvedt #define PA_CTRL_APAON		6
115*eafe5708SHans-Christian Egtvedt #define PA_CTRL_APAPRECH	5
116*eafe5708SHans-Christian Egtvedt #define PA_CTRL_APALP		4
117*eafe5708SHans-Christian Egtvedt #define PA_CTRL_APAGAIN		0
118*eafe5708SHans-Christian Egtvedt 
119*eafe5708SHans-Christian Egtvedt #endif /* _SND_AT73C213_H */
120