xref: /linux/sound/soc/codecs/da7219.h (revision 6d817c0e9fd7536be76690bfdee88e8a81c16f7d)
1*6d817c0eSAdam Thomson /*
2*6d817c0eSAdam Thomson  * da7219.h - DA7219 ALSA SoC Codec Driver
3*6d817c0eSAdam Thomson  *
4*6d817c0eSAdam Thomson  * Copyright (c) 2015 Dialog Semiconductor
5*6d817c0eSAdam Thomson  *
6*6d817c0eSAdam Thomson  * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
7*6d817c0eSAdam Thomson  *
8*6d817c0eSAdam Thomson  * This program is free software; you can redistribute  it and/or modify it
9*6d817c0eSAdam Thomson  * under  the terms of  the GNU General  Public License as published by the
10*6d817c0eSAdam Thomson  * Free Software Foundation;  either version 2 of the  License, or (at your
11*6d817c0eSAdam Thomson  * option) any later version.
12*6d817c0eSAdam Thomson  */
13*6d817c0eSAdam Thomson 
14*6d817c0eSAdam Thomson #ifndef __DA7219_H
15*6d817c0eSAdam Thomson #define __DA7219_H
16*6d817c0eSAdam Thomson 
17*6d817c0eSAdam Thomson #include <linux/regmap.h>
18*6d817c0eSAdam Thomson #include <linux/regulator/consumer.h>
19*6d817c0eSAdam Thomson #include <sound/da7219.h>
20*6d817c0eSAdam Thomson 
21*6d817c0eSAdam Thomson /*
22*6d817c0eSAdam Thomson  * Registers
23*6d817c0eSAdam Thomson  */
24*6d817c0eSAdam Thomson 
25*6d817c0eSAdam Thomson #define DA7219_MIC_1_GAIN_STATUS	0x6
26*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_GAIN_STATUS	0x8
27*6d817c0eSAdam Thomson #define DA7219_ADC_L_GAIN_STATUS	0xA
28*6d817c0eSAdam Thomson #define DA7219_DAC_L_GAIN_STATUS	0xC
29*6d817c0eSAdam Thomson #define DA7219_DAC_R_GAIN_STATUS	0xD
30*6d817c0eSAdam Thomson #define DA7219_HP_L_GAIN_STATUS		0xE
31*6d817c0eSAdam Thomson #define DA7219_HP_R_GAIN_STATUS		0xF
32*6d817c0eSAdam Thomson #define DA7219_MIC_1_SELECT		0x10
33*6d817c0eSAdam Thomson #define DA7219_CIF_TIMEOUT_CTRL		0x12
34*6d817c0eSAdam Thomson #define DA7219_CIF_CTRL			0x13
35*6d817c0eSAdam Thomson #define DA7219_SR_24_48			0x16
36*6d817c0eSAdam Thomson #define DA7219_SR			0x17
37*6d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG		0x1B
38*6d817c0eSAdam Thomson #define DA7219_PLL_CTRL			0x20
39*6d817c0eSAdam Thomson #define DA7219_PLL_FRAC_TOP		0x22
40*6d817c0eSAdam Thomson #define DA7219_PLL_FRAC_BOT		0x23
41*6d817c0eSAdam Thomson #define DA7219_PLL_INTEGER		0x24
42*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STS		0x25
43*6d817c0eSAdam Thomson #define DA7219_DIG_ROUTING_DAI		0x2A
44*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_MODE		0x2B
45*6d817c0eSAdam Thomson #define DA7219_DAI_CTRL			0x2C
46*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_CTRL		0x2D
47*6d817c0eSAdam Thomson #define DA7219_DIG_ROUTING_DAC		0x2E
48*6d817c0eSAdam Thomson #define DA7219_ALC_CTRL1		0x2F
49*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER		0x30
50*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER		0x31
51*6d817c0eSAdam Thomson #define DA7219_REFERENCES		0x32
52*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_SELECT		0x33
53*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_GAIN		0x34
54*6d817c0eSAdam Thomson #define DA7219_ADC_L_GAIN		0x36
55*6d817c0eSAdam Thomson #define DA7219_ADC_FILTERS1		0x38
56*6d817c0eSAdam Thomson #define DA7219_MIC_1_GAIN		0x39
57*6d817c0eSAdam Thomson #define DA7219_SIDETONE_CTRL		0x3A
58*6d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN		0x3B
59*6d817c0eSAdam Thomson #define DA7219_DROUTING_ST_OUTFILT_1L	0x3C
60*6d817c0eSAdam Thomson #define DA7219_DROUTING_ST_OUTFILT_1R	0x3D
61*6d817c0eSAdam Thomson #define DA7219_DAC_FILTERS5		0x40
62*6d817c0eSAdam Thomson #define DA7219_DAC_FILTERS2		0x41
63*6d817c0eSAdam Thomson #define DA7219_DAC_FILTERS3		0x42
64*6d817c0eSAdam Thomson #define DA7219_DAC_FILTERS4		0x43
65*6d817c0eSAdam Thomson #define DA7219_DAC_FILTERS1		0x44
66*6d817c0eSAdam Thomson #define DA7219_DAC_L_GAIN		0x45
67*6d817c0eSAdam Thomson #define DA7219_DAC_R_GAIN		0x46
68*6d817c0eSAdam Thomson #define DA7219_CP_CTRL			0x47
69*6d817c0eSAdam Thomson #define DA7219_HP_L_GAIN		0x48
70*6d817c0eSAdam Thomson #define DA7219_HP_R_GAIN		0x49
71*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_SELECT		0x4B
72*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_SELECT		0x4C
73*6d817c0eSAdam Thomson #define DA7219_SYSTEM_MODES_INPUT	0x50
74*6d817c0eSAdam Thomson #define DA7219_SYSTEM_MODES_OUTPUT	0x51
75*6d817c0eSAdam Thomson #define DA7219_MICBIAS_CTRL		0x62
76*6d817c0eSAdam Thomson #define DA7219_MIC_1_CTRL		0x63
77*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_CTRL		0x65
78*6d817c0eSAdam Thomson #define DA7219_ADC_L_CTRL		0x67
79*6d817c0eSAdam Thomson #define DA7219_DAC_L_CTRL		0x69
80*6d817c0eSAdam Thomson #define DA7219_DAC_R_CTRL		0x6A
81*6d817c0eSAdam Thomson #define DA7219_HP_L_CTRL		0x6B
82*6d817c0eSAdam Thomson #define DA7219_HP_R_CTRL		0x6C
83*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_CTRL		0x6E
84*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_CTRL		0x6F
85*6d817c0eSAdam Thomson #define DA7219_CHIP_ID1			0x81
86*6d817c0eSAdam Thomson #define DA7219_CHIP_ID2			0x82
87*6d817c0eSAdam Thomson #define DA7219_CHIP_REVISION		0x83
88*6d817c0eSAdam Thomson #define DA7219_LDO_CTRL			0x90
89*6d817c0eSAdam Thomson #define DA7219_IO_CTRL			0x91
90*6d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_CTRL		0x92
91*6d817c0eSAdam Thomson #define DA7219_PC_COUNT			0x94
92*6d817c0eSAdam Thomson #define DA7219_CP_VOL_THRESHOLD1	0x95
93*6d817c0eSAdam Thomson #define DA7219_CP_DELAY			0x96
94*6d817c0eSAdam Thomson #define DA7219_DIG_CTRL			0x99
95*6d817c0eSAdam Thomson #define DA7219_ALC_CTRL2		0x9A
96*6d817c0eSAdam Thomson #define DA7219_ALC_CTRL3		0x9B
97*6d817c0eSAdam Thomson #define DA7219_ALC_NOISE		0x9C
98*6d817c0eSAdam Thomson #define DA7219_ALC_TARGET_MIN		0x9D
99*6d817c0eSAdam Thomson #define DA7219_ALC_TARGET_MAX		0x9E
100*6d817c0eSAdam Thomson #define DA7219_ALC_GAIN_LIMITS		0x9F
101*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_LIMITS	0xA0
102*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_CTRL	0xA1
103*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL	0xA2
104*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L	0xA3
105*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L	0xA4
106*6d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME	0xAF
107*6d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESH	0xB0
108*6d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESH		0xB1
109*6d817c0eSAdam Thomson #define DA7219_DAC_NG_CTRL		0xB2
110*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_CFG1		0xB4
111*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_CFG2		0xB5
112*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_CYCLES		0xB6
113*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ1_L		0xB7
114*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ1_U		0xB8
115*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ2_L		0xB9
116*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ2_U		0xBA
117*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_ON_PER		0xBB
118*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_OFF_PER		0xBC
119*6d817c0eSAdam Thomson #define DA7219_SYSTEM_STATUS		0xE0
120*6d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE		0xFD
121*6d817c0eSAdam Thomson 
122*6d817c0eSAdam Thomson 
123*6d817c0eSAdam Thomson /*
124*6d817c0eSAdam Thomson  * Bit Fields
125*6d817c0eSAdam Thomson  */
126*6d817c0eSAdam Thomson 
127*6d817c0eSAdam Thomson #define DA7219_SWITCH_EN_MAX		0x1
128*6d817c0eSAdam Thomson 
129*6d817c0eSAdam Thomson /* DA7219_MIC_1_GAIN_STATUS = 0x6 */
130*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_STATUS_SHIFT	0
131*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_STATUS_MASK	(0x7 << 0)
132*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_MAX		0x7
133*6d817c0eSAdam Thomson 
134*6d817c0eSAdam Thomson /* DA7219_MIXIN_L_GAIN_STATUS = 0x8 */
135*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_STATUS_SHIFT	0
136*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_STATUS_MASK	(0xF << 0)
137*6d817c0eSAdam Thomson 
138*6d817c0eSAdam Thomson /* DA7219_ADC_L_GAIN_STATUS = 0xA */
139*6d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_STATUS_SHIFT	0
140*6d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_STATUS_MASK	(0x7F << 0)
141*6d817c0eSAdam Thomson 
142*6d817c0eSAdam Thomson /* DA7219_DAC_L_GAIN_STATUS = 0xC */
143*6d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_STATUS_SHIFT	0
144*6d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_STATUS_MASK	(0x7F << 0)
145*6d817c0eSAdam Thomson 
146*6d817c0eSAdam Thomson /* DA7219_DAC_R_GAIN_STATUS = 0xD */
147*6d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_STATUS_SHIFT	0
148*6d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_STATUS_MASK	(0x7F << 0)
149*6d817c0eSAdam Thomson 
150*6d817c0eSAdam Thomson /* DA7219_HP_L_GAIN_STATUS = 0xE */
151*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_STATUS_SHIFT	0
152*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_STATUS_MASK	(0x3F << 0)
153*6d817c0eSAdam Thomson 
154*6d817c0eSAdam Thomson /* DA7219_HP_R_GAIN_STATUS = 0xF */
155*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_STATUS_SHIFT	0
156*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_STATUS_MASK	(0x3F << 0)
157*6d817c0eSAdam Thomson 
158*6d817c0eSAdam Thomson /* DA7219_MIC_1_SELECT = 0x10 */
159*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_IN_SEL_SHIFT	0
160*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_IN_SEL_MASK	(0x3 << 0)
161*6d817c0eSAdam Thomson 
162*6d817c0eSAdam Thomson /* DA7219_CIF_TIMEOUT_CTRL = 0x12 */
163*6d817c0eSAdam Thomson #define DA7219_I2C_TIMEOUT_EN_SHIFT	0
164*6d817c0eSAdam Thomson #define DA7219_I2C_TIMEOUT_EN_MASK	(0x1 << 0)
165*6d817c0eSAdam Thomson 
166*6d817c0eSAdam Thomson /* DA7219_CIF_CTRL = 0x13 */
167*6d817c0eSAdam Thomson #define DA7219_CIF_I2C_WRITE_MODE_SHIFT		0
168*6d817c0eSAdam Thomson #define DA7219_CIF_I2C_WRITE_MODE_MASK		(0x1 << 0)
169*6d817c0eSAdam Thomson #define DA7219_CIF_REG_SOFT_RESET_SHIFT		7
170*6d817c0eSAdam Thomson #define DA7219_CIF_REG_SOFT_RESET_MASK		(0x1 << 7)
171*6d817c0eSAdam Thomson 
172*6d817c0eSAdam Thomson /* DA7219_SR_24_48 = 0x16 */
173*6d817c0eSAdam Thomson #define DA7219_SR_24_48_SHIFT	0
174*6d817c0eSAdam Thomson #define DA7219_SR_24_48_MASK	(0x1 << 0)
175*6d817c0eSAdam Thomson 
176*6d817c0eSAdam Thomson /* DA7219_SR = 0x17 */
177*6d817c0eSAdam Thomson #define DA7219_SR_SHIFT		0
178*6d817c0eSAdam Thomson #define DA7219_SR_MASK		(0xF << 0)
179*6d817c0eSAdam Thomson #define DA7219_SR_8000		(0x01 << 0)
180*6d817c0eSAdam Thomson #define DA7219_SR_11025		(0x02 << 0)
181*6d817c0eSAdam Thomson #define DA7219_SR_12000		(0x03 << 0)
182*6d817c0eSAdam Thomson #define DA7219_SR_16000		(0x05 << 0)
183*6d817c0eSAdam Thomson #define DA7219_SR_22050		(0x06 << 0)
184*6d817c0eSAdam Thomson #define DA7219_SR_24000		(0x07 << 0)
185*6d817c0eSAdam Thomson #define DA7219_SR_32000		(0x09 << 0)
186*6d817c0eSAdam Thomson #define DA7219_SR_44100		(0x0A << 0)
187*6d817c0eSAdam Thomson #define DA7219_SR_48000		(0x0B << 0)
188*6d817c0eSAdam Thomson #define DA7219_SR_88200		(0x0E << 0)
189*6d817c0eSAdam Thomson #define DA7219_SR_96000		(0x0F << 0)
190*6d817c0eSAdam Thomson 
191*6d817c0eSAdam Thomson /* DA7219_CIF_I2C_ADDR_CFG = 0x1B */
192*6d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG_SHIFT	0
193*6d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG_MASK	(0x3 << 0)
194*6d817c0eSAdam Thomson 
195*6d817c0eSAdam Thomson /* DA7219_PLL_CTRL = 0x20 */
196*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_SHIFT		2
197*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_MASK		(0x7 << 2)
198*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_2_5_MHZ	(0x0 << 2)
199*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_5_10_MHZ	(0x1 << 2)
200*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_10_20_MHZ	(0x2 << 2)
201*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_20_40_MHZ	(0x3 << 2)
202*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_40_54_MHZ	(0x4 << 2)
203*6d817c0eSAdam Thomson #define DA7219_PLL_MCLK_SQR_EN_SHIFT	5
204*6d817c0eSAdam Thomson #define DA7219_PLL_MCLK_SQR_EN_MASK	(0x1 << 5)
205*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_SHIFT		6
206*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_MASK		(0x3 << 6)
207*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_BYPASS		(0x0 << 6)
208*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_NORMAL		(0x1 << 6)
209*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_SRM		(0x2 << 6)
210*6d817c0eSAdam Thomson #define DA7219_PLL_MODE_32KHZ		(0x3 << 6)
211*6d817c0eSAdam Thomson 
212*6d817c0eSAdam Thomson /* DA7219_PLL_FRAC_TOP = 0x22 */
213*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT	0
214*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_TOP_MASK	(0x1F << 0)
215*6d817c0eSAdam Thomson 
216*6d817c0eSAdam Thomson /* DA7219_PLL_FRAC_BOT = 0x23 */
217*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_BOT_SHIFT	0
218*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_BOT_MASK	(0xFF << 0)
219*6d817c0eSAdam Thomson 
220*6d817c0eSAdam Thomson /* DA7219_PLL_INTEGER = 0x24 */
221*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_INTEGER_SHIFT	0
222*6d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_INTEGER_MASK	(0x7F << 0)
223*6d817c0eSAdam Thomson 
224*6d817c0eSAdam Thomson /* DA7219_PLL_SRM_STS = 0x25 */
225*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATE_SHIFT	0
226*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATE_MASK	(0xF << 0)
227*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATUS_SHIFT	4
228*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATUS_MASK	(0xF << 4)
229*6d817c0eSAdam Thomson #define DA7219_PLL_SRM_STS_SRM_LOCK	(0x1 << 7)
230*6d817c0eSAdam Thomson 
231*6d817c0eSAdam Thomson /* DA7219_DIG_ROUTING_DAI = 0x2A */
232*6d817c0eSAdam Thomson #define DA7219_DAI_L_SRC_SHIFT	0
233*6d817c0eSAdam Thomson #define DA7219_DAI_L_SRC_MASK	(0x3 << 0)
234*6d817c0eSAdam Thomson #define DA7219_DAI_R_SRC_SHIFT	4
235*6d817c0eSAdam Thomson #define DA7219_DAI_R_SRC_MASK	(0x3 << 4)
236*6d817c0eSAdam Thomson #define DA7219_OUT_SRC_MAX	4
237*6d817c0eSAdam Thomson 
238*6d817c0eSAdam Thomson /* DA7219_DAI_CLK_MODE = 0x2B */
239*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_SHIFT	0
240*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_MASK	(0x3 << 0)
241*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_32	(0x0 << 0)
242*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_64	(0x1 << 0)
243*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_128	(0x2 << 0)
244*6d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_256	(0x3 << 0)
245*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_SHIFT	2
246*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_MASK		(0x1 << 2)
247*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_INV		(0x1 << 2)
248*6d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_SHIFT	3
249*6d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_MASK	(0x1 << 3)
250*6d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_INV		(0x1 << 3)
251*6d817c0eSAdam Thomson #define DA7219_DAI_WCLK_TRI_STATE_SHIFT	4
252*6d817c0eSAdam Thomson #define DA7219_DAI_WCLK_TRI_STATE_MASK	(0x1 << 4)
253*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_EN_SHIFT		7
254*6d817c0eSAdam Thomson #define DA7219_DAI_CLK_EN_MASK		(0x1 << 7)
255*6d817c0eSAdam Thomson 
256*6d817c0eSAdam Thomson /* DA7219_DAI_CTRL = 0x2C */
257*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_SHIFT		0
258*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_MASK		(0x3 << 0)
259*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_I2S		(0x0 << 0)
260*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_LEFT_J	(0x1 << 0)
261*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_RIGHT_J	(0x2 << 0)
262*6d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_DSP		(0x3 << 0)
263*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_SHIFT	2
264*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_MASK	(0x3 << 2)
265*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S16_LE	(0x0 << 2)
266*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S20_LE	(0x1 << 2)
267*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S24_LE	(0x2 << 2)
268*6d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S32_LE	(0x3 << 2)
269*6d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_SHIFT		4
270*6d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_MASK		(0x3 << 4)
271*6d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_MAX		2
272*6d817c0eSAdam Thomson #define DA7219_DAI_EN_SHIFT		7
273*6d817c0eSAdam Thomson #define DA7219_DAI_EN_MASK		(0x1 << 7)
274*6d817c0eSAdam Thomson 
275*6d817c0eSAdam Thomson /* DA7219_DAI_TDM_CTRL = 0x2D */
276*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_CH_EN_SHIFT	0
277*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_CH_EN_MASK	(0x3 << 0)
278*6d817c0eSAdam Thomson #define DA7219_DAI_OE_SHIFT		6
279*6d817c0eSAdam Thomson #define DA7219_DAI_OE_MASK		(0x1 << 6)
280*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_MODE_EN_SHIFT	7
281*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_MODE_EN_MASK	(0x1 << 7)
282*6d817c0eSAdam Thomson #define DA7219_DAI_TDM_MAX_SLOTS	2
283*6d817c0eSAdam Thomson 
284*6d817c0eSAdam Thomson /* DA7219_DIG_ROUTING_DAC = 0x2E */
285*6d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_SHIFT		0
286*6d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_MASK		(0x3 << 0)
287*6d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_TONEGEN	(0x1 << 0)
288*6d817c0eSAdam Thomson #define DA7219_DAC_L_MONO_SHIFT		3
289*6d817c0eSAdam Thomson #define DA7219_DAC_L_MONO_MASK		(0x1 << 3)
290*6d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_SHIFT		4
291*6d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_MASK		(0x3 << 4)
292*6d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_TONEGEN	(0x1 << 4)
293*6d817c0eSAdam Thomson #define DA7219_DAC_R_MONO_SHIFT		7
294*6d817c0eSAdam Thomson #define DA7219_DAC_R_MONO_MASK		(0x1 << 7)
295*6d817c0eSAdam Thomson 
296*6d817c0eSAdam Thomson /* DA7219_ALC_CTRL1 = 0x2F */
297*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_EN_SHIFT	0
298*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_EN_MASK	(0x1 << 0)
299*6d817c0eSAdam Thomson #define DA7219_ALC_SYNC_MODE_SHIFT	1
300*6d817c0eSAdam Thomson #define DA7219_ALC_SYNC_MODE_MASK	(0x1 << 1)
301*6d817c0eSAdam Thomson #define DA7219_ALC_EN_SHIFT		3
302*6d817c0eSAdam Thomson #define DA7219_ALC_EN_MASK		(0x1 << 3)
303*6d817c0eSAdam Thomson #define DA7219_ALC_AUTO_CALIB_EN_SHIFT	4
304*6d817c0eSAdam Thomson #define DA7219_ALC_AUTO_CALIB_EN_MASK	(0x1 << 4)
305*6d817c0eSAdam Thomson #define DA7219_ALC_CALIB_OVERFLOW_SHIFT	5
306*6d817c0eSAdam Thomson #define DA7219_ALC_CALIB_OVERFLOW_MASK	(0x1 << 5)
307*6d817c0eSAdam Thomson 
308*6d817c0eSAdam Thomson /* DA7219_DAI_OFFSET_LOWER = 0x30 */
309*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER_SHIFT	0
310*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER_MASK	(0xFF << 0)
311*6d817c0eSAdam Thomson 
312*6d817c0eSAdam Thomson /* DA7219_DAI_OFFSET_UPPER = 0x31 */
313*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER_SHIFT	0
314*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER_MASK	(0x7 << 0)
315*6d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_MAX		0x2FF
316*6d817c0eSAdam Thomson 
317*6d817c0eSAdam Thomson /* DA7219_REFERENCES = 0x32 */
318*6d817c0eSAdam Thomson #define DA7219_BIAS_EN_SHIFT		3
319*6d817c0eSAdam Thomson #define DA7219_BIAS_EN_MASK		(0x1 << 3)
320*6d817c0eSAdam Thomson #define DA7219_VMID_FAST_CHARGE_SHIFT	4
321*6d817c0eSAdam Thomson #define DA7219_VMID_FAST_CHARGE_MASK	(0x1 << 4)
322*6d817c0eSAdam Thomson 
323*6d817c0eSAdam Thomson /* DA7219_MIXIN_L_SELECT = 0x33 */
324*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_SELECT_SHIFT	0
325*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_SELECT_MASK	(0x1 << 0)
326*6d817c0eSAdam Thomson 
327*6d817c0eSAdam Thomson /* DA7219_MIXIN_L_GAIN = 0x34 */
328*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_SHIFT	0
329*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_MASK	(0xF << 0)
330*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_MAX	0xF
331*6d817c0eSAdam Thomson 
332*6d817c0eSAdam Thomson /* DA7219_ADC_L_GAIN = 0x36 */
333*6d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_SHIFT	0
334*6d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_MASK	(0x7F << 0)
335*6d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_MAX	0x7F
336*6d817c0eSAdam Thomson 
337*6d817c0eSAdam Thomson /* DA7219_ADC_FILTERS1 = 0x38 */
338*6d817c0eSAdam Thomson #define DA7219_ADC_VOICE_HPF_CORNER_SHIFT	0
339*6d817c0eSAdam Thomson #define DA7219_ADC_VOICE_HPF_CORNER_MASK	(0x7 << 0)
340*6d817c0eSAdam Thomson #define DA7219_VOICE_HPF_CORNER_MAX		8
341*6d817c0eSAdam Thomson #define DA7219_ADC_VOICE_EN_SHIFT		3
342*6d817c0eSAdam Thomson #define DA7219_ADC_VOICE_EN_MASK		(0x1 << 3)
343*6d817c0eSAdam Thomson #define DA7219_ADC_AUDIO_HPF_CORNER_SHIFT	4
344*6d817c0eSAdam Thomson #define DA7219_ADC_AUDIO_HPF_CORNER_MASK	(0x3 << 4)
345*6d817c0eSAdam Thomson #define DA7219_AUDIO_HPF_CORNER_MAX		4
346*6d817c0eSAdam Thomson #define DA7219_ADC_HPF_EN_SHIFT			7
347*6d817c0eSAdam Thomson #define DA7219_ADC_HPF_EN_MASK			(0x1 << 7)
348*6d817c0eSAdam Thomson #define DA7219_HPF_MODE_SHIFT			0
349*6d817c0eSAdam Thomson #define DA7219_HPF_DISABLED			((0x0 << 3) | (0x0 << 7))
350*6d817c0eSAdam Thomson #define DA7219_HPF_AUDIO_EN			((0x0 << 3) | (0x1 << 7))
351*6d817c0eSAdam Thomson #define DA7219_HPF_VOICE_EN			((0x1 << 3) | (0x1 << 7))
352*6d817c0eSAdam Thomson #define DA7219_HPF_MODE_MASK			((0x1 << 3) | (0x1 << 7))
353*6d817c0eSAdam Thomson #define DA7219_HPF_MODE_MAX			3
354*6d817c0eSAdam Thomson 
355*6d817c0eSAdam Thomson /* DA7219_MIC_1_GAIN = 0x39 */
356*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_SHIFT	0
357*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_MASK	(0x7 << 0)
358*6d817c0eSAdam Thomson 
359*6d817c0eSAdam Thomson /* DA7219_SIDETONE_CTRL = 0x3A */
360*6d817c0eSAdam Thomson #define DA7219_SIDETONE_MUTE_EN_SHIFT	6
361*6d817c0eSAdam Thomson #define DA7219_SIDETONE_MUTE_EN_MASK	(0x1 << 6)
362*6d817c0eSAdam Thomson #define DA7219_SIDETONE_EN_SHIFT	7
363*6d817c0eSAdam Thomson #define DA7219_SIDETONE_EN_MASK		(0x1 << 7)
364*6d817c0eSAdam Thomson 
365*6d817c0eSAdam Thomson /* DA7219_SIDETONE_GAIN = 0x3B */
366*6d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_SHIFT	0
367*6d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_MASK	(0xF << 0)
368*6d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_MAX	0xE
369*6d817c0eSAdam Thomson 
370*6d817c0eSAdam Thomson /* DA7219_DROUTING_ST_OUTFILT_1L = 0x3C */
371*6d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1L_SRC_SHIFT		0
372*6d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1L_SRC_MASK		(0x7 << 0)
373*6d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1L_SHIFT	0
374*6d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1R_SHIFT	1
375*6d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_SIDETONE_SHIFT	2
376*6d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1L		(0x1 << 0)
377*6d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1R		(0x1 << 1)
378*6d817c0eSAdam Thomson 
379*6d817c0eSAdam Thomson /* DA7219_DROUTING_ST_OUTFILT_1R = 0x3D */
380*6d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1R_SRC_SHIFT	0
381*6d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1R_SRC_MASK	(0x7 << 0)
382*6d817c0eSAdam Thomson 
383*6d817c0eSAdam Thomson /* DA7219_DAC_FILTERS5 = 0x40 */
384*6d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_SHIFT	4
385*6d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_MASK	(0x7 << 4)
386*6d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_MAX	7
387*6d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_EN_SHIFT	7
388*6d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_EN_MASK	(0x1 << 7)
389*6d817c0eSAdam Thomson 
390*6d817c0eSAdam Thomson /* DA7219_DAC_FILTERS2 = 0x41 */
391*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND1_SHIFT	0
392*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND1_MASK	(0xF << 0)
393*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND2_SHIFT	4
394*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND2_MASK	(0xF << 4)
395*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND_MAX		0xF
396*6d817c0eSAdam Thomson 
397*6d817c0eSAdam Thomson /* DA7219_DAC_FILTERS3 = 0x42 */
398*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND3_SHIFT	0
399*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND3_MASK	(0xF << 0)
400*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND4_SHIFT	4
401*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND4_MASK	(0xF << 4)
402*6d817c0eSAdam Thomson 
403*6d817c0eSAdam Thomson /* DA7219_DAC_FILTERS4 = 0x43 */
404*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND5_SHIFT	0
405*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND5_MASK	(0xF << 0)
406*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_EN_SHIFT		7
407*6d817c0eSAdam Thomson #define DA7219_DAC_EQ_EN_MASK		(0x1 << 7)
408*6d817c0eSAdam Thomson 
409*6d817c0eSAdam Thomson /* DA7219_DAC_FILTERS1 = 0x44 */
410*6d817c0eSAdam Thomson #define DA7219_DAC_VOICE_HPF_CORNER_SHIFT	0
411*6d817c0eSAdam Thomson #define DA7219_DAC_VOICE_HPF_CORNER_MASK	(0x7 << 0)
412*6d817c0eSAdam Thomson #define DA7219_DAC_VOICE_EN_SHIFT		3
413*6d817c0eSAdam Thomson #define DA7219_DAC_VOICE_EN_MASK		(0x1 << 3)
414*6d817c0eSAdam Thomson #define DA7219_DAC_AUDIO_HPF_CORNER_SHIFT	4
415*6d817c0eSAdam Thomson #define DA7219_DAC_AUDIO_HPF_CORNER_MASK	(0x3 << 4)
416*6d817c0eSAdam Thomson #define DA7219_DAC_HPF_EN_SHIFT			7
417*6d817c0eSAdam Thomson #define DA7219_DAC_HPF_EN_MASK			(0x1 << 7)
418*6d817c0eSAdam Thomson 
419*6d817c0eSAdam Thomson /* DA7219_DAC_L_GAIN = 0x45 */
420*6d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_SHIFT	0
421*6d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_MASK	(0x7F << 0)
422*6d817c0eSAdam Thomson #define DA7219_DAC_DIGITAL_GAIN_MAX	0x7F
423*6d817c0eSAdam Thomson #define DA7219_DAC_DIGITAL_GAIN_0DB	(0x6F << 0)
424*6d817c0eSAdam Thomson 
425*6d817c0eSAdam Thomson /* DA7219_DAC_R_GAIN = 0x46 */
426*6d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_SHIFT	0
427*6d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_MASK	(0x7F << 0)
428*6d817c0eSAdam Thomson 
429*6d817c0eSAdam Thomson /* DA7219_CP_CTRL = 0x47 */
430*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_SHIFT		4
431*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_MASK		(0x3 << 4)
432*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_REL_MASK	0x3
433*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_MAX		3
434*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_LARGEST_VOL	0x1
435*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_DAC_VOL	0x2
436*6d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_SIG_MAG	0x3
437*6d817c0eSAdam Thomson #define DA7219_CP_EN_SHIFT		7
438*6d817c0eSAdam Thomson #define DA7219_CP_EN_MASK		(0x1 << 7)
439*6d817c0eSAdam Thomson 
440*6d817c0eSAdam Thomson /* DA7219_HP_L_GAIN = 0x48 */
441*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_SHIFT	0
442*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_MASK	(0x3F << 0)
443*6d817c0eSAdam Thomson #define DA7219_HP_AMP_GAIN_MAX		0x3F
444*6d817c0eSAdam Thomson #define DA7219_HP_AMP_GAIN_0DB		(0x39 << 0)
445*6d817c0eSAdam Thomson 
446*6d817c0eSAdam Thomson /* DA7219_HP_R_GAIN = 0x49 */
447*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_SHIFT	0
448*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_MASK	(0x3F << 0)
449*6d817c0eSAdam Thomson 
450*6d817c0eSAdam Thomson /* DA7219_MIXOUT_L_SELECT = 0x4B */
451*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_MIX_SELECT_SHIFT	0
452*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_MIX_SELECT_MASK		(0x1 << 0)
453*6d817c0eSAdam Thomson 
454*6d817c0eSAdam Thomson /* DA7219_MIXOUT_R_SELECT = 0x4C */
455*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_MIX_SELECT_SHIFT	0
456*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_MIX_SELECT_MASK		(0x1 << 0)
457*6d817c0eSAdam Thomson 
458*6d817c0eSAdam Thomson /* DA7219_SYSTEM_MODES_INPUT = 0x50 */
459*6d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_SHIFT	0
460*6d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_MASK		(0x1 << 0)
461*6d817c0eSAdam Thomson #define DA7219_ADC_MODE_SHIFT		1
462*6d817c0eSAdam Thomson #define DA7219_ADC_MODE_MASK		(0x7F << 1)
463*6d817c0eSAdam Thomson 
464*6d817c0eSAdam Thomson /* DA7219_SYSTEM_MODES_OUTPUT = 0x51 */
465*6d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_SHIFT	0
466*6d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_MASK		(0x1 << 0)
467*6d817c0eSAdam Thomson #define DA7219_DAC_MODE_SHIFT		1
468*6d817c0eSAdam Thomson #define DA7219_DAC_MODE_MASK		(0x7F << 1)
469*6d817c0eSAdam Thomson 
470*6d817c0eSAdam Thomson /* DA7219_MICBIAS_CTRL = 0x62 */
471*6d817c0eSAdam Thomson #define DA7219_MICBIAS1_LEVEL_SHIFT	0
472*6d817c0eSAdam Thomson #define DA7219_MICBIAS1_LEVEL_MASK	(0x7 << 0)
473*6d817c0eSAdam Thomson #define DA7219_MICBIAS1_EN_SHIFT	3
474*6d817c0eSAdam Thomson #define DA7219_MICBIAS1_EN_MASK		(0x1 << 3)
475*6d817c0eSAdam Thomson 
476*6d817c0eSAdam Thomson /* DA7219_MIC_1_CTRL = 0x63 */
477*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_RAMP_EN_SHIFT	5
478*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_RAMP_EN_MASK	(0x1 << 5)
479*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_MUTE_EN_SHIFT	6
480*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_MUTE_EN_MASK	(0x1 << 6)
481*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_EN_SHIFT	7
482*6d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_EN_MASK	(0x1 << 7)
483*6d817c0eSAdam Thomson 
484*6d817c0eSAdam Thomson /* DA7219_MIXIN_L_CTRL = 0x65 */
485*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_EN_SHIFT		3
486*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_EN_MASK		(0x1 << 3)
487*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_ZC_EN_SHIFT		4
488*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_ZC_EN_MASK		(0x1 << 4)
489*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_RAMP_EN_SHIFT	5
490*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_RAMP_EN_MASK		(0x1 << 5)
491*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_MUTE_EN_SHIFT	6
492*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_MUTE_EN_MASK		(0x1 << 6)
493*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_EN_SHIFT		7
494*6d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_EN_MASK		(0x1 << 7)
495*6d817c0eSAdam Thomson 
496*6d817c0eSAdam Thomson /* DA7219_ADC_L_CTRL = 0x67 */
497*6d817c0eSAdam Thomson #define DA7219_ADC_L_BIAS_SHIFT		0
498*6d817c0eSAdam Thomson #define DA7219_ADC_L_BIAS_MASK		(0x3 << 0)
499*6d817c0eSAdam Thomson #define DA7219_ADC_L_RAMP_EN_SHIFT	5
500*6d817c0eSAdam Thomson #define DA7219_ADC_L_RAMP_EN_MASK	(0x1 << 5)
501*6d817c0eSAdam Thomson #define DA7219_ADC_L_MUTE_EN_SHIFT	6
502*6d817c0eSAdam Thomson #define DA7219_ADC_L_MUTE_EN_MASK	(0x1 << 6)
503*6d817c0eSAdam Thomson #define DA7219_ADC_L_EN_SHIFT		7
504*6d817c0eSAdam Thomson #define DA7219_ADC_L_EN_MASK		(0x1 << 7)
505*6d817c0eSAdam Thomson 
506*6d817c0eSAdam Thomson /* DA7219_DAC_L_CTRL = 0x69 */
507*6d817c0eSAdam Thomson #define DA7219_DAC_L_RAMP_EN_SHIFT	5
508*6d817c0eSAdam Thomson #define DA7219_DAC_L_RAMP_EN_MASK	(0x1 << 5)
509*6d817c0eSAdam Thomson #define DA7219_DAC_L_MUTE_EN_SHIFT	6
510*6d817c0eSAdam Thomson #define DA7219_DAC_L_MUTE_EN_MASK	(0x1 << 6)
511*6d817c0eSAdam Thomson #define DA7219_DAC_L_EN_SHIFT		7
512*6d817c0eSAdam Thomson #define DA7219_DAC_L_EN_MASK		(0x1 << 7)
513*6d817c0eSAdam Thomson 
514*6d817c0eSAdam Thomson /* DA7219_DAC_R_CTRL = 0x6A */
515*6d817c0eSAdam Thomson #define DA7219_DAC_R_RAMP_EN_SHIFT	5
516*6d817c0eSAdam Thomson #define DA7219_DAC_R_RAMP_EN_MASK	(0x1 << 5)
517*6d817c0eSAdam Thomson #define DA7219_DAC_R_MUTE_EN_SHIFT	6
518*6d817c0eSAdam Thomson #define DA7219_DAC_R_MUTE_EN_MASK	(0x1 << 6)
519*6d817c0eSAdam Thomson #define DA7219_DAC_R_EN_SHIFT		7
520*6d817c0eSAdam Thomson #define DA7219_DAC_R_EN_MASK		(0x1 << 7)
521*6d817c0eSAdam Thomson 
522*6d817c0eSAdam Thomson /* DA7219_HP_L_CTRL = 0x6B */
523*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MIN_GAIN_EN_SHIFT	2
524*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MIN_GAIN_EN_MASK	(0x1 << 2)
525*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_OE_SHIFT		3
526*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_OE_MASK			(0x1 << 3)
527*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_ZC_EN_SHIFT		4
528*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_ZC_EN_MASK		(0x1 << 4)
529*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_RAMP_EN_SHIFT		5
530*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_RAMP_EN_MASK		(0x1 << 5)
531*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MUTE_EN_SHIFT		6
532*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MUTE_EN_MASK		(0x1 << 6)
533*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_EN_SHIFT		7
534*6d817c0eSAdam Thomson #define DA7219_HP_L_AMP_EN_MASK			(0x1 << 7)
535*6d817c0eSAdam Thomson 
536*6d817c0eSAdam Thomson /* DA7219_HP_R_CTRL = 0x6C */
537*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MIN_GAIN_EN_SHIFT	2
538*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MIN_GAIN_EN_MASK	(0x1 << 2)
539*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_OE_SHIFT		3
540*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_OE_MASK			(0x1 << 3)
541*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_ZC_EN_SHIFT		4
542*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_ZC_EN_MASK		(0x1 << 4)
543*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_RAMP_EN_SHIFT		5
544*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_RAMP_EN_MASK		(0x1 << 5)
545*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MUTE_EN_SHIFT		6
546*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MUTE_EN_MASK		(0x1 << 6)
547*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_EN_SHIFT		7
548*6d817c0eSAdam Thomson #define DA7219_HP_R_AMP_EN_MASK			(0x1 << 7)
549*6d817c0eSAdam Thomson 
550*6d817c0eSAdam Thomson /* DA7219_MIXOUT_L_CTRL = 0x6E */
551*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_AMP_EN_SHIFT	7
552*6d817c0eSAdam Thomson #define DA7219_MIXOUT_L_AMP_EN_MASK	(0x1 << 7)
553*6d817c0eSAdam Thomson 
554*6d817c0eSAdam Thomson /* DA7219_MIXOUT_R_CTRL = 0x6F */
555*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_AMP_EN_SHIFT	7
556*6d817c0eSAdam Thomson #define DA7219_MIXOUT_R_AMP_EN_MASK	(0x1 << 7)
557*6d817c0eSAdam Thomson 
558*6d817c0eSAdam Thomson /* DA7219_CHIP_ID1 = 0x81 */
559*6d817c0eSAdam Thomson #define DA7219_CHIP_ID1_SHIFT	0
560*6d817c0eSAdam Thomson #define DA7219_CHIP_ID1_MASK	(0xFF << 0)
561*6d817c0eSAdam Thomson 
562*6d817c0eSAdam Thomson /* DA7219_CHIP_ID2 = 0x82 */
563*6d817c0eSAdam Thomson #define DA7219_CHIP_ID2_SHIFT	0
564*6d817c0eSAdam Thomson #define DA7219_CHIP_ID2_MASK	(0xFF << 0)
565*6d817c0eSAdam Thomson 
566*6d817c0eSAdam Thomson /* DA7219_CHIP_REVISION = 0x83 */
567*6d817c0eSAdam Thomson #define DA7219_CHIP_MINOR_SHIFT	0
568*6d817c0eSAdam Thomson #define DA7219_CHIP_MINOR_MASK	(0xF << 0)
569*6d817c0eSAdam Thomson #define DA7219_CHIP_MAJOR_SHIFT	4
570*6d817c0eSAdam Thomson #define DA7219_CHIP_MAJOR_MASK	(0xF << 4)
571*6d817c0eSAdam Thomson 
572*6d817c0eSAdam Thomson /* DA7219_LDO_CTRL = 0x90 */
573*6d817c0eSAdam Thomson #define DA7219_LDO_LEVEL_SELECT_SHIFT	4
574*6d817c0eSAdam Thomson #define DA7219_LDO_LEVEL_SELECT_MASK	(0x3 << 4)
575*6d817c0eSAdam Thomson #define DA7219_LDO_EN_SHIFT		7
576*6d817c0eSAdam Thomson #define DA7219_LDO_EN_MASK		(0x1 << 7)
577*6d817c0eSAdam Thomson 
578*6d817c0eSAdam Thomson /* DA7219_IO_CTRL = 0x91 */
579*6d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_SHIFT		0
580*6d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_MASK		(0x1 << 0)
581*6d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_2_5V_3_6V	0
582*6d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_1_2V_2_8V	1
583*6d817c0eSAdam Thomson 
584*6d817c0eSAdam Thomson /* DA7219_GAIN_RAMP_CTRL = 0x92 */
585*6d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_SHIFT	0
586*6d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_MASK	(0x3 << 0)
587*6d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_MAX	4
588*6d817c0eSAdam Thomson 
589*6d817c0eSAdam Thomson /* DA7219_PC_COUNT = 0x94 */
590*6d817c0eSAdam Thomson #define DA7219_PC_FREERUN_SHIFT		0
591*6d817c0eSAdam Thomson #define DA7219_PC_FREERUN_MASK		(0x1 << 0)
592*6d817c0eSAdam Thomson #define DA7219_PC_RESYNC_AUTO_SHIFT	1
593*6d817c0eSAdam Thomson #define DA7219_PC_RESYNC_AUTO_MASK	(0x1 << 1)
594*6d817c0eSAdam Thomson 
595*6d817c0eSAdam Thomson /* DA7219_CP_VOL_THRESHOLD1 = 0x95 */
596*6d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_SHIFT	0
597*6d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_MASK	(0x3F << 0)
598*6d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_MAX	0x3F
599*6d817c0eSAdam Thomson 
600*6d817c0eSAdam Thomson /* DA7219_DIG_CTRL = 0x99 */
601*6d817c0eSAdam Thomson #define DA7219_DAC_L_INV_SHIFT	3
602*6d817c0eSAdam Thomson #define DA7219_DAC_L_INV_MASK	(0x1 << 3)
603*6d817c0eSAdam Thomson #define DA7219_DAC_R_INV_SHIFT	7
604*6d817c0eSAdam Thomson #define DA7219_DAC_R_INV_MASK	(0x1 << 7)
605*6d817c0eSAdam Thomson 
606*6d817c0eSAdam Thomson /* DA7219_ALC_CTRL2 = 0x9A */
607*6d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_SHIFT		0
608*6d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_MASK		(0xF << 0)
609*6d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_MAX		13
610*6d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_SHIFT	4
611*6d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_MASK		(0xF << 4)
612*6d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_MAX		11
613*6d817c0eSAdam Thomson 
614*6d817c0eSAdam Thomson /* DA7219_ALC_CTRL3 = 0x9B */
615*6d817c0eSAdam Thomson #define DA7219_ALC_HOLD_SHIFT		0
616*6d817c0eSAdam Thomson #define DA7219_ALC_HOLD_MASK		(0xF << 0)
617*6d817c0eSAdam Thomson #define DA7219_ALC_HOLD_MAX		16
618*6d817c0eSAdam Thomson #define DA7219_ALC_INTEG_ATTACK_SHIFT	4
619*6d817c0eSAdam Thomson #define DA7219_ALC_INTEG_ATTACK_MASK	(0x3 << 4)
620*6d817c0eSAdam Thomson #define DA7219_ALC_INTEG_RELEASE_SHIFT	6
621*6d817c0eSAdam Thomson #define DA7219_ALC_INTEG_RELEASE_MASK	(0x3 << 6)
622*6d817c0eSAdam Thomson #define DA7219_ALC_INTEG_MAX		4
623*6d817c0eSAdam Thomson 
624*6d817c0eSAdam Thomson /* DA7219_ALC_NOISE = 0x9C */
625*6d817c0eSAdam Thomson #define DA7219_ALC_NOISE_SHIFT		0
626*6d817c0eSAdam Thomson #define DA7219_ALC_NOISE_MASK		(0x3F << 0)
627*6d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX	0x3F
628*6d817c0eSAdam Thomson 
629*6d817c0eSAdam Thomson /* DA7219_ALC_TARGET_MIN = 0x9D */
630*6d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MIN_SHIFT	0
631*6d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MIN_MASK	(0x3F << 0)
632*6d817c0eSAdam Thomson 
633*6d817c0eSAdam Thomson /* DA7219_ALC_TARGET_MAX = 0x9E */
634*6d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX_SHIFT	0
635*6d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX_MASK	(0x3F << 0)
636*6d817c0eSAdam Thomson 
637*6d817c0eSAdam Thomson /* DA7219_ALC_GAIN_LIMITS = 0x9F */
638*6d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_MAX_SHIFT	0
639*6d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_MAX_MASK	(0xF << 0)
640*6d817c0eSAdam Thomson #define DA7219_ALC_GAIN_MAX_SHIFT	4
641*6d817c0eSAdam Thomson #define DA7219_ALC_GAIN_MAX_MASK	(0xF << 4)
642*6d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_GAIN_MAX	0xF
643*6d817c0eSAdam Thomson 
644*6d817c0eSAdam Thomson /* DA7219_ALC_ANA_GAIN_LIMITS = 0xA0 */
645*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN_SHIFT	0
646*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN_MASK	(0x7 << 0)
647*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN		0x1
648*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX_SHIFT	4
649*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX_MASK	(0x7 << 4)
650*6d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX		0x7
651*6d817c0eSAdam Thomson 
652*6d817c0eSAdam Thomson /* DA7219_ALC_ANTICLIP_CTRL = 0xA1 */
653*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_SHIFT	0
654*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_MASK	(0x3 << 0)
655*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_MAX	4
656*6d817c0eSAdam Thomson #define DA7219_ALC_ANTIPCLIP_EN_SHIFT	7
657*6d817c0eSAdam Thomson #define DA7219_ALC_ANTIPCLIP_EN_MASK	(0x1 << 7)
658*6d817c0eSAdam Thomson 
659*6d817c0eSAdam Thomson /* DA7219_ALC_ANTICLIP_LEVEL = 0xA2 */
660*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL_SHIFT	0
661*6d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL_MASK	(0x7F << 0)
662*6d817c0eSAdam Thomson 
663*6d817c0eSAdam Thomson /* DA7219_ALC_OFFSET_AUTO_M_L = 0xA3 */
664*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L_SHIFT	0
665*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L_MASK		(0xFF << 0)
666*6d817c0eSAdam Thomson 
667*6d817c0eSAdam Thomson /* DA7219_ALC_OFFSET_AUTO_U_L = 0xA4 */
668*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L_SHIFT	0
669*6d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L_MASK		(0xF << 0)
670*6d817c0eSAdam Thomson 
671*6d817c0eSAdam Thomson /* DA7219_DAC_NG_SETUP_TIME = 0xAF */
672*6d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_SHIFT	0
673*6d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_MASK	(0x3 << 0)
674*6d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_MAX	4
675*6d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPUP_RATE_SHIFT	2
676*6d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPUP_RATE_MASK	(0x1 << 2)
677*6d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPDN_RATE_SHIFT	3
678*6d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPDN_RATE_MASK	(0x1 << 3)
679*6d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMP_RATE_MAX	2
680*6d817c0eSAdam Thomson 
681*6d817c0eSAdam Thomson /* DA7219_DAC_NG_OFF_THRESH = 0xB0 */
682*6d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESHOLD_SHIFT	0
683*6d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESHOLD_MASK	(0x7 << 0)
684*6d817c0eSAdam Thomson #define DA7219_DAC_NG_THRESHOLD_MAX		0x7
685*6d817c0eSAdam Thomson 
686*6d817c0eSAdam Thomson /* DA7219_DAC_NG_ON_THRESH = 0xB1 */
687*6d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESHOLD_SHIFT	0
688*6d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESHOLD_MASK		(0x7 << 0)
689*6d817c0eSAdam Thomson 
690*6d817c0eSAdam Thomson /* DA7219_DAC_NG_CTRL = 0xB2 */
691*6d817c0eSAdam Thomson #define DA7219_DAC_NG_EN_SHIFT	7
692*6d817c0eSAdam Thomson #define DA7219_DAC_NG_EN_MASK	(0x1 << 7)
693*6d817c0eSAdam Thomson 
694*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_CFG1 = 0xB4 */
695*6d817c0eSAdam Thomson #define DA7219_DTMF_REG_SHIFT		0
696*6d817c0eSAdam Thomson #define DA7219_DTMF_REG_MASK		(0xF << 0)
697*6d817c0eSAdam Thomson #define DA7219_DTMF_REG_MAX		16
698*6d817c0eSAdam Thomson #define DA7219_DTMF_EN_SHIFT		4
699*6d817c0eSAdam Thomson #define DA7219_DTMF_EN_MASK		(0x1 << 4)
700*6d817c0eSAdam Thomson #define DA7219_START_STOPN_SHIFT	7
701*6d817c0eSAdam Thomson #define DA7219_START_STOPN_MASK		(0x1 << 7)
702*6d817c0eSAdam Thomson 
703*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_CFG2 = 0xB5 */
704*6d817c0eSAdam Thomson #define DA7219_SWG_SEL_SHIFT		0
705*6d817c0eSAdam Thomson #define DA7219_SWG_SEL_MASK		(0x3 << 0)
706*6d817c0eSAdam Thomson #define DA7219_SWG_SEL_MAX		4
707*6d817c0eSAdam Thomson #define DA7219_SWG_SEL_SRAMP		(0x3 << 0)
708*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_SHIFT	4
709*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MASK	(0xF << 4)
710*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MAX	0xF
711*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MINUS_9DB	(0x3 << 4)
712*6d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MINUS_15DB	(0x5 << 4)
713*6d817c0eSAdam Thomson 
714*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_CYCLES = 0xB6 */
715*6d817c0eSAdam Thomson #define DA7219_BEEP_CYCLES_SHIFT	0
716*6d817c0eSAdam Thomson #define DA7219_BEEP_CYCLES_MASK		(0x7 << 0)
717*6d817c0eSAdam Thomson 
718*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ1_L = 0xB7 */
719*6d817c0eSAdam Thomson #define DA7219_FREQ1_L_SHIFT	0
720*6d817c0eSAdam Thomson #define DA7219_FREQ1_L_MASK	(0xFF << 0)
721*6d817c0eSAdam Thomson #define DA7219_FREQ_MAX		0xFFFF
722*6d817c0eSAdam Thomson 
723*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ1_U = 0xB8 */
724*6d817c0eSAdam Thomson #define DA7219_FREQ1_U_SHIFT	0
725*6d817c0eSAdam Thomson #define DA7219_FREQ1_U_MASK	(0xFF << 0)
726*6d817c0eSAdam Thomson 
727*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ2_L = 0xB9 */
728*6d817c0eSAdam Thomson #define DA7219_FREQ2_L_SHIFT	0
729*6d817c0eSAdam Thomson #define DA7219_FREQ2_L_MASK	(0xFF << 0)
730*6d817c0eSAdam Thomson 
731*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ2_U = 0xBA */
732*6d817c0eSAdam Thomson #define DA7219_FREQ2_U_SHIFT	0
733*6d817c0eSAdam Thomson #define DA7219_FREQ2_U_MASK	(0xFF << 0)
734*6d817c0eSAdam Thomson 
735*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_ON_PER = 0xBB */
736*6d817c0eSAdam Thomson #define DA7219_BEEP_ON_PER_SHIFT	0
737*6d817c0eSAdam Thomson #define DA7219_BEEP_ON_PER_MASK		(0x3F << 0)
738*6d817c0eSAdam Thomson #define DA7219_BEEP_ON_OFF_MAX		0x3F
739*6d817c0eSAdam Thomson 
740*6d817c0eSAdam Thomson /* DA7219_TONE_GEN_OFF_PER = 0xBC */
741*6d817c0eSAdam Thomson #define DA7219_BEEP_OFF_PER_SHIFT	0
742*6d817c0eSAdam Thomson #define DA7219_BEEP_OFF_PER_MASK	(0x3F << 0)
743*6d817c0eSAdam Thomson 
744*6d817c0eSAdam Thomson /* DA7219_SYSTEM_STATUS = 0xE0 */
745*6d817c0eSAdam Thomson #define DA7219_SC1_BUSY_SHIFT	0
746*6d817c0eSAdam Thomson #define DA7219_SC1_BUSY_MASK	(0x1 << 0)
747*6d817c0eSAdam Thomson #define DA7219_SC2_BUSY_SHIFT	1
748*6d817c0eSAdam Thomson #define DA7219_SC2_BUSY_MASK	(0x1 << 1)
749*6d817c0eSAdam Thomson 
750*6d817c0eSAdam Thomson /* DA7219_SYSTEM_ACTIVE = 0xFD */
751*6d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE_SHIFT	0
752*6d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE_MASK	(0x1 << 0)
753*6d817c0eSAdam Thomson 
754*6d817c0eSAdam Thomson 
755*6d817c0eSAdam Thomson /*
756*6d817c0eSAdam Thomson  * General defines & data
757*6d817c0eSAdam Thomson  */
758*6d817c0eSAdam Thomson 
759*6d817c0eSAdam Thomson /* Register inversion */
760*6d817c0eSAdam Thomson #define DA7219_NO_INVERT	0
761*6d817c0eSAdam Thomson #define DA7219_INVERT		1
762*6d817c0eSAdam Thomson 
763*6d817c0eSAdam Thomson /* Byte related defines */
764*6d817c0eSAdam Thomson #define DA7219_BYTE_SHIFT	8
765*6d817c0eSAdam Thomson #define DA7219_BYTE_MASK	0xFF
766*6d817c0eSAdam Thomson 
767*6d817c0eSAdam Thomson /* PLL Output Frequencies */
768*6d817c0eSAdam Thomson #define DA7219_PLL_FREQ_OUT_90316	90316800
769*6d817c0eSAdam Thomson #define DA7219_PLL_FREQ_OUT_98304	98304000
770*6d817c0eSAdam Thomson 
771*6d817c0eSAdam Thomson /* PLL Frequency Dividers */
772*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_2_5_MHZ_VAL	1
773*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_5_10_MHZ_VAL	2
774*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_10_20_MHZ_VAL	4
775*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_20_40_MHZ_VAL	8
776*6d817c0eSAdam Thomson #define DA7219_PLL_INDIV_40_54_MHZ_VAL	16
777*6d817c0eSAdam Thomson 
778*6d817c0eSAdam Thomson /* SRM */
779*6d817c0eSAdam Thomson #define DA7219_SRM_CHECK_RETRIES	8
780*6d817c0eSAdam Thomson 
781*6d817c0eSAdam Thomson enum da7219_clk_src {
782*6d817c0eSAdam Thomson 	DA7219_CLKSRC_MCLK = 0,
783*6d817c0eSAdam Thomson 	DA7219_CLKSRC_MCLK_SQR,
784*6d817c0eSAdam Thomson };
785*6d817c0eSAdam Thomson 
786*6d817c0eSAdam Thomson enum da7219_sys_clk {
787*6d817c0eSAdam Thomson 	DA7219_SYSCLK_MCLK = 0,
788*6d817c0eSAdam Thomson 	DA7219_SYSCLK_PLL,
789*6d817c0eSAdam Thomson 	DA7219_SYSCLK_PLL_SRM,
790*6d817c0eSAdam Thomson 	DA7219_SYSCLK_PLL_32KHZ
791*6d817c0eSAdam Thomson };
792*6d817c0eSAdam Thomson 
793*6d817c0eSAdam Thomson /* Regulators */
794*6d817c0eSAdam Thomson enum da7219_supplies {
795*6d817c0eSAdam Thomson 	DA7219_SUPPLY_VDD = 0,
796*6d817c0eSAdam Thomson 	DA7219_SUPPLY_VDDMIC,
797*6d817c0eSAdam Thomson 	DA7219_SUPPLY_VDDIO,
798*6d817c0eSAdam Thomson 	DA7219_NUM_SUPPLIES,
799*6d817c0eSAdam Thomson };
800*6d817c0eSAdam Thomson 
801*6d817c0eSAdam Thomson struct da7219_aad_priv;
802*6d817c0eSAdam Thomson 
803*6d817c0eSAdam Thomson /* Private data */
804*6d817c0eSAdam Thomson struct da7219_priv {
805*6d817c0eSAdam Thomson 	struct da7219_aad_priv *aad;
806*6d817c0eSAdam Thomson 	struct da7219_pdata *pdata;
807*6d817c0eSAdam Thomson 
808*6d817c0eSAdam Thomson 	struct regulator_bulk_data supplies[DA7219_NUM_SUPPLIES];
809*6d817c0eSAdam Thomson 	struct regmap *regmap;
810*6d817c0eSAdam Thomson 	struct mutex lock;
811*6d817c0eSAdam Thomson 
812*6d817c0eSAdam Thomson 	struct clk *mclk;
813*6d817c0eSAdam Thomson 	unsigned int mclk_rate;
814*6d817c0eSAdam Thomson 	int clk_src;
815*6d817c0eSAdam Thomson 
816*6d817c0eSAdam Thomson 	bool master;
817*6d817c0eSAdam Thomson 	bool alc_en;
818*6d817c0eSAdam Thomson };
819*6d817c0eSAdam Thomson 
820*6d817c0eSAdam Thomson #endif /* __DA7219_H */
821