diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:21:36 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:18:12 -0500 |
commit | ee42381e71c56328db9e9d64d19a4de7a2f09a93 (patch) | |
tree | 641cdecfa64347efb7d402c707412e0a45fe7ced /sound/pci/ac97/ac97_patch.c | |
parent | dc4cafbadad1ae2322e598f2cb72720ef4095fee (diff) |
[ALSA] Remove xxx_t typedefs: AC97
Modules: AC97 Codec
Remove xxx_t typedefs from the AC97 codec support.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ac97/ac97_patch.c')
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 408 |
1 files changed, 204 insertions, 204 deletions
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index de1c72ad2c6b..c68ee0f3e72a 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * Chip specific initialization | 39 | * Chip specific initialization |
40 | */ | 40 | */ |
41 | 41 | ||
42 | static int patch_build_controls(ac97_t * ac97, const snd_kcontrol_new_t *controls, int count) | 42 | static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontrol_new *controls, int count) |
43 | { | 43 | { |
44 | int idx, err; | 44 | int idx, err; |
45 | 45 | ||
@@ -50,7 +50,7 @@ static int patch_build_controls(ac97_t * ac97, const snd_kcontrol_new_t *control | |||
50 | } | 50 | } |
51 | 51 | ||
52 | /* set to the page, update bits and restore the page */ | 52 | /* set to the page, update bits and restore the page */ |
53 | static int ac97_update_bits_page(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value, unsigned short page) | 53 | static int ac97_update_bits_page(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value, unsigned short page) |
54 | { | 54 | { |
55 | unsigned short page_save; | 55 | unsigned short page_save; |
56 | int ret; | 56 | int ret; |
@@ -67,7 +67,7 @@ static int ac97_update_bits_page(ac97_t *ac97, unsigned short reg, unsigned shor | |||
67 | /* | 67 | /* |
68 | * shared line-in/mic controls | 68 | * shared line-in/mic controls |
69 | */ | 69 | */ |
70 | static int ac97_enum_text_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo, | 70 | static int ac97_enum_text_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo, |
71 | const char **texts, unsigned int nums) | 71 | const char **texts, unsigned int nums) |
72 | { | 72 | { |
73 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 73 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
@@ -79,23 +79,23 @@ static int ac97_enum_text_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui | |||
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | static int ac97_surround_jack_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 82 | static int ac97_surround_jack_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
83 | { | 83 | { |
84 | static const char *texts[] = { "Shared", "Independent" }; | 84 | static const char *texts[] = { "Shared", "Independent" }; |
85 | return ac97_enum_text_info(kcontrol, uinfo, texts, 2); | 85 | return ac97_enum_text_info(kcontrol, uinfo, texts, 2); |
86 | } | 86 | } |
87 | 87 | ||
88 | static int ac97_surround_jack_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 88 | static int ac97_surround_jack_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
89 | { | 89 | { |
90 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 90 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
91 | 91 | ||
92 | ucontrol->value.enumerated.item[0] = ac97->indep_surround; | 92 | ucontrol->value.enumerated.item[0] = ac97->indep_surround; |
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | static int ac97_surround_jack_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 96 | static int ac97_surround_jack_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
97 | { | 97 | { |
98 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 98 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
99 | unsigned char indep = !!ucontrol->value.enumerated.item[0]; | 99 | unsigned char indep = !!ucontrol->value.enumerated.item[0]; |
100 | 100 | ||
101 | if (indep != ac97->indep_surround) { | 101 | if (indep != ac97->indep_surround) { |
@@ -107,7 +107,7 @@ static int ac97_surround_jack_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | static int ac97_channel_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 110 | static int ac97_channel_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
111 | { | 111 | { |
112 | static const char *texts[] = { "2ch", "4ch", "6ch" }; | 112 | static const char *texts[] = { "2ch", "4ch", "6ch" }; |
113 | if (kcontrol->private_value) | 113 | if (kcontrol->private_value) |
@@ -115,17 +115,17 @@ static int ac97_channel_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
115 | return ac97_enum_text_info(kcontrol, uinfo, texts, 3); | 115 | return ac97_enum_text_info(kcontrol, uinfo, texts, 3); |
116 | } | 116 | } |
117 | 117 | ||
118 | static int ac97_channel_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 118 | static int ac97_channel_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
119 | { | 119 | { |
120 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 120 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
121 | 121 | ||
122 | ucontrol->value.enumerated.item[0] = ac97->channel_mode; | 122 | ucontrol->value.enumerated.item[0] = ac97->channel_mode; |
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int ac97_channel_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 126 | static int ac97_channel_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
127 | { | 127 | { |
128 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 128 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
129 | unsigned char mode = ucontrol->value.enumerated.item[0]; | 129 | unsigned char mode = ucontrol->value.enumerated.item[0]; |
130 | 130 | ||
131 | if (mode != ac97->channel_mode) { | 131 | if (mode != ac97->channel_mode) { |
@@ -163,22 +163,22 @@ static int ac97_channel_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
163 | .private_value = 1, \ | 163 | .private_value = 1, \ |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline int is_surround_on(ac97_t *ac97) | 166 | static inline int is_surround_on(struct snd_ac97 *ac97) |
167 | { | 167 | { |
168 | return ac97->channel_mode >= 1; | 168 | return ac97->channel_mode >= 1; |
169 | } | 169 | } |
170 | 170 | ||
171 | static inline int is_clfe_on(ac97_t *ac97) | 171 | static inline int is_clfe_on(struct snd_ac97 *ac97) |
172 | { | 172 | { |
173 | return ac97->channel_mode >= 2; | 173 | return ac97->channel_mode >= 2; |
174 | } | 174 | } |
175 | 175 | ||
176 | static inline int is_shared_linein(ac97_t *ac97) | 176 | static inline int is_shared_linein(struct snd_ac97 *ac97) |
177 | { | 177 | { |
178 | return ! ac97->indep_surround && is_surround_on(ac97); | 178 | return ! ac97->indep_surround && is_surround_on(ac97); |
179 | } | 179 | } |
180 | 180 | ||
181 | static inline int is_shared_micin(ac97_t *ac97) | 181 | static inline int is_shared_micin(struct snd_ac97 *ac97) |
182 | { | 182 | { |
183 | return ! ac97->indep_surround && is_clfe_on(ac97); | 183 | return ! ac97->indep_surround && is_clfe_on(ac97); |
184 | } | 184 | } |
@@ -187,7 +187,7 @@ static inline int is_shared_micin(ac97_t *ac97) | |||
187 | /* The following snd_ac97_ymf753_... items added by David Shust (dshust@shustring.com) */ | 187 | /* The following snd_ac97_ymf753_... items added by David Shust (dshust@shustring.com) */ |
188 | 188 | ||
189 | /* It is possible to indicate to the Yamaha YMF753 the type of speakers being used. */ | 189 | /* It is possible to indicate to the Yamaha YMF753 the type of speakers being used. */ |
190 | static int snd_ac97_ymf753_info_speaker(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 190 | static int snd_ac97_ymf753_info_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
191 | { | 191 | { |
192 | static char *texts[3] = { | 192 | static char *texts[3] = { |
193 | "Standard", "Small", "Smaller" | 193 | "Standard", "Small", "Smaller" |
@@ -202,9 +202,9 @@ static int snd_ac97_ymf753_info_speaker(snd_kcontrol_t *kcontrol, snd_ctl_elem_i | |||
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int snd_ac97_ymf753_get_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 205 | static int snd_ac97_ymf753_get_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
206 | { | 206 | { |
207 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 207 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
208 | unsigned short val; | 208 | unsigned short val; |
209 | 209 | ||
210 | val = ac97->regs[AC97_YMF753_3D_MODE_SEL]; | 210 | val = ac97->regs[AC97_YMF753_3D_MODE_SEL]; |
@@ -215,9 +215,9 @@ static int snd_ac97_ymf753_get_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_v | |||
215 | return 0; | 215 | return 0; |
216 | } | 216 | } |
217 | 217 | ||
218 | static int snd_ac97_ymf753_put_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 218 | static int snd_ac97_ymf753_put_speaker(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
219 | { | 219 | { |
220 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 220 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
221 | unsigned short val; | 221 | unsigned short val; |
222 | 222 | ||
223 | if (ucontrol->value.enumerated.item[0] > 2) | 223 | if (ucontrol->value.enumerated.item[0] > 2) |
@@ -226,7 +226,7 @@ static int snd_ac97_ymf753_put_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_v | |||
226 | return snd_ac97_update(ac97, AC97_YMF753_3D_MODE_SEL, val); | 226 | return snd_ac97_update(ac97, AC97_YMF753_3D_MODE_SEL, val); |
227 | } | 227 | } |
228 | 228 | ||
229 | static const snd_kcontrol_new_t snd_ac97_ymf753_controls_speaker = | 229 | static const struct snd_kcontrol_new snd_ac97_ymf753_controls_speaker = |
230 | { | 230 | { |
231 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 231 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
232 | .name = "3D Control - Speaker", | 232 | .name = "3D Control - Speaker", |
@@ -236,7 +236,7 @@ static const snd_kcontrol_new_t snd_ac97_ymf753_controls_speaker = | |||
236 | }; | 236 | }; |
237 | 237 | ||
238 | /* It is possible to indicate to the Yamaha YMF753 the source to direct to the S/PDIF output. */ | 238 | /* It is possible to indicate to the Yamaha YMF753 the source to direct to the S/PDIF output. */ |
239 | static int snd_ac97_ymf753_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 239 | static int snd_ac97_ymf753_spdif_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
240 | { | 240 | { |
241 | static char *texts[2] = { "AC-Link", "A/D Converter" }; | 241 | static char *texts[2] = { "AC-Link", "A/D Converter" }; |
242 | 242 | ||
@@ -249,9 +249,9 @@ static int snd_ac97_ymf753_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_e | |||
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | 251 | ||
252 | static int snd_ac97_ymf753_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 252 | static int snd_ac97_ymf753_spdif_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
253 | { | 253 | { |
254 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 254 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
255 | unsigned short val; | 255 | unsigned short val; |
256 | 256 | ||
257 | val = ac97->regs[AC97_YMF753_DIT_CTRL2]; | 257 | val = ac97->regs[AC97_YMF753_DIT_CTRL2]; |
@@ -259,9 +259,9 @@ static int snd_ac97_ymf753_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_e | |||
259 | return 0; | 259 | return 0; |
260 | } | 260 | } |
261 | 261 | ||
262 | static int snd_ac97_ymf753_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 262 | static int snd_ac97_ymf753_spdif_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
263 | { | 263 | { |
264 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 264 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
265 | unsigned short val; | 265 | unsigned short val; |
266 | 266 | ||
267 | if (ucontrol->value.enumerated.item[0] > 1) | 267 | if (ucontrol->value.enumerated.item[0] > 1) |
@@ -274,7 +274,7 @@ static int snd_ac97_ymf753_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_e | |||
274 | The YMF753 will output the S/PDIF signal to pin 43, 47 (EAPD), or 48. | 274 | The YMF753 will output the S/PDIF signal to pin 43, 47 (EAPD), or 48. |
275 | By default, no output pin is selected, and the S/PDIF signal is not output. | 275 | By default, no output pin is selected, and the S/PDIF signal is not output. |
276 | There is also a bit to mute S/PDIF output in a vendor-specific register. */ | 276 | There is also a bit to mute S/PDIF output in a vendor-specific register. */ |
277 | static int snd_ac97_ymf753_spdif_output_pin_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 277 | static int snd_ac97_ymf753_spdif_output_pin_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
278 | { | 278 | { |
279 | static char *texts[3] = { "Disabled", "Pin 43", "Pin 48" }; | 279 | static char *texts[3] = { "Disabled", "Pin 43", "Pin 48" }; |
280 | 280 | ||
@@ -287,9 +287,9 @@ static int snd_ac97_ymf753_spdif_output_pin_info(snd_kcontrol_t *kcontrol, snd_c | |||
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
289 | 289 | ||
290 | static int snd_ac97_ymf753_spdif_output_pin_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 290 | static int snd_ac97_ymf753_spdif_output_pin_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
291 | { | 291 | { |
292 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 292 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
293 | unsigned short val; | 293 | unsigned short val; |
294 | 294 | ||
295 | val = ac97->regs[AC97_YMF753_DIT_CTRL2]; | 295 | val = ac97->regs[AC97_YMF753_DIT_CTRL2]; |
@@ -297,9 +297,9 @@ static int snd_ac97_ymf753_spdif_output_pin_get(snd_kcontrol_t * kcontrol, snd_c | |||
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | static int snd_ac97_ymf753_spdif_output_pin_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 300 | static int snd_ac97_ymf753_spdif_output_pin_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
301 | { | 301 | { |
302 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 302 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
303 | unsigned short val; | 303 | unsigned short val; |
304 | 304 | ||
305 | if (ucontrol->value.enumerated.item[0] > 2) | 305 | if (ucontrol->value.enumerated.item[0] > 2) |
@@ -311,7 +311,7 @@ static int snd_ac97_ymf753_spdif_output_pin_put(snd_kcontrol_t * kcontrol, snd_c | |||
311 | snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */ | 311 | snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */ |
312 | } | 312 | } |
313 | 313 | ||
314 | static const snd_kcontrol_new_t snd_ac97_ymf753_controls_spdif[3] = { | 314 | static const struct snd_kcontrol_new snd_ac97_ymf753_controls_spdif[3] = { |
315 | { | 315 | { |
316 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 316 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
317 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", | 317 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", |
@@ -329,9 +329,9 @@ static const snd_kcontrol_new_t snd_ac97_ymf753_controls_spdif[3] = { | |||
329 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",NONE,NONE) "Mute", AC97_YMF753_DIT_CTRL2, 2, 1, 1) | 329 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",NONE,NONE) "Mute", AC97_YMF753_DIT_CTRL2, 2, 1, 1) |
330 | }; | 330 | }; |
331 | 331 | ||
332 | static int patch_yamaha_ymf753_3d(ac97_t * ac97) | 332 | static int patch_yamaha_ymf753_3d(struct snd_ac97 * ac97) |
333 | { | 333 | { |
334 | snd_kcontrol_t *kctl; | 334 | struct snd_kcontrol *kctl; |
335 | int err; | 335 | int err; |
336 | 336 | ||
337 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) | 337 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) |
@@ -345,7 +345,7 @@ static int patch_yamaha_ymf753_3d(ac97_t * ac97) | |||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | 347 | ||
348 | static int patch_yamaha_ymf753_post_spdif(ac97_t * ac97) | 348 | static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97) |
349 | { | 349 | { |
350 | int err; | 350 | int err; |
351 | 351 | ||
@@ -359,7 +359,7 @@ static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = { | |||
359 | .build_post_spdif = patch_yamaha_ymf753_post_spdif | 359 | .build_post_spdif = patch_yamaha_ymf753_post_spdif |
360 | }; | 360 | }; |
361 | 361 | ||
362 | int patch_yamaha_ymf753(ac97_t * ac97) | 362 | int patch_yamaha_ymf753(struct snd_ac97 * ac97) |
363 | { | 363 | { |
364 | /* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust@shustring.com. | 364 | /* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust@shustring.com. |
365 | This chip has nonstandard and extended behaviour with regard to its S/PDIF output. | 365 | This chip has nonstandard and extended behaviour with regard to its S/PDIF output. |
@@ -380,12 +380,12 @@ int patch_yamaha_ymf753(ac97_t * ac97) | |||
380 | * added support for WM9705,WM9708,WM9709,WM9710,WM9711,WM9712 and WM9717. | 380 | * added support for WM9705,WM9708,WM9709,WM9710,WM9711,WM9712 and WM9717. |
381 | */ | 381 | */ |
382 | 382 | ||
383 | static const snd_kcontrol_new_t wm97xx_snd_ac97_controls[] = { | 383 | static const struct snd_kcontrol_new wm97xx_snd_ac97_controls[] = { |
384 | AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), | 384 | AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), |
385 | AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), | 385 | AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), |
386 | }; | 386 | }; |
387 | 387 | ||
388 | static int patch_wolfson_wm9703_specific(ac97_t * ac97) | 388 | static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97) |
389 | { | 389 | { |
390 | /* This is known to work for the ViewSonic ViewPad 1000 | 390 | /* This is known to work for the ViewSonic ViewPad 1000 |
391 | * Randolph Bentson <bentson@holmsjoen.com> | 391 | * Randolph Bentson <bentson@holmsjoen.com> |
@@ -405,13 +405,13 @@ static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = { | |||
405 | .build_specific = patch_wolfson_wm9703_specific, | 405 | .build_specific = patch_wolfson_wm9703_specific, |
406 | }; | 406 | }; |
407 | 407 | ||
408 | int patch_wolfson03(ac97_t * ac97) | 408 | int patch_wolfson03(struct snd_ac97 * ac97) |
409 | { | 409 | { |
410 | ac97->build_ops = &patch_wolfson_wm9703_ops; | 410 | ac97->build_ops = &patch_wolfson_wm9703_ops; |
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | static const snd_kcontrol_new_t wm9704_snd_ac97_controls[] = { | 414 | static const struct snd_kcontrol_new wm9704_snd_ac97_controls[] = { |
415 | AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), | 415 | AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1), |
416 | AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), | 416 | AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1), |
417 | AC97_DOUBLE("Rear Playback Volume", AC97_WM9704_RMIXER_VOL, 8, 0, 31, 1), | 417 | AC97_DOUBLE("Rear Playback Volume", AC97_WM9704_RMIXER_VOL, 8, 0, 31, 1), |
@@ -420,7 +420,7 @@ AC97_DOUBLE("Rear DAC Volume", AC97_WM9704_RPCM_VOL, 8, 0, 31, 1), | |||
420 | AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1), | 420 | AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1), |
421 | }; | 421 | }; |
422 | 422 | ||
423 | static int patch_wolfson_wm9704_specific(ac97_t * ac97) | 423 | static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97) |
424 | { | 424 | { |
425 | int err, i; | 425 | int err, i; |
426 | for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) { | 426 | for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) { |
@@ -436,14 +436,14 @@ static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = { | |||
436 | .build_specific = patch_wolfson_wm9704_specific, | 436 | .build_specific = patch_wolfson_wm9704_specific, |
437 | }; | 437 | }; |
438 | 438 | ||
439 | int patch_wolfson04(ac97_t * ac97) | 439 | int patch_wolfson04(struct snd_ac97 * ac97) |
440 | { | 440 | { |
441 | /* WM9704M/9704Q */ | 441 | /* WM9704M/9704Q */ |
442 | ac97->build_ops = &patch_wolfson_wm9704_ops; | 442 | ac97->build_ops = &patch_wolfson_wm9704_ops; |
443 | return 0; | 443 | return 0; |
444 | } | 444 | } |
445 | 445 | ||
446 | static int patch_wolfson_wm9705_specific(ac97_t * ac97) | 446 | static int patch_wolfson_wm9705_specific(struct snd_ac97 * ac97) |
447 | { | 447 | { |
448 | int err, i; | 448 | int err, i; |
449 | for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) { | 449 | for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) { |
@@ -458,7 +458,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9705_ops = { | |||
458 | .build_specific = patch_wolfson_wm9705_specific, | 458 | .build_specific = patch_wolfson_wm9705_specific, |
459 | }; | 459 | }; |
460 | 460 | ||
461 | int patch_wolfson05(ac97_t * ac97) | 461 | int patch_wolfson05(struct snd_ac97 * ac97) |
462 | { | 462 | { |
463 | /* WM9705, WM9710 */ | 463 | /* WM9705, WM9710 */ |
464 | ac97->build_ops = &patch_wolfson_wm9705_ops; | 464 | ac97->build_ops = &patch_wolfson_wm9705_ops; |
@@ -490,7 +490,7 @@ AC97_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, wm9711_rec_sel), | |||
490 | AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9711_ng_type), | 490 | AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9711_ng_type), |
491 | }; | 491 | }; |
492 | 492 | ||
493 | static const snd_kcontrol_new_t wm9711_snd_ac97_controls[] = { | 493 | static const struct snd_kcontrol_new wm9711_snd_ac97_controls[] = { |
494 | AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), | 494 | AC97_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), |
495 | AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), | 495 | AC97_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), |
496 | AC97_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0), | 496 | AC97_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0), |
@@ -568,7 +568,7 @@ AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0), | |||
568 | AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0), | 568 | AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0), |
569 | }; | 569 | }; |
570 | 570 | ||
571 | static int patch_wolfson_wm9711_specific(ac97_t * ac97) | 571 | static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97) |
572 | { | 572 | { |
573 | int err, i; | 573 | int err, i; |
574 | 574 | ||
@@ -589,7 +589,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = { | |||
589 | .build_specific = patch_wolfson_wm9711_specific, | 589 | .build_specific = patch_wolfson_wm9711_specific, |
590 | }; | 590 | }; |
591 | 591 | ||
592 | int patch_wolfson11(ac97_t * ac97) | 592 | int patch_wolfson11(struct snd_ac97 * ac97) |
593 | { | 593 | { |
594 | /* WM9711, WM9712 */ | 594 | /* WM9711, WM9712 */ |
595 | ac97->build_ops = &patch_wolfson_wm9711_ops; | 595 | ac97->build_ops = &patch_wolfson_wm9711_ops; |
@@ -636,7 +636,7 @@ AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 15, 2, wm9713_base), | |||
636 | AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9713_ng_type), | 636 | AC97_ENUM_SINGLE(AC97_PCI_SVID, 5, 2, wm9713_ng_type), |
637 | }; | 637 | }; |
638 | 638 | ||
639 | static const snd_kcontrol_new_t wm13_snd_ac97_controls[] = { | 639 | static const struct snd_kcontrol_new wm13_snd_ac97_controls[] = { |
640 | AC97_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1), | 640 | AC97_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1), |
641 | AC97_SINGLE("Line In to Headphone Switch", AC97_PC_BEEP, 15, 1, 1), | 641 | AC97_SINGLE("Line In to Headphone Switch", AC97_PC_BEEP, 15, 1, 1), |
642 | AC97_SINGLE("Line In to Master Switch", AC97_PC_BEEP, 14, 1, 1), | 642 | AC97_SINGLE("Line In to Master Switch", AC97_PC_BEEP, 14, 1, 1), |
@@ -728,14 +728,14 @@ AC97_SINGLE("Bass Volume", AC97_GENERAL_PURPOSE, 8, 15, 1), | |||
728 | AC97_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1), | 728 | AC97_SINGLE("Tone Volume", AC97_GENERAL_PURPOSE, 0, 15, 1), |
729 | }; | 729 | }; |
730 | 730 | ||
731 | static const snd_kcontrol_new_t wm13_snd_ac97_controls_3d[] = { | 731 | static const struct snd_kcontrol_new wm13_snd_ac97_controls_3d[] = { |
732 | AC97_ENUM("Inv Input Mux", wm9713_enum[11]), | 732 | AC97_ENUM("Inv Input Mux", wm9713_enum[11]), |
733 | AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0), | 733 | AC97_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0), |
734 | AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0), | 734 | AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0), |
735 | AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1), | 735 | AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1), |
736 | }; | 736 | }; |
737 | 737 | ||
738 | static int patch_wolfson_wm9713_3d (ac97_t * ac97) | 738 | static int patch_wolfson_wm9713_3d (struct snd_ac97 * ac97) |
739 | { | 739 | { |
740 | int err, i; | 740 | int err, i; |
741 | 741 | ||
@@ -746,7 +746,7 @@ static int patch_wolfson_wm9713_3d (ac97_t * ac97) | |||
746 | return 0; | 746 | return 0; |
747 | } | 747 | } |
748 | 748 | ||
749 | static int patch_wolfson_wm9713_specific(ac97_t * ac97) | 749 | static int patch_wolfson_wm9713_specific(struct snd_ac97 * ac97) |
750 | { | 750 | { |
751 | int err, i; | 751 | int err, i; |
752 | 752 | ||
@@ -765,13 +765,13 @@ static int patch_wolfson_wm9713_specific(ac97_t * ac97) | |||
765 | } | 765 | } |
766 | 766 | ||
767 | #ifdef CONFIG_PM | 767 | #ifdef CONFIG_PM |
768 | static void patch_wolfson_wm9713_suspend (ac97_t * ac97) | 768 | static void patch_wolfson_wm9713_suspend (struct snd_ac97 * ac97) |
769 | { | 769 | { |
770 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff); | 770 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff); |
771 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff); | 771 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff); |
772 | } | 772 | } |
773 | 773 | ||
774 | static void patch_wolfson_wm9713_resume (ac97_t * ac97) | 774 | static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97) |
775 | { | 775 | { |
776 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); | 776 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00); |
777 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); | 777 | snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810); |
@@ -788,7 +788,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = { | |||
788 | #endif | 788 | #endif |
789 | }; | 789 | }; |
790 | 790 | ||
791 | int patch_wolfson13(ac97_t * ac97) | 791 | int patch_wolfson13(struct snd_ac97 * ac97) |
792 | { | 792 | { |
793 | /* WM9713, WM9714 */ | 793 | /* WM9713, WM9714 */ |
794 | ac97->build_ops = &patch_wolfson_wm9713_ops; | 794 | ac97->build_ops = &patch_wolfson_wm9713_ops; |
@@ -808,7 +808,7 @@ int patch_wolfson13(ac97_t * ac97) | |||
808 | /* | 808 | /* |
809 | * Tritech codec | 809 | * Tritech codec |
810 | */ | 810 | */ |
811 | int patch_tritech_tr28028(ac97_t * ac97) | 811 | int patch_tritech_tr28028(struct snd_ac97 * ac97) |
812 | { | 812 | { |
813 | snd_ac97_write_cache(ac97, 0x26, 0x0300); | 813 | snd_ac97_write_cache(ac97, 0x26, 0x0300); |
814 | snd_ac97_write_cache(ac97, 0x26, 0x0000); | 814 | snd_ac97_write_cache(ac97, 0x26, 0x0000); |
@@ -820,9 +820,9 @@ int patch_tritech_tr28028(ac97_t * ac97) | |||
820 | /* | 820 | /* |
821 | * Sigmatel STAC97xx codecs | 821 | * Sigmatel STAC97xx codecs |
822 | */ | 822 | */ |
823 | static int patch_sigmatel_stac9700_3d(ac97_t * ac97) | 823 | static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97) |
824 | { | 824 | { |
825 | snd_kcontrol_t *kctl; | 825 | struct snd_kcontrol *kctl; |
826 | int err; | 826 | int err; |
827 | 827 | ||
828 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) | 828 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) |
@@ -833,9 +833,9 @@ static int patch_sigmatel_stac9700_3d(ac97_t * ac97) | |||
833 | return 0; | 833 | return 0; |
834 | } | 834 | } |
835 | 835 | ||
836 | static int patch_sigmatel_stac9708_3d(ac97_t * ac97) | 836 | static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97) |
837 | { | 837 | { |
838 | snd_kcontrol_t *kctl; | 838 | struct snd_kcontrol *kctl; |
839 | int err; | 839 | int err; |
840 | 840 | ||
841 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) | 841 | if ((err = snd_ctl_add(ac97->bus->card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0) |
@@ -850,18 +850,18 @@ static int patch_sigmatel_stac9708_3d(ac97_t * ac97) | |||
850 | return 0; | 850 | return 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | static const snd_kcontrol_new_t snd_ac97_sigmatel_4speaker = | 853 | static const struct snd_kcontrol_new snd_ac97_sigmatel_4speaker = |
854 | AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch", AC97_SIGMATEL_DAC2INVERT, 2, 1, 0); | 854 | AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch", AC97_SIGMATEL_DAC2INVERT, 2, 1, 0); |
855 | 855 | ||
856 | static const snd_kcontrol_new_t snd_ac97_sigmatel_phaseinvert = | 856 | static const struct snd_kcontrol_new snd_ac97_sigmatel_phaseinvert = |
857 | AC97_SINGLE("Sigmatel Surround Phase Inversion Playback Switch", AC97_SIGMATEL_DAC2INVERT, 3, 1, 0); | 857 | AC97_SINGLE("Sigmatel Surround Phase Inversion Playback Switch", AC97_SIGMATEL_DAC2INVERT, 3, 1, 0); |
858 | 858 | ||
859 | static const snd_kcontrol_new_t snd_ac97_sigmatel_controls[] = { | 859 | static const struct snd_kcontrol_new snd_ac97_sigmatel_controls[] = { |
860 | AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0), | 860 | AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0), |
861 | AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0) | 861 | AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0) |
862 | }; | 862 | }; |
863 | 863 | ||
864 | static int patch_sigmatel_stac97xx_specific(ac97_t * ac97) | 864 | static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97) |
865 | { | 865 | { |
866 | int err; | 866 | int err; |
867 | 867 | ||
@@ -886,15 +886,15 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = { | |||
886 | .build_specific = patch_sigmatel_stac97xx_specific | 886 | .build_specific = patch_sigmatel_stac97xx_specific |
887 | }; | 887 | }; |
888 | 888 | ||
889 | int patch_sigmatel_stac9700(ac97_t * ac97) | 889 | int patch_sigmatel_stac9700(struct snd_ac97 * ac97) |
890 | { | 890 | { |
891 | ac97->build_ops = &patch_sigmatel_stac9700_ops; | 891 | ac97->build_ops = &patch_sigmatel_stac9700_ops; |
892 | return 0; | 892 | return 0; |
893 | } | 893 | } |
894 | 894 | ||
895 | static int snd_ac97_stac9708_put_bias(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 895 | static int snd_ac97_stac9708_put_bias(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
896 | { | 896 | { |
897 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 897 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
898 | int err; | 898 | int err; |
899 | 899 | ||
900 | down(&ac97->page_mutex); | 900 | down(&ac97->page_mutex); |
@@ -906,7 +906,7 @@ static int snd_ac97_stac9708_put_bias(snd_kcontrol_t *kcontrol, snd_ctl_elem_val | |||
906 | return err; | 906 | return err; |
907 | } | 907 | } |
908 | 908 | ||
909 | static const snd_kcontrol_new_t snd_ac97_stac9708_bias_control = { | 909 | static const struct snd_kcontrol_new snd_ac97_stac9708_bias_control = { |
910 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 910 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
911 | .name = "Sigmatel Output Bias Switch", | 911 | .name = "Sigmatel Output Bias Switch", |
912 | .info = snd_ac97_info_volsw, | 912 | .info = snd_ac97_info_volsw, |
@@ -915,7 +915,7 @@ static const snd_kcontrol_new_t snd_ac97_stac9708_bias_control = { | |||
915 | .private_value = AC97_SINGLE_VALUE(AC97_SIGMATEL_BIAS2, 4, 1, 0), | 915 | .private_value = AC97_SINGLE_VALUE(AC97_SIGMATEL_BIAS2, 4, 1, 0), |
916 | }; | 916 | }; |
917 | 917 | ||
918 | static int patch_sigmatel_stac9708_specific(ac97_t *ac97) | 918 | static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97) |
919 | { | 919 | { |
920 | int err; | 920 | int err; |
921 | 921 | ||
@@ -930,7 +930,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = { | |||
930 | .build_specific = patch_sigmatel_stac9708_specific | 930 | .build_specific = patch_sigmatel_stac9708_specific |
931 | }; | 931 | }; |
932 | 932 | ||
933 | int patch_sigmatel_stac9708(ac97_t * ac97) | 933 | int patch_sigmatel_stac9708(struct snd_ac97 * ac97) |
934 | { | 934 | { |
935 | unsigned int codec72, codec6c; | 935 | unsigned int codec72, codec6c; |
936 | 936 | ||
@@ -956,7 +956,7 @@ int patch_sigmatel_stac9708(ac97_t * ac97) | |||
956 | return 0; | 956 | return 0; |
957 | } | 957 | } |
958 | 958 | ||
959 | int patch_sigmatel_stac9721(ac97_t * ac97) | 959 | int patch_sigmatel_stac9721(struct snd_ac97 * ac97) |
960 | { | 960 | { |
961 | ac97->build_ops = &patch_sigmatel_stac9700_ops; | 961 | ac97->build_ops = &patch_sigmatel_stac9700_ops; |
962 | if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) { | 962 | if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) { |
@@ -970,7 +970,7 @@ int patch_sigmatel_stac9721(ac97_t * ac97) | |||
970 | return 0; | 970 | return 0; |
971 | } | 971 | } |
972 | 972 | ||
973 | int patch_sigmatel_stac9744(ac97_t * ac97) | 973 | int patch_sigmatel_stac9744(struct snd_ac97 * ac97) |
974 | { | 974 | { |
975 | // patch for SigmaTel | 975 | // patch for SigmaTel |
976 | ac97->build_ops = &patch_sigmatel_stac9700_ops; | 976 | ac97->build_ops = &patch_sigmatel_stac9700_ops; |
@@ -982,7 +982,7 @@ int patch_sigmatel_stac9744(ac97_t * ac97) | |||
982 | return 0; | 982 | return 0; |
983 | } | 983 | } |
984 | 984 | ||
985 | int patch_sigmatel_stac9756(ac97_t * ac97) | 985 | int patch_sigmatel_stac9756(struct snd_ac97 * ac97) |
986 | { | 986 | { |
987 | // patch for SigmaTel | 987 | // patch for SigmaTel |
988 | ac97->build_ops = &patch_sigmatel_stac9700_ops; | 988 | ac97->build_ops = &patch_sigmatel_stac9700_ops; |
@@ -994,7 +994,7 @@ int patch_sigmatel_stac9756(ac97_t * ac97) | |||
994 | return 0; | 994 | return 0; |
995 | } | 995 | } |
996 | 996 | ||
997 | static int snd_ac97_stac9758_output_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 997 | static int snd_ac97_stac9758_output_jack_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
998 | { | 998 | { |
999 | static char *texts[5] = { "Input/Disabled", "Front Output", | 999 | static char *texts[5] = { "Input/Disabled", "Front Output", |
1000 | "Rear Output", "Center/LFE Output", "Mixer Output" }; | 1000 | "Rear Output", "Center/LFE Output", "Mixer Output" }; |
@@ -1008,9 +1008,9 @@ static int snd_ac97_stac9758_output_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_ | |||
1008 | return 0; | 1008 | return 0; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | static int snd_ac97_stac9758_output_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) | 1011 | static int snd_ac97_stac9758_output_jack_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1012 | { | 1012 | { |
1013 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1013 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1014 | int shift = kcontrol->private_value; | 1014 | int shift = kcontrol->private_value; |
1015 | unsigned short val; | 1015 | unsigned short val; |
1016 | 1016 | ||
@@ -1022,9 +1022,9 @@ static int snd_ac97_stac9758_output_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_e | |||
1022 | return 0; | 1022 | return 0; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | static int snd_ac97_stac9758_output_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1025 | static int snd_ac97_stac9758_output_jack_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1026 | { | 1026 | { |
1027 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1027 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1028 | int shift = kcontrol->private_value; | 1028 | int shift = kcontrol->private_value; |
1029 | unsigned short val; | 1029 | unsigned short val; |
1030 | 1030 | ||
@@ -1038,7 +1038,7 @@ static int snd_ac97_stac9758_output_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_e | |||
1038 | 7 << shift, val << shift, 0); | 1038 | 7 << shift, val << shift, 0); |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | static int snd_ac97_stac9758_input_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1041 | static int snd_ac97_stac9758_input_jack_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1042 | { | 1042 | { |
1043 | static char *texts[7] = { "Mic2 Jack", "Mic1 Jack", "Line In Jack", | 1043 | static char *texts[7] = { "Mic2 Jack", "Mic1 Jack", "Line In Jack", |
1044 | "Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" }; | 1044 | "Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" }; |
@@ -1052,9 +1052,9 @@ static int snd_ac97_stac9758_input_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_e | |||
1052 | return 0; | 1052 | return 0; |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | static int snd_ac97_stac9758_input_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) | 1055 | static int snd_ac97_stac9758_input_jack_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1056 | { | 1056 | { |
1057 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1057 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1058 | int shift = kcontrol->private_value; | 1058 | int shift = kcontrol->private_value; |
1059 | unsigned short val; | 1059 | unsigned short val; |
1060 | 1060 | ||
@@ -1063,16 +1063,16 @@ static int snd_ac97_stac9758_input_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_el | |||
1063 | return 0; | 1063 | return 0; |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | static int snd_ac97_stac9758_input_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1066 | static int snd_ac97_stac9758_input_jack_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1067 | { | 1067 | { |
1068 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1068 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1069 | int shift = kcontrol->private_value; | 1069 | int shift = kcontrol->private_value; |
1070 | 1070 | ||
1071 | return ac97_update_bits_page(ac97, AC97_SIGMATEL_INSEL, 7 << shift, | 1071 | return ac97_update_bits_page(ac97, AC97_SIGMATEL_INSEL, 7 << shift, |
1072 | ucontrol->value.enumerated.item[0] << shift, 0); | 1072 | ucontrol->value.enumerated.item[0] << shift, 0); |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | static int snd_ac97_stac9758_phonesel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1075 | static int snd_ac97_stac9758_phonesel_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1076 | { | 1076 | { |
1077 | static char *texts[3] = { "None", "Front Jack", "Rear Jack" }; | 1077 | static char *texts[3] = { "None", "Front Jack", "Rear Jack" }; |
1078 | 1078 | ||
@@ -1085,17 +1085,17 @@ static int snd_ac97_stac9758_phonesel_info(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
1085 | return 0; | 1085 | return 0; |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | static int snd_ac97_stac9758_phonesel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) | 1088 | static int snd_ac97_stac9758_phonesel_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1089 | { | 1089 | { |
1090 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1090 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1091 | 1091 | ||
1092 | ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; | 1092 | ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3; |
1093 | return 0; | 1093 | return 0; |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | static int snd_ac97_stac9758_phonesel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1096 | static int snd_ac97_stac9758_phonesel_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1097 | { | 1097 | { |
1098 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1098 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1099 | 1099 | ||
1100 | return ac97_update_bits_page(ac97, AC97_SIGMATEL_IOMISC, 3, | 1100 | return ac97_update_bits_page(ac97, AC97_SIGMATEL_IOMISC, 3, |
1101 | ucontrol->value.enumerated.item[0], 0); | 1101 | ucontrol->value.enumerated.item[0], 0); |
@@ -1113,7 +1113,7 @@ static int snd_ac97_stac9758_phonesel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem | |||
1113 | .get = snd_ac97_stac9758_input_jack_get, \ | 1113 | .get = snd_ac97_stac9758_input_jack_get, \ |
1114 | .put = snd_ac97_stac9758_input_jack_put, \ | 1114 | .put = snd_ac97_stac9758_input_jack_put, \ |
1115 | .private_value = shift } | 1115 | .private_value = shift } |
1116 | static const snd_kcontrol_new_t snd_ac97_sigmatel_stac9758_controls[] = { | 1116 | static const struct snd_kcontrol_new snd_ac97_sigmatel_stac9758_controls[] = { |
1117 | STAC9758_OUTPUT_JACK("Mic1 Jack", 1), | 1117 | STAC9758_OUTPUT_JACK("Mic1 Jack", 1), |
1118 | STAC9758_OUTPUT_JACK("LineIn Jack", 4), | 1118 | STAC9758_OUTPUT_JACK("LineIn Jack", 4), |
1119 | STAC9758_OUTPUT_JACK("Front Jack", 7), | 1119 | STAC9758_OUTPUT_JACK("Front Jack", 7), |
@@ -1132,7 +1132,7 @@ static const snd_kcontrol_new_t snd_ac97_sigmatel_stac9758_controls[] = { | |||
1132 | AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0) | 1132 | AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0) |
1133 | }; | 1133 | }; |
1134 | 1134 | ||
1135 | static int patch_sigmatel_stac9758_specific(ac97_t *ac97) | 1135 | static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97) |
1136 | { | 1136 | { |
1137 | int err; | 1137 | int err; |
1138 | 1138 | ||
@@ -1159,7 +1159,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = { | |||
1159 | .build_specific = patch_sigmatel_stac9758_specific | 1159 | .build_specific = patch_sigmatel_stac9758_specific |
1160 | }; | 1160 | }; |
1161 | 1161 | ||
1162 | int patch_sigmatel_stac9758(ac97_t * ac97) | 1162 | int patch_sigmatel_stac9758(struct snd_ac97 * ac97) |
1163 | { | 1163 | { |
1164 | static unsigned short regs[4] = { | 1164 | static unsigned short regs[4] = { |
1165 | AC97_SIGMATEL_OUTSEL, | 1165 | AC97_SIGMATEL_OUTSEL, |
@@ -1202,12 +1202,12 @@ int patch_sigmatel_stac9758(ac97_t * ac97) | |||
1202 | /* | 1202 | /* |
1203 | * Cirrus Logic CS42xx codecs | 1203 | * Cirrus Logic CS42xx codecs |
1204 | */ | 1204 | */ |
1205 | static const snd_kcontrol_new_t snd_ac97_cirrus_controls_spdif[2] = { | 1205 | static const struct snd_kcontrol_new snd_ac97_cirrus_controls_spdif[2] = { |
1206 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CSR_SPDIF, 15, 1, 0), | 1206 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CSR_SPDIF, 15, 1, 0), |
1207 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0) | 1207 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0) |
1208 | }; | 1208 | }; |
1209 | 1209 | ||
1210 | static int patch_cirrus_build_spdif(ac97_t * ac97) | 1210 | static int patch_cirrus_build_spdif(struct snd_ac97 * ac97) |
1211 | { | 1211 | { |
1212 | int err; | 1212 | int err; |
1213 | 1213 | ||
@@ -1233,7 +1233,7 @@ static struct snd_ac97_build_ops patch_cirrus_ops = { | |||
1233 | .build_spdif = patch_cirrus_build_spdif | 1233 | .build_spdif = patch_cirrus_build_spdif |
1234 | }; | 1234 | }; |
1235 | 1235 | ||
1236 | int patch_cirrus_spdif(ac97_t * ac97) | 1236 | int patch_cirrus_spdif(struct snd_ac97 * ac97) |
1237 | { | 1237 | { |
1238 | /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers. | 1238 | /* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers. |
1239 | WHY CAN'T ANYONE FOLLOW THE BLOODY SPEC? *sigh* | 1239 | WHY CAN'T ANYONE FOLLOW THE BLOODY SPEC? *sigh* |
@@ -1254,7 +1254,7 @@ int patch_cirrus_spdif(ac97_t * ac97) | |||
1254 | return 0; | 1254 | return 0; |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | int patch_cirrus_cs4299(ac97_t * ac97) | 1257 | int patch_cirrus_cs4299(struct snd_ac97 * ac97) |
1258 | { | 1258 | { |
1259 | /* force the detection of PC Beep */ | 1259 | /* force the detection of PC Beep */ |
1260 | ac97->flags |= AC97_HAS_PC_BEEP; | 1260 | ac97->flags |= AC97_HAS_PC_BEEP; |
@@ -1265,11 +1265,11 @@ int patch_cirrus_cs4299(ac97_t * ac97) | |||
1265 | /* | 1265 | /* |
1266 | * Conexant codecs | 1266 | * Conexant codecs |
1267 | */ | 1267 | */ |
1268 | static const snd_kcontrol_new_t snd_ac97_conexant_controls_spdif[1] = { | 1268 | static const struct snd_kcontrol_new snd_ac97_conexant_controls_spdif[1] = { |
1269 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0), | 1269 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0), |
1270 | }; | 1270 | }; |
1271 | 1271 | ||
1272 | static int patch_conexant_build_spdif(ac97_t * ac97) | 1272 | static int patch_conexant_build_spdif(struct snd_ac97 * ac97) |
1273 | { | 1273 | { |
1274 | int err; | 1274 | int err; |
1275 | 1275 | ||
@@ -1290,7 +1290,7 @@ static struct snd_ac97_build_ops patch_conexant_ops = { | |||
1290 | .build_spdif = patch_conexant_build_spdif | 1290 | .build_spdif = patch_conexant_build_spdif |
1291 | }; | 1291 | }; |
1292 | 1292 | ||
1293 | int patch_conexant(ac97_t * ac97) | 1293 | int patch_conexant(struct snd_ac97 * ac97) |
1294 | { | 1294 | { |
1295 | ac97->build_ops = &patch_conexant_ops; | 1295 | ac97->build_ops = &patch_conexant_ops; |
1296 | ac97->flags |= AC97_CX_SPDIF; | 1296 | ac97->flags |= AC97_CX_SPDIF; |
@@ -1303,7 +1303,7 @@ int patch_conexant(ac97_t * ac97) | |||
1303 | * Analog Device AD18xx, AD19xx codecs | 1303 | * Analog Device AD18xx, AD19xx codecs |
1304 | */ | 1304 | */ |
1305 | #ifdef CONFIG_PM | 1305 | #ifdef CONFIG_PM |
1306 | static void ad18xx_resume(ac97_t *ac97) | 1306 | static void ad18xx_resume(struct snd_ac97 *ac97) |
1307 | { | 1307 | { |
1308 | static unsigned short setup_regs[] = { | 1308 | static unsigned short setup_regs[] = { |
1309 | AC97_AD_MISC, AC97_AD_SERIAL_CFG, AC97_AD_JACK_SPDIF, | 1309 | AC97_AD_MISC, AC97_AD_SERIAL_CFG, AC97_AD_JACK_SPDIF, |
@@ -1367,7 +1367,7 @@ static void ad18xx_resume(ac97_t *ac97) | |||
1367 | } | 1367 | } |
1368 | #endif | 1368 | #endif |
1369 | 1369 | ||
1370 | int patch_ad1819(ac97_t * ac97) | 1370 | int patch_ad1819(struct snd_ac97 * ac97) |
1371 | { | 1371 | { |
1372 | unsigned short scfg; | 1372 | unsigned short scfg; |
1373 | 1373 | ||
@@ -1377,7 +1377,7 @@ int patch_ad1819(ac97_t * ac97) | |||
1377 | return 0; | 1377 | return 0; |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned short mask) | 1380 | static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, unsigned short mask) |
1381 | { | 1381 | { |
1382 | unsigned short val; | 1382 | unsigned short val; |
1383 | 1383 | ||
@@ -1393,7 +1393,7 @@ static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned sh | |||
1393 | return mask; | 1393 | return mask; |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bits) | 1396 | static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short codec_bits) |
1397 | { | 1397 | { |
1398 | static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; | 1398 | static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; |
1399 | unsigned short val; | 1399 | unsigned short val; |
@@ -1411,7 +1411,7 @@ static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bi | |||
1411 | return 1; | 1411 | return 1; |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | static void patch_ad1881_chained(ac97_t * ac97, int unchained_idx, int cidx1, int cidx2) | 1414 | static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int cidx1, int cidx2) |
1415 | { | 1415 | { |
1416 | // already detected? | 1416 | // already detected? |
1417 | if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1]) | 1417 | if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1]) |
@@ -1441,7 +1441,7 @@ static struct snd_ac97_build_ops patch_ad1881_build_ops = { | |||
1441 | #endif | 1441 | #endif |
1442 | }; | 1442 | }; |
1443 | 1443 | ||
1444 | int patch_ad1881(ac97_t * ac97) | 1444 | int patch_ad1881(struct snd_ac97 * ac97) |
1445 | { | 1445 | { |
1446 | static const char cfg_idxs[3][2] = { | 1446 | static const char cfg_idxs[3][2] = { |
1447 | {2, 1}, | 1447 | {2, 1}, |
@@ -1500,7 +1500,7 @@ int patch_ad1881(ac97_t * ac97) | |||
1500 | return 0; | 1500 | return 0; |
1501 | } | 1501 | } |
1502 | 1502 | ||
1503 | static const snd_kcontrol_new_t snd_ac97_controls_ad1885[] = { | 1503 | static const struct snd_kcontrol_new snd_ac97_controls_ad1885[] = { |
1504 | AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0), | 1504 | AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0), |
1505 | /* AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0), */ /* seems problematic */ | 1505 | /* AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0), */ /* seems problematic */ |
1506 | AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0), | 1506 | AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0), |
@@ -1509,7 +1509,7 @@ static const snd_kcontrol_new_t snd_ac97_controls_ad1885[] = { | |||
1509 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 8, 1, 1), /* inverted */ | 1509 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 8, 1, 1), /* inverted */ |
1510 | }; | 1510 | }; |
1511 | 1511 | ||
1512 | static int patch_ad1885_specific(ac97_t * ac97) | 1512 | static int patch_ad1885_specific(struct snd_ac97 * ac97) |
1513 | { | 1513 | { |
1514 | int err; | 1514 | int err; |
1515 | 1515 | ||
@@ -1525,7 +1525,7 @@ static struct snd_ac97_build_ops patch_ad1885_build_ops = { | |||
1525 | #endif | 1525 | #endif |
1526 | }; | 1526 | }; |
1527 | 1527 | ||
1528 | int patch_ad1885(ac97_t * ac97) | 1528 | int patch_ad1885(struct snd_ac97 * ac97) |
1529 | { | 1529 | { |
1530 | patch_ad1881(ac97); | 1530 | patch_ad1881(ac97); |
1531 | /* This is required to deal with the Intel D815EEAL2 */ | 1531 | /* This is required to deal with the Intel D815EEAL2 */ |
@@ -1538,7 +1538,7 @@ int patch_ad1885(ac97_t * ac97) | |||
1538 | return 0; | 1538 | return 0; |
1539 | } | 1539 | } |
1540 | 1540 | ||
1541 | int patch_ad1886(ac97_t * ac97) | 1541 | int patch_ad1886(struct snd_ac97 * ac97) |
1542 | { | 1542 | { |
1543 | patch_ad1881(ac97); | 1543 | patch_ad1881(ac97); |
1544 | /* Presario700 workaround */ | 1544 | /* Presario700 workaround */ |
@@ -1569,7 +1569,7 @@ int patch_ad1886(ac97_t * ac97) | |||
1569 | #define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */ | 1569 | #define AC97_AD198X_DACZ 0x8000 /* DAC zero-fill mode */ |
1570 | 1570 | ||
1571 | 1571 | ||
1572 | static int snd_ac97_ad198x_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1572 | static int snd_ac97_ad198x_spdif_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1573 | { | 1573 | { |
1574 | static char *texts[2] = { "AC-Link", "A/D Converter" }; | 1574 | static char *texts[2] = { "AC-Link", "A/D Converter" }; |
1575 | 1575 | ||
@@ -1582,9 +1582,9 @@ static int snd_ac97_ad198x_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_e | |||
1582 | return 0; | 1582 | return 0; |
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | static int snd_ac97_ad198x_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1585 | static int snd_ac97_ad198x_spdif_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1586 | { | 1586 | { |
1587 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1587 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1588 | unsigned short val; | 1588 | unsigned short val; |
1589 | 1589 | ||
1590 | val = ac97->regs[AC97_AD_SERIAL_CFG]; | 1590 | val = ac97->regs[AC97_AD_SERIAL_CFG]; |
@@ -1592,9 +1592,9 @@ static int snd_ac97_ad198x_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_e | |||
1592 | return 0; | 1592 | return 0; |
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | static int snd_ac97_ad198x_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1595 | static int snd_ac97_ad198x_spdif_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1596 | { | 1596 | { |
1597 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1597 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1598 | unsigned short val; | 1598 | unsigned short val; |
1599 | 1599 | ||
1600 | if (ucontrol->value.enumerated.item[0] > 1) | 1600 | if (ucontrol->value.enumerated.item[0] > 1) |
@@ -1603,7 +1603,7 @@ static int snd_ac97_ad198x_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_e | |||
1603 | return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val); | 1603 | return snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x0004, val); |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | static const snd_kcontrol_new_t snd_ac97_ad198x_spdif_source = { | 1606 | static const struct snd_kcontrol_new snd_ac97_ad198x_spdif_source = { |
1607 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1607 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1608 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", | 1608 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", |
1609 | .info = snd_ac97_ad198x_spdif_source_info, | 1609 | .info = snd_ac97_ad198x_spdif_source_info, |
@@ -1611,17 +1611,17 @@ static const snd_kcontrol_new_t snd_ac97_ad198x_spdif_source = { | |||
1611 | .put = snd_ac97_ad198x_spdif_source_put, | 1611 | .put = snd_ac97_ad198x_spdif_source_put, |
1612 | }; | 1612 | }; |
1613 | 1613 | ||
1614 | static int patch_ad198x_post_spdif(ac97_t * ac97) | 1614 | static int patch_ad198x_post_spdif(struct snd_ac97 * ac97) |
1615 | { | 1615 | { |
1616 | return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1); | 1616 | return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1); |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | static const snd_kcontrol_new_t snd_ac97_ad1981x_jack_sense[] = { | 1619 | static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = { |
1620 | AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0), | 1620 | AC97_SINGLE("Headphone Jack Sense", AC97_AD_JACK_SPDIF, 11, 1, 0), |
1621 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), | 1621 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), |
1622 | }; | 1622 | }; |
1623 | 1623 | ||
1624 | static int patch_ad1981a_specific(ac97_t * ac97) | 1624 | static int patch_ad1981a_specific(struct snd_ac97 * ac97) |
1625 | { | 1625 | { |
1626 | return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, | 1626 | return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, |
1627 | ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); | 1627 | ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); |
@@ -1635,7 +1635,7 @@ static struct snd_ac97_build_ops patch_ad1981a_build_ops = { | |||
1635 | #endif | 1635 | #endif |
1636 | }; | 1636 | }; |
1637 | 1637 | ||
1638 | static void check_ad1981_hp_jack_sense(ac97_t *ac97) | 1638 | static void check_ad1981_hp_jack_sense(struct snd_ac97 *ac97) |
1639 | { | 1639 | { |
1640 | u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; | 1640 | u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; |
1641 | switch (subid) { | 1641 | switch (subid) { |
@@ -1649,7 +1649,7 @@ static void check_ad1981_hp_jack_sense(ac97_t *ac97) | |||
1649 | } | 1649 | } |
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | int patch_ad1981a(ac97_t *ac97) | 1652 | int patch_ad1981a(struct snd_ac97 *ac97) |
1653 | { | 1653 | { |
1654 | patch_ad1881(ac97); | 1654 | patch_ad1881(ac97); |
1655 | ac97->build_ops = &patch_ad1981a_build_ops; | 1655 | ac97->build_ops = &patch_ad1981a_build_ops; |
@@ -1659,10 +1659,10 @@ int patch_ad1981a(ac97_t *ac97) | |||
1659 | return 0; | 1659 | return 0; |
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | static const snd_kcontrol_new_t snd_ac97_ad198x_2cmic = | 1662 | static const struct snd_kcontrol_new snd_ac97_ad198x_2cmic = |
1663 | AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0); | 1663 | AC97_SINGLE("Stereo Mic", AC97_AD_MISC, 6, 1, 0); |
1664 | 1664 | ||
1665 | static int patch_ad1981b_specific(ac97_t *ac97) | 1665 | static int patch_ad1981b_specific(struct snd_ac97 *ac97) |
1666 | { | 1666 | { |
1667 | int err; | 1667 | int err; |
1668 | 1668 | ||
@@ -1680,7 +1680,7 @@ static struct snd_ac97_build_ops patch_ad1981b_build_ops = { | |||
1680 | #endif | 1680 | #endif |
1681 | }; | 1681 | }; |
1682 | 1682 | ||
1683 | int patch_ad1981b(ac97_t *ac97) | 1683 | int patch_ad1981b(struct snd_ac97 *ac97) |
1684 | { | 1684 | { |
1685 | patch_ad1881(ac97); | 1685 | patch_ad1881(ac97); |
1686 | ac97->build_ops = &patch_ad1981b_build_ops; | 1686 | ac97->build_ops = &patch_ad1981b_build_ops; |
@@ -1690,7 +1690,7 @@ int patch_ad1981b(ac97_t *ac97) | |||
1690 | return 0; | 1690 | return 0; |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | static int snd_ac97_ad1888_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1693 | static int snd_ac97_ad1888_lohpsel_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1694 | { | 1694 | { |
1695 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1695 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1696 | uinfo->count = 1; | 1696 | uinfo->count = 1; |
@@ -1699,9 +1699,9 @@ static int snd_ac97_ad1888_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i | |||
1699 | return 0; | 1699 | return 0; |
1700 | } | 1700 | } |
1701 | 1701 | ||
1702 | static int snd_ac97_ad1888_lohpsel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) | 1702 | static int snd_ac97_ad1888_lohpsel_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1703 | { | 1703 | { |
1704 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1704 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1705 | unsigned short val; | 1705 | unsigned short val; |
1706 | 1706 | ||
1707 | val = ac97->regs[AC97_AD_MISC]; | 1707 | val = ac97->regs[AC97_AD_MISC]; |
@@ -1709,9 +1709,9 @@ static int snd_ac97_ad1888_lohpsel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
1709 | return 0; | 1709 | return 0; |
1710 | } | 1710 | } |
1711 | 1711 | ||
1712 | static int snd_ac97_ad1888_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1712 | static int snd_ac97_ad1888_lohpsel_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1713 | { | 1713 | { |
1714 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1714 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1715 | unsigned short val; | 1715 | unsigned short val; |
1716 | 1716 | ||
1717 | val = !ucontrol->value.integer.value[0] | 1717 | val = !ucontrol->value.integer.value[0] |
@@ -1720,7 +1720,7 @@ static int snd_ac97_ad1888_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
1720 | AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val); | 1720 | AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val); |
1721 | } | 1721 | } |
1722 | 1722 | ||
1723 | static int snd_ac97_ad1888_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 1723 | static int snd_ac97_ad1888_downmix_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1724 | { | 1724 | { |
1725 | static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"}; | 1725 | static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"}; |
1726 | 1726 | ||
@@ -1733,9 +1733,9 @@ static int snd_ac97_ad1888_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i | |||
1733 | return 0; | 1733 | return 0; |
1734 | } | 1734 | } |
1735 | 1735 | ||
1736 | static int snd_ac97_ad1888_downmix_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol) | 1736 | static int snd_ac97_ad1888_downmix_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1737 | { | 1737 | { |
1738 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1738 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1739 | unsigned short val; | 1739 | unsigned short val; |
1740 | 1740 | ||
1741 | val = ac97->regs[AC97_AD_MISC]; | 1741 | val = ac97->regs[AC97_AD_MISC]; |
@@ -1746,9 +1746,9 @@ static int snd_ac97_ad1888_downmix_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
1746 | return 0; | 1746 | return 0; |
1747 | } | 1747 | } |
1748 | 1748 | ||
1749 | static int snd_ac97_ad1888_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 1749 | static int snd_ac97_ad1888_downmix_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1750 | { | 1750 | { |
1751 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 1751 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
1752 | unsigned short val; | 1752 | unsigned short val; |
1753 | 1753 | ||
1754 | if (ucontrol->value.enumerated.item[0] > 2) | 1754 | if (ucontrol->value.enumerated.item[0] > 2) |
@@ -1762,7 +1762,7 @@ static int snd_ac97_ad1888_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
1762 | AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val); | 1762 | AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val); |
1763 | } | 1763 | } |
1764 | 1764 | ||
1765 | static void ad1888_update_jacks(ac97_t *ac97) | 1765 | static void ad1888_update_jacks(struct snd_ac97 *ac97) |
1766 | { | 1766 | { |
1767 | unsigned short val = 0; | 1767 | unsigned short val = 0; |
1768 | if (! is_shared_linein(ac97)) | 1768 | if (! is_shared_linein(ac97)) |
@@ -1773,7 +1773,7 @@ static void ad1888_update_jacks(ac97_t *ac97) | |||
1773 | snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); | 1773 | snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | static const snd_kcontrol_new_t snd_ac97_ad1888_controls[] = { | 1776 | static const struct snd_kcontrol_new snd_ac97_ad1888_controls[] = { |
1777 | { | 1777 | { |
1778 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1778 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1779 | .name = "Exchange Front/Surround", | 1779 | .name = "Exchange Front/Surround", |
@@ -1796,7 +1796,7 @@ static const snd_kcontrol_new_t snd_ac97_ad1888_controls[] = { | |||
1796 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), | 1796 | AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), |
1797 | }; | 1797 | }; |
1798 | 1798 | ||
1799 | static int patch_ad1888_specific(ac97_t *ac97) | 1799 | static int patch_ad1888_specific(struct snd_ac97 *ac97) |
1800 | { | 1800 | { |
1801 | /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ | 1801 | /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ |
1802 | snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Master Surround Playback"); | 1802 | snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Master Surround Playback"); |
@@ -1813,7 +1813,7 @@ static struct snd_ac97_build_ops patch_ad1888_build_ops = { | |||
1813 | .update_jacks = ad1888_update_jacks, | 1813 | .update_jacks = ad1888_update_jacks, |
1814 | }; | 1814 | }; |
1815 | 1815 | ||
1816 | int patch_ad1888(ac97_t * ac97) | 1816 | int patch_ad1888(struct snd_ac97 * ac97) |
1817 | { | 1817 | { |
1818 | unsigned short misc; | 1818 | unsigned short misc; |
1819 | 1819 | ||
@@ -1833,7 +1833,7 @@ int patch_ad1888(ac97_t * ac97) | |||
1833 | return 0; | 1833 | return 0; |
1834 | } | 1834 | } |
1835 | 1835 | ||
1836 | static int patch_ad1980_specific(ac97_t *ac97) | 1836 | static int patch_ad1980_specific(struct snd_ac97 *ac97) |
1837 | { | 1837 | { |
1838 | int err; | 1838 | int err; |
1839 | 1839 | ||
@@ -1851,25 +1851,25 @@ static struct snd_ac97_build_ops patch_ad1980_build_ops = { | |||
1851 | .update_jacks = ad1888_update_jacks, | 1851 | .update_jacks = ad1888_update_jacks, |
1852 | }; | 1852 | }; |
1853 | 1853 | ||
1854 | int patch_ad1980(ac97_t * ac97) | 1854 | int patch_ad1980(struct snd_ac97 * ac97) |
1855 | { | 1855 | { |
1856 | patch_ad1888(ac97); | 1856 | patch_ad1888(ac97); |
1857 | ac97->build_ops = &patch_ad1980_build_ops; | 1857 | ac97->build_ops = &patch_ad1980_build_ops; |
1858 | return 0; | 1858 | return 0; |
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | static const snd_kcontrol_new_t snd_ac97_ad1985_controls[] = { | 1861 | static const struct snd_kcontrol_new snd_ac97_ad1985_controls[] = { |
1862 | AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0) | 1862 | AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0) |
1863 | }; | 1863 | }; |
1864 | 1864 | ||
1865 | static void ad1985_update_jacks(ac97_t *ac97) | 1865 | static void ad1985_update_jacks(struct snd_ac97 *ac97) |
1866 | { | 1866 | { |
1867 | ad1888_update_jacks(ac97); | 1867 | ad1888_update_jacks(ac97); |
1868 | snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, | 1868 | snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, |
1869 | is_shared_micin(ac97) ? 0 : 1 << 9); | 1869 | is_shared_micin(ac97) ? 0 : 1 << 9); |
1870 | } | 1870 | } |
1871 | 1871 | ||
1872 | static int patch_ad1985_specific(ac97_t *ac97) | 1872 | static int patch_ad1985_specific(struct snd_ac97 *ac97) |
1873 | { | 1873 | { |
1874 | int err; | 1874 | int err; |
1875 | 1875 | ||
@@ -1887,7 +1887,7 @@ static struct snd_ac97_build_ops patch_ad1985_build_ops = { | |||
1887 | .update_jacks = ad1985_update_jacks, | 1887 | .update_jacks = ad1985_update_jacks, |
1888 | }; | 1888 | }; |
1889 | 1889 | ||
1890 | int patch_ad1985(ac97_t * ac97) | 1890 | int patch_ad1985(struct snd_ac97 * ac97) |
1891 | { | 1891 | { |
1892 | unsigned short misc; | 1892 | unsigned short misc; |
1893 | 1893 | ||
@@ -1916,7 +1916,7 @@ int patch_ad1985(ac97_t * ac97) | |||
1916 | /* | 1916 | /* |
1917 | * realtek ALC65x/850 codecs | 1917 | * realtek ALC65x/850 codecs |
1918 | */ | 1918 | */ |
1919 | static void alc650_update_jacks(ac97_t *ac97) | 1919 | static void alc650_update_jacks(struct snd_ac97 *ac97) |
1920 | { | 1920 | { |
1921 | int shared; | 1921 | int shared; |
1922 | 1922 | ||
@@ -1937,7 +1937,7 @@ static void alc650_update_jacks(ac97_t *ac97) | |||
1937 | shared ? 0 : 0x100); | 1937 | shared ? 0 : 0x100); |
1938 | } | 1938 | } |
1939 | 1939 | ||
1940 | static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = { | 1940 | static const struct snd_kcontrol_new snd_ac97_controls_alc650[] = { |
1941 | AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0), | 1941 | AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0), |
1942 | AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0), | 1942 | AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0), |
1943 | AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0), | 1943 | AC97_SINGLE("Center/LFE Down Mix", AC97_ALC650_MULTICH, 2, 1, 0), |
@@ -1963,14 +1963,14 @@ static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = { | |||
1963 | AC97_CHANNEL_MODE_CTL, | 1963 | AC97_CHANNEL_MODE_CTL, |
1964 | }; | 1964 | }; |
1965 | 1965 | ||
1966 | static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc650[] = { | 1966 | static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc650[] = { |
1967 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0), | 1967 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0), |
1968 | AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0), | 1968 | AC97_SINGLE("Analog to IEC958 Output", AC97_ALC650_MULTICH, 12, 1, 0), |
1969 | /* disable this controls since it doesn't work as expected */ | 1969 | /* disable this controls since it doesn't work as expected */ |
1970 | /* AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0), */ | 1970 | /* AC97_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 13, 1, 0), */ |
1971 | }; | 1971 | }; |
1972 | 1972 | ||
1973 | static int patch_alc650_specific(ac97_t * ac97) | 1973 | static int patch_alc650_specific(struct snd_ac97 * ac97) |
1974 | { | 1974 | { |
1975 | int err; | 1975 | int err; |
1976 | 1976 | ||
@@ -1988,7 +1988,7 @@ static struct snd_ac97_build_ops patch_alc650_ops = { | |||
1988 | .update_jacks = alc650_update_jacks | 1988 | .update_jacks = alc650_update_jacks |
1989 | }; | 1989 | }; |
1990 | 1990 | ||
1991 | int patch_alc650(ac97_t * ac97) | 1991 | int patch_alc650(struct snd_ac97 * ac97) |
1992 | { | 1992 | { |
1993 | unsigned short val; | 1993 | unsigned short val; |
1994 | 1994 | ||
@@ -2043,7 +2043,7 @@ int patch_alc650(ac97_t * ac97) | |||
2043 | return 0; | 2043 | return 0; |
2044 | } | 2044 | } |
2045 | 2045 | ||
2046 | static void alc655_update_jacks(ac97_t *ac97) | 2046 | static void alc655_update_jacks(struct snd_ac97 *ac97) |
2047 | { | 2047 | { |
2048 | int shared; | 2048 | int shared; |
2049 | 2049 | ||
@@ -2060,17 +2060,17 @@ static void alc655_update_jacks(ac97_t *ac97) | |||
2060 | shared ? (1 << 10) : 0, 0); | 2060 | shared ? (1 << 10) : 0, 0); |
2061 | } | 2061 | } |
2062 | 2062 | ||
2063 | static const snd_kcontrol_new_t snd_ac97_controls_alc655[] = { | 2063 | static const struct snd_kcontrol_new snd_ac97_controls_alc655[] = { |
2064 | AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), | 2064 | AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), |
2065 | AC97_SURROUND_JACK_MODE_CTL, | 2065 | AC97_SURROUND_JACK_MODE_CTL, |
2066 | AC97_CHANNEL_MODE_CTL, | 2066 | AC97_CHANNEL_MODE_CTL, |
2067 | }; | 2067 | }; |
2068 | 2068 | ||
2069 | static int alc655_iec958_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 2069 | static int alc655_iec958_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2070 | { | 2070 | { |
2071 | static char *texts_655[3] = { "PCM", "Analog In", "IEC958 In" }; | 2071 | static char *texts_655[3] = { "PCM", "Analog In", "IEC958 In" }; |
2072 | static char *texts_658[4] = { "PCM", "Analog1 In", "Analog2 In", "IEC958 In" }; | 2072 | static char *texts_658[4] = { "PCM", "Analog1 In", "Analog2 In", "IEC958 In" }; |
2073 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2073 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2074 | 2074 | ||
2075 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2075 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2076 | uinfo->count = 1; | 2076 | uinfo->count = 1; |
@@ -2084,9 +2084,9 @@ static int alc655_iec958_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_ | |||
2084 | return 0; | 2084 | return 0; |
2085 | } | 2085 | } |
2086 | 2086 | ||
2087 | static int alc655_iec958_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 2087 | static int alc655_iec958_route_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2088 | { | 2088 | { |
2089 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2089 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2090 | unsigned short val; | 2090 | unsigned short val; |
2091 | 2091 | ||
2092 | val = ac97->regs[AC97_ALC650_MULTICH]; | 2092 | val = ac97->regs[AC97_ALC650_MULTICH]; |
@@ -2097,16 +2097,16 @@ static int alc655_iec958_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_ | |||
2097 | return 0; | 2097 | return 0; |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | static int alc655_iec958_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 2100 | static int alc655_iec958_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2101 | { | 2101 | { |
2102 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2102 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2103 | 2103 | ||
2104 | return ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 3 << 12, | 2104 | return ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 3 << 12, |
2105 | (unsigned short)ucontrol->value.enumerated.item[0] << 12, | 2105 | (unsigned short)ucontrol->value.enumerated.item[0] << 12, |
2106 | 0); | 2106 | 0); |
2107 | } | 2107 | } |
2108 | 2108 | ||
2109 | static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc655[] = { | 2109 | static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc655[] = { |
2110 | AC97_PAGE_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0, 0), | 2110 | AC97_PAGE_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_ALC650_MULTICH, 11, 1, 0, 0), |
2111 | /* disable this controls since it doesn't work as expected */ | 2111 | /* disable this controls since it doesn't work as expected */ |
2112 | /* AC97_PAGE_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0, 0), */ | 2112 | /* AC97_PAGE_SINGLE("IEC958 Input Monitor", AC97_ALC650_MULTICH, 14, 1, 0, 0), */ |
@@ -2119,7 +2119,7 @@ static const snd_kcontrol_new_t snd_ac97_spdif_controls_alc655[] = { | |||
2119 | }, | 2119 | }, |
2120 | }; | 2120 | }; |
2121 | 2121 | ||
2122 | static int patch_alc655_specific(ac97_t * ac97) | 2122 | static int patch_alc655_specific(struct snd_ac97 * ac97) |
2123 | { | 2123 | { |
2124 | int err; | 2124 | int err; |
2125 | 2125 | ||
@@ -2137,7 +2137,7 @@ static struct snd_ac97_build_ops patch_alc655_ops = { | |||
2137 | .update_jacks = alc655_update_jacks | 2137 | .update_jacks = alc655_update_jacks |
2138 | }; | 2138 | }; |
2139 | 2139 | ||
2140 | int patch_alc655(ac97_t * ac97) | 2140 | int patch_alc655(struct snd_ac97 * ac97) |
2141 | { | 2141 | { |
2142 | unsigned int val; | 2142 | unsigned int val; |
2143 | 2143 | ||
@@ -2189,7 +2189,7 @@ int patch_alc655(ac97_t * ac97) | |||
2189 | #define AC97_ALC850_JACK_SELECT 0x76 | 2189 | #define AC97_ALC850_JACK_SELECT 0x76 |
2190 | #define AC97_ALC850_MISC1 0x7a | 2190 | #define AC97_ALC850_MISC1 0x7a |
2191 | 2191 | ||
2192 | static void alc850_update_jacks(ac97_t *ac97) | 2192 | static void alc850_update_jacks(struct snd_ac97 *ac97) |
2193 | { | 2193 | { |
2194 | int shared; | 2194 | int shared; |
2195 | 2195 | ||
@@ -2211,14 +2211,14 @@ static void alc850_update_jacks(ac97_t *ac97) | |||
2211 | shared ? (2<<4) : (1<<4)); | 2211 | shared ? (2<<4) : (1<<4)); |
2212 | } | 2212 | } |
2213 | 2213 | ||
2214 | static const snd_kcontrol_new_t snd_ac97_controls_alc850[] = { | 2214 | static const struct snd_kcontrol_new snd_ac97_controls_alc850[] = { |
2215 | AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), | 2215 | AC97_PAGE_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0, 0), |
2216 | AC97_SINGLE("Mic Front Input Switch", AC97_ALC850_JACK_SELECT, 15, 1, 1), | 2216 | AC97_SINGLE("Mic Front Input Switch", AC97_ALC850_JACK_SELECT, 15, 1, 1), |
2217 | AC97_SURROUND_JACK_MODE_CTL, | 2217 | AC97_SURROUND_JACK_MODE_CTL, |
2218 | AC97_CHANNEL_MODE_CTL, | 2218 | AC97_CHANNEL_MODE_CTL, |
2219 | }; | 2219 | }; |
2220 | 2220 | ||
2221 | static int patch_alc850_specific(ac97_t *ac97) | 2221 | static int patch_alc850_specific(struct snd_ac97 *ac97) |
2222 | { | 2222 | { |
2223 | int err; | 2223 | int err; |
2224 | 2224 | ||
@@ -2236,7 +2236,7 @@ static struct snd_ac97_build_ops patch_alc850_ops = { | |||
2236 | .update_jacks = alc850_update_jacks | 2236 | .update_jacks = alc850_update_jacks |
2237 | }; | 2237 | }; |
2238 | 2238 | ||
2239 | int patch_alc850(ac97_t *ac97) | 2239 | int patch_alc850(struct snd_ac97 *ac97) |
2240 | { | 2240 | { |
2241 | ac97->build_ops = &patch_alc850_ops; | 2241 | ac97->build_ops = &patch_alc850_ops; |
2242 | 2242 | ||
@@ -2273,20 +2273,20 @@ int patch_alc850(ac97_t *ac97) | |||
2273 | /* | 2273 | /* |
2274 | * C-Media CM97xx codecs | 2274 | * C-Media CM97xx codecs |
2275 | */ | 2275 | */ |
2276 | static void cm9738_update_jacks(ac97_t *ac97) | 2276 | static void cm9738_update_jacks(struct snd_ac97 *ac97) |
2277 | { | 2277 | { |
2278 | /* shared Line-In */ | 2278 | /* shared Line-In */ |
2279 | snd_ac97_update_bits(ac97, AC97_CM9738_VENDOR_CTRL, 1 << 10, | 2279 | snd_ac97_update_bits(ac97, AC97_CM9738_VENDOR_CTRL, 1 << 10, |
2280 | is_shared_linein(ac97) ? (1 << 10) : 0); | 2280 | is_shared_linein(ac97) ? (1 << 10) : 0); |
2281 | } | 2281 | } |
2282 | 2282 | ||
2283 | static const snd_kcontrol_new_t snd_ac97_cm9738_controls[] = { | 2283 | static const struct snd_kcontrol_new snd_ac97_cm9738_controls[] = { |
2284 | AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0), | 2284 | AC97_SINGLE("Duplicate Front", AC97_CM9738_VENDOR_CTRL, 13, 1, 0), |
2285 | AC97_SURROUND_JACK_MODE_CTL, | 2285 | AC97_SURROUND_JACK_MODE_CTL, |
2286 | AC97_CHANNEL_MODE_4CH_CTL, | 2286 | AC97_CHANNEL_MODE_4CH_CTL, |
2287 | }; | 2287 | }; |
2288 | 2288 | ||
2289 | static int patch_cm9738_specific(ac97_t * ac97) | 2289 | static int patch_cm9738_specific(struct snd_ac97 * ac97) |
2290 | { | 2290 | { |
2291 | return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls)); | 2291 | return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls)); |
2292 | } | 2292 | } |
@@ -2296,7 +2296,7 @@ static struct snd_ac97_build_ops patch_cm9738_ops = { | |||
2296 | .update_jacks = cm9738_update_jacks | 2296 | .update_jacks = cm9738_update_jacks |
2297 | }; | 2297 | }; |
2298 | 2298 | ||
2299 | int patch_cm9738(ac97_t * ac97) | 2299 | int patch_cm9738(struct snd_ac97 * ac97) |
2300 | { | 2300 | { |
2301 | ac97->build_ops = &patch_cm9738_ops; | 2301 | ac97->build_ops = &patch_cm9738_ops; |
2302 | /* FIXME: can anyone confirm below? */ | 2302 | /* FIXME: can anyone confirm below? */ |
@@ -2307,7 +2307,7 @@ int patch_cm9738(ac97_t * ac97) | |||
2307 | return 0; | 2307 | return 0; |
2308 | } | 2308 | } |
2309 | 2309 | ||
2310 | static int snd_ac97_cmedia_spdif_playback_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2310 | static int snd_ac97_cmedia_spdif_playback_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2311 | { | 2311 | { |
2312 | static char *texts[] = { "Analog", "Digital" }; | 2312 | static char *texts[] = { "Analog", "Digital" }; |
2313 | 2313 | ||
@@ -2320,9 +2320,9 @@ static int snd_ac97_cmedia_spdif_playback_source_info(snd_kcontrol_t *kcontrol, | |||
2320 | return 0; | 2320 | return 0; |
2321 | } | 2321 | } |
2322 | 2322 | ||
2323 | static int snd_ac97_cmedia_spdif_playback_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2323 | static int snd_ac97_cmedia_spdif_playback_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2324 | { | 2324 | { |
2325 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2325 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2326 | unsigned short val; | 2326 | unsigned short val; |
2327 | 2327 | ||
2328 | val = ac97->regs[AC97_CM9739_SPDIF_CTRL]; | 2328 | val = ac97->regs[AC97_CM9739_SPDIF_CTRL]; |
@@ -2330,16 +2330,16 @@ static int snd_ac97_cmedia_spdif_playback_source_get(snd_kcontrol_t * kcontrol, | |||
2330 | return 0; | 2330 | return 0; |
2331 | } | 2331 | } |
2332 | 2332 | ||
2333 | static int snd_ac97_cmedia_spdif_playback_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2333 | static int snd_ac97_cmedia_spdif_playback_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2334 | { | 2334 | { |
2335 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2335 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2336 | 2336 | ||
2337 | return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL, | 2337 | return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL, |
2338 | 0x01 << 1, | 2338 | 0x01 << 1, |
2339 | (ucontrol->value.enumerated.item[0] & 0x01) << 1); | 2339 | (ucontrol->value.enumerated.item[0] & 0x01) << 1); |
2340 | } | 2340 | } |
2341 | 2341 | ||
2342 | static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = { | 2342 | static const struct snd_kcontrol_new snd_ac97_cm9739_controls_spdif[] = { |
2343 | /* BIT 0: SPDI_EN - always true */ | 2343 | /* BIT 0: SPDI_EN - always true */ |
2344 | { /* BIT 1: SPDIFS */ | 2344 | { /* BIT 1: SPDIFS */ |
2345 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2345 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -2357,7 +2357,7 @@ static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = { | |||
2357 | /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */ | 2357 | /* BIT 8: SPD32 - 32bit SPDIF - not supported yet */ |
2358 | }; | 2358 | }; |
2359 | 2359 | ||
2360 | static void cm9739_update_jacks(ac97_t *ac97) | 2360 | static void cm9739_update_jacks(struct snd_ac97 *ac97) |
2361 | { | 2361 | { |
2362 | /* shared Line-In */ | 2362 | /* shared Line-In */ |
2363 | snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 1 << 10, | 2363 | snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 1 << 10, |
@@ -2367,17 +2367,17 @@ static void cm9739_update_jacks(ac97_t *ac97) | |||
2367 | is_shared_micin(ac97) ? 0x1000 : 0x2000); | 2367 | is_shared_micin(ac97) ? 0x1000 : 0x2000); |
2368 | } | 2368 | } |
2369 | 2369 | ||
2370 | static const snd_kcontrol_new_t snd_ac97_cm9739_controls[] = { | 2370 | static const struct snd_kcontrol_new snd_ac97_cm9739_controls[] = { |
2371 | AC97_SURROUND_JACK_MODE_CTL, | 2371 | AC97_SURROUND_JACK_MODE_CTL, |
2372 | AC97_CHANNEL_MODE_CTL, | 2372 | AC97_CHANNEL_MODE_CTL, |
2373 | }; | 2373 | }; |
2374 | 2374 | ||
2375 | static int patch_cm9739_specific(ac97_t * ac97) | 2375 | static int patch_cm9739_specific(struct snd_ac97 * ac97) |
2376 | { | 2376 | { |
2377 | return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls)); | 2377 | return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls)); |
2378 | } | 2378 | } |
2379 | 2379 | ||
2380 | static int patch_cm9739_post_spdif(ac97_t * ac97) | 2380 | static int patch_cm9739_post_spdif(struct snd_ac97 * ac97) |
2381 | { | 2381 | { |
2382 | return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif)); | 2382 | return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif)); |
2383 | } | 2383 | } |
@@ -2388,7 +2388,7 @@ static struct snd_ac97_build_ops patch_cm9739_ops = { | |||
2388 | .update_jacks = cm9739_update_jacks | 2388 | .update_jacks = cm9739_update_jacks |
2389 | }; | 2389 | }; |
2390 | 2390 | ||
2391 | int patch_cm9739(ac97_t * ac97) | 2391 | int patch_cm9739(struct snd_ac97 * ac97) |
2392 | { | 2392 | { |
2393 | unsigned short val; | 2393 | unsigned short val; |
2394 | 2394 | ||
@@ -2447,7 +2447,7 @@ int patch_cm9739(ac97_t * ac97) | |||
2447 | #define AC97_CM9761_FUNC 0x66 | 2447 | #define AC97_CM9761_FUNC 0x66 |
2448 | #define AC97_CM9761_SPDIF_CTRL 0x6c | 2448 | #define AC97_CM9761_SPDIF_CTRL 0x6c |
2449 | 2449 | ||
2450 | static void cm9761_update_jacks(ac97_t *ac97) | 2450 | static void cm9761_update_jacks(struct snd_ac97 *ac97) |
2451 | { | 2451 | { |
2452 | /* FIXME: check the bits for each model | 2452 | /* FIXME: check the bits for each model |
2453 | * model 83 is confirmed to work | 2453 | * model 83 is confirmed to work |
@@ -2482,12 +2482,12 @@ static void cm9761_update_jacks(ac97_t *ac97) | |||
2482 | snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val); | 2482 | snd_ac97_update_bits(ac97, AC97_CM9761_MULTI_CHAN, 0x3c88, val); |
2483 | } | 2483 | } |
2484 | 2484 | ||
2485 | static const snd_kcontrol_new_t snd_ac97_cm9761_controls[] = { | 2485 | static const struct snd_kcontrol_new snd_ac97_cm9761_controls[] = { |
2486 | AC97_SURROUND_JACK_MODE_CTL, | 2486 | AC97_SURROUND_JACK_MODE_CTL, |
2487 | AC97_CHANNEL_MODE_CTL, | 2487 | AC97_CHANNEL_MODE_CTL, |
2488 | }; | 2488 | }; |
2489 | 2489 | ||
2490 | static int cm9761_spdif_out_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 2490 | static int cm9761_spdif_out_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2491 | { | 2491 | { |
2492 | static char *texts[] = { "AC-Link", "ADC", "SPDIF-In" }; | 2492 | static char *texts[] = { "AC-Link", "ADC", "SPDIF-In" }; |
2493 | 2493 | ||
@@ -2500,9 +2500,9 @@ static int cm9761_spdif_out_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i | |||
2500 | return 0; | 2500 | return 0; |
2501 | } | 2501 | } |
2502 | 2502 | ||
2503 | static int cm9761_spdif_out_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 2503 | static int cm9761_spdif_out_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2504 | { | 2504 | { |
2505 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2505 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2506 | 2506 | ||
2507 | if (ac97->regs[AC97_CM9761_FUNC] & 0x1) | 2507 | if (ac97->regs[AC97_CM9761_FUNC] & 0x1) |
2508 | ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */ | 2508 | ucontrol->value.enumerated.item[0] = 2; /* SPDIF-loopback */ |
@@ -2513,9 +2513,9 @@ static int cm9761_spdif_out_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va | |||
2513 | return 0; | 2513 | return 0; |
2514 | } | 2514 | } |
2515 | 2515 | ||
2516 | static int cm9761_spdif_out_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 2516 | static int cm9761_spdif_out_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2517 | { | 2517 | { |
2518 | ac97_t *ac97 = snd_kcontrol_chip(kcontrol); | 2518 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
2519 | 2519 | ||
2520 | if (ucontrol->value.enumerated.item[0] == 2) | 2520 | if (ucontrol->value.enumerated.item[0] == 2) |
2521 | return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1); | 2521 | return snd_ac97_update_bits(ac97, AC97_CM9761_FUNC, 0x1, 0x1); |
@@ -2528,7 +2528,7 @@ static const char *cm9761_dac_clock[] = { "AC-Link", "SPDIF-In", "Both" }; | |||
2528 | static const struct ac97_enum cm9761_dac_clock_enum = | 2528 | static const struct ac97_enum cm9761_dac_clock_enum = |
2529 | AC97_ENUM_SINGLE(AC97_CM9761_SPDIF_CTRL, 9, 3, cm9761_dac_clock); | 2529 | AC97_ENUM_SINGLE(AC97_CM9761_SPDIF_CTRL, 9, 3, cm9761_dac_clock); |
2530 | 2530 | ||
2531 | static const snd_kcontrol_new_t snd_ac97_cm9761_controls_spdif[] = { | 2531 | static const struct snd_kcontrol_new snd_ac97_cm9761_controls_spdif[] = { |
2532 | { /* BIT 1: SPDIFS */ | 2532 | { /* BIT 1: SPDIFS */ |
2533 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2533 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2534 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", | 2534 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", |
@@ -2546,12 +2546,12 @@ static const snd_kcontrol_new_t snd_ac97_cm9761_controls_spdif[] = { | |||
2546 | AC97_ENUM("DAC Clock Source", cm9761_dac_clock_enum), | 2546 | AC97_ENUM("DAC Clock Source", cm9761_dac_clock_enum), |
2547 | }; | 2547 | }; |
2548 | 2548 | ||
2549 | static int patch_cm9761_post_spdif(ac97_t * ac97) | 2549 | static int patch_cm9761_post_spdif(struct snd_ac97 * ac97) |
2550 | { | 2550 | { |
2551 | return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_controls_spdif)); | 2551 | return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_controls_spdif)); |
2552 | } | 2552 | } |
2553 | 2553 | ||
2554 | static int patch_cm9761_specific(ac97_t * ac97) | 2554 | static int patch_cm9761_specific(struct snd_ac97 * ac97) |
2555 | { | 2555 | { |
2556 | return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls)); | 2556 | return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls)); |
2557 | } | 2557 | } |
@@ -2562,7 +2562,7 @@ static struct snd_ac97_build_ops patch_cm9761_ops = { | |||
2562 | .update_jacks = cm9761_update_jacks | 2562 | .update_jacks = cm9761_update_jacks |
2563 | }; | 2563 | }; |
2564 | 2564 | ||
2565 | int patch_cm9761(ac97_t *ac97) | 2565 | int patch_cm9761(struct snd_ac97 *ac97) |
2566 | { | 2566 | { |
2567 | unsigned short val; | 2567 | unsigned short val; |
2568 | 2568 | ||
@@ -2641,13 +2641,13 @@ int patch_cm9761(ac97_t *ac97) | |||
2641 | static const char *cm9780_ch_select[] = { "Front", "Side", "Center/LFE", "Rear" }; | 2641 | static const char *cm9780_ch_select[] = { "Front", "Side", "Center/LFE", "Rear" }; |
2642 | static const struct ac97_enum cm9780_ch_select_enum = | 2642 | static const struct ac97_enum cm9780_ch_select_enum = |
2643 | AC97_ENUM_SINGLE(AC97_CM9780_MULTI_CHAN, 6, 4, cm9780_ch_select); | 2643 | AC97_ENUM_SINGLE(AC97_CM9780_MULTI_CHAN, 6, 4, cm9780_ch_select); |
2644 | static const snd_kcontrol_new_t cm9780_controls[] = { | 2644 | static const struct snd_kcontrol_new cm9780_controls[] = { |
2645 | AC97_DOUBLE("Side Playback Switch", AC97_CM9780_SIDE, 15, 7, 1, 1), | 2645 | AC97_DOUBLE("Side Playback Switch", AC97_CM9780_SIDE, 15, 7, 1, 1), |
2646 | AC97_DOUBLE("Side Playback Volume", AC97_CM9780_SIDE, 8, 0, 31, 0), | 2646 | AC97_DOUBLE("Side Playback Volume", AC97_CM9780_SIDE, 8, 0, 31, 0), |
2647 | AC97_ENUM("Side Playback Route", cm9780_ch_select_enum), | 2647 | AC97_ENUM("Side Playback Route", cm9780_ch_select_enum), |
2648 | }; | 2648 | }; |
2649 | 2649 | ||
2650 | static int patch_cm9780_specific(ac97_t *ac97) | 2650 | static int patch_cm9780_specific(struct snd_ac97 *ac97) |
2651 | { | 2651 | { |
2652 | return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls)); | 2652 | return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls)); |
2653 | } | 2653 | } |
@@ -2657,7 +2657,7 @@ static struct snd_ac97_build_ops patch_cm9780_ops = { | |||
2657 | .build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */ | 2657 | .build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */ |
2658 | }; | 2658 | }; |
2659 | 2659 | ||
2660 | int patch_cm9780(ac97_t *ac97) | 2660 | int patch_cm9780(struct snd_ac97 *ac97) |
2661 | { | 2661 | { |
2662 | unsigned short val; | 2662 | unsigned short val; |
2663 | 2663 | ||
@@ -2677,14 +2677,14 @@ int patch_cm9780(ac97_t *ac97) | |||
2677 | /* | 2677 | /* |
2678 | * VIA VT1616 codec | 2678 | * VIA VT1616 codec |
2679 | */ | 2679 | */ |
2680 | static const snd_kcontrol_new_t snd_ac97_controls_vt1616[] = { | 2680 | static const struct snd_kcontrol_new snd_ac97_controls_vt1616[] = { |
2681 | AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0), | 2681 | AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0), |
2682 | AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0), | 2682 | AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0), |
2683 | AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0), | 2683 | AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0), |
2684 | AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0), | 2684 | AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0), |
2685 | }; | 2685 | }; |
2686 | 2686 | ||
2687 | static int patch_vt1616_specific(ac97_t * ac97) | 2687 | static int patch_vt1616_specific(struct snd_ac97 * ac97) |
2688 | { | 2688 | { |
2689 | int err; | 2689 | int err; |
2690 | 2690 | ||
@@ -2700,7 +2700,7 @@ static struct snd_ac97_build_ops patch_vt1616_ops = { | |||
2700 | .build_specific = patch_vt1616_specific | 2700 | .build_specific = patch_vt1616_specific |
2701 | }; | 2701 | }; |
2702 | 2702 | ||
2703 | int patch_vt1616(ac97_t * ac97) | 2703 | int patch_vt1616(struct snd_ac97 * ac97) |
2704 | { | 2704 | { |
2705 | ac97->build_ops = &patch_vt1616_ops; | 2705 | ac97->build_ops = &patch_vt1616_ops; |
2706 | return 0; | 2706 | return 0; |
@@ -2709,7 +2709,7 @@ int patch_vt1616(ac97_t * ac97) | |||
2709 | /* | 2709 | /* |
2710 | * VT1617A codec | 2710 | * VT1617A codec |
2711 | */ | 2711 | */ |
2712 | int patch_vt1617a(ac97_t * ac97) | 2712 | int patch_vt1617a(struct snd_ac97 * ac97) |
2713 | { | 2713 | { |
2714 | ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ | 2714 | ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */ |
2715 | ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; | 2715 | ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; |
@@ -2718,7 +2718,7 @@ int patch_vt1617a(ac97_t * ac97) | |||
2718 | 2718 | ||
2719 | /* | 2719 | /* |
2720 | */ | 2720 | */ |
2721 | static void it2646_update_jacks(ac97_t *ac97) | 2721 | static void it2646_update_jacks(struct snd_ac97 *ac97) |
2722 | { | 2722 | { |
2723 | /* shared Line-In */ | 2723 | /* shared Line-In */ |
2724 | snd_ac97_update_bits(ac97, 0x76, 1 << 9, | 2724 | snd_ac97_update_bits(ac97, 0x76, 1 << 9, |
@@ -2728,18 +2728,18 @@ static void it2646_update_jacks(ac97_t *ac97) | |||
2728 | is_shared_micin(ac97) ? (1<<10) : 0); | 2728 | is_shared_micin(ac97) ? (1<<10) : 0); |
2729 | } | 2729 | } |
2730 | 2730 | ||
2731 | static const snd_kcontrol_new_t snd_ac97_controls_it2646[] = { | 2731 | static const struct snd_kcontrol_new snd_ac97_controls_it2646[] = { |
2732 | AC97_SURROUND_JACK_MODE_CTL, | 2732 | AC97_SURROUND_JACK_MODE_CTL, |
2733 | AC97_CHANNEL_MODE_CTL, | 2733 | AC97_CHANNEL_MODE_CTL, |
2734 | }; | 2734 | }; |
2735 | 2735 | ||
2736 | static const snd_kcontrol_new_t snd_ac97_spdif_controls_it2646[] = { | 2736 | static const struct snd_kcontrol_new snd_ac97_spdif_controls_it2646[] = { |
2737 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0x76, 11, 1, 0), | 2737 | AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0x76, 11, 1, 0), |
2738 | AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0), | 2738 | AC97_SINGLE("Analog to IEC958 Output", 0x76, 12, 1, 0), |
2739 | AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0), | 2739 | AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0), |
2740 | }; | 2740 | }; |
2741 | 2741 | ||
2742 | static int patch_it2646_specific(ac97_t * ac97) | 2742 | static int patch_it2646_specific(struct snd_ac97 * ac97) |
2743 | { | 2743 | { |
2744 | int err; | 2744 | int err; |
2745 | if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0) | 2745 | if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0) |
@@ -2754,7 +2754,7 @@ static struct snd_ac97_build_ops patch_it2646_ops = { | |||
2754 | .update_jacks = it2646_update_jacks | 2754 | .update_jacks = it2646_update_jacks |
2755 | }; | 2755 | }; |
2756 | 2756 | ||
2757 | int patch_it2646(ac97_t * ac97) | 2757 | int patch_it2646(struct snd_ac97 * ac97) |
2758 | { | 2758 | { |
2759 | ac97->build_ops = &patch_it2646_ops; | 2759 | ac97->build_ops = &patch_it2646_ops; |
2760 | /* full DAC volume */ | 2760 | /* full DAC volume */ |
@@ -2770,11 +2770,11 @@ int patch_it2646(ac97_t * ac97) | |||
2770 | #define AC97_SI3036_CHIP_ID 0x5a | 2770 | #define AC97_SI3036_CHIP_ID 0x5a |
2771 | #define AC97_SI3036_LINE_CFG 0x5c | 2771 | #define AC97_SI3036_LINE_CFG 0x5c |
2772 | 2772 | ||
2773 | static const snd_kcontrol_new_t snd_ac97_controls_si3036[] = { | 2773 | static const struct snd_kcontrol_new snd_ac97_controls_si3036[] = { |
2774 | AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1) | 2774 | AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1) |
2775 | }; | 2775 | }; |
2776 | 2776 | ||
2777 | static int patch_si3036_specific(ac97_t * ac97) | 2777 | static int patch_si3036_specific(struct snd_ac97 * ac97) |
2778 | { | 2778 | { |
2779 | int idx, err; | 2779 | int idx, err; |
2780 | for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) | 2780 | for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++) |
@@ -2787,7 +2787,7 @@ static struct snd_ac97_build_ops patch_si3036_ops = { | |||
2787 | .build_specific = patch_si3036_specific, | 2787 | .build_specific = patch_si3036_specific, |
2788 | }; | 2788 | }; |
2789 | 2789 | ||
2790 | int mpatch_si3036(ac97_t * ac97) | 2790 | int mpatch_si3036(struct snd_ac97 * ac97) |
2791 | { | 2791 | { |
2792 | ac97->build_ops = &patch_si3036_ops; | 2792 | ac97->build_ops = &patch_si3036_ops; |
2793 | snd_ac97_write_cache(ac97, 0x5c, 0xf210 ); | 2793 | snd_ac97_write_cache(ac97, 0x5c, 0xf210 ); |