diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-02-13 08:36:49 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@ti.com> | 2012-03-12 09:34:20 -0400 |
commit | 81da6a9e49b9561f325d201c54eca274f066e13b (patch) | |
tree | f498abca4d9495fc2fa3c2355a2fc3c3095cd5e6 /sound/soc/omap | |
parent | 20456242e8d13287b476264223caef7f1193741a (diff) |
ASoC: OMAP: mcbsp.h: Clean up bit definitions
Use BIT() for bit position, correct field definition by adding mask to
them, and also adding the missing spaces around '<<'
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/mcbsp.h | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h index 6d579938a154..ec00c275ec49 100644 --- a/sound/soc/omap/mcbsp.h +++ b/sound/soc/omap/mcbsp.h | |||
@@ -89,130 +89,130 @@ enum { | |||
89 | #define OMAP_ST_REG_SSELCR 0x2C | 89 | #define OMAP_ST_REG_SSELCR 0x2C |
90 | 90 | ||
91 | /************************** McBSP SPCR1 bit definitions ***********************/ | 91 | /************************** McBSP SPCR1 bit definitions ***********************/ |
92 | #define RRST 0x0001 | 92 | #define RRST BIT(0) |
93 | #define RRDY 0x0002 | 93 | #define RRDY BIT(1) |
94 | #define RFULL 0x0004 | 94 | #define RFULL BIT(2) |
95 | #define RSYNC_ERR 0x0008 | 95 | #define RSYNC_ERR BIT(3) |
96 | #define RINTM(value) ((value)<<4) /* bits 4:5 */ | 96 | #define RINTM(value) (((value) & 0x3) << 4) /* bits 4:5 */ |
97 | #define ABIS 0x0040 | 97 | #define ABIS BIT(6) |
98 | #define DXENA 0x0080 | 98 | #define DXENA BIT(7) |
99 | #define CLKSTP(value) ((value)<<11) /* bits 11:12 */ | 99 | #define CLKSTP(value) (((value) & 0x3) << 11) /* bits 11:12 */ |
100 | #define RJUST(value) ((value)<<13) /* bits 13:14 */ | 100 | #define RJUST(value) (((value) & 0x3) << 13) /* bits 13:14 */ |
101 | #define ALB 0x8000 | 101 | #define ALB BIT(15) |
102 | #define DLB 0x8000 | 102 | #define DLB BIT(15) |
103 | 103 | ||
104 | /************************** McBSP SPCR2 bit definitions ***********************/ | 104 | /************************** McBSP SPCR2 bit definitions ***********************/ |
105 | #define XRST 0x0001 | 105 | #define XRST BIT(0) |
106 | #define XRDY 0x0002 | 106 | #define XRDY BIT(1) |
107 | #define XEMPTY 0x0004 | 107 | #define XEMPTY BIT(2) |
108 | #define XSYNC_ERR 0x0008 | 108 | #define XSYNC_ERR BIT(3) |
109 | #define XINTM(value) ((value)<<4) /* bits 4:5 */ | 109 | #define XINTM(value) (((value) & 0x3) << 4) /* bits 4:5 */ |
110 | #define GRST 0x0040 | 110 | #define GRST BIT(6) |
111 | #define FRST 0x0080 | 111 | #define FRST BIT(7) |
112 | #define SOFT 0x0100 | 112 | #define SOFT BIT(8) |
113 | #define FREE 0x0200 | 113 | #define FREE BIT(9) |
114 | 114 | ||
115 | /************************** McBSP PCR bit definitions *************************/ | 115 | /************************** McBSP PCR bit definitions *************************/ |
116 | #define CLKRP 0x0001 | 116 | #define CLKRP BIT(0) |
117 | #define CLKXP 0x0002 | 117 | #define CLKXP BIT(1) |
118 | #define FSRP 0x0004 | 118 | #define FSRP BIT(2) |
119 | #define FSXP 0x0008 | 119 | #define FSXP BIT(3) |
120 | #define DR_STAT 0x0010 | 120 | #define DR_STAT BIT(4) |
121 | #define DX_STAT 0x0020 | 121 | #define DX_STAT BIT(5) |
122 | #define CLKS_STAT 0x0040 | 122 | #define CLKS_STAT BIT(6) |
123 | #define SCLKME 0x0080 | 123 | #define SCLKME BIT(7) |
124 | #define CLKRM 0x0100 | 124 | #define CLKRM BIT(8) |
125 | #define CLKXM 0x0200 | 125 | #define CLKXM BIT(9) |
126 | #define FSRM 0x0400 | 126 | #define FSRM BIT(10) |
127 | #define FSXM 0x0800 | 127 | #define FSXM BIT(11) |
128 | #define RIOEN 0x1000 | 128 | #define RIOEN BIT(12) |
129 | #define XIOEN 0x2000 | 129 | #define XIOEN BIT(13) |
130 | #define IDLE_EN 0x4000 | 130 | #define IDLE_EN BIT(14) |
131 | 131 | ||
132 | /************************** McBSP RCR1 bit definitions ************************/ | 132 | /************************** McBSP RCR1 bit definitions ************************/ |
133 | #define RWDLEN1(value) ((value)<<5) /* Bits 5:7 */ | 133 | #define RWDLEN1(value) (((value) & 0x7) << 5) /* Bits 5:7 */ |
134 | #define RFRLEN1(value) ((value)<<8) /* Bits 8:14 */ | 134 | #define RFRLEN1(value) (((value) & 0x7f) << 8) /* Bits 8:14 */ |
135 | 135 | ||
136 | /************************** McBSP XCR1 bit definitions ************************/ | 136 | /************************** McBSP XCR1 bit definitions ************************/ |
137 | #define XWDLEN1(value) ((value)<<5) /* Bits 5:7 */ | 137 | #define XWDLEN1(value) (((value) & 0x7) << 5) /* Bits 5:7 */ |
138 | #define XFRLEN1(value) ((value)<<8) /* Bits 8:14 */ | 138 | #define XFRLEN1(value) (((value) & 0x7f) << 8) /* Bits 8:14 */ |
139 | 139 | ||
140 | /*************************** McBSP RCR2 bit definitions ***********************/ | 140 | /*************************** McBSP RCR2 bit definitions ***********************/ |
141 | #define RDATDLY(value) (value) /* Bits 0:1 */ | 141 | #define RDATDLY(value) ((value) & 0x3) /* Bits 0:1 */ |
142 | #define RFIG 0x0004 | 142 | #define RFIG BIT(2) |
143 | #define RCOMPAND(value) ((value)<<3) /* Bits 3:4 */ | 143 | #define RCOMPAND(value) (((value) & 0x3) << 3) /* Bits 3:4 */ |
144 | #define RWDLEN2(value) ((value)<<5) /* Bits 5:7 */ | 144 | #define RWDLEN2(value) (((value) & 0x7) << 5) /* Bits 5:7 */ |
145 | #define RFRLEN2(value) ((value)<<8) /* Bits 8:14 */ | 145 | #define RFRLEN2(value) (((value) & 0x7f) << 8) /* Bits 8:14 */ |
146 | #define RPHASE 0x8000 | 146 | #define RPHASE BIT(15) |
147 | 147 | ||
148 | /*************************** McBSP XCR2 bit definitions ***********************/ | 148 | /*************************** McBSP XCR2 bit definitions ***********************/ |
149 | #define XDATDLY(value) (value) /* Bits 0:1 */ | 149 | #define XDATDLY(value) ((value) & 0x3) /* Bits 0:1 */ |
150 | #define XFIG 0x0004 | 150 | #define XFIG BIT(2) |
151 | #define XCOMPAND(value) ((value)<<3) /* Bits 3:4 */ | 151 | #define XCOMPAND(value) (((value) & 0x3) << 3) /* Bits 3:4 */ |
152 | #define XWDLEN2(value) ((value)<<5) /* Bits 5:7 */ | 152 | #define XWDLEN2(value) (((value) & 0x7) << 5) /* Bits 5:7 */ |
153 | #define XFRLEN2(value) ((value)<<8) /* Bits 8:14 */ | 153 | #define XFRLEN2(value) (((value) & 0x7f) << 8) /* Bits 8:14 */ |
154 | #define XPHASE 0x8000 | 154 | #define XPHASE BIT(15) |
155 | 155 | ||
156 | /************************* McBSP SRGR1 bit definitions ************************/ | 156 | /************************* McBSP SRGR1 bit definitions ************************/ |
157 | #define CLKGDV(value) (value) /* Bits 0:7 */ | 157 | #define CLKGDV(value) ((value) & 0x7f) /* Bits 0:7 */ |
158 | #define FWID(value) ((value)<<8) /* Bits 8:15 */ | 158 | #define FWID(value) (((value) & 0xff) << 8) /* Bits 8:15 */ |
159 | 159 | ||
160 | /************************* McBSP SRGR2 bit definitions ************************/ | 160 | /************************* McBSP SRGR2 bit definitions ************************/ |
161 | #define FPER(value) (value) /* Bits 0:11 */ | 161 | #define FPER(value) ((value) & 0x0fff) /* Bits 0:11 */ |
162 | #define FSGM 0x1000 | 162 | #define FSGM BIT(12) |
163 | #define CLKSM 0x2000 | 163 | #define CLKSM BIT(13) |
164 | #define CLKSP 0x4000 | 164 | #define CLKSP BIT(14) |
165 | #define GSYNC 0x8000 | 165 | #define GSYNC BIT(15) |
166 | 166 | ||
167 | /************************* McBSP MCR1 bit definitions *************************/ | 167 | /************************* McBSP MCR1 bit definitions *************************/ |
168 | #define RMCM 0x0001 | 168 | #define RMCM BIT(0) |
169 | #define RCBLK(value) ((value)<<2) /* Bits 2:4 */ | 169 | #define RCBLK(value) (((value) & 0x7) << 2) /* Bits 2:4 */ |
170 | #define RPABLK(value) ((value)<<5) /* Bits 5:6 */ | 170 | #define RPABLK(value) (((value) & 0x3) << 5) /* Bits 5:6 */ |
171 | #define RPBBLK(value) ((value)<<7) /* Bits 7:8 */ | 171 | #define RPBBLK(value) (((value) & 0x3) << 7) /* Bits 7:8 */ |
172 | 172 | ||
173 | /************************* McBSP MCR2 bit definitions *************************/ | 173 | /************************* McBSP MCR2 bit definitions *************************/ |
174 | #define XMCM(value) (value) /* Bits 0:1 */ | 174 | #define XMCM(value) ((value) & 0x3) /* Bits 0:1 */ |
175 | #define XCBLK(value) ((value)<<2) /* Bits 2:4 */ | 175 | #define XCBLK(value) (((value) & 0x7) << 2) /* Bits 2:4 */ |
176 | #define XPABLK(value) ((value)<<5) /* Bits 5:6 */ | 176 | #define XPABLK(value) (((value) & 0x3) << 5) /* Bits 5:6 */ |
177 | #define XPBBLK(value) ((value)<<7) /* Bits 7:8 */ | 177 | #define XPBBLK(value) (((value) & 0x3) << 7) /* Bits 7:8 */ |
178 | 178 | ||
179 | /*********************** McBSP XCCR bit definitions *************************/ | 179 | /*********************** McBSP XCCR bit definitions *************************/ |
180 | #define EXTCLKGATE 0x8000 | 180 | #define XDISABLE BIT(0) |
181 | #define PPCONNECT 0x4000 | 181 | #define XDMAEN BIT(3) |
182 | #define DXENDLY(value) ((value)<<12) /* Bits 12:13 */ | 182 | #define DILB BIT(5) |
183 | #define XFULL_CYCLE 0x0800 | 183 | #define XFULL_CYCLE BIT(11) |
184 | #define DILB 0x0020 | 184 | #define DXENDLY(value) (((value) & 0x3) << 12) /* Bits 12:13 */ |
185 | #define XDMAEN 0x0008 | 185 | #define PPCONNECT BIT(14) |
186 | #define XDISABLE 0x0001 | 186 | #define EXTCLKGATE BIT(15) |
187 | 187 | ||
188 | /********************** McBSP RCCR bit definitions *************************/ | 188 | /********************** McBSP RCCR bit definitions *************************/ |
189 | #define RFULL_CYCLE 0x0800 | 189 | #define RDISABLE BIT(0) |
190 | #define RDMAEN 0x0008 | 190 | #define RDMAEN BIT(3) |
191 | #define RDISABLE 0x0001 | 191 | #define RFULL_CYCLE BIT(11) |
192 | 192 | ||
193 | /********************** McBSP SYSCONFIG bit definitions ********************/ | 193 | /********************** McBSP SYSCONFIG bit definitions ********************/ |
194 | #define CLOCKACTIVITY(value) ((value)<<8) | 194 | #define SOFTRST BIT(1) |
195 | #define SIDLEMODE(value) ((value)<<3) | 195 | #define ENAWAKEUP BIT(2) |
196 | #define ENAWAKEUP 0x0004 | 196 | #define SIDLEMODE(value) (((value) & 0x3) << 3) |
197 | #define SOFTRST 0x0002 | 197 | #define CLOCKACTIVITY(value) (((value) & 0x3) << 8) |
198 | 198 | ||
199 | /********************** McBSP SSELCR bit definitions ***********************/ | 199 | /********************** McBSP SSELCR bit definitions ***********************/ |
200 | #define SIDETONEEN 0x0400 | 200 | #define SIDETONEEN BIT(10) |
201 | 201 | ||
202 | /********************** McBSP Sidetone SYSCONFIG bit definitions ***********/ | 202 | /********************** McBSP Sidetone SYSCONFIG bit definitions ***********/ |
203 | #define ST_AUTOIDLE 0x0001 | 203 | #define ST_AUTOIDLE BIT(0) |
204 | 204 | ||
205 | /********************** McBSP Sidetone SGAINCR bit definitions *************/ | 205 | /********************** McBSP Sidetone SGAINCR bit definitions *************/ |
206 | #define ST_CH1GAIN(value) ((value<<16)) /* Bits 16:31 */ | 206 | #define ST_CH0GAIN(value) ((value) & 0xffff) /* Bits 0:15 */ |
207 | #define ST_CH0GAIN(value) (value) /* Bits 0:15 */ | 207 | #define ST_CH1GAIN(value) (((value) & 0xffff) << 16) /* Bits 16:31 */ |
208 | 208 | ||
209 | /********************** McBSP Sidetone SFIRCR bit definitions **************/ | 209 | /********************** McBSP Sidetone SFIRCR bit definitions **************/ |
210 | #define ST_FIRCOEFF(value) (value) /* Bits 0:15 */ | 210 | #define ST_FIRCOEFF(value) ((value) & 0xffff) /* Bits 0:15 */ |
211 | 211 | ||
212 | /********************** McBSP Sidetone SSELCR bit definitions **************/ | 212 | /********************** McBSP Sidetone SSELCR bit definitions **************/ |
213 | #define ST_COEFFWRDONE 0x0004 | 213 | #define ST_SIDETONEEN BIT(0) |
214 | #define ST_COEFFWREN 0x0002 | 214 | #define ST_COEFFWREN BIT(1) |
215 | #define ST_SIDETONEEN 0x0001 | 215 | #define ST_COEFFWRDONE BIT(2) |
216 | 216 | ||
217 | /********************** McBSP DMA operating modes **************************/ | 217 | /********************** McBSP DMA operating modes **************************/ |
218 | #define MCBSP_DMA_MODE_ELEMENT 0 | 218 | #define MCBSP_DMA_MODE_ELEMENT 0 |
@@ -220,15 +220,15 @@ enum { | |||
220 | #define MCBSP_DMA_MODE_FRAME 2 | 220 | #define MCBSP_DMA_MODE_FRAME 2 |
221 | 221 | ||
222 | /********************** McBSP WAKEUPEN bit definitions *********************/ | 222 | /********************** McBSP WAKEUPEN bit definitions *********************/ |
223 | #define XEMPTYEOFEN 0x4000 | 223 | #define RSYNCERREN BIT(0) |
224 | #define XRDYEN 0x0400 | 224 | #define RFSREN BIT(1) |
225 | #define XEOFEN 0x0200 | 225 | #define REOFEN BIT(2) |
226 | #define XFSXEN 0x0100 | 226 | #define RRDYEN BIT(3) |
227 | #define XSYNCERREN 0x0080 | 227 | #define XSYNCERREN BIT(7) |
228 | #define RRDYEN 0x0008 | 228 | #define XFSXEN BIT(8) |
229 | #define REOFEN 0x0004 | 229 | #define XEOFEN BIT(9) |
230 | #define RFSREN 0x0002 | 230 | #define XRDYEN BIT(10) |
231 | #define RSYNCERREN 0x0001 | 231 | #define XEMPTYEOFEN BIT(14) |
232 | 232 | ||
233 | /* we don't do multichannel for now */ | 233 | /* we don't do multichannel for now */ |
234 | struct omap_mcbsp_reg_cfg { | 234 | struct omap_mcbsp_reg_cfg { |