wm8731.c (b3b9c1cbb35125f7e43a323ebe89e7a74e3c1ac2) wm8731.c (a71a468a50f1385855e28864e26251b02df829bb)
1/*
2 * wm8731.c -- WM8731 ALSA SoC Audio driver
3 *
4 * Copyright 2005 Openedhand Ltd.
5 *
6 * Author: Richard Purdie <richard@openedhand.com>
7 *
8 * Based on wm8753.c by Liam Girdwood

--- 76 unchanged lines hidden (view full) ---

85static struct snd_soc_dai_mode wm8731_modes[] = {
86 /* codec frame and clock master modes */
87 /* 8k */
88 {
89 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
90 .pcmfmt = WM8731_HIFI_BITS,
91 .pcmrate = SNDRV_PCM_RATE_8000,
92 .pcmdir = WM8731_DIR,
1/*
2 * wm8731.c -- WM8731 ALSA SoC Audio driver
3 *
4 * Copyright 2005 Openedhand Ltd.
5 *
6 * Author: Richard Purdie <richard@openedhand.com>
7 *
8 * Based on wm8753.c by Liam Girdwood

--- 76 unchanged lines hidden (view full) ---

85static struct snd_soc_dai_mode wm8731_modes[] = {
86 /* codec frame and clock master modes */
87 /* 8k */
88 {
89 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
90 .pcmfmt = WM8731_HIFI_BITS,
91 .pcmrate = SNDRV_PCM_RATE_8000,
92 .pcmdir = WM8731_DIR,
93 .flags = SND_SOC_DAI_BFS_RATE,
93 .fs = 1536,
94 .fs = 1536,
94 .bfs = SND_SOC_FSB(64),
95 .bfs = 64,
95 },
96 {
97 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
98 .pcmfmt = WM8731_HIFI_BITS,
99 .pcmrate = SNDRV_PCM_RATE_8000,
100 .pcmdir = WM8731_DIR,
96 },
97 {
98 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
99 .pcmfmt = WM8731_HIFI_BITS,
100 .pcmrate = SNDRV_PCM_RATE_8000,
101 .pcmdir = WM8731_DIR,
102 .flags = SND_SOC_DAI_BFS_RATE,
101 .fs = 2304,
103 .fs = 2304,
102 .bfs = SND_SOC_FSB(64),
104 .bfs = 64,
103 },
104 {
105 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
106 .pcmfmt = WM8731_HIFI_BITS,
107 .pcmrate = SNDRV_PCM_RATE_8000,
108 .pcmdir = WM8731_DIR,
105 },
106 {
107 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
108 .pcmfmt = WM8731_HIFI_BITS,
109 .pcmrate = SNDRV_PCM_RATE_8000,
110 .pcmdir = WM8731_DIR,
111 .flags = SND_SOC_DAI_BFS_RATE,
109 .fs = 1408,
112 .fs = 1408,
110 .bfs = SND_SOC_FSB(64),
113 .bfs = 64,
111 },
112 {
113 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
114 .pcmfmt = WM8731_HIFI_BITS,
115 .pcmrate = SNDRV_PCM_RATE_8000,
116 .pcmdir = WM8731_DIR,
114 },
115 {
116 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
117 .pcmfmt = WM8731_HIFI_BITS,
118 .pcmrate = SNDRV_PCM_RATE_8000,
119 .pcmdir = WM8731_DIR,
120 .flags = SND_SOC_DAI_BFS_RATE,
117 .fs = 2112,
121 .fs = 2112,
118 .bfs = SND_SOC_FSB(64),
122 .bfs = 64,
119 },
120
121 /* 32k */
122 {
123 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
124 .pcmfmt = WM8731_HIFI_BITS,
125 .pcmrate = SNDRV_PCM_RATE_32000,
126 .pcmdir = WM8731_DIR,
123 },
124
125 /* 32k */
126 {
127 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
128 .pcmfmt = WM8731_HIFI_BITS,
129 .pcmrate = SNDRV_PCM_RATE_32000,
130 .pcmdir = WM8731_DIR,
131 .flags = SND_SOC_DAI_BFS_RATE,
127 .fs = 384,
132 .fs = 384,
128 .bfs = SND_SOC_FSB(64),
133 .bfs = 64,
129 },
130 {
131 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
132 .pcmfmt = WM8731_HIFI_BITS,
133 .pcmrate = SNDRV_PCM_RATE_32000,
134 .pcmdir = WM8731_DIR,
134 },
135 {
136 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
137 .pcmfmt = WM8731_HIFI_BITS,
138 .pcmrate = SNDRV_PCM_RATE_32000,
139 .pcmdir = WM8731_DIR,
140 .flags = SND_SOC_DAI_BFS_RATE,
135 .fs = 576,
141 .fs = 576,
136 .bfs = SND_SOC_FSB(64),
142 .bfs = 64,
137 },
138
139 /* 44.1k & 48k */
140 {
141 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
142 .pcmfmt = WM8731_HIFI_BITS,
143 .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
144 .pcmdir = WM8731_DIR,
143 },
144
145 /* 44.1k & 48k */
146 {
147 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
148 .pcmfmt = WM8731_HIFI_BITS,
149 .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
150 .pcmdir = WM8731_DIR,
151 .flags = SND_SOC_DAI_BFS_RATE,
145 .fs = 256,
152 .fs = 256,
146 .bfs = SND_SOC_FSB(64),
153 .bfs = 64,
147 },
148 {
149 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
150 .pcmfmt = WM8731_HIFI_BITS,
151 .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
152 .pcmdir = WM8731_DIR,
154 },
155 {
156 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
157 .pcmfmt = WM8731_HIFI_BITS,
158 .pcmrate = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
159 .pcmdir = WM8731_DIR,
160 .flags = SND_SOC_DAI_BFS_RATE,
153 .fs = 384,
161 .fs = 384,
154 .bfs = SND_SOC_FSB(64),
162 .bfs = 64,
155 },
156
157 /* 88.2 & 96k */
158 {
159 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
160 .pcmfmt = WM8731_HIFI_BITS,
161 .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000,
162 .pcmdir = WM8731_DIR,
163 },
164
165 /* 88.2 & 96k */
166 {
167 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
168 .pcmfmt = WM8731_HIFI_BITS,
169 .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000,
170 .pcmdir = WM8731_DIR,
171 .flags = SND_SOC_DAI_BFS_RATE,
163 .fs = 128,
172 .fs = 128,
164 .bfs = SND_SOC_FSB(64),
165
173 .bfs = 64,
166 },
167 {
168 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
169 .pcmfmt = WM8731_HIFI_BITS,
170 .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000,
171 .pcmdir = WM8731_DIR,
174 },
175 {
176 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
177 .pcmfmt = WM8731_HIFI_BITS,
178 .pcmrate = SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000,
179 .pcmdir = WM8731_DIR,
180 .flags = SND_SOC_DAI_BFS_RATE,
172 .fs = 192,
181 .fs = 192,
173 .bfs = SND_SOC_FSB(64),
182 .bfs = 64,
174 },
175
176 /* USB codec frame and clock master modes */
177 /* 8k */
178 {
179 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
180 .pcmfmt = WM8731_HIFI_BITS,
181 .pcmrate = SNDRV_PCM_RATE_8000,

--- 50 unchanged lines hidden (view full) ---

232 /* codec frame and clock slave modes */
233 {
234 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBS_CFS,
235 .pcmfmt = WM8731_HIFI_BITS,
236 .pcmrate = WM8731_RATES,
237 .pcmdir = WM8731_DIR,
238 .flags = SND_SOC_DAI_BFS_DIV,
239 .fs = SND_SOC_FS_ALL,
183 },
184
185 /* USB codec frame and clock master modes */
186 /* 8k */
187 {
188 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBM_CFM,
189 .pcmfmt = WM8731_HIFI_BITS,
190 .pcmrate = SNDRV_PCM_RATE_8000,

--- 50 unchanged lines hidden (view full) ---

241 /* codec frame and clock slave modes */
242 {
243 .fmt = WM8731_DAIFMT | SND_SOC_DAIFMT_CBS_CFS,
244 .pcmfmt = WM8731_HIFI_BITS,
245 .pcmrate = WM8731_RATES,
246 .pcmdir = WM8731_DIR,
247 .flags = SND_SOC_DAI_BFS_DIV,
248 .fs = SND_SOC_FS_ALL,
240 .bfs = SND_SOC_FSBD_ALL,
249 .bfs = SND_SOC_FSB_ALL,
241 },
242};
243
244/*
245 * read wm8731 register cache
246 */
247static inline unsigned int wm8731_read_reg_cache(struct snd_soc_codec *codec,
248 unsigned int reg)

--- 627 unchanged lines hidden ---
250 },
251};
252
253/*
254 * read wm8731 register cache
255 */
256static inline unsigned int wm8731_read_reg_cache(struct snd_soc_codec *codec,
257 unsigned int reg)

--- 627 unchanged lines hidden ---