]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tas2770sw-android/tas2770sw-android.git/blob - tas2770.h
Add slot width setting
[tas2770sw-android/tas2770sw-android.git] / tas2770.h
2 #ifndef __TAS2770_
3 #define __TAS2770_
6 /* Book Control Register (available in page0 of each book) */
7 #define TAS2770_BOOKCTL_PAGE            0
8 #define TAS2770_BOOKCTL_REG         127
11 #define TAS2770_REG(page, reg)        ((page * 128) + reg)
13     /* Page */
14 #define TAS2770_Page  TAS2770_REG(0X0, 0x00)
15 #define TAS2770_Page_Page_Mask  (0xff << 0)
17     /* Software Reset */
18 #define TAS2770_SoftwareReset  TAS2770_REG(0X0, 0x01)
19 #define TAS2770_SoftwareReset_SoftwareReset_Mask  (0x1 << 0),
20 #define TAS2770_SoftwareReset_SoftwareReset_DontReset  (0x0 << 0)
21 #define TAS2770_SoftwareReset_SoftwareReset_Reset  (0x1 << 0)
23     /* Power Control */
24 #define TAS2770_PowerControl  TAS2770_REG(0X0, 0x02)
25 #define TAS2770_PowerControl_ISNSPower_Mask  (0x1 << 3)
26 #define TAS2770_PowerControl_ISNSPower_Active  (0x0 << 3)
27 #define TAS2770_PowerControl_ISNSPower_PoweredDown  (0x1 << 3)
28 #define TAS2770_PowerControl_VSNSPower_Mask  (0x1 << 2)
29 #define TAS2770_PowerControl_VSNSPower_Active  (0x0 << 2)
30 #define TAS2770_PowerControl_VSNSPower_PoweredDown  (0x1 << 2)
31 #define TAS2770_PowerControl_OperationalMode10_Mask  (0x3 << 0)
32 #define TAS2770_PowerControl_OperationalMode10_Active  (0x0 << 0)
33 #define TAS2770_PowerControl_OperationalMode10_Mute  (0x1 << 0)
34 #define TAS2770_PowerControl_OperationalMode10_Shutdown  (0x2 << 0)
36         /* data format */
37 #define TAS2770_DATAFORMAT_SHIFT                2
38 #define TAS2770_DATAFORMAT_I2S                  0x0
39 #define TAS2770_DATAFORMAT_DSP                  0x1
40 #define TAS2770_DATAFORMAT_RIGHT_J              0x2
41 #define TAS2770_DATAFORMAT_LEFT_J               0x3
43 #define TAS2770_DAI_FMT_MASK            (0x7 << TAS2770_DATAFORMAT_SHIFT)
45     /* Playback Configuration Reg0 */
46 #define TAS2770_PlaybackConfigurationReg0  TAS2770_REG(0X0, 0x03)
47 #define TAS2770_PlaybackConfigurationReg0_PDMPinMapping_Mask  (0x1 << 7)
48 #define TAS2770_PlaybackConfigurationReg0_PDMPinMapping_Pdm0  (0x0 << 7)
49 #define TAS2770_PlaybackConfigurationReg0_PDMPinMapping_Pdm1  (0x1 << 7)
50 #define TAS2770_PlaybackConfigurationReg0_PlaybackPDMSource_Mask  (0x1 << 6)
51 #define TAS2770_PlaybackConfigurationReg0_PlaybackSource_Mask  (0x1 << 5)
52 #define TAS2770_PlaybackConfigurationReg0_PlaybackSource_Pcm  (0x0 << 5)
53 #define TAS2770_PlaybackConfigurationReg0_PlaybackSource_Pdm  (0x1 << 5)
54 #define TAS2770_PlaybackConfigurationReg0_AmplifierLevel40_Mask  (0x1f << 0)
56     /* Playback Configuration Reg1 */
57 #define TAS2770_PlaybackConfigurationReg1  TAS2770_REG(0X0, 0x04)
58 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_Mask  (0x7 << 0)
59 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_2  (0x1 << 0)
60 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_50  (0x2 << 0)
61 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_100  (0x3 << 0)
62 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_200  (0x4 << 0)
63 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_400  (0x5 << 0)
64 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_800  (0x6 << 0)
65 #define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_Bypass  (0x0 << 0)
67     /* Playback Configuration Reg2 */
68 #define TAS2770_PlaybackConfigurationReg2  TAS2770_REG(0X0, 0x05)
69 #define TAS2770_PlaybackConfigurationReg2_DVCPCM70_Mask  (0xff << 0)
71     /* Playback Configuration Reg3 */
72 #define TAS2770_PlaybackConfigurationReg3  TAS2770_REG(0X0, 0x06)
73 #define TAS2770_PlaybackConfigurationReg3_DVCPDM70_Mask  (0xff << 0)
75     /* Misc Configuration Reg0 */
76 #define TAS2770_MiscConfigurationReg0  TAS2770_REG(0X0, 0x07)
77 #define TAS2770_MiscConfigurationReg0_DVCRampRate76_Mask  (0x3 << 6)
78 #define TAS2770_MiscConfigurationReg0_DVCRampRate76_0_5dbPer1Sample  (0x0 << 6)
79 #define TAS2770_MiscConfigurationReg0_DVCRampRate76_0_5dbPer4Sample  (0x1 << 6)
80 #define TAS2770_MiscConfigurationReg0_DVCRampRate76_0_5dbPer8Sample  (0x2 << 6)
81 #define TAS2770_MiscConfigurationReg0_DVCRampRate76_VolRampDisabled  (0x3 << 6)
82 #define TAS2770_MiscConfigurationReg0_OCERetry_Mask  (0x1 << 5)
83 #define TAS2770_MiscConfigurationReg0_OCERetry_DoNotRetry  (0x0 << 5)
84 #define TAS2770_MiscConfigurationReg0_OCERetry_Retry  (0x1 << 5)
85 #define TAS2770_MiscConfigurationReg0_OTERetry_Mask  (0x1 << 4)
86 #define TAS2770_MiscConfigurationReg0_OTERetry_DoNotRetry  (0x0 << 4)
87 #define TAS2770_MiscConfigurationReg0_OTERetry_Retry  (0x1 << 4)
88 #define TAS2770_MiscConfigurationReg0_IRQZPull_Mask  (0x1 << 3)
89 #define TAS2770_MiscConfigurationReg0_IRQZPull_Disabled  (0x0 << 3)
90 #define TAS2770_MiscConfigurationReg0_IRQZPull_Enabled  (0x1 << 3)
91 #define TAS2770_MiscConfigurationReg0_AMPSS_Mask  (0x1 << 2)
92 #define TAS2770_MiscConfigurationReg0_AMPSS_Disabled  (0x0 << 2)
93 #define TAS2770_MiscConfigurationReg0_AMPSS_Enabled  (0x1 << 2)
95     /* PDM Input Reg0 */
96 #define TAS2770_PDMInputReg0  TAS2770_REG(0X0, 0x08)
97 #define TAS2770_PDMInputReg0_ClassDSYNC_Mask  (0x1 << 6)
98 #define TAS2770_PDMInputReg0_ClassDSYNC_AsyncMode  (0x0 << 6)
99 #define TAS2770_PDMInputReg0_ClassDSYNC_Retry  (0x1 << 6),
100 #define TAS2770_PDMInputReg0_PDMRATESW54_Mask  (0x3 << 4)
101 #define TAS2770_PDMInputReg0_PDMRATED132_Mask  (0x3 << 2)
102 #define TAS2770_PDMInputReg0_PDMRATED132_2_543_38MHz  (0x0 << 2)
103 #define TAS2770_PDMInputReg0_PDMRATED132_5_086_76MHz  (0x1 << 2)
104 #define TAS2770_PDMInputReg0_PDMRATED010_Mask  (0x3 << 0)
105 #define TAS2770_PDMInputReg0_PDMRATED010_2_543_38MHz  (0x0 << 0)
106 #define TAS2770_PDMInputReg0_PDMRATED010_5_086_76MHz  (0x1 << 0)
108     /* PDM Configuration Reg1 */
109 #define TAS2770_PDMConfigurationReg1  TAS2770_REG(0X0, 0x09)
110 #define TAS2770_PDMConfigurationReg1_PDMEDGED1_Mask  (0x1 << 7)
111 #define TAS2770_PDMConfigurationReg1_PDMEDGED1_Rising  (0x0 << 7)
112 #define TAS2770_PDMConfigurationReg1_PDMEDGED1_Falling  (0x1 << 7)
113 #define TAS2770_PDMConfigurationReg1_PDMEDGED0_Mask  (0x1 << 6)
114 #define TAS2770_PDMConfigurationReg1_PDMEDGED0_Rising  (0x0 << 6)
115 #define TAS2770_PDMConfigurationReg1_PDMEDGED0_Falling  (0x1 << 6)
116 #define TAS2770_PDMConfigurationReg1_PDMSLVD1_Mask  (0x1 << 5)
117 #define TAS2770_PDMConfigurationReg1_PDMSLVD1_Slave  (0x0 << 5)
118 #define TAS2770_PDMConfigurationReg1_PDMSLVD1_Master  (0x1 << 5)
119 #define TAS2770_PDMConfigurationReg1_PDMSLVD0_Mask  (0x1 << 4)
120 #define TAS2770_PDMConfigurationReg1_PDMSLVD0_Slave  (0x0 << 4)
121 #define TAS2770_PDMConfigurationReg1_PDMSLVD0_Master  (0x1 << 4)
122 #define TAS2770_PDMConfigurationReg1_PDMCLKD1_Mask  (0x1 << 3)
123 #define TAS2770_PDMConfigurationReg1_PDMCLKD1_Pdmck0  (0x0 << 3)
124 #define TAS2770_PDMConfigurationReg1_PDMCLKD1_Pdmck1  (0x1 << 3)
125 #define TAS2770_PDMConfigurationReg1_PDMCLKD0_Mask  (0x1 << 2)
126 #define TAS2770_PDMConfigurationReg1_PDMCLKD0_Pdmck0  (0x0 << 2)
127 #define TAS2770_PDMConfigurationReg1_PDMCLKD0_Pdmck1  (0x1 << 2)
128 #define TAS2770_PDMConfigurationReg1_PDMGATED1_Mask  (0x1 << 1)
129 #define TAS2770_PDMConfigurationReg1_PDMGATED1_GatedOff  (0x0 << 1)
130 #define TAS2770_PDMConfigurationReg1_PDMGATED1_Active  (0x1 << 1)
131 #define TAS2770_PDMConfigurationReg1_PDMGATED0_Mask  (0x1 << 0)
132 #define TAS2770_PDMConfigurationReg1_PDMGATED0_GatedOff  (0x0 << 0)
133 #define TAS2770_PDMConfigurationReg1_PDMGATED0_Active  (0x1 << 0)
135     /* TDM Configuration Reg0 */
136 #define TAS2770_TDMConfigurationReg0  TAS2770_REG(0X0, 0x0A)
137 #define TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask  (0x1 << 5)
138 #define TAS2770_TDMConfigurationReg0_SAMPRATERAMP_48KHz  (0x0 << 5)
139 #define TAS2770_TDMConfigurationReg0_SAMPRATERAMP_44_1KHz  (0x1 << 5)
140 #define TAS2770_TDMConfigurationReg0_DETECTSAMPRATE_Mask  (0x1 << 4)
141 #define TAS2770_TDMConfigurationReg0_DETECTSAMPRATE_Disabled  (0x1 << 4)
142 #define TAS2770_TDMConfigurationReg0_DETECTSAMPRATE_Enabled  (0x0 << 4)
143 #define TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask  (0x7 << 1)
144 #define TAS2770_TDMConfigurationReg0_SAMPRATE31_44_1_48kHz  (0x3 << 1)
145 #define TAS2770_TDMConfigurationReg0_SAMPRATE31_88_2_96kHz  (0x4 << 1)
146 #define TAS2770_TDMConfigurationReg0_SAMPRATE31_176_4_192kHz  (0x5 << 1)
147 #define TAS2770_TDMConfigurationReg0_FRAMESTART_Mask  (0x1 << 0)
148 #define TAS2770_TDMConfigurationReg0_FRAMESTART_LowToHigh  (0x0 << 0)
149 #define TAS2770_TDMConfigurationReg0_FRAMESTART_HighToLow  (0x1 << 0)
151     /* TDM Configuration Reg1 */
152 #define TAS2770_TDMConfigurationReg1  TAS2770_REG(0X0, 0x0B)
153 #define TAS2770_TDMConfigurationReg1_RXJUSTIFY_Mask  (0x1 << 6)
154 #define TAS2770_TDMConfigurationReg1_RXJUSTIFY_Left  (0x0 << 6)
155 #define TAS2770_TDMConfigurationReg1_RXJUSTIFY_Right  (0x1 << 6)
156 #define TAS2770_TDMConfigurationReg1_RXOFFSET51_Mask  (0x1f << 1)
157 #define TAS2770_TDMConfigurationReg1_RXOFFSET51_Shift (1)
158 #define TAS2770_TDMConfigurationReg1_RXEDGE_Mask  (0x1 << 0)
159 #define TAS2770_TDMConfigurationReg1_RXEDGE_Rising  (0x0 << 0)
160 #define TAS2770_TDMConfigurationReg1_RXEDGE_Falling  (0x1 << 0)
162     /* TDM Configuration Reg2 */
163 #define TAS2770_TDMConfigurationReg2  TAS2770_REG(0X0, 0x0C)
164 #define TAS2770_TDMConfigurationReg2_RXSCFG54_Mask  (0x3 << 4)
165 #define TAS2770_TDMConfigurationReg2_RXSCFG54_Mono_I2C  (0x0 << 4),
166 #define TAS2770_TDMConfigurationReg2_RXSCFG54_Mono_Left  (0x1 << 4),
167 #define TAS2770_TDMConfigurationReg2_RXSCFG54_Mono_Right  (0x2 << 4)
168 #define TAS2770_TDMConfigurationReg2_RXSCFG54_Stereo_DownMix  (0x3 << 4)
169 #define TAS2770_TDMConfigurationReg2_RXWLEN32_Mask  (0x3 << 2)
170 #define TAS2770_TDMConfigurationReg2_RXWLEN32_16Bits  (0x0 << 2)
171 #define TAS2770_TDMConfigurationReg2_RXWLEN32_20Bits  (0x1 << 2)
172 #define TAS2770_TDMConfigurationReg2_RXWLEN32_24Bits  (0x2 << 2)
173 #define TAS2770_TDMConfigurationReg2_RXWLEN32_32Bits  (0x3 << 2)
174 #define TAS2770_TDMConfigurationReg2_RXSLEN10_Mask  (0x3 << 0)
175 #define TAS2770_TDMConfigurationReg2_RXSLEN10_16Bits  (0x0 << 0)
176 #define TAS2770_TDMConfigurationReg2_RXSLEN10_24Bits  (0x1 << 0)
177 #define TAS2770_TDMConfigurationReg2_RXSLEN10_32Bits  (0x2 << 0)
179     /* TDM Configuration Reg3 */
180 #define TAS2770_TDMConfigurationReg3  TAS2770_REG(0X0, 0x0D)
181 #define TAS2770_TDMConfigurationReg3_RXSLOTRight74_Mask  (0xf << 4)
182 #define TAS2770_TDMConfigurationReg3_RXSLOTRight74_Shift 4
183 #define TAS2770_TDMConfigurationReg3_RXSLOTLeft30_Mask  (0xf << 0)
184 #define TAS2770_TDMConfigurationReg3_RXSLOTLeft30_Shift 0
186     /* TDM Configuration Reg4 */
187 #define TAS2770_TDMConfigurationReg4  TAS2770_REG(0X0, 0x0E)
188 #define TAS2770_TDMConfigurationReg4_TXKEEPER_Mask  (0x1 << 5)
189 #define TAS2770_TDMConfigurationReg4_TXKEEPER_Disable  (0x0 << 5)
190 #define TAS2770_TDMConfigurationReg4_TXKEEPER_Enable  (0x1 << 5)
191 #define TAS2770_TDMConfigurationReg4_TXFILL_Mask  (0x1 << 4)
192 #define TAS2770_TDMConfigurationReg4_TXFILL_Transmit0  (0x0 << 4)
193 #define TAS2770_TDMConfigurationReg4_TXFILL_TransmitHiz  (0x1 << 4)
194 #define TAS2770_TDMConfigurationReg4_TXOFFSET31_Mask  (0x7 << 1)
195 #define TAS2770_TDMConfigurationReg4_TXEDGE_Mask  (0x1 << 0)
196 #define TAS2770_TDMConfigurationReg4_TXEDGE_Rising  (0x0 << 0)
197 #define TAS2770_TDMConfigurationReg4_TXEDGE_Falling  (0x1 << 0)
199     /* TDM Configuration Reg5 */
200 #define TAS2770_TDMConfigurationReg5  TAS2770_REG(0X0, 0x0F)
201 #define TAS2770_TDMConfigurationReg5_VSNSTX_Mask  (0x1 << 6)
202 #define TAS2770_TDMConfigurationReg5_VSNSTX_Disable  (0x0 << 6)
203 #define TAS2770_TDMConfigurationReg5_VSNSTX_Enable  (0x1 << 6)
204 #define TAS2770_TDMConfigurationReg5_VSNSSLOT50_Mask  (0x3f << 0)
206     /* TDM Configuration Reg6 */
207 #define TAS2770_TDMConfigurationReg6  TAS2770_REG(0X0, 0x10)
208 #define TAS2770_TDMConfigurationReg6_ISNSTX_Mask  (0x1 << 6)
209 #define TAS2770_TDMConfigurationReg6_ISNSTX_Disable  (0x0 << 6)
210 #define TAS2770_TDMConfigurationReg6_ISNSTX_Enable  (0x1 << 6)
211 #define TAS2770_TDMConfigurationReg6_ISNSSLOT50_Mask  (0x3f << 0)
213     /* TDM Configuration Reg7 */
214 #define TAS2770_TDMConfigurationReg7  TAS2770_REG(0X0, 0x11)
215 #define TAS2770_TDMConfigurationReg7_PDMTX_Mask  (0x1 << 6)
216 #define TAS2770_TDMConfigurationReg7_PDMTX_Disable  (0x0 << 6)
217 #define TAS2770_TDMConfigurationReg7_PDMTX_Enable  (0x1 << 6)
218 #define TAS2770_TDMConfigurationReg7_PDMSLOT50_Mask  (0x3f << 0)
220     /* TDM Configuration Reg8 */
221 #define TAS2770_TDMConfigurationReg8  TAS2770_REG(0X0, 0x12)
222 #define TAS2770_TDMConfigurationReg8_VBATSLEN_Mask  (0x1 << 7)
223 #define TAS2770_TDMConfigurationReg8_VBATSLEN_8Bits  (0x0 << 7)
224 #define TAS2770_TDMConfigurationReg8_VBATSLEN_16Bits  (0x1 << 7)
225 #define TAS2770_TDMConfigurationReg8_VBATTX_Mask  (0x1 << 6)
226 #define TAS2770_TDMConfigurationReg8_VBATTX_Disable  (0x0 << 6)
227 #define TAS2770_TDMConfigurationReg8_VBATTX_Enable  (0x1 << 6)
228 #define TAS2770_TDMConfigurationReg8_VBATSLOT50_Mask  (0x3f << 0)
230     /* TDM Configuration Reg9 */
231 #define TAS2770_TDMConfigurationReg9  TAS2770_REG(0X0, 0x13)
232 #define TAS2770_TDMConfigurationReg9_TEMPTX_Mask  (0x1 << 6)
233 #define TAS2770_TDMConfigurationReg9_TEMPTX_Disable  (0x0 << 6)
234 #define TAS2770_TDMConfigurationReg9_TEMPTX_Enable  (0x1 << 6)
235 #define TAS2770_TDMConfigurationReg9_TEMPSLOT50_Mask  (0x3f << 0)
237     /* TDM Configuration Reg10 */
238 #define TAS2770_TDMConfigurationReg10  TAS2770_REG(0X0, 0x14)
239 #define TAS2770_TDMConfigurationReg10_GAINTX_Mask  (0x1 << 6)
240 #define TAS2770_TDMConfigurationReg10_GAINTX_Disable  (0x0 << 6)
241 #define TAS2770_TDMConfigurationReg10_GAINTX_Enable  (0x1 << 6)
242 #define TAS2770_TDMConfigurationReg10_GAINSLOT50_Mask  (0x3f << 0)
244     /* Limiter Configuration Reg0 */
245 #define TAS2770_LimiterConfigurationReg0  TAS2770_REG(0X0, 0x15)
246 #define TAS2770_LimiterConfigurationReg0_LIMATKST54_Mask  (0x3 << 4)
247 #define TAS2770_LimiterConfigurationReg0_LIMATKST54_1  (0x2 << 4)
248 #define TAS2770_LimiterConfigurationReg0_LIMATKST54_2  (0x3 << 4)
249 #define TAS2770_LimiterConfigurationReg0_LIMATKST54_0_25  (0x0 << 4)
250 #define TAS2770_LimiterConfigurationReg0_LIMATKST54_0_5  (0x1 << 4)
251 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_Mask  (0x7 << 1)
252 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_5  (0x0 << 1)
253 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_10  (0x1 << 1)
254 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_20  (0x2 << 1)
255 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_40  (0x3 << 1)
256 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_80  (0x4 << 1)
257 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_160  (0x5 << 1)
258 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_320  (0x6 << 1)
259 #define TAS2770_LimiterConfigurationReg0_LIMATKRT31_640  (0x7 << 1)
260 #define TAS2770_LimiterConfigurationReg0_LIMEN_Mask  (0x1 << 0)
261 #define TAS2770_LimiterConfigurationReg0_LIMEN_Disabled  (0x0 << 0)
262 #define TAS2770_LimiterConfigurationReg0_LIMEN_Enabled  (0x1 << 0)
264     /* Limiter Configuration Reg1 */
265 #define TAS2770_LimiterConfigurationReg1  TAS2770_REG(0X0, 0x16)
266 #define TAS2770_LimiterConfigurationReg1_LIMRLSST76_Mask  (0x3 << 6)
267 #define TAS2770_LimiterConfigurationReg1_LIMRLSST76_1  (0x2 << 6)
268 #define TAS2770_LimiterConfigurationReg1_LIMRLSST76_2  (0x3 << 6)
269 #define TAS2770_LimiterConfigurationReg1_LIMRLSST76_0_25  (0x0 << 6)
270 #define TAS2770_LimiterConfigurationReg1_LIMRLSST76_0_5  (0x1 << 6)
271 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_Mask  (0x7 << 3)
272 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_10  (0x0 << 3)
273 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_50  (0x1 << 3)
274 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_100  (0x2 << 3)
275 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_250  (0x3 << 3)
276 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_500  (0x4 << 3)
277 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_750  (0x5 << 3)
278 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_1000  (0x6 << 3)
279 #define TAS2770_LimiterConfigurationReg1_LIMRLSRT53_1500  (0x7 << 3)
280 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_Mask  (0x7 << 0)
281 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_0  (0x0 << 0)
282 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_10  (0x1 << 0)
283 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_25  (0x2 << 0)
284 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_50  (0x3 << 0)
285 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_100  (0x4 << 0)
286 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_250  (0x5 << 0)
287 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_500  (0x6 << 0)
288 #define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_1000  (0x7 << 0)
290     /* Limiter Configuration Reg2 */
291 #define TAS2770_LimiterConfigurationReg2  TAS2770_REG(0X0, 0x17)
292 #define TAS2770_LimiterConfigurationReg2_LIMMAXATN40_Mask  (0x1f << 0)
294     /* Limiter Configuration Reg3 */
295 #define TAS2770_LimiterConfigurationReg3  TAS2770_REG(0X0, 0x18)
296 #define TAS2770_LimiterConfigurationReg3_LIMTHMAX60_Mask  (0x7f << 0)
298     /* Limiter Configuration Reg4 */
299 #define TAS2770_LimiterConfigurationReg4  TAS2770_REG(0X0, 0x19)
300 #define TAS2770_LimiterConfigurationReg4_LIMTHMIN60_Mask  (0x7f << 0)
302     /* Limiter Configuration Reg5 */
303 #define TAS2770_LimiterConfigurationReg5  TAS2770_REG(0X0, 0x1A)
304 #define TAS2770_LimiterConfigurationReg5_LIMINFPOINT_Mask  (0x7f << 0)
306     /* Brown Out Prevention Reg0 */
307 #define TAS2770_BrownOutPreventionReg0  TAS2770_REG(0X0, 0x1B)
308 #define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_Mask  (0x3 << 4)
309 #define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_1  (0x0 << 4)
310 #define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_2  (0x2 << 4)
311 #define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_4  (0x3 << 4)
312 #define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_1_5  (0x1 << 4)
313 #define TAS2770_BrownOutPreventionReg0_BOPHLDCLR_Mask  (0x1 << 3)
314 #define TAS2770_BrownOutPreventionReg0_BOPHLDCLR_DontClear  (0x0 << 3)
315 #define TAS2770_BrownOutPreventionReg0_BOPHLDCLR_Clear  (0x1 << 3)
316 #define TAS2770_BrownOutPreventionReg0_BOPINFHLD_Mask  (0x1 << 2)
317 #define TAS2770_BrownOutPreventionReg0_BOPINFHLD_UseHoldTime  (0x0 << 2)
318 #define TAS2770_BrownOutPreventionReg0_BOPINFHLD_HoldUntilCleared  (0x1 << 2)
319 #define TAS2770_BrownOutPreventionReg0_BOPMUTE_Mask  (0x1 << 1)
320 #define TAS2770_BrownOutPreventionReg0_BOPMUTE_DoNotMute  (0x0 << 1)
321 #define TAS2770_BrownOutPreventionReg0_BOPMUTE_Mute  (0x1 << 1)
322 #define TAS2770_BrownOutPreventionReg0_BOPEN_Mask  (0x1 << 0)
323 #define TAS2770_BrownOutPreventionReg0_BOPEN_Disabled  (0x0 << 0)
324 #define TAS2770_BrownOutPreventionReg0_BOPEN_Enabled  (0x1 << 0)
326     /* Brown Out Prevention Reg1 */
327 #define TAS2770_BrownOutPreventionReg1  TAS2770_REG(0X0, 0x1C)
328 #define TAS2770_BrownOutPreventionReg1_BOPTH70_Mask  (0xff << 0)
330     /* Brown Out Prevention Reg2 */
331 #define TAS2770_BrownOutPreventionReg2  TAS2770_REG(0X0, 0x1D)
332 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_Mask  (0x7 << 5)
333 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_5  (0x0 << 5)
334 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_10  (0x1 << 5)
335 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_20  (0x2 << 5)
336 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_40  (0x3 << 5)
337 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_80  (0x4 << 5)
338 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_160  (0x5 << 5)
339 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_320  (0x6 << 5)
340 #define TAS2770_BrownOutPreventionReg2_BOPATKRT75_640  (0x7 << 5)
341 #define TAS2770_BrownOutPreventionReg2_BOPATKST43_Mask  (0x3 << 3)
342 #define TAS2770_BrownOutPreventionReg2_BOPATKST43_1  (0x1 << 3)
343 #define TAS2770_BrownOutPreventionReg2_BOPATKST43_2  (0x3 << 3)
344 #define TAS2770_BrownOutPreventionReg2_BOPATKST43_0_5  (0x0 << 3)
345 #define TAS2770_BrownOutPreventionReg2_BOPATKST43_1_5  (0x2 << 3)
346 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_Mask  (0x7 << 0)
347 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_0  (0x0 << 0)
348 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_10  (0x1 << 0)
349 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_25  (0x2 << 0)
350 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_50  (0x3 << 0)
351 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_100  (0x4 << 0)
352 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_250  (0x5 << 0)
353 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_500  (0x6 << 0)
354 #define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_1000  (0x7 << 0)
356     /* ICLA Reg0 */
357 #define TAS2770_ICLAReg0  TAS2770_REG(0X0, 0x1E)
358 #define TAS2770_ICLAReg0_ICLAUSEMAX_Mask  (0x1 << 7)
359 #define TAS2770_ICLAReg0_ICLAUSEMAX_Min  (0x0 << 7)
360 #define TAS2770_ICLAReg0_ICLAUSEMAX_Max  (0x1 << 7)
361 #define TAS2770_ICLAReg0_ICLASLOT61_Mask  (0x3f << 1)
362 #define TAS2770_ICLAReg0_ICLAEN_Mask  (0x1 << 0)
363 #define TAS2770_ICLAReg0_ICLAEN_Disabled  (0x0 << 0)
364 #define TAS2770_ICLAReg0_ICLAEN_Enabled  (0x1 << 0)
366     /* ICLA Reg1 */
367 #define TAS2770_ICLAReg1  TAS2770_REG(0X0, 0x1F)
368 #define TAS2770_ICLAReg1_ICLASEN_Mask  (0xff << 0)
369 #define TAS2770_ICLAReg1_ICLASLOT_7_Disable  (0x0 << 7)
370 #define TAS2770_ICLAReg1_ICLASLOT_7_Enable  (0x1 << 7)
371 #define TAS2770_ICLAReg1_ICLASLOT_6_Disable  (0x0 << 6)
372 #define TAS2770_ICLAReg1_ICLASLOT_6_Enable  (0x1 << 6)
373 #define TAS2770_ICLAReg1_ICLASLOT_5_Disable  (0x0 << 5)
374 #define TAS2770_ICLAReg1_ICLASLOT_5_Enable  (0x1 << 5)
375 #define TAS2770_ICLAReg1_ICLASLOT_4_Disable  (0x0 << 4)
376 #define TAS2770_ICLAReg1_ICLASLOT_4_Enable  (0x1 << 4)
377 #define TAS2770_ICLAReg1_ICLASLOT_3_Disable  (0x0 << 3)
378 #define TAS2770_ICLAReg1_ICLASLOT_3_Enable  (0x1 << 3)
379 #define TAS2770_ICLAReg1_ICLASLOT_2_Disable  (0x0 << 2)
380 #define TAS2770_ICLAReg1_ICLASLOT_2_Enable  (0x1 << 2)
381 #define TAS2770_ICLAReg1_ICLASLOT_1_Disable  (0x0 << 1)
382 #define TAS2770_ICLAReg1_ICLASLOT_1_Enable  (0x1 << 1)
383 #define TAS2770_ICLAReg1_ICLASLOT_0_Disable  (0x0 << 0)
384 #define TAS2770_ICLAReg1_ICLASLOT_0_Enable  (0x1 << 0)
386     /* Interrupt Mask Reg0 */
387 #define TAS2770_InterruptMaskReg0  TAS2770_REG(0X0, 0x20)
388 #define TAS2770_InterruptMaskReg0_LIMMUTEINTMASK_Mask  (0x1 << 7)
389 #define TAS2770_InterruptMaskReg0_LIMMUTEINTMASK_Unmask  (0x0 << 7)
390 #define TAS2770_InterruptMaskReg0_LIMMUTEINTMASK_Disable  (0x1 << 7)
391 #define TAS2770_InterruptMaskReg0_LIMINFHLDINTMASK_Mask  (0x1 << 6)
392 #define TAS2770_InterruptMaskReg0_LIMINFHLDINTMASK_Unmask  (0x0 << 6)
393 #define TAS2770_InterruptMaskReg0_LIMINFHLDINTMASK_Disable  (0x1 << 6)
394 #define TAS2770_InterruptMaskReg0_LIMMAXATNINTMASK_Mask  (0x1 << 5)
395 #define TAS2770_InterruptMaskReg0_LIMMAXATNINTMASK_Unmask  (0x0 << 5)
396 #define TAS2770_InterruptMaskReg0_LIMMAXATNINTMASK_Disable  (0x1 << 5)
397 #define TAS2770_InterruptMaskReg0_VBATLessthanINFINTMASK_Mask  (0x1 << 4)
398 #define TAS2770_InterruptMaskReg0_VBATLessthanINFINTMASK_Unmask  (0x0 << 4)
399 #define TAS2770_InterruptMaskReg0_VBATLessthanINFINTMASK_Disable  (0x1 << 4)
400 #define TAS2770_InterruptMaskReg0_LIMActiveFlagINTMASK_Mask  (0x1 << 3)
401 #define TAS2770_InterruptMaskReg0_LIMActiveFlagINTMASK_Unmask  (0x0 << 3)
402 #define TAS2770_InterruptMaskReg0_LIMActiveFlagINTMASK_Disable  (0x1 << 3)
403 #define TAS2770_InterruptMaskReg0_TDMClockErrorINTMASK_Mask  (0x1 << 2)
404 #define TAS2770_InterruptMaskReg0_TDMClockErrorINTMASK_Unmask  (0x0 << 2)
405 #define TAS2770_InterruptMaskReg0_TDMClockErrorINTMASK_Disable  (0x1 << 2)
406 #define TAS2770_InterruptMaskReg0_OCEINTMASK_Mask  (0x1 << 1)
407 #define TAS2770_InterruptMaskReg0_OCEINTMASK_Unmask  (0x0 << 1)
408 #define TAS2770_InterruptMaskReg0_OCEINTMASK_Disable  (0x1 << 1)
409 #define TAS2770_InterruptMaskReg0_OTEINTMASK_Mask  (0x1 << 0)
410 #define TAS2770_InterruptMaskReg0_OTEINTMASK_Unmask  (0x0 << 0)
411 #define TAS2770_InterruptMaskReg0_OTEINTMASK_Disable  (0x1 << 0)
413     /* Interrupt Mask Reg1 */
414 #define TAS2770_InterruptMaskReg1  TAS2770_REG(0X0, 0x21)
415 #define TAS2770_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Mask  (0x1 << 7)
416 #define TAS2770_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Unmask  (0x0 << 7)
417 #define TAS2770_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Disable  (0x1 << 7)
418 #define TAS2770_InterruptMaskReg1_VBATOVLOINTMASK_Mask  (0x1 << 3)
419 #define TAS2770_InterruptMaskReg1_VBATOVLOINTMASK_Unmask  (0x0 << 3)
420 #define TAS2770_InterruptMaskReg1_VBATOVLOINTMASK_Disable  (0x1 << 3)
421 #define TAS2770_InterruptMaskReg1_VBATUVLOINTMASK_Mask  (0x1 << 2)
422 #define TAS2770_InterruptMaskReg1_VBATUVLOINTMASK_Unmask  (0x0 << 2)
423 #define TAS2770_InterruptMaskReg1_VBATUVLOINTMASK_Disable  (0x1 << 2)
424 #define TAS2770_InterruptMaskReg1_BrownOutFlagINTMASK_Mask  (0x1 << 1)
425 #define TAS2770_InterruptMaskReg1_BrownOutFlagINTMASK_Unmask  (0x0 << 1)
426 #define TAS2770_InterruptMaskReg1_BrownOutFlagINTMASK_Disable  (0x1 << 1)
427 #define TAS2770_InterruptMaskReg1_PDMClockErrorINTMASK_Mask  (0x1 << 0)
428 #define TAS2770_InterruptMaskReg1_PDMClockErrorINTMASK_Unmask  (0x0 << 0)
429 #define TAS2770_InterruptMaskReg1_PDMClockErrorINTMASK_Disable  (0x1 << 0)
431     /* Live-Interrupt Reg0 */
432 #define TAS2770_LiveInterruptReg0  TAS2770_REG(0X0, 0x22)
433 #define TAS2770_LiveInterruptReg0_LIMMUTE_Mask  (0x1 << 7)
434 #define TAS2770_LiveInterruptReg0_LIMMUTE_NoInterrupt  (0x0 << 7)
435 #define TAS2770_LiveInterruptReg0_LIMMUTE_Interrupt  (0x1 << 7)
436 #define TAS2770_LiveInterruptReg0_LIMINFHLD_Mask  (0x1 << 6)
437 #define TAS2770_LiveInterruptReg0_LIMINFHLD_NoInterrupt  (0x0 << 6)
438 #define TAS2770_LiveInterruptReg0_LIMINFHLD_Interrupt  (0x1 << 6)
439 #define TAS2770_LiveInterruptReg0_LIMMAXATN_Mask  (0x1 << 5)
440 #define TAS2770_LiveInterruptReg0_LIMMAXATN_NoInterrupt  (0x0 << 5)
441 #define TAS2770_LiveInterruptReg0_LIMMAXATN_Interrupt  (0x1 << 5)
442 #define TAS2770_LiveInterruptReg0_VBATLessthanINF_Mask  (0x1 << 4)
443 #define TAS2770_LiveInterruptReg0_VBATLessthanINF_NoInterrupt  (0x0 << 4)
444 #define TAS2770_LiveInterruptReg0_VBATLessthanINF_Interrupt  (0x1 << 4)
445 #define TAS2770_LiveInterruptReg0_LIMActiveFlag_Mask  (0x1 << 3)
446 #define TAS2770_LiveInterruptReg0_LIMActiveFlag_NoInterrupt  (0x0 << 3)
447 #define TAS2770_LiveInterruptReg0_LIMActiveFlag_Interrupt  (0x1 << 3)
448 #define TAS2770_LiveInterruptReg0_TDMClockError_Mask  (0x1 << 2)
449 #define TAS2770_LiveInterruptReg0_TDMClockError_NoInterrupt  (0x0 << 2)
450 #define TAS2770_LiveInterruptReg0_TDMClockError_Interrupt  (0x1 << 2)
451 #define TAS2770_LiveInterruptReg0_OCEFlag_Mask  (0x1 << 1)
452 #define TAS2770_LiveInterruptReg0_OCEFlag_NoInterrupt  (0x0 << 1)
453 #define TAS2770_LiveInterruptReg0_OCEFlag_Interrupt  (0x1 << 1)
454 #define TAS2770_LiveInterruptReg0_OTEFlag_Mask  (0x1 << 0)
455 #define TAS2770_LiveInterruptReg0_OTEFlag_NoInterrupt  (0x0 << 0)
456 #define TAS2770_LiveInterruptReg0_OTEFlag_Interrupt  (0x1 << 0)
458     /* Live-Interrupt Reg1 */
459 #define TAS2770_LiveInterruptReg1  TAS2770_REG(0X0, 0x23)
460 #define TAS2770_LiveInterruptReg1_PDMAUDDATAINVALID_Mask  (0x1 << 7)
461 #define TAS2770_LiveInterruptReg1_PDMAUDDATAINVALID_NoInterrupt  (0x0 << 7)
462 #define TAS2770_LiveInterruptReg1_PDMAUDDATAINVALID_Interrupt  (0x1 << 7)
463 #define TAS2770_LiveInterruptReg1_VBATOVLO_Mask  (0x1 << 3)
464 #define TAS2770_LiveInterruptReg1_VBATOVLO_NoInterrupt  (0x0 << 3)
465 #define TAS2770_LiveInterruptReg1_VBATOVLO_Interrupt  (0x1 << 3)
466 #define TAS2770_LiveInterruptReg1_VBATUVLO_Mask  (0x1 << 2)
467 #define TAS2770_LiveInterruptReg1_VBATUVLO_NoInterrupt  (0x0 << 2)
468 #define TAS2770_LiveInterruptReg1_VBATUVLO_Interrupt  (0x1 << 2)
469 #define TAS2770_LiveInterruptReg1_BrownOutFlag_Mask  (0x1 << 1)
470 #define TAS2770_LiveInterruptReg1_BrownOutFlag_NoInterrupt  (0x0 << 1)
471 #define TAS2770_LiveInterruptReg1_BrownOutFlag_Interrupt  (0x1 << 1)
472 #define TAS2770_LiveInterruptReg1_PDMClockError_Mask  (0x1 << 0)
473 #define TAS2770_LiveInterruptReg1_PDMClockError_NoInterrupt  (0x0 << 0)
474 #define TAS2770_LiveInterruptReg1_PDMClockError_Interrupt  (0x1 << 0)
476     /* Latched-Interrupt Reg0 */
477 #define TAS2770_LatchedInterruptReg0  TAS2770_REG(0X0, 0x24)
478 #define TAS2770_LatchedInterruptReg0_LIMMUTESticky_Mask  (0x1 << 7)
479 #define TAS2770_LatchedInterruptReg0_LIMMUTESticky_NoInterrupt  (0x0 << 7)
480 #define TAS2770_LatchedInterruptReg0_LIMMUTESticky_Interrupt  (0x1 << 7)
481 #define TAS2770_LatchedInterruptReg0_LIMINFHLDSticky_Mask  (0x1 << 6)
482 #define TAS2770_LatchedInterruptReg0_LIMINFHLDSticky_NoInterrupt  (0x0 << 6)
483 #define TAS2770_LatchedInterruptReg0_LIMINFHLDSticky_Interrupt  (0x1 << 6)
484 #define TAS2770_LatchedInterruptReg0_LIMMAXATNSticky_Mask  (0x1 << 5)
485 #define TAS2770_LatchedInterruptReg0_LIMMAXATNSticky_NoInterrupt  (0x0 << 5)
486 #define TAS2770_LatchedInterruptReg0_LIMMAXATNSticky_Interrupt  (0x1 << 5)
487 #define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_Mask  (0x1 << 4)
488 #define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_NoInterrupt \
489         (0x0 << 4)
490 #define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_Interrupt  (0x1 << 4)
491 #define TAS2770_LatchedInterruptReg0_LIMActiveFlagSticky_Mask  (0x1 << 3)
492 #define TAS2770_LatchedInterruptReg0_LIMActiveFlagSticky_NoInterrupt  (0x0 << 3)
493 #define TAS2770_LatchedInterruptReg0_LIMActiveFlagSticky_Interrupt  (0x1 << 3)
494 #define TAS2770_LatchedInterruptReg0_TDMClockErrorSticky_Mask  (0x1 << 2)
495 #define TAS2770_LatchedInterruptReg0_TDMClockErrorSticky_NoInterrupt  (0x0 << 2)
496 #define TAS2770_LatchedInterruptReg0_TDMClockErrorSticky_Interrupt  (0x1 << 2)
497 #define TAS2770_LatchedInterruptReg0_OCEFlagSticky_Mask  (0x1 << 1)
498 #define TAS2770_LatchedInterruptReg0_OCEFlagSticky_NoInterrupt  (0x0 << 1)
499 #define TAS2770_LatchedInterruptReg0_OCEFlagSticky_Interrupt  (0x1 << 1)
500 #define TAS2770_LatchedInterruptReg0_OTEFlagSticky_Mask  (0x1 << 0)
501 #define TAS2770_LatchedInterruptReg0_OTEFlagSticky_NoInterrupt  (0x0 << 0)
502 #define TAS2770_LatchedInterruptReg0_OTEFlagSticky_Interrupt  (0x1 << 0)
504     /* Latched-Interrupt Reg1 */
505 #define TAS2770_LatchedInterruptReg1  TAS2770_REG(0X0, 0x25)
506 #define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Mask  (0x1 << 7)
507 #define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_NoInterrupt \
508         (0x0 << 7)
509 #define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Interrupt \
510         (0x1 << 7)
511 #define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_Mask  (0x1 << 3)
512 #define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_NoInterrupt  (0x0 << 3)
513 #define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_Interrupt  (0x1 << 3)
514 #define TAS2770_LatchedInterruptReg1_VBATUVLOSticky_Mask  (0x1 << 2)
515 #define TAS2770_LatchedInterruptReg1_VBATUVLOSticky_NoInterrupt  (0x0 << 2)
516 #define TAS2770_LatchedInterruptReg1_VBATUVLOSticky_Interrupt  (0x1 << 2)
517 #define TAS2770_LatchedInterruptReg1_BrownOutFlagSticky_Mask  (0x1 << 1)
518 #define TAS2770_LatchedInterruptReg1_BrownOutFlagSticky_NoInterrupt  (0x0 << 1)
519 #define TAS2770_LatchedInterruptReg1_BrownOutFlagSticky_Interrupt  (0x1 << 1)
520 #define TAS2770_LatchedInterruptReg1_PDMClockErrorSticky_Mask  (0x1 << 0)
521 #define TAS2770_LatchedInterruptReg1_PDMClockErrorSticky_NoInterrupt  (0x0 << 0)
522 #define TAS2770_LatchedInterruptReg1_PDMClockErrorSticky_Interrupt  (0x1 << 0)
524     /* VBAT MSB */
525 #define TAS2770_VBATMSB  TAS2770_REG(0X0, 0x27)
526 #define TAS2770_VBATMSB_VBATMSB70_Mask  (0xff << 0)
528     /* VBAT LSB */
529 #define TAS2770_VBATLSB  TAS2770_REG(0X0, 0x28)
530 #define TAS2770_VBATLSB_VBATLSB74_Mask  (0xf << 4)
532     /* TEMP MSB */
533 #define TAS2770_TEMPMSB  TAS2770_REG(0X0, 0x29)
534 #define TAS2770_TEMPMSB_TEMPMSB70_Mask  (0xff << 0)
536     /* TEMP LSB */
537 #define TAS2770_TEMPLSB  TAS2770_REG(0X0, 0x2A)
538 #define TAS2770_TEMPLSB_TEMPLSB74_Mask  (0xf << 4)
540         /* SDZ Config */
541 #define TAS2770_SDZCONFIG  TAS2770_REG(0X0, 0x2F)
542 #define TAS2770_SDZCONFIG_ICLANONZEROMIN_Mask  (0x1 << 4)
543 #define TAS2770_SDZCONFIG_ICLANONZEROMIN_Disable  (0x0 << 4)
544 #define TAS2770_SDZCONFIG_ICLANONZEROMIN_Enable  (0x1 << 4)
545 #define TAS2770_SDZCONFIG_SDZMODECONF_Mask  (0x3 << 2)
546 #define TAS2770_SDZCONFIG_SDZMODECONF_ForcedShutdownAfterTimeout  (0x0 << 2)
547 #define TAS2770_SDZCONFIG_SDZMODECONF_ForceShutdown  (0x1 << 2)
548 #define TAS2770_SDZCONFIG_SDZMODECONF_NormalShutdown  (0x2 << 2)
549 #define TAS2770_SDZCONFIG_SDZMODETIMEOUT_Mask  (0x3 << 0)
550 #define TAS2770_SDZCONFIG_SDZMODETIMEOUT_2ms  (0x0 << 0)
551 #define TAS2770_SDZCONFIG_SDZMODETIMEOUT_4ms  (0x1 << 0)
552 #define TAS2770_SDZCONFIG_SDZMODETIMEOUT_6ms  (0x2 << 0)
553 #define TAS2770_SDZCONFIG_SDZMODETIMEOUT_23p8ms  (0x3 << 0)
556     /* Interrupt Configuration */
557 #define TAS2770_InterruptConfiguration  TAS2770_REG(0X0, 0x30)
558 #define TAS2770_InterruptConfiguration_INTTHRUSW_Mask  (0x1 << 2),
559 #define TAS2770_InterruptConfiguration_INTTHRUSW_IntOnIRQZ  (0x0 << 2)
560 #define TAS2770_InterruptConfiguration_INTTHRUSW_IntFor2ms  (0x1 << 2)
561 #define TAS2770_InterruptConfiguration_PININTConfig10_Mask  (0x3 << 0)
562 #define TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLiveInterrupts \
563         (0x0 << 0)
564 #define \
565 TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLatchedInterrupts \
566         (0x1 << 0)
567 #define \
568 TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLiveInterrupts \
569         (0x2 << 0)
570 #define \
571 TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLatchedInterrupts \
572         (0x3 << 0)
574     /* Digital Input Pin Pull Down */
575 #define TAS2770_DigitalInputPinPullDown  TAS2770_REG(0X0, 0x31)
576 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDOUT_Mask  (0x1 << 7)
577 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDOUT_Disabled  (0x0 << 7)
578 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDOUT_Enabled  (0x1 << 7)
579 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDIN_Mask  (0x1 << 6)
580 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDIN_Disabled  (0x0 << 6)
581 #define TAS2770_DigitalInputPinPullDown_WKPulldownSDIN_Enabled  (0x1 << 6)
582 #define TAS2770_DigitalInputPinPullDown_WKPulldownFSYNC_Mask  (0x1 << 5)
583 #define TAS2770_DigitalInputPinPullDown_WKPulldownFSYNC_Disabled  (0x0 << 5)
584 #define TAS2770_DigitalInputPinPullDown_WKPulldownFSYNC_Enabled  (0x1 << 5)
585 #define TAS2770_DigitalInputPinPullDown_WKPulldownSBCLK_Mask  (0x1 << 4)
586 #define TAS2770_DigitalInputPinPullDown_WKPulldownSBCLK_Disabled  (0x0 << 4)
587 #define TAS2770_DigitalInputPinPullDown_WKPulldownSBCLK_Enabled  (0x1 << 4)
588 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD0_Mask  (0x1 << 3)
589 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD0_Disabled  (0x0 << 3)
590 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD0_Enabled  (0x1 << 3)
591 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD1_Mask  (0x1 << 2)
592 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD1_Disabled  (0x0 << 2)
593 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMD1_Enabled  (0x1 << 2)
594 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK0_Mask  (0x1 << 1)
595 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK0_Disabled  (0x0 << 1)
596 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK0_Enabled  (0x1 << 1)
597 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK1_Mask  (0x1 << 0)
598 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK1_Disabled  (0x0 << 0)
599 #define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK1_Enabled  (0x1 << 0)
601     /* Misc IRQ */
602 #define TAS2770_MiscIRQ  TAS2770_REG(0X0, 0x32)
603 #define TAS2770_MiscIRQ_IRQZREQD_Mask  (0x1 << 7)
604 #define TAS2770_MiscIRQ_IRQZREQD_ActiveHigh  (0x0 << 7)
605 #define TAS2770_MiscIRQ_IRQZREQD_ActiveLow  (0x1 << 7)
606 #define TAS2770_MiscIRQ_IRQZBITBANG_Mask  (0x1 << 0)
607 #define TAS2770_MiscIRQ_IRQZBITBANG_IRQZInputBuf0  (0x0 << 0)
608 #define TAS2770_MiscIRQ_IRQZBITBANG_IRQZInputBuf1  (0x1 << 0)
611     /* Clock Configuration */
612 #define TAS2770_ClockConfiguration  TAS2770_REG(0X0, 0x3C)
613 #define TAS2770_ClockConfiguration_SBCLKtoFS52_Mask  (0xf << 2)
614 #define TAS2770_ClockConfiguration_SBCLKtoFS52_16  (0x0 << 2)
615 #define TAS2770_ClockConfiguration_SBCLKtoFS52_24  (0x1 << 2)
616 #define TAS2770_ClockConfiguration_SBCLKtoFS52_32  (0x2 << 2)
617 #define TAS2770_ClockConfiguration_SBCLKtoFS52_48  (0x3 << 2)
618 #define TAS2770_ClockConfiguration_SBCLKtoFS52_64  (0x4 << 2)
619 #define TAS2770_ClockConfiguration_SBCLKtoFS52_96  (0x5 << 2)
620 #define TAS2770_ClockConfiguration_SBCLKtoFS52_128  (0x6 << 2)
621 #define TAS2770_ClockConfiguration_SBCLKtoFS52_192  (0x7 << 2)
622 #define TAS2770_ClockConfiguration_SBCLKtoFS52_256  (0x8 << 2)
623 #define TAS2770_ClockConfiguration_SBCLKtoFS52_384  (0x9 << 2)
624 #define TAS2770_ClockConfiguration_SBCLKtoFS52_512  (0xa << 2)
625 #define TAS2770_ClockConfiguration_DISCLKRateDetect10_Mask  (0x3 << 0)
626 #define TAS2770_ClockConfiguration_DISCLKRateDetect10_Disabled  (0x1 << 0)
627 #define TAS2770_ClockConfiguration_DISCLKRateDetect10_Enabled  (0x0 << 0)
630 #define TAS2770_BDIVSelection_BCLKMaster  TAS2770_REG(0X0, 0x3D)
631 #define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_Mask  (0x3 << 0)
632 #define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_NDIV2Output  (0x0 << 0)
633 #define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_NDIV1Output  (0x1 << 0)
634 #define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_MCLKOutput  (0x2 << 0)
635 #define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_PDMCLK1PAD  (0x3 << 0)
637 #define TAS2770_BDIVSelection_HOLDSARUPDATE  TAS2770_REG(0X0, 0x41)
638 #define TAS2770_BDIVSelection_HOLDSARUPDATE10_Mask  (0x1 << 0)
639 #define TAS2770_BDIVSelection_HOLDSARUPDATE10_Disabled  (0x0 << 0)
640 #define TAS2770_BDIVSelection_HOLDSARUPDATE10_Enabled  (0x1 << 0)
643     /* TDM Clock detection monitor */
644 #define TAS2770_TDMClockdetectionmonitor  TAS2770_REG(0X0, 0x77)
645 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_Mask  (0xf << 3)
646 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_16  (0x0 << 3)
647 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_24  (0x1 << 3)
648 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_32  (0x2 << 3)
649 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_48  (0x3 << 3)
650 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_64  (0x4 << 3)
651 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_96  (0x5 << 3)
652 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_128  (0x6 << 3)
653 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_192  (0x7 << 3)
654 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_256  (0x8 << 3)
655 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_384  (0x9 << 3)
656 #define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_512  (0xf << 3)
657 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_Mask  (0x7 << 0),
658 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_8khz  (0x0 << 0)
659 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_16khz  (0x1 << 0)
660 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_32khz  (0x2 << 0)
661 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_48khz  (0x3 << 0)
662 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_96khz  (0x4 << 0)
663 #define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_192khz  (0x5 << 0)
665     /* Revision and PG ID */
666 #define TAS2770_RevisionandPGID  TAS2770_REG(0X0, 0x7D)
667 #define TAS2770_RevisionandPGID_RevisionID74_Mask  (0xf << 4)
668 #define TAS2770_RevisionandPGID_PGID30_Mask  (0xf << 0)
670     /* I2C Checksum */
671 #define TAS2770_I2CChecksum  TAS2770_REG(0X0, 0x7E)
672 #define TAS2770_I2CChecksum_I2CChecksum70_Mask  (0xff << 0)
674     /* Book */
675 #define TAS2770_Book  TAS2770_REG(0X0, 0x7F)
676 #define TAS2770_Book_Book70_Mask  (0xff << 0)
679 #define TAS2770_RegisterCount  55
681 #define ERROR_NONE          0x0000000
682 #define ERROR_PLL_ABSENT    0x0000000
683 #define ERROR_DEVA_I2C_COMM 0x0000000
684 #define ERROR_DEVB_I2C_COMM 0x0000000
685 #define ERROR_PRAM_CRCCHK   0x0000000
686 #define ERROR_YRAM_CRCCHK   0x0000001
687 #define ERROR_CLK_DET2      0x0000002
688 #define ERROR_CLK_DET1      0x0000004
689 #define ERROR_CLK_LOST      0x0000008
690 #define ERROR_BROWNOUT      0x0000010
691 #define ERROR_DIE_OVERTEMP  0x0000020
692 #define ERROR_CLK_HALT      0x0000040
693 #define ERROR_UNDER_VOLTAGE 0x0000080
694 #define ERROR_OVER_CURRENT  0x0000100
695 #define ERROR_CLASSD_PWR    0x0000200
696 #define ERROR_FAILSAFE      0x4000000
698 struct tas2770_register {
699         int book;
700         int page;
701         int reg;
702 };
704 struct tas2770_dai_cfg {
705         unsigned int dai_fmt;
706         unsigned int tdm_delay;
707 };
709 struct tas2770_priv {
710         struct device *dev;
711         struct regmap *regmap;
712         struct mutex dev_lock;
713         struct delayed_work irq_work;
714         struct hrtimer mtimer;
715         int mnClkin;
716         int mnClkid;
717         bool mbPowerUp;
718         int mnCurrentBook;
719         int mnCurrentPage;
720         int mnLoad;
721         int mnASIFormat;
722         int mnResetGPIO;
723         int mnIRQGPIO;
724         int mnIRQ;
725         bool mbIRQEnable;
726         int mnSamplingRate;
727         int mnFrameSize;
728         int mnPLL;
729         int mnPPG;
730         int mnLeftSlot;
731         int mnRightSlot;
732         int mnCh_size;
733         int mnSlot_width;
734         int mnVmon_slot_no;
735         int mnImon_slot_no;
736         void (*hw_reset)(struct tas2770_priv *pTAS2770);
737         void (*clearIRQ)(struct tas2770_priv *pTAS2770);
738         void (*enableIRQ)(struct tas2770_priv *pTAS2770, bool enable);
739                 /* device is working, but system is suspended */
740         int (*runtime_suspend)(struct tas2770_priv *pTAS2770);
741         int (*runtime_resume)(struct tas2770_priv *pTAS2770);
742         bool mbRuntimeSuspend;
744         unsigned int mnErrCode;
745 #ifdef CONFIG_TAS2770_CODEC
746         struct mutex codec_lock;
747 #endif
748 };
750 #endif /* __TAS2770_ */