aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/ppc/awacs.c175
-rw-r--r--sound/ppc/beep.c34
-rw-r--r--sound/ppc/burgundy.c75
-rw-r--r--sound/ppc/daca.c72
-rw-r--r--sound/ppc/keywest.c6
-rw-r--r--sound/ppc/pmac.c202
-rw-r--r--sound/ppc/pmac.h93
-rw-r--r--sound/ppc/powermac.c6
-rw-r--r--sound/ppc/toonie.c32
-rw-r--r--sound/ppc/tumbler.c244
10 files changed, 503 insertions, 436 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 758ca1bcbcf2..82d791be7499 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -35,18 +35,18 @@
35#endif 35#endif
36 36
37#ifdef PMAC_AMP_AVAIL 37#ifdef PMAC_AMP_AVAIL
38typedef struct awacs_amp { 38struct awacs_amp {
39 unsigned char amp_master; 39 unsigned char amp_master;
40 unsigned char amp_vol[2][2]; 40 unsigned char amp_vol[2][2];
41 unsigned char amp_tone[2]; 41 unsigned char amp_tone[2];
42} awacs_amp_t; 42};
43 43
44#define CHECK_CUDA_AMP() (sys_ctrler == SYS_CTRLER_CUDA) 44#define CHECK_CUDA_AMP() (sys_ctrler == SYS_CTRLER_CUDA)
45 45
46#endif /* PMAC_AMP_AVAIL */ 46#endif /* PMAC_AMP_AVAIL */
47 47
48 48
49static void snd_pmac_screamer_wait(pmac_t *chip) 49static void snd_pmac_screamer_wait(struct snd_pmac *chip)
50{ 50{
51 long timeout = 2000; 51 long timeout = 2000;
52 while (!(in_le32(&chip->awacs->codec_stat) & MASK_VALID)) { 52 while (!(in_le32(&chip->awacs->codec_stat) & MASK_VALID)) {
@@ -62,7 +62,7 @@ static void snd_pmac_screamer_wait(pmac_t *chip)
62 * write AWACS register 62 * write AWACS register
63 */ 63 */
64static void 64static void
65snd_pmac_awacs_write(pmac_t *chip, int val) 65snd_pmac_awacs_write(struct snd_pmac *chip, int val)
66{ 66{
67 long timeout = 5000000; 67 long timeout = 5000000;
68 68
@@ -78,21 +78,21 @@ snd_pmac_awacs_write(pmac_t *chip, int val)
78} 78}
79 79
80static void 80static void
81snd_pmac_awacs_write_reg(pmac_t *chip, int reg, int val) 81snd_pmac_awacs_write_reg(struct snd_pmac *chip, int reg, int val)
82{ 82{
83 snd_pmac_awacs_write(chip, val | (reg << 12)); 83 snd_pmac_awacs_write(chip, val | (reg << 12));
84 chip->awacs_reg[reg] = val; 84 chip->awacs_reg[reg] = val;
85} 85}
86 86
87static void 87static void
88snd_pmac_awacs_write_noreg(pmac_t *chip, int reg, int val) 88snd_pmac_awacs_write_noreg(struct snd_pmac *chip, int reg, int val)
89{ 89{
90 snd_pmac_awacs_write(chip, val | (reg << 12)); 90 snd_pmac_awacs_write(chip, val | (reg << 12));
91} 91}
92 92
93#ifdef CONFIG_PM 93#ifdef CONFIG_PM
94/* Recalibrate chip */ 94/* Recalibrate chip */
95static void screamer_recalibrate(pmac_t *chip) 95static void screamer_recalibrate(struct snd_pmac *chip)
96{ 96{
97 if (chip->model != PMAC_SCREAMER) 97 if (chip->model != PMAC_SCREAMER)
98 return; 98 return;
@@ -105,7 +105,8 @@ static void screamer_recalibrate(pmac_t *chip)
105 /* delay for broken crystal part */ 105 /* delay for broken crystal part */
106 msleep(750); 106 msleep(750);
107 snd_pmac_awacs_write_noreg(chip, 1, 107 snd_pmac_awacs_write_noreg(chip, 1,
108 chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE); 108 chip->awacs_reg[1] | MASK_RECALIBRATE |
109 MASK_CMUTE | MASK_AMUTE);
109 snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); 110 snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
110 snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]); 111 snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]);
111} 112}
@@ -118,7 +119,7 @@ static void screamer_recalibrate(pmac_t *chip)
118/* 119/*
119 * additional callback to set the pcm format 120 * additional callback to set the pcm format
120 */ 121 */
121static void snd_pmac_awacs_set_format(pmac_t *chip) 122static void snd_pmac_awacs_set_format(struct snd_pmac *chip)
122{ 123{
123 chip->awacs_reg[1] &= ~MASK_SAMPLERATE; 124 chip->awacs_reg[1] &= ~MASK_SAMPLERATE;
124 chip->awacs_reg[1] |= chip->rate_index << 3; 125 chip->awacs_reg[1] |= chip->rate_index << 3;
@@ -132,7 +133,8 @@ static void snd_pmac_awacs_set_format(pmac_t *chip)
132/* 133/*
133 * volumes: 0-15 stereo 134 * volumes: 0-15 stereo
134 */ 135 */
135static int snd_pmac_awacs_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 136static int snd_pmac_awacs_info_volume(struct snd_kcontrol *kcontrol,
137 struct snd_ctl_elem_info *uinfo)
136{ 138{
137 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 139 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
138 uinfo->count = 2; 140 uinfo->count = 2;
@@ -141,9 +143,10 @@ static int snd_pmac_awacs_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
141 return 0; 143 return 0;
142} 144}
143 145
144static int snd_pmac_awacs_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 146static int snd_pmac_awacs_get_volume(struct snd_kcontrol *kcontrol,
147 struct snd_ctl_elem_value *ucontrol)
145{ 148{
146 pmac_t *chip = snd_kcontrol_chip(kcontrol); 149 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
147 int reg = kcontrol->private_value & 0xff; 150 int reg = kcontrol->private_value & 0xff;
148 int lshift = (kcontrol->private_value >> 8) & 0xff; 151 int lshift = (kcontrol->private_value >> 8) & 0xff;
149 int inverted = (kcontrol->private_value >> 16) & 1; 152 int inverted = (kcontrol->private_value >> 16) & 1;
@@ -163,9 +166,10 @@ static int snd_pmac_awacs_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
163 return 0; 166 return 0;
164} 167}
165 168
166static int snd_pmac_awacs_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 169static int snd_pmac_awacs_put_volume(struct snd_kcontrol *kcontrol,
170 struct snd_ctl_elem_value *ucontrol)
167{ 171{
168 pmac_t *chip = snd_kcontrol_chip(kcontrol); 172 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
169 int reg = kcontrol->private_value & 0xff; 173 int reg = kcontrol->private_value & 0xff;
170 int lshift = (kcontrol->private_value >> 8) & 0xff; 174 int lshift = (kcontrol->private_value >> 8) & 0xff;
171 int inverted = (kcontrol->private_value >> 16) & 1; 175 int inverted = (kcontrol->private_value >> 16) & 1;
@@ -203,9 +207,10 @@ static int snd_pmac_awacs_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
203/* 207/*
204 * mute master/ogain for AWACS: mono 208 * mute master/ogain for AWACS: mono
205 */ 209 */
206static int snd_pmac_awacs_get_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 210static int snd_pmac_awacs_get_switch(struct snd_kcontrol *kcontrol,
211 struct snd_ctl_elem_value *ucontrol)
207{ 212{
208 pmac_t *chip = snd_kcontrol_chip(kcontrol); 213 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
209 int reg = kcontrol->private_value & 0xff; 214 int reg = kcontrol->private_value & 0xff;
210 int shift = (kcontrol->private_value >> 8) & 0xff; 215 int shift = (kcontrol->private_value >> 8) & 0xff;
211 int invert = (kcontrol->private_value >> 16) & 1; 216 int invert = (kcontrol->private_value >> 16) & 1;
@@ -221,9 +226,10 @@ static int snd_pmac_awacs_get_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
221 return 0; 226 return 0;
222} 227}
223 228
224static int snd_pmac_awacs_put_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 229static int snd_pmac_awacs_put_switch(struct snd_kcontrol *kcontrol,
230 struct snd_ctl_elem_value *ucontrol)
225{ 231{
226 pmac_t *chip = snd_kcontrol_chip(kcontrol); 232 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
227 int reg = kcontrol->private_value & 0xff; 233 int reg = kcontrol->private_value & 0xff;
228 int shift = (kcontrol->private_value >> 8) & 0xff; 234 int shift = (kcontrol->private_value >> 8) & 0xff;
229 int invert = (kcontrol->private_value >> 16) & 1; 235 int invert = (kcontrol->private_value >> 16) & 1;
@@ -268,7 +274,7 @@ static void awacs_set_cuda(int reg, int val)
268/* 274/*
269 * level = 0 - 14, 7 = 0 dB 275 * level = 0 - 14, 7 = 0 dB
270 */ 276 */
271static void awacs_amp_set_tone(awacs_amp_t *amp, int bass, int treble) 277static void awacs_amp_set_tone(struct awacs_amp *amp, int bass, int treble)
272{ 278{
273 amp->amp_tone[0] = bass; 279 amp->amp_tone[0] = bass;
274 amp->amp_tone[1] = treble; 280 amp->amp_tone[1] = treble;
@@ -282,7 +288,8 @@ static void awacs_amp_set_tone(awacs_amp_t *amp, int bass, int treble)
282/* 288/*
283 * vol = 0 - 31 (attenuation), 32 = mute bit, stereo 289 * vol = 0 - 31 (attenuation), 32 = mute bit, stereo
284 */ 290 */
285static int awacs_amp_set_vol(awacs_amp_t *amp, int index, int lvol, int rvol, int do_check) 291static int awacs_amp_set_vol(struct awacs_amp *amp, int index, int lvol, int rvol,
292 int do_check)
286{ 293{
287 if (do_check && amp->amp_vol[index][0] == lvol && 294 if (do_check && amp->amp_vol[index][0] == lvol &&
288 amp->amp_vol[index][1] == rvol) 295 amp->amp_vol[index][1] == rvol)
@@ -297,7 +304,7 @@ static int awacs_amp_set_vol(awacs_amp_t *amp, int index, int lvol, int rvol, in
297/* 304/*
298 * 0 = -79 dB, 79 = 0 dB, 99 = +20 dB 305 * 0 = -79 dB, 79 = 0 dB, 99 = +20 dB
299 */ 306 */
300static void awacs_amp_set_master(awacs_amp_t *amp, int vol) 307static void awacs_amp_set_master(struct awacs_amp *amp, int vol)
301{ 308{
302 amp->amp_master = vol; 309 amp->amp_master = vol;
303 if (vol <= 79) 310 if (vol <= 79)
@@ -307,9 +314,9 @@ static void awacs_amp_set_master(awacs_amp_t *amp, int vol)
307 awacs_set_cuda(1, vol); 314 awacs_set_cuda(1, vol);
308} 315}
309 316
310static void awacs_amp_free(pmac_t *chip) 317static void awacs_amp_free(struct snd_pmac *chip)
311{ 318{
312 awacs_amp_t *amp = chip->mixer_data; 319 struct awacs_amp *amp = chip->mixer_data;
313 snd_assert(amp, return); 320 snd_assert(amp, return);
314 kfree(amp); 321 kfree(amp);
315 chip->mixer_data = NULL; 322 chip->mixer_data = NULL;
@@ -320,7 +327,8 @@ static void awacs_amp_free(pmac_t *chip)
320/* 327/*
321 * mixer controls 328 * mixer controls
322 */ 329 */
323static int snd_pmac_awacs_info_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 330static int snd_pmac_awacs_info_volume_amp(struct snd_kcontrol *kcontrol,
331 struct snd_ctl_elem_info *uinfo)
324{ 332{
325 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 333 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
326 uinfo->count = 2; 334 uinfo->count = 2;
@@ -329,11 +337,12 @@ static int snd_pmac_awacs_info_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem
329 return 0; 337 return 0;
330} 338}
331 339
332static int snd_pmac_awacs_get_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 340static int snd_pmac_awacs_get_volume_amp(struct snd_kcontrol *kcontrol,
341 struct snd_ctl_elem_value *ucontrol)
333{ 342{
334 pmac_t *chip = snd_kcontrol_chip(kcontrol); 343 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
335 int index = kcontrol->private_value; 344 int index = kcontrol->private_value;
336 awacs_amp_t *amp = chip->mixer_data; 345 struct awacs_amp *amp = chip->mixer_data;
337 snd_assert(amp, return -EINVAL); 346 snd_assert(amp, return -EINVAL);
338 snd_assert(index >= 0 && index <= 1, return -EINVAL); 347 snd_assert(index >= 0 && index <= 1, return -EINVAL);
339 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31); 348 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31);
@@ -341,12 +350,13 @@ static int snd_pmac_awacs_get_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_
341 return 0; 350 return 0;
342} 351}
343 352
344static int snd_pmac_awacs_put_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 353static int snd_pmac_awacs_put_volume_amp(struct snd_kcontrol *kcontrol,
354 struct snd_ctl_elem_value *ucontrol)
345{ 355{
346 pmac_t *chip = snd_kcontrol_chip(kcontrol); 356 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
347 int index = kcontrol->private_value; 357 int index = kcontrol->private_value;
348 int vol[2]; 358 int vol[2];
349 awacs_amp_t *amp = chip->mixer_data; 359 struct awacs_amp *amp = chip->mixer_data;
350 snd_assert(amp, return -EINVAL); 360 snd_assert(amp, return -EINVAL);
351 snd_assert(index >= 0 && index <= 1, return -EINVAL); 361 snd_assert(index >= 0 && index <= 1, return -EINVAL);
352 362
@@ -355,11 +365,12 @@ static int snd_pmac_awacs_put_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_
355 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); 365 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1);
356} 366}
357 367
358static int snd_pmac_awacs_get_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 368static int snd_pmac_awacs_get_switch_amp(struct snd_kcontrol *kcontrol,
369 struct snd_ctl_elem_value *ucontrol)
359{ 370{
360 pmac_t *chip = snd_kcontrol_chip(kcontrol); 371 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
361 int index = kcontrol->private_value; 372 int index = kcontrol->private_value;
362 awacs_amp_t *amp = chip->mixer_data; 373 struct awacs_amp *amp = chip->mixer_data;
363 snd_assert(amp, return -EINVAL); 374 snd_assert(amp, return -EINVAL);
364 snd_assert(index >= 0 && index <= 1, return -EINVAL); 375 snd_assert(index >= 0 && index <= 1, return -EINVAL);
365 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) ? 0 : 1; 376 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) ? 0 : 1;
@@ -367,12 +378,13 @@ static int snd_pmac_awacs_get_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_
367 return 0; 378 return 0;
368} 379}
369 380
370static int snd_pmac_awacs_put_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 381static int snd_pmac_awacs_put_switch_amp(struct snd_kcontrol *kcontrol,
382 struct snd_ctl_elem_value *ucontrol)
371{ 383{
372 pmac_t *chip = snd_kcontrol_chip(kcontrol); 384 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
373 int index = kcontrol->private_value; 385 int index = kcontrol->private_value;
374 int vol[2]; 386 int vol[2];
375 awacs_amp_t *amp = chip->mixer_data; 387 struct awacs_amp *amp = chip->mixer_data;
376 snd_assert(amp, return -EINVAL); 388 snd_assert(amp, return -EINVAL);
377 snd_assert(index >= 0 && index <= 1, return -EINVAL); 389 snd_assert(index >= 0 && index <= 1, return -EINVAL);
378 390
@@ -381,7 +393,8 @@ static int snd_pmac_awacs_put_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_
381 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); 393 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1);
382} 394}
383 395
384static int snd_pmac_awacs_info_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 396static int snd_pmac_awacs_info_tone_amp(struct snd_kcontrol *kcontrol,
397 struct snd_ctl_elem_info *uinfo)
385{ 398{
386 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 399 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
387 uinfo->count = 1; 400 uinfo->count = 1;
@@ -390,22 +403,24 @@ static int snd_pmac_awacs_info_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
390 return 0; 403 return 0;
391} 404}
392 405
393static int snd_pmac_awacs_get_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 406static int snd_pmac_awacs_get_tone_amp(struct snd_kcontrol *kcontrol,
407 struct snd_ctl_elem_value *ucontrol)
394{ 408{
395 pmac_t *chip = snd_kcontrol_chip(kcontrol); 409 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
396 int index = kcontrol->private_value; 410 int index = kcontrol->private_value;
397 awacs_amp_t *amp = chip->mixer_data; 411 struct awacs_amp *amp = chip->mixer_data;
398 snd_assert(amp, return -EINVAL); 412 snd_assert(amp, return -EINVAL);
399 snd_assert(index >= 0 && index <= 1, return -EINVAL); 413 snd_assert(index >= 0 && index <= 1, return -EINVAL);
400 ucontrol->value.integer.value[0] = amp->amp_tone[index]; 414 ucontrol->value.integer.value[0] = amp->amp_tone[index];
401 return 0; 415 return 0;
402} 416}
403 417
404static int snd_pmac_awacs_put_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 418static int snd_pmac_awacs_put_tone_amp(struct snd_kcontrol *kcontrol,
419 struct snd_ctl_elem_value *ucontrol)
405{ 420{
406 pmac_t *chip = snd_kcontrol_chip(kcontrol); 421 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
407 int index = kcontrol->private_value; 422 int index = kcontrol->private_value;
408 awacs_amp_t *amp = chip->mixer_data; 423 struct awacs_amp *amp = chip->mixer_data;
409 snd_assert(amp, return -EINVAL); 424 snd_assert(amp, return -EINVAL);
410 snd_assert(index >= 0 && index <= 1, return -EINVAL); 425 snd_assert(index >= 0 && index <= 1, return -EINVAL);
411 if (ucontrol->value.integer.value[0] != amp->amp_tone[index]) { 426 if (ucontrol->value.integer.value[0] != amp->amp_tone[index]) {
@@ -416,7 +431,8 @@ static int snd_pmac_awacs_put_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_va
416 return 0; 431 return 0;
417} 432}
418 433
419static int snd_pmac_awacs_info_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 434static int snd_pmac_awacs_info_master_amp(struct snd_kcontrol *kcontrol,
435 struct snd_ctl_elem_info *uinfo)
420{ 436{
421 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 437 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
422 uinfo->count = 1; 438 uinfo->count = 1;
@@ -425,19 +441,21 @@ static int snd_pmac_awacs_info_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem
425 return 0; 441 return 0;
426} 442}
427 443
428static int snd_pmac_awacs_get_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 444static int snd_pmac_awacs_get_master_amp(struct snd_kcontrol *kcontrol,
445 struct snd_ctl_elem_value *ucontrol)
429{ 446{
430 pmac_t *chip = snd_kcontrol_chip(kcontrol); 447 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
431 awacs_amp_t *amp = chip->mixer_data; 448 struct awacs_amp *amp = chip->mixer_data;
432 snd_assert(amp, return -EINVAL); 449 snd_assert(amp, return -EINVAL);
433 ucontrol->value.integer.value[0] = amp->amp_master; 450 ucontrol->value.integer.value[0] = amp->amp_master;
434 return 0; 451 return 0;
435} 452}
436 453
437static int snd_pmac_awacs_put_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 454static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,
455 struct snd_ctl_elem_value *ucontrol)
438{ 456{
439 pmac_t *chip = snd_kcontrol_chip(kcontrol); 457 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
440 awacs_amp_t *amp = chip->mixer_data; 458 struct awacs_amp *amp = chip->mixer_data;
441 snd_assert(amp, return -EINVAL); 459 snd_assert(amp, return -EINVAL);
442 if (ucontrol->value.integer.value[0] != amp->amp_master) { 460 if (ucontrol->value.integer.value[0] != amp->amp_master) {
443 amp->amp_master = ucontrol->value.integer.value[0]; 461 amp->amp_master = ucontrol->value.integer.value[0];
@@ -450,7 +468,7 @@ static int snd_pmac_awacs_put_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_
450#define AMP_CH_SPK 0 468#define AMP_CH_SPK 0
451#define AMP_CH_HD 1 469#define AMP_CH_HD 1
452 470
453static snd_kcontrol_new_t snd_pmac_awacs_amp_vol[] __initdata = { 471static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] __initdata = {
454 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 472 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
455 .name = "PC Speaker Playback Volume", 473 .name = "PC Speaker Playback Volume",
456 .info = snd_pmac_awacs_info_volume_amp, 474 .info = snd_pmac_awacs_info_volume_amp,
@@ -487,7 +505,7 @@ static snd_kcontrol_new_t snd_pmac_awacs_amp_vol[] __initdata = {
487 }, 505 },
488}; 506};
489 507
490static snd_kcontrol_new_t snd_pmac_awacs_amp_hp_sw __initdata = { 508static struct snd_kcontrol_new snd_pmac_awacs_amp_hp_sw __initdata = {
491 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 509 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
492 .name = "Headphone Playback Switch", 510 .name = "Headphone Playback Switch",
493 .info = snd_pmac_boolean_stereo_info, 511 .info = snd_pmac_boolean_stereo_info,
@@ -496,7 +514,7 @@ static snd_kcontrol_new_t snd_pmac_awacs_amp_hp_sw __initdata = {
496 .private_value = AMP_CH_HD, 514 .private_value = AMP_CH_HD,
497}; 515};
498 516
499static snd_kcontrol_new_t snd_pmac_awacs_amp_spk_sw __initdata = { 517static struct snd_kcontrol_new snd_pmac_awacs_amp_spk_sw __initdata = {
500 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 518 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
501 .name = "PC Speaker Playback Switch", 519 .name = "PC Speaker Playback Switch",
502 .info = snd_pmac_boolean_stereo_info, 520 .info = snd_pmac_boolean_stereo_info,
@@ -511,7 +529,8 @@ static snd_kcontrol_new_t snd_pmac_awacs_amp_spk_sw __initdata = {
511/* 529/*
512 * mic boost for screamer 530 * mic boost for screamer
513 */ 531 */
514static int snd_pmac_screamer_mic_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 532static int snd_pmac_screamer_mic_boost_info(struct snd_kcontrol *kcontrol,
533 struct snd_ctl_elem_info *uinfo)
515{ 534{
516 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 535 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
517 uinfo->count = 1; 536 uinfo->count = 1;
@@ -520,9 +539,10 @@ static int snd_pmac_screamer_mic_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_el
520 return 0; 539 return 0;
521} 540}
522 541
523static int snd_pmac_screamer_mic_boost_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 542static int snd_pmac_screamer_mic_boost_get(struct snd_kcontrol *kcontrol,
543 struct snd_ctl_elem_value *ucontrol)
524{ 544{
525 pmac_t *chip = snd_kcontrol_chip(kcontrol); 545 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
526 int val; 546 int val;
527 unsigned long flags; 547 unsigned long flags;
528 548
@@ -538,9 +558,10 @@ static int snd_pmac_screamer_mic_boost_get(snd_kcontrol_t *kcontrol, snd_ctl_ele
538 return 0; 558 return 0;
539} 559}
540 560
541static int snd_pmac_screamer_mic_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 561static int snd_pmac_screamer_mic_boost_put(struct snd_kcontrol *kcontrol,
562 struct snd_ctl_elem_value *ucontrol)
542{ 563{
543 pmac_t *chip = snd_kcontrol_chip(kcontrol); 564 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
544 int changed = 0; 565 int changed = 0;
545 int val0, val6; 566 int val0, val6;
546 unsigned long flags; 567 unsigned long flags;
@@ -568,7 +589,7 @@ static int snd_pmac_screamer_mic_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_ele
568/* 589/*
569 * lists of mixer elements 590 * lists of mixer elements
570 */ 591 */
571static snd_kcontrol_new_t snd_pmac_awacs_mixers[] __initdata = { 592static struct snd_kcontrol_new snd_pmac_awacs_mixers[] __initdata = {
572 AWACS_VOLUME("Master Playback Volume", 2, 6, 1), 593 AWACS_VOLUME("Master Playback Volume", 2, 6, 1),
573 AWACS_SWITCH("Master Capture Switch", 1, SHIFT_LOOPTHRU, 0), 594 AWACS_SWITCH("Master Capture Switch", 1, SHIFT_LOOPTHRU, 0),
574 AWACS_VOLUME("Capture Volume", 0, 4, 0), 595 AWACS_VOLUME("Capture Volume", 0, 4, 0),
@@ -578,24 +599,24 @@ static snd_kcontrol_new_t snd_pmac_awacs_mixers[] __initdata = {
578/* FIXME: is this correct order? 599/* FIXME: is this correct order?
579 * screamer (powerbook G3 pismo) seems to have different bits... 600 * screamer (powerbook G3 pismo) seems to have different bits...
580 */ 601 */
581static snd_kcontrol_new_t snd_pmac_awacs_mixers2[] __initdata = { 602static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] __initdata = {
582 AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_LINE, 0), 603 AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_LINE, 0),
583 AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_MIC, 0), 604 AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_MIC, 0),
584}; 605};
585 606
586static snd_kcontrol_new_t snd_pmac_screamer_mixers2[] __initdata = { 607static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] __initdata = {
587 AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), 608 AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),
588 AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0), 609 AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0),
589}; 610};
590 611
591static snd_kcontrol_new_t snd_pmac_awacs_master_sw __initdata = 612static struct snd_kcontrol_new snd_pmac_awacs_master_sw __initdata =
592AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1); 613AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1);
593 614
594static snd_kcontrol_new_t snd_pmac_awacs_mic_boost[] __initdata = { 615static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] __initdata = {
595 AWACS_SWITCH("Mic Boost", 0, SHIFT_GAINLINE, 0), 616 AWACS_SWITCH("Mic Boost", 0, SHIFT_GAINLINE, 0),
596}; 617};
597 618
598static snd_kcontrol_new_t snd_pmac_screamer_mic_boost[] __initdata = { 619static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] __initdata = {
599 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 620 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
600 .name = "Mic Boost", 621 .name = "Mic Boost",
601 .info = snd_pmac_screamer_mic_boost_info, 622 .info = snd_pmac_screamer_mic_boost_info,
@@ -604,17 +625,17 @@ static snd_kcontrol_new_t snd_pmac_screamer_mic_boost[] __initdata = {
604 }, 625 },
605}; 626};
606 627
607static snd_kcontrol_new_t snd_pmac_awacs_speaker_vol[] __initdata = { 628static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] __initdata = {
608 AWACS_VOLUME("PC Speaker Playback Volume", 4, 6, 1), 629 AWACS_VOLUME("PC Speaker Playback Volume", 4, 6, 1),
609}; 630};
610static snd_kcontrol_new_t snd_pmac_awacs_speaker_sw __initdata = 631static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata =
611AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1); 632AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1);
612 633
613 634
614/* 635/*
615 * add new mixer elements to the card 636 * add new mixer elements to the card
616 */ 637 */
617static int build_mixers(pmac_t *chip, int nums, snd_kcontrol_new_t *mixers) 638static int build_mixers(struct snd_pmac *chip, int nums, struct snd_kcontrol_new *mixers)
618{ 639{
619 int i, err; 640 int i, err;
620 641
@@ -629,7 +650,7 @@ static int build_mixers(pmac_t *chip, int nums, snd_kcontrol_new_t *mixers)
629/* 650/*
630 * restore all registers 651 * restore all registers
631 */ 652 */
632static void awacs_restore_all_regs(pmac_t *chip) 653static void awacs_restore_all_regs(struct snd_pmac *chip)
633{ 654{
634 snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]); 655 snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]);
635 snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); 656 snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
@@ -643,13 +664,13 @@ static void awacs_restore_all_regs(pmac_t *chip)
643} 664}
644 665
645#ifdef CONFIG_PM 666#ifdef CONFIG_PM
646static void snd_pmac_awacs_suspend(pmac_t *chip) 667static void snd_pmac_awacs_suspend(struct snd_pmac *chip)
647{ 668{
648 snd_pmac_awacs_write_noreg(chip, 1, (chip->awacs_reg[1] 669 snd_pmac_awacs_write_noreg(chip, 1, (chip->awacs_reg[1]
649 | MASK_AMUTE | MASK_CMUTE)); 670 | MASK_AMUTE | MASK_CMUTE));
650} 671}
651 672
652static void snd_pmac_awacs_resume(pmac_t *chip) 673static void snd_pmac_awacs_resume(struct snd_pmac *chip)
653{ 674{
654 if (machine_is_compatible("PowerBook3,1") 675 if (machine_is_compatible("PowerBook3,1")
655 || machine_is_compatible("PowerBook3,2")) { 676 || machine_is_compatible("PowerBook3,2")) {
@@ -668,7 +689,7 @@ static void snd_pmac_awacs_resume(pmac_t *chip)
668 screamer_recalibrate(chip); 689 screamer_recalibrate(chip);
669#ifdef PMAC_AMP_AVAIL 690#ifdef PMAC_AMP_AVAIL
670 if (chip->mixer_data) { 691 if (chip->mixer_data) {
671 awacs_amp_t *amp = chip->mixer_data; 692 struct awacs_amp *amp = chip->mixer_data;
672 awacs_amp_set_vol(amp, 0, amp->amp_vol[0][0], amp->amp_vol[0][1], 0); 693 awacs_amp_set_vol(amp, 0, amp->amp_vol[0][0], amp->amp_vol[0][1], 0);
673 awacs_amp_set_vol(amp, 1, amp->amp_vol[1][0], amp->amp_vol[1][1], 0); 694 awacs_amp_set_vol(amp, 1, amp->amp_vol[1][0], amp->amp_vol[1][1], 0);
674 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]); 695 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]);
@@ -682,13 +703,13 @@ static void snd_pmac_awacs_resume(pmac_t *chip)
682/* 703/*
683 * auto-mute stuffs 704 * auto-mute stuffs
684 */ 705 */
685static int snd_pmac_awacs_detect_headphone(pmac_t *chip) 706static int snd_pmac_awacs_detect_headphone(struct snd_pmac *chip)
686{ 707{
687 return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0; 708 return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0;
688} 709}
689 710
690#ifdef PMAC_AMP_AVAIL 711#ifdef PMAC_AMP_AVAIL
691static int toggle_amp_mute(awacs_amp_t *amp, int index, int mute) 712static int toggle_amp_mute(struct awacs_amp *amp, int index, int mute)
692{ 713{
693 int vol[2]; 714 int vol[2];
694 vol[0] = amp->amp_vol[index][0] & 31; 715 vol[0] = amp->amp_vol[index][0] & 31;
@@ -701,12 +722,12 @@ static int toggle_amp_mute(awacs_amp_t *amp, int index, int mute)
701} 722}
702#endif 723#endif
703 724
704static void snd_pmac_awacs_update_automute(pmac_t *chip, int do_notify) 725static void snd_pmac_awacs_update_automute(struct snd_pmac *chip, int do_notify)
705{ 726{
706 if (chip->auto_mute) { 727 if (chip->auto_mute) {
707#ifdef PMAC_AMP_AVAIL 728#ifdef PMAC_AMP_AVAIL
708 if (chip->mixer_data) { 729 if (chip->mixer_data) {
709 awacs_amp_t *amp = chip->mixer_data; 730 struct awacs_amp *amp = chip->mixer_data;
710 int changed; 731 int changed;
711 if (snd_pmac_awacs_detect_headphone(chip)) { 732 if (snd_pmac_awacs_detect_headphone(chip)) {
712 changed = toggle_amp_mute(amp, AMP_CH_HD, 0); 733 changed = toggle_amp_mute(amp, AMP_CH_HD, 0);
@@ -746,7 +767,7 @@ static void snd_pmac_awacs_update_automute(pmac_t *chip, int do_notify)
746 * initialize chip 767 * initialize chip
747 */ 768 */
748int __init 769int __init
749snd_pmac_awacs_init(pmac_t *chip) 770snd_pmac_awacs_init(struct snd_pmac *chip)
750{ 771{
751 int err, vol; 772 int err, vol;
752 773
@@ -780,7 +801,7 @@ snd_pmac_awacs_init(pmac_t *chip)
780 chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf; 801 chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
781#ifdef PMAC_AMP_AVAIL 802#ifdef PMAC_AMP_AVAIL
782 if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) { 803 if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
783 awacs_amp_t *amp = kmalloc(sizeof(*amp), GFP_KERNEL); 804 struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
784 if (! amp) 805 if (! amp)
785 return -ENOMEM; 806 return -ENOMEM;
786 chip->mixer_data = amp; 807 chip->mixer_data = amp;
diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c
index d4ec6cc3f1c5..5fec1e58f310 100644
--- a/sound/ppc/beep.c
+++ b/sound/ppc/beep.c
@@ -30,7 +30,7 @@
30#include <sound/control.h> 30#include <sound/control.h>
31#include "pmac.h" 31#include "pmac.h"
32 32
33struct snd_pmac_beep { 33struct pmac_beep {
34 int running; /* boolean */ 34 int running; /* boolean */
35 int volume; /* mixer volume: 0-100 */ 35 int volume; /* mixer volume: 0-100 */
36 int volume_play; /* currently playing volume */ 36 int volume_play; /* currently playing volume */
@@ -44,9 +44,9 @@ struct snd_pmac_beep {
44/* 44/*
45 * stop beep if running 45 * stop beep if running
46 */ 46 */
47void snd_pmac_beep_stop(pmac_t *chip) 47void snd_pmac_beep_stop(struct snd_pmac *chip)
48{ 48{
49 pmac_beep_t *beep = chip->beep; 49 struct pmac_beep *beep = chip->beep;
50 if (beep && beep->running) { 50 if (beep && beep->running) {
51 beep->running = 0; 51 beep->running = 0;
52 snd_pmac_beep_dma_stop(chip); 52 snd_pmac_beep_dma_stop(chip);
@@ -97,10 +97,11 @@ static short beep_wform[256] = {
97#define BEEP_BUFLEN 512 97#define BEEP_BUFLEN 512
98#define BEEP_VOLUME 15 /* 0 - 100 */ 98#define BEEP_VOLUME 15 /* 0 - 100 */
99 99
100static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigned int code, int hz) 100static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type,
101 unsigned int code, int hz)
101{ 102{
102 pmac_t *chip; 103 struct snd_pmac *chip;
103 pmac_beep_t *beep; 104 struct pmac_beep *beep;
104 unsigned long flags; 105 unsigned long flags;
105 int beep_speed = 0; 106 int beep_speed = 0;
106 int srate; 107 int srate;
@@ -171,7 +172,8 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigne
171 * beep volume mixer 172 * beep volume mixer
172 */ 173 */
173 174
174static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 175static int snd_pmac_info_beep(struct snd_kcontrol *kcontrol,
176 struct snd_ctl_elem_info *uinfo)
175{ 177{
176 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 178 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
177 uinfo->count = 1; 179 uinfo->count = 1;
@@ -180,17 +182,19 @@ static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
180 return 0; 182 return 0;
181} 183}
182 184
183static int snd_pmac_get_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 185static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol,
186 struct snd_ctl_elem_value *ucontrol)
184{ 187{
185 pmac_t *chip = snd_kcontrol_chip(kcontrol); 188 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
186 snd_assert(chip->beep, return -ENXIO); 189 snd_assert(chip->beep, return -ENXIO);
187 ucontrol->value.integer.value[0] = chip->beep->volume; 190 ucontrol->value.integer.value[0] = chip->beep->volume;
188 return 0; 191 return 0;
189} 192}
190 193
191static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 194static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol,
195 struct snd_ctl_elem_value *ucontrol)
192{ 196{
193 pmac_t *chip = snd_kcontrol_chip(kcontrol); 197 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
194 int oval; 198 int oval;
195 snd_assert(chip->beep, return -ENXIO); 199 snd_assert(chip->beep, return -ENXIO);
196 oval = chip->beep->volume; 200 oval = chip->beep->volume;
@@ -198,7 +202,7 @@ static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
198 return oval != chip->beep->volume; 202 return oval != chip->beep->volume;
199} 203}
200 204
201static snd_kcontrol_new_t snd_pmac_beep_mixer = { 205static struct snd_kcontrol_new snd_pmac_beep_mixer = {
202 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 206 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
203 .name = "Beep Playback Volume", 207 .name = "Beep Playback Volume",
204 .info = snd_pmac_info_beep, 208 .info = snd_pmac_info_beep,
@@ -207,9 +211,9 @@ static snd_kcontrol_new_t snd_pmac_beep_mixer = {
207}; 211};
208 212
209/* Initialize beep stuff */ 213/* Initialize beep stuff */
210int __init snd_pmac_attach_beep(pmac_t *chip) 214int __init snd_pmac_attach_beep(struct snd_pmac *chip)
211{ 215{
212 pmac_beep_t *beep; 216 struct pmac_beep *beep;
213 struct input_dev *input_dev; 217 struct input_dev *input_dev;
214 void *dmabuf; 218 void *dmabuf;
215 int err = -ENOMEM; 219 int err = -ENOMEM;
@@ -255,7 +259,7 @@ int __init snd_pmac_attach_beep(pmac_t *chip)
255 return err; 259 return err;
256} 260}
257 261
258void snd_pmac_detach_beep(pmac_t *chip) 262void snd_pmac_detach_beep(struct snd_pmac *chip)
259{ 263{
260 if (chip->beep) { 264 if (chip->beep) {
261 input_unregister_device(chip->beep->dev); 265 input_unregister_device(chip->beep->dev);
diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c
index edbc0484e22a..e02263fe44dc 100644
--- a/sound/ppc/burgundy.c
+++ b/sound/ppc/burgundy.c
@@ -31,7 +31,7 @@
31 31
32/* Waits for busy flag to clear */ 32/* Waits for busy flag to clear */
33static inline void 33static inline void
34snd_pmac_burgundy_busy_wait(pmac_t *chip) 34snd_pmac_burgundy_busy_wait(struct snd_pmac *chip)
35{ 35{
36 int timeout = 50; 36 int timeout = 50;
37 while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--) 37 while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
@@ -41,7 +41,7 @@ snd_pmac_burgundy_busy_wait(pmac_t *chip)
41} 41}
42 42
43static inline void 43static inline void
44snd_pmac_burgundy_extend_wait(pmac_t *chip) 44snd_pmac_burgundy_extend_wait(struct snd_pmac *chip)
45{ 45{
46 int timeout; 46 int timeout;
47 timeout = 50; 47 timeout = 50;
@@ -57,7 +57,7 @@ snd_pmac_burgundy_extend_wait(pmac_t *chip)
57} 57}
58 58
59static void 59static void
60snd_pmac_burgundy_wcw(pmac_t *chip, unsigned addr, unsigned val) 60snd_pmac_burgundy_wcw(struct snd_pmac *chip, unsigned addr, unsigned val)
61{ 61{
62 out_le32(&chip->awacs->codec_ctrl, addr + 0x200c00 + (val & 0xff)); 62 out_le32(&chip->awacs->codec_ctrl, addr + 0x200c00 + (val & 0xff));
63 snd_pmac_burgundy_busy_wait(chip); 63 snd_pmac_burgundy_busy_wait(chip);
@@ -70,7 +70,7 @@ snd_pmac_burgundy_wcw(pmac_t *chip, unsigned addr, unsigned val)
70} 70}
71 71
72static unsigned 72static unsigned
73snd_pmac_burgundy_rcw(pmac_t *chip, unsigned addr) 73snd_pmac_burgundy_rcw(struct snd_pmac *chip, unsigned addr)
74{ 74{
75 unsigned val = 0; 75 unsigned val = 0;
76 unsigned long flags; 76 unsigned long flags;
@@ -103,14 +103,14 @@ snd_pmac_burgundy_rcw(pmac_t *chip, unsigned addr)
103} 103}
104 104
105static void 105static void
106snd_pmac_burgundy_wcb(pmac_t *chip, unsigned int addr, unsigned int val) 106snd_pmac_burgundy_wcb(struct snd_pmac *chip, unsigned int addr, unsigned int val)
107{ 107{
108 out_le32(&chip->awacs->codec_ctrl, addr + 0x300000 + (val & 0xff)); 108 out_le32(&chip->awacs->codec_ctrl, addr + 0x300000 + (val & 0xff));
109 snd_pmac_burgundy_busy_wait(chip); 109 snd_pmac_burgundy_busy_wait(chip);
110} 110}
111 111
112static unsigned 112static unsigned
113snd_pmac_burgundy_rcb(pmac_t *chip, unsigned int addr) 113snd_pmac_burgundy_rcb(struct snd_pmac *chip, unsigned int addr)
114{ 114{
115 unsigned val = 0; 115 unsigned val = 0;
116 unsigned long flags; 116 unsigned long flags;
@@ -131,7 +131,8 @@ snd_pmac_burgundy_rcb(pmac_t *chip, unsigned int addr)
131 * Burgundy volume: 0 - 100, stereo 131 * Burgundy volume: 0 - 100, stereo
132 */ 132 */
133static void 133static void
134snd_pmac_burgundy_write_volume(pmac_t *chip, unsigned int address, long *volume, int shift) 134snd_pmac_burgundy_write_volume(struct snd_pmac *chip, unsigned int address,
135 long *volume, int shift)
135{ 136{
136 int hardvolume, lvolume, rvolume; 137 int hardvolume, lvolume, rvolume;
137 138
@@ -146,7 +147,8 @@ snd_pmac_burgundy_write_volume(pmac_t *chip, unsigned int address, long *volume,
146} 147}
147 148
148static void 149static void
149snd_pmac_burgundy_read_volume(pmac_t *chip, unsigned int address, long *volume, int shift) 150snd_pmac_burgundy_read_volume(struct snd_pmac *chip, unsigned int address,
151 long *volume, int shift)
150{ 152{
151 int wvolume; 153 int wvolume;
152 154
@@ -171,7 +173,8 @@ snd_pmac_burgundy_read_volume(pmac_t *chip, unsigned int address, long *volume,
171#define BASE2ADDR(base) ((base) << 12) 173#define BASE2ADDR(base) ((base) << 12)
172#define ADDR2BASE(addr) ((addr) >> 12) 174#define ADDR2BASE(addr) ((addr) >> 12)
173 175
174static int snd_pmac_burgundy_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 176static int snd_pmac_burgundy_info_volume(struct snd_kcontrol *kcontrol,
177 struct snd_ctl_elem_info *uinfo)
175{ 178{
176 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 179 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
177 uinfo->count = 2; 180 uinfo->count = 2;
@@ -180,23 +183,27 @@ static int snd_pmac_burgundy_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_
180 return 0; 183 return 0;
181} 184}
182 185
183static int snd_pmac_burgundy_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 186static int snd_pmac_burgundy_get_volume(struct snd_kcontrol *kcontrol,
187 struct snd_ctl_elem_value *ucontrol)
184{ 188{
185 pmac_t *chip = snd_kcontrol_chip(kcontrol); 189 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
186 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff); 190 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
187 int shift = (kcontrol->private_value >> 8) & 0xff; 191 int shift = (kcontrol->private_value >> 8) & 0xff;
188 snd_pmac_burgundy_read_volume(chip, addr, ucontrol->value.integer.value, shift); 192 snd_pmac_burgundy_read_volume(chip, addr, ucontrol->value.integer.value,
193 shift);
189 return 0; 194 return 0;
190} 195}
191 196
192static int snd_pmac_burgundy_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 197static int snd_pmac_burgundy_put_volume(struct snd_kcontrol *kcontrol,
198 struct snd_ctl_elem_value *ucontrol)
193{ 199{
194 pmac_t *chip = snd_kcontrol_chip(kcontrol); 200 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
195 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff); 201 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
196 int shift = (kcontrol->private_value >> 8) & 0xff; 202 int shift = (kcontrol->private_value >> 8) & 0xff;
197 long nvoices[2]; 203 long nvoices[2];
198 204
199 snd_pmac_burgundy_write_volume(chip, addr, ucontrol->value.integer.value, shift); 205 snd_pmac_burgundy_write_volume(chip, addr, ucontrol->value.integer.value,
206 shift);
200 snd_pmac_burgundy_read_volume(chip, addr, nvoices, shift); 207 snd_pmac_burgundy_read_volume(chip, addr, nvoices, shift);
201 return (nvoices[0] != ucontrol->value.integer.value[0] || 208 return (nvoices[0] != ucontrol->value.integer.value[0] ||
202 nvoices[1] != ucontrol->value.integer.value[1]); 209 nvoices[1] != ucontrol->value.integer.value[1]);
@@ -211,7 +218,8 @@ static int snd_pmac_burgundy_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_v
211 218
212/* lineout/speaker */ 219/* lineout/speaker */
213 220
214static int snd_pmac_burgundy_info_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 221static int snd_pmac_burgundy_info_switch_out(struct snd_kcontrol *kcontrol,
222 struct snd_ctl_elem_info *uinfo)
215{ 223{
216 int stereo = (kcontrol->private_value >> 24) & 1; 224 int stereo = (kcontrol->private_value >> 24) & 1;
217 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 225 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -221,9 +229,10 @@ static int snd_pmac_burgundy_info_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_e
221 return 0; 229 return 0;
222} 230}
223 231
224static int snd_pmac_burgundy_get_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 232static int snd_pmac_burgundy_get_switch_out(struct snd_kcontrol *kcontrol,
233 struct snd_ctl_elem_value *ucontrol)
225{ 234{
226 pmac_t *chip = snd_kcontrol_chip(kcontrol); 235 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
227 int lmask = kcontrol->private_value & 0xff; 236 int lmask = kcontrol->private_value & 0xff;
228 int rmask = (kcontrol->private_value >> 8) & 0xff; 237 int rmask = (kcontrol->private_value >> 8) & 0xff;
229 int stereo = (kcontrol->private_value >> 24) & 1; 238 int stereo = (kcontrol->private_value >> 24) & 1;
@@ -234,9 +243,10 @@ static int snd_pmac_burgundy_get_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_el
234 return 0; 243 return 0;
235} 244}
236 245
237static int snd_pmac_burgundy_put_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 246static int snd_pmac_burgundy_put_switch_out(struct snd_kcontrol *kcontrol,
247 struct snd_ctl_elem_value *ucontrol)
238{ 248{
239 pmac_t *chip = snd_kcontrol_chip(kcontrol); 249 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
240 int lmask = kcontrol->private_value & 0xff; 250 int lmask = kcontrol->private_value & 0xff;
241 int rmask = (kcontrol->private_value >> 8) & 0xff; 251 int rmask = (kcontrol->private_value >> 8) & 0xff;
242 int stereo = (kcontrol->private_value >> 24) & 1; 252 int stereo = (kcontrol->private_value >> 24) & 1;
@@ -259,7 +269,8 @@ static int snd_pmac_burgundy_put_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_el
259 .private_value = ((lmask) | ((rmask) << 8) | ((stereo) << 24)) } 269 .private_value = ((lmask) | ((rmask) << 8) | ((stereo) << 24)) }
260 270
261/* line/speaker output volume */ 271/* line/speaker output volume */
262static int snd_pmac_burgundy_info_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 272static int snd_pmac_burgundy_info_volume_out(struct snd_kcontrol *kcontrol,
273 struct snd_ctl_elem_info *uinfo)
263{ 274{
264 int stereo = (kcontrol->private_value >> 24) & 1; 275 int stereo = (kcontrol->private_value >> 24) & 1;
265 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 276 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -269,9 +280,10 @@ static int snd_pmac_burgundy_info_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_e
269 return 0; 280 return 0;
270} 281}
271 282
272static int snd_pmac_burgundy_get_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 283static int snd_pmac_burgundy_get_volume_out(struct snd_kcontrol *kcontrol,
284 struct snd_ctl_elem_value *ucontrol)
273{ 285{
274 pmac_t *chip = snd_kcontrol_chip(kcontrol); 286 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
275 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff); 287 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
276 int stereo = (kcontrol->private_value >> 24) & 1; 288 int stereo = (kcontrol->private_value >> 24) & 1;
277 int oval; 289 int oval;
@@ -283,9 +295,10 @@ static int snd_pmac_burgundy_get_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_el
283 return 0; 295 return 0;
284} 296}
285 297
286static int snd_pmac_burgundy_put_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 298static int snd_pmac_burgundy_put_volume_out(struct snd_kcontrol *kcontrol,
299 struct snd_ctl_elem_value *ucontrol)
287{ 300{
288 pmac_t *chip = snd_kcontrol_chip(kcontrol); 301 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
289 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff); 302 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
290 int stereo = (kcontrol->private_value >> 24) & 1; 303 int stereo = (kcontrol->private_value >> 24) & 1;
291 int oval, val; 304 int oval, val;
@@ -308,7 +321,7 @@ static int snd_pmac_burgundy_put_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_el
308 .put = snd_pmac_burgundy_put_volume_out,\ 321 .put = snd_pmac_burgundy_put_volume_out,\
309 .private_value = (ADDR2BASE(addr) | ((stereo) << 24)) } 322 .private_value = (ADDR2BASE(addr) | ((stereo) << 24)) }
310 323
311static snd_kcontrol_new_t snd_pmac_burgundy_mixers[] __initdata = { 324static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] __initdata = {
312 BURGUNDY_VOLUME("Master Playback Volume", 0, MASK_ADDR_BURGUNDY_MASTER_VOLUME, 8), 325 BURGUNDY_VOLUME("Master Playback Volume", 0, MASK_ADDR_BURGUNDY_MASTER_VOLUME, 8),
313 BURGUNDY_VOLUME("Line Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLLINE, 16), 326 BURGUNDY_VOLUME("Line Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLLINE, 16),
314 BURGUNDY_VOLUME("CD Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLCD, 16), 327 BURGUNDY_VOLUME("CD Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLCD, 16),
@@ -317,9 +330,9 @@ static snd_kcontrol_new_t snd_pmac_burgundy_mixers[] __initdata = {
317 /*BURGUNDY_OUTPUT_VOLUME("PCM Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENLINEOUT, 1),*/ 330 /*BURGUNDY_OUTPUT_VOLUME("PCM Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENLINEOUT, 1),*/
318 BURGUNDY_OUTPUT_VOLUME("Headphone Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENSPEAKER, 1), 331 BURGUNDY_OUTPUT_VOLUME("Headphone Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENSPEAKER, 1),
319}; 332};
320static snd_kcontrol_new_t snd_pmac_burgundy_master_sw __initdata = 333static struct snd_kcontrol_new snd_pmac_burgundy_master_sw __initdata =
321BURGUNDY_OUTPUT_SWITCH("Headphone Playback Switch", 0, BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); 334BURGUNDY_OUTPUT_SWITCH("Headphone Playback Switch", 0, BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1);
322static snd_kcontrol_new_t snd_pmac_burgundy_speaker_sw __initdata = 335static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw __initdata =
323BURGUNDY_OUTPUT_SWITCH("PC Speaker Playback Switch", 0, BURGUNDY_OUTPUT_INTERN, 0, 0); 336BURGUNDY_OUTPUT_SWITCH("PC Speaker Playback Switch", 0, BURGUNDY_OUTPUT_INTERN, 0, 0);
324 337
325 338
@@ -327,12 +340,12 @@ BURGUNDY_OUTPUT_SWITCH("PC Speaker Playback Switch", 0, BURGUNDY_OUTPUT_INTERN,
327/* 340/*
328 * auto-mute stuffs 341 * auto-mute stuffs
329 */ 342 */
330static int snd_pmac_burgundy_detect_headphone(pmac_t *chip) 343static int snd_pmac_burgundy_detect_headphone(struct snd_pmac *chip)
331{ 344{
332 return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0; 345 return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0;
333} 346}
334 347
335static void snd_pmac_burgundy_update_automute(pmac_t *chip, int do_notify) 348static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_notify)
336{ 349{
337 if (chip->auto_mute) { 350 if (chip->auto_mute) {
338 int reg, oreg; 351 int reg, oreg;
@@ -361,7 +374,7 @@ static void snd_pmac_burgundy_update_automute(pmac_t *chip, int do_notify)
361/* 374/*
362 * initialize burgundy 375 * initialize burgundy
363 */ 376 */
364int __init snd_pmac_burgundy_init(pmac_t *chip) 377int __init snd_pmac_burgundy_init(struct snd_pmac *chip)
365{ 378{
366 int i, err; 379 int i, err;
367 380
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index a737f298e77d..08cde51177d7 100644
--- a/sound/ppc/daca.c
+++ b/sound/ppc/daca.c
@@ -40,18 +40,18 @@
40#define DACA_VOL_MAX 0x38 40#define DACA_VOL_MAX 0x38
41 41
42 42
43typedef struct pmac_daca_t { 43struct pmac_daca {
44 pmac_keywest_t i2c; 44 struct pmac_keywest i2c;
45 int left_vol, right_vol; 45 int left_vol, right_vol;
46 unsigned int deemphasis : 1; 46 unsigned int deemphasis : 1;
47 unsigned int amp_on : 1; 47 unsigned int amp_on : 1;
48} pmac_daca_t; 48};
49 49
50 50
51/* 51/*
52 * initialize / detect DACA 52 * initialize / detect DACA
53 */ 53 */
54static int daca_init_client(pmac_keywest_t *i2c) 54static int daca_init_client(struct pmac_keywest *i2c)
55{ 55{
56 unsigned short wdata = 0x00; 56 unsigned short wdata = 0x00;
57 /* SR: no swap, 1bit delay, 32-48kHz */ 57 /* SR: no swap, 1bit delay, 32-48kHz */
@@ -66,7 +66,7 @@ static int daca_init_client(pmac_keywest_t *i2c)
66/* 66/*
67 * update volume 67 * update volume
68 */ 68 */
69static int daca_set_volume(pmac_daca_t *mix) 69static int daca_set_volume(struct pmac_daca *mix)
70{ 70{
71 unsigned char data[2]; 71 unsigned char data[2];
72 72
@@ -92,7 +92,8 @@ static int daca_set_volume(pmac_daca_t *mix)
92 92
93 93
94/* deemphasis switch */ 94/* deemphasis switch */
95static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 95static int daca_info_deemphasis(struct snd_kcontrol *kcontrol,
96 struct snd_ctl_elem_info *uinfo)
96{ 97{
97 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 98 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
98 uinfo->count = 1; 99 uinfo->count = 1;
@@ -101,20 +102,22 @@ static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u
101 return 0; 102 return 0;
102} 103}
103 104
104static int daca_get_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 105static int daca_get_deemphasis(struct snd_kcontrol *kcontrol,
106 struct snd_ctl_elem_value *ucontrol)
105{ 107{
106 pmac_t *chip = snd_kcontrol_chip(kcontrol); 108 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
107 pmac_daca_t *mix; 109 struct pmac_daca *mix;
108 if (! (mix = chip->mixer_data)) 110 if (! (mix = chip->mixer_data))
109 return -ENODEV; 111 return -ENODEV;
110 ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0; 112 ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0;
111 return 0; 113 return 0;
112} 114}
113 115
114static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 116static int daca_put_deemphasis(struct snd_kcontrol *kcontrol,
117 struct snd_ctl_elem_value *ucontrol)
115{ 118{
116 pmac_t *chip = snd_kcontrol_chip(kcontrol); 119 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
117 pmac_daca_t *mix; 120 struct pmac_daca *mix;
118 int change; 121 int change;
119 122
120 if (! (mix = chip->mixer_data)) 123 if (! (mix = chip->mixer_data))
@@ -128,7 +131,8 @@ static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
128} 131}
129 132
130/* output volume */ 133/* output volume */
131static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 134static int daca_info_volume(struct snd_kcontrol *kcontrol,
135 struct snd_ctl_elem_info *uinfo)
132{ 136{
133 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 137 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
134 uinfo->count = 2; 138 uinfo->count = 2;
@@ -137,10 +141,11 @@ static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
137 return 0; 141 return 0;
138} 142}
139 143
140static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 144static int daca_get_volume(struct snd_kcontrol *kcontrol,
145 struct snd_ctl_elem_value *ucontrol)
141{ 146{
142 pmac_t *chip = snd_kcontrol_chip(kcontrol); 147 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
143 pmac_daca_t *mix; 148 struct pmac_daca *mix;
144 if (! (mix = chip->mixer_data)) 149 if (! (mix = chip->mixer_data))
145 return -ENODEV; 150 return -ENODEV;
146 ucontrol->value.integer.value[0] = mix->left_vol; 151 ucontrol->value.integer.value[0] = mix->left_vol;
@@ -148,10 +153,11 @@ static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
148 return 0; 153 return 0;
149} 154}
150 155
151static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 156static int daca_put_volume(struct snd_kcontrol *kcontrol,
157 struct snd_ctl_elem_value *ucontrol)
152{ 158{
153 pmac_t *chip = snd_kcontrol_chip(kcontrol); 159 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
154 pmac_daca_t *mix; 160 struct pmac_daca *mix;
155 int change; 161 int change;
156 162
157 if (! (mix = chip->mixer_data)) 163 if (! (mix = chip->mixer_data))
@@ -169,20 +175,22 @@ static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
169/* amplifier switch */ 175/* amplifier switch */
170#define daca_info_amp daca_info_deemphasis 176#define daca_info_amp daca_info_deemphasis
171 177
172static int daca_get_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 178static int daca_get_amp(struct snd_kcontrol *kcontrol,
179 struct snd_ctl_elem_value *ucontrol)
173{ 180{
174 pmac_t *chip = snd_kcontrol_chip(kcontrol); 181 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
175 pmac_daca_t *mix; 182 struct pmac_daca *mix;
176 if (! (mix = chip->mixer_data)) 183 if (! (mix = chip->mixer_data))
177 return -ENODEV; 184 return -ENODEV;
178 ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0; 185 ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0;
179 return 0; 186 return 0;
180} 187}
181 188
182static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 189static int daca_put_amp(struct snd_kcontrol *kcontrol,
190 struct snd_ctl_elem_value *ucontrol)
183{ 191{
184 pmac_t *chip = snd_kcontrol_chip(kcontrol); 192 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
185 pmac_daca_t *mix; 193 struct pmac_daca *mix;
186 int change; 194 int change;
187 195
188 if (! (mix = chip->mixer_data)) 196 if (! (mix = chip->mixer_data))
@@ -196,7 +204,7 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol
196 return change; 204 return change;
197} 205}
198 206
199static snd_kcontrol_new_t daca_mixers[] = { 207static struct snd_kcontrol_new daca_mixers[] = {
200 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 208 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
201 .name = "Deemphasis Switch", 209 .name = "Deemphasis Switch",
202 .info = daca_info_deemphasis, 210 .info = daca_info_deemphasis,
@@ -219,9 +227,9 @@ static snd_kcontrol_new_t daca_mixers[] = {
219 227
220 228
221#ifdef CONFIG_PM 229#ifdef CONFIG_PM
222static void daca_resume(pmac_t *chip) 230static void daca_resume(struct snd_pmac *chip)
223{ 231{
224 pmac_daca_t *mix = chip->mixer_data; 232 struct pmac_daca *mix = chip->mixer_data;
225 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); 233 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08);
226 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, 234 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG,
227 mix->amp_on ? 0x05 : 0x04); 235 mix->amp_on ? 0x05 : 0x04);
@@ -230,9 +238,9 @@ static void daca_resume(pmac_t *chip)
230#endif /* CONFIG_PM */ 238#endif /* CONFIG_PM */
231 239
232 240
233static void daca_cleanup(pmac_t *chip) 241static void daca_cleanup(struct snd_pmac *chip)
234{ 242{
235 pmac_daca_t *mix = chip->mixer_data; 243 struct pmac_daca *mix = chip->mixer_data;
236 if (! mix) 244 if (! mix)
237 return; 245 return;
238 snd_pmac_keywest_cleanup(&mix->i2c); 246 snd_pmac_keywest_cleanup(&mix->i2c);
@@ -241,10 +249,10 @@ static void daca_cleanup(pmac_t *chip)
241} 249}
242 250
243/* exported */ 251/* exported */
244int __init snd_pmac_daca_init(pmac_t *chip) 252int __init snd_pmac_daca_init(struct snd_pmac *chip)
245{ 253{
246 int i, err; 254 int i, err;
247 pmac_daca_t *mix; 255 struct pmac_daca *mix;
248 256
249#ifdef CONFIG_KMOD 257#ifdef CONFIG_KMOD
250 if (current->fs->root) 258 if (current->fs->root)
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index df073a05b5d7..097fbcfc5d45 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -32,7 +32,7 @@
32 * we have to keep a static variable here since i2c attach_adapter 32 * we have to keep a static variable here since i2c attach_adapter
33 * callback cannot pass a private data. 33 * callback cannot pass a private data.
34 */ 34 */
35static pmac_keywest_t *keywest_ctx; 35static struct pmac_keywest *keywest_ctx;
36 36
37 37
38#define I2C_DRIVERID_KEYWEST 0xFEBA 38#define I2C_DRIVERID_KEYWEST 0xFEBA
@@ -106,7 +106,7 @@ static int keywest_detach_client(struct i2c_client *client)
106} 106}
107 107
108/* exported */ 108/* exported */
109void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c) 109void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c)
110{ 110{
111 if (keywest_ctx && keywest_ctx == i2c) { 111 if (keywest_ctx && keywest_ctx == i2c) {
112 i2c_del_driver(&keywest_driver); 112 i2c_del_driver(&keywest_driver);
@@ -126,7 +126,7 @@ int __init snd_pmac_tumbler_post_init(void)
126} 126}
127 127
128/* exported */ 128/* exported */
129int __init snd_pmac_keywest_init(pmac_keywest_t *i2c) 129int __init snd_pmac_keywest_init(struct pmac_keywest *i2c)
130{ 130{
131 int err; 131 int err;
132 132
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index dd28187ec0e9..222765fd0dc5 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -37,10 +37,10 @@
37 37
38 38
39#ifdef CONFIG_PM 39#ifdef CONFIG_PM
40static int snd_pmac_register_sleep_notifier(pmac_t *chip); 40static int snd_pmac_register_sleep_notifier(struct snd_pmac *chip);
41static int snd_pmac_unregister_sleep_notifier(pmac_t *chip); 41static int snd_pmac_unregister_sleep_notifier(struct snd_pmac *chip);
42static int snd_pmac_suspend(snd_card_t *card, pm_message_t state); 42static int snd_pmac_suspend(struct snd_card *card, pm_message_t state);
43static int snd_pmac_resume(snd_card_t *card); 43static int snd_pmac_resume(struct snd_card *card);
44#endif 44#endif
45 45
46 46
@@ -56,7 +56,7 @@ static int tumbler_freqs[1] = {
56/* 56/*
57 * allocate DBDMA command arrays 57 * allocate DBDMA command arrays
58 */ 58 */
59static int snd_pmac_dbdma_alloc(pmac_t *chip, pmac_dbdma_t *rec, int size) 59static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, int size)
60{ 60{
61 unsigned int rsize = sizeof(struct dbdma_cmd) * (size + 1); 61 unsigned int rsize = sizeof(struct dbdma_cmd) * (size + 1);
62 62
@@ -72,7 +72,7 @@ static int snd_pmac_dbdma_alloc(pmac_t *chip, pmac_dbdma_t *rec, int size)
72 return 0; 72 return 0;
73} 73}
74 74
75static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec) 75static void snd_pmac_dbdma_free(struct snd_pmac *chip, struct pmac_dbdma *rec)
76{ 76{
77 if (rec) { 77 if (rec) {
78 unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1); 78 unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
@@ -90,7 +90,7 @@ static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec)
90 * look up frequency table 90 * look up frequency table
91 */ 91 */
92 92
93unsigned int snd_pmac_rate_index(pmac_t *chip, pmac_stream_t *rec, unsigned int rate) 93unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, unsigned int rate)
94{ 94{
95 int i, ok, found; 95 int i, ok, found;
96 96
@@ -119,8 +119,8 @@ static inline int another_stream(int stream)
119/* 119/*
120 * allocate buffers 120 * allocate buffers
121 */ 121 */
122static int snd_pmac_pcm_hw_params(snd_pcm_substream_t *subs, 122static int snd_pmac_pcm_hw_params(struct snd_pcm_substream *subs,
123 snd_pcm_hw_params_t *hw_params) 123 struct snd_pcm_hw_params *hw_params)
124{ 124{
125 return snd_pcm_lib_malloc_pages(subs, params_buffer_bytes(hw_params)); 125 return snd_pcm_lib_malloc_pages(subs, params_buffer_bytes(hw_params));
126} 126}
@@ -128,7 +128,7 @@ static int snd_pmac_pcm_hw_params(snd_pcm_substream_t *subs,
128/* 128/*
129 * release buffers 129 * release buffers
130 */ 130 */
131static int snd_pmac_pcm_hw_free(snd_pcm_substream_t *subs) 131static int snd_pmac_pcm_hw_free(struct snd_pcm_substream *subs)
132{ 132{
133 snd_pcm_lib_free_pages(subs); 133 snd_pcm_lib_free_pages(subs);
134 return 0; 134 return 0;
@@ -137,7 +137,7 @@ static int snd_pmac_pcm_hw_free(snd_pcm_substream_t *subs)
137/* 137/*
138 * get a stream of the opposite direction 138 * get a stream of the opposite direction
139 */ 139 */
140static pmac_stream_t *snd_pmac_get_stream(pmac_t *chip, int stream) 140static struct pmac_stream *snd_pmac_get_stream(struct snd_pmac *chip, int stream)
141{ 141{
142 switch (stream) { 142 switch (stream) {
143 case SNDRV_PCM_STREAM_PLAYBACK: 143 case SNDRV_PCM_STREAM_PLAYBACK:
@@ -154,7 +154,7 @@ static pmac_stream_t *snd_pmac_get_stream(pmac_t *chip, int stream)
154 * wait while run status is on 154 * wait while run status is on
155 */ 155 */
156static inline void 156static inline void
157snd_pmac_wait_ack(pmac_stream_t *rec) 157snd_pmac_wait_ack(struct pmac_stream *rec)
158{ 158{
159 int timeout = 50000; 159 int timeout = 50000;
160 while ((in_le32(&rec->dma->status) & RUN) && timeout-- > 0) 160 while ((in_le32(&rec->dma->status) & RUN) && timeout-- > 0)
@@ -165,7 +165,7 @@ snd_pmac_wait_ack(pmac_stream_t *rec)
165 * set the format and rate to the chip. 165 * set the format and rate to the chip.
166 * call the lowlevel function if defined (e.g. for AWACS). 166 * call the lowlevel function if defined (e.g. for AWACS).
167 */ 167 */
168static void snd_pmac_pcm_set_format(pmac_t *chip) 168static void snd_pmac_pcm_set_format(struct snd_pmac *chip)
169{ 169{
170 /* set up frequency and format */ 170 /* set up frequency and format */
171 out_le32(&chip->awacs->control, chip->control_mask | (chip->rate_index << 8)); 171 out_le32(&chip->awacs->control, chip->control_mask | (chip->rate_index << 8));
@@ -177,7 +177,7 @@ static void snd_pmac_pcm_set_format(pmac_t *chip)
177/* 177/*
178 * stop the DMA transfer 178 * stop the DMA transfer
179 */ 179 */
180static inline void snd_pmac_dma_stop(pmac_stream_t *rec) 180static inline void snd_pmac_dma_stop(struct pmac_stream *rec)
181{ 181{
182 out_le32(&rec->dma->control, (RUN|WAKE|FLUSH|PAUSE) << 16); 182 out_le32(&rec->dma->control, (RUN|WAKE|FLUSH|PAUSE) << 16);
183 snd_pmac_wait_ack(rec); 183 snd_pmac_wait_ack(rec);
@@ -186,7 +186,7 @@ static inline void snd_pmac_dma_stop(pmac_stream_t *rec)
186/* 186/*
187 * set the command pointer address 187 * set the command pointer address
188 */ 188 */
189static inline void snd_pmac_dma_set_command(pmac_stream_t *rec, pmac_dbdma_t *cmd) 189static inline void snd_pmac_dma_set_command(struct pmac_stream *rec, struct pmac_dbdma *cmd)
190{ 190{
191 out_le32(&rec->dma->cmdptr, cmd->addr); 191 out_le32(&rec->dma->cmdptr, cmd->addr);
192} 192}
@@ -194,7 +194,7 @@ static inline void snd_pmac_dma_set_command(pmac_stream_t *rec, pmac_dbdma_t *cm
194/* 194/*
195 * start the DMA 195 * start the DMA
196 */ 196 */
197static inline void snd_pmac_dma_run(pmac_stream_t *rec, int status) 197static inline void snd_pmac_dma_run(struct pmac_stream *rec, int status)
198{ 198{
199 out_le32(&rec->dma->control, status | (status << 16)); 199 out_le32(&rec->dma->control, status | (status << 16));
200} 200}
@@ -203,14 +203,14 @@ static inline void snd_pmac_dma_run(pmac_stream_t *rec, int status)
203/* 203/*
204 * prepare playback/capture stream 204 * prepare playback/capture stream
205 */ 205 */
206static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs) 206static int snd_pmac_pcm_prepare(struct snd_pmac *chip, struct pmac_stream *rec, struct snd_pcm_substream *subs)
207{ 207{
208 int i; 208 int i;
209 volatile struct dbdma_cmd __iomem *cp; 209 volatile struct dbdma_cmd __iomem *cp;
210 snd_pcm_runtime_t *runtime = subs->runtime; 210 struct snd_pcm_runtime *runtime = subs->runtime;
211 int rate_index; 211 int rate_index;
212 long offset; 212 long offset;
213 pmac_stream_t *astr; 213 struct pmac_stream *astr;
214 214
215 rec->dma_size = snd_pcm_lib_buffer_bytes(subs); 215 rec->dma_size = snd_pcm_lib_buffer_bytes(subs);
216 rec->period_size = snd_pcm_lib_period_bytes(subs); 216 rec->period_size = snd_pcm_lib_period_bytes(subs);
@@ -267,8 +267,8 @@ static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substr
267/* 267/*
268 * PCM trigger/stop 268 * PCM trigger/stop
269 */ 269 */
270static int snd_pmac_pcm_trigger(pmac_t *chip, pmac_stream_t *rec, 270static int snd_pmac_pcm_trigger(struct snd_pmac *chip, struct pmac_stream *rec,
271 snd_pcm_substream_t *subs, int cmd) 271 struct snd_pcm_substream *subs, int cmd)
272{ 272{
273 volatile struct dbdma_cmd __iomem *cp; 273 volatile struct dbdma_cmd __iomem *cp;
274 int i, command; 274 int i, command;
@@ -314,8 +314,9 @@ static int snd_pmac_pcm_trigger(pmac_t *chip, pmac_stream_t *rec,
314 * return the current pointer 314 * return the current pointer
315 */ 315 */
316inline 316inline
317static snd_pcm_uframes_t snd_pmac_pcm_pointer(pmac_t *chip, pmac_stream_t *rec, 317static snd_pcm_uframes_t snd_pmac_pcm_pointer(struct snd_pmac *chip,
318 snd_pcm_substream_t *subs) 318 struct pmac_stream *rec,
319 struct snd_pcm_substream *subs)
319{ 320{
320 int count = 0; 321 int count = 0;
321 322
@@ -338,22 +339,22 @@ static snd_pcm_uframes_t snd_pmac_pcm_pointer(pmac_t *chip, pmac_stream_t *rec,
338 * playback 339 * playback
339 */ 340 */
340 341
341static int snd_pmac_playback_prepare(snd_pcm_substream_t *subs) 342static int snd_pmac_playback_prepare(struct snd_pcm_substream *subs)
342{ 343{
343 pmac_t *chip = snd_pcm_substream_chip(subs); 344 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
344 return snd_pmac_pcm_prepare(chip, &chip->playback, subs); 345 return snd_pmac_pcm_prepare(chip, &chip->playback, subs);
345} 346}
346 347
347static int snd_pmac_playback_trigger(snd_pcm_substream_t *subs, 348static int snd_pmac_playback_trigger(struct snd_pcm_substream *subs,
348 int cmd) 349 int cmd)
349{ 350{
350 pmac_t *chip = snd_pcm_substream_chip(subs); 351 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
351 return snd_pmac_pcm_trigger(chip, &chip->playback, subs, cmd); 352 return snd_pmac_pcm_trigger(chip, &chip->playback, subs, cmd);
352} 353}
353 354
354static snd_pcm_uframes_t snd_pmac_playback_pointer(snd_pcm_substream_t *subs) 355static snd_pcm_uframes_t snd_pmac_playback_pointer(struct snd_pcm_substream *subs)
355{ 356{
356 pmac_t *chip = snd_pcm_substream_chip(subs); 357 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
357 return snd_pmac_pcm_pointer(chip, &chip->playback, subs); 358 return snd_pmac_pcm_pointer(chip, &chip->playback, subs);
358} 359}
359 360
@@ -362,22 +363,22 @@ static snd_pcm_uframes_t snd_pmac_playback_pointer(snd_pcm_substream_t *subs)
362 * capture 363 * capture
363 */ 364 */
364 365
365static int snd_pmac_capture_prepare(snd_pcm_substream_t *subs) 366static int snd_pmac_capture_prepare(struct snd_pcm_substream *subs)
366{ 367{
367 pmac_t *chip = snd_pcm_substream_chip(subs); 368 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
368 return snd_pmac_pcm_prepare(chip, &chip->capture, subs); 369 return snd_pmac_pcm_prepare(chip, &chip->capture, subs);
369} 370}
370 371
371static int snd_pmac_capture_trigger(snd_pcm_substream_t *subs, 372static int snd_pmac_capture_trigger(struct snd_pcm_substream *subs,
372 int cmd) 373 int cmd)
373{ 374{
374 pmac_t *chip = snd_pcm_substream_chip(subs); 375 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
375 return snd_pmac_pcm_trigger(chip, &chip->capture, subs, cmd); 376 return snd_pmac_pcm_trigger(chip, &chip->capture, subs, cmd);
376} 377}
377 378
378static snd_pcm_uframes_t snd_pmac_capture_pointer(snd_pcm_substream_t *subs) 379static snd_pcm_uframes_t snd_pmac_capture_pointer(struct snd_pcm_substream *subs)
379{ 380{
380 pmac_t *chip = snd_pcm_substream_chip(subs); 381 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
381 return snd_pmac_pcm_pointer(chip, &chip->capture, subs); 382 return snd_pmac_pcm_pointer(chip, &chip->capture, subs);
382} 383}
383 384
@@ -385,7 +386,7 @@ static snd_pcm_uframes_t snd_pmac_capture_pointer(snd_pcm_substream_t *subs)
385/* 386/*
386 * update playback/capture pointer from interrupts 387 * update playback/capture pointer from interrupts
387 */ 388 */
388static void snd_pmac_pcm_update(pmac_t *chip, pmac_stream_t *rec) 389static void snd_pmac_pcm_update(struct snd_pmac *chip, struct pmac_stream *rec)
389{ 390{
390 volatile struct dbdma_cmd __iomem *cp; 391 volatile struct dbdma_cmd __iomem *cp;
391 int c; 392 int c;
@@ -421,7 +422,7 @@ static void snd_pmac_pcm_update(pmac_t *chip, pmac_stream_t *rec)
421 * hw info 422 * hw info
422 */ 423 */
423 424
424static snd_pcm_hardware_t snd_pmac_playback = 425static struct snd_pcm_hardware snd_pmac_playback =
425{ 426{
426 .info = (SNDRV_PCM_INFO_INTERLEAVED | 427 .info = (SNDRV_PCM_INFO_INTERLEAVED |
427 SNDRV_PCM_INFO_MMAP | 428 SNDRV_PCM_INFO_MMAP |
@@ -440,7 +441,7 @@ static snd_pcm_hardware_t snd_pmac_playback =
440 .periods_max = PMAC_MAX_FRAGS, 441 .periods_max = PMAC_MAX_FRAGS,
441}; 442};
442 443
443static snd_pcm_hardware_t snd_pmac_capture = 444static struct snd_pcm_hardware snd_pmac_capture =
444{ 445{
445 .info = (SNDRV_PCM_INFO_INTERLEAVED | 446 .info = (SNDRV_PCM_INFO_INTERLEAVED |
446 SNDRV_PCM_INFO_MMAP | 447 SNDRV_PCM_INFO_MMAP |
@@ -461,11 +462,11 @@ static snd_pcm_hardware_t snd_pmac_capture =
461 462
462 463
463#if 0 // NYI 464#if 0 // NYI
464static int snd_pmac_hw_rule_rate(snd_pcm_hw_params_t *params, 465static int snd_pmac_hw_rule_rate(struct snd_pcm_hw_params *params,
465 snd_pcm_hw_rule_t *rule) 466 struct snd_pcm_hw_rule *rule)
466{ 467{
467 pmac_t *chip = rule->private; 468 struct snd_pmac *chip = rule->private;
468 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); 469 struct pmac_stream *rec = snd_pmac_get_stream(chip, rule->deps[0]);
469 int i, freq_table[8], num_freqs; 470 int i, freq_table[8], num_freqs;
470 471
471 if (! rec) 472 if (! rec)
@@ -480,11 +481,11 @@ static int snd_pmac_hw_rule_rate(snd_pcm_hw_params_t *params,
480 num_freqs, freq_table, 0); 481 num_freqs, freq_table, 0);
481} 482}
482 483
483static int snd_pmac_hw_rule_format(snd_pcm_hw_params_t *params, 484static int snd_pmac_hw_rule_format(struct snd_pcm_hw_params *params,
484 snd_pcm_hw_rule_t *rule) 485 struct snd_pcm_hw_rule *rule)
485{ 486{
486 pmac_t *chip = rule->private; 487 struct snd_pmac *chip = rule->private;
487 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); 488 struct pmac_stream *rec = snd_pmac_get_stream(chip, rule->deps[0]);
488 489
489 if (! rec) 490 if (! rec)
490 return -EINVAL; 491 return -EINVAL;
@@ -493,9 +494,10 @@ static int snd_pmac_hw_rule_format(snd_pcm_hw_params_t *params,
493} 494}
494#endif // NYI 495#endif // NYI
495 496
496static int snd_pmac_pcm_open(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs) 497static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
498 struct snd_pcm_substream *subs)
497{ 499{
498 snd_pcm_runtime_t *runtime = subs->runtime; 500 struct snd_pcm_runtime *runtime = subs->runtime;
499 int i, j, fflags; 501 int i, j, fflags;
500 static int typical_freqs[] = { 502 static int typical_freqs[] = {
501 44100, 503 44100,
@@ -565,9 +567,10 @@ static int snd_pmac_pcm_open(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream
565 return 0; 567 return 0;
566} 568}
567 569
568static int snd_pmac_pcm_close(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs) 570static int snd_pmac_pcm_close(struct snd_pmac *chip, struct pmac_stream *rec,
571 struct snd_pcm_substream *subs)
569{ 572{
570 pmac_stream_t *astr; 573 struct pmac_stream *astr;
571 574
572 snd_pmac_dma_stop(rec); 575 snd_pmac_dma_stop(rec);
573 576
@@ -582,32 +585,32 @@ static int snd_pmac_pcm_close(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substrea
582 return 0; 585 return 0;
583} 586}
584 587
585static int snd_pmac_playback_open(snd_pcm_substream_t *subs) 588static int snd_pmac_playback_open(struct snd_pcm_substream *subs)
586{ 589{
587 pmac_t *chip = snd_pcm_substream_chip(subs); 590 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
588 591
589 subs->runtime->hw = snd_pmac_playback; 592 subs->runtime->hw = snd_pmac_playback;
590 return snd_pmac_pcm_open(chip, &chip->playback, subs); 593 return snd_pmac_pcm_open(chip, &chip->playback, subs);
591} 594}
592 595
593static int snd_pmac_capture_open(snd_pcm_substream_t *subs) 596static int snd_pmac_capture_open(struct snd_pcm_substream *subs)
594{ 597{
595 pmac_t *chip = snd_pcm_substream_chip(subs); 598 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
596 599
597 subs->runtime->hw = snd_pmac_capture; 600 subs->runtime->hw = snd_pmac_capture;
598 return snd_pmac_pcm_open(chip, &chip->capture, subs); 601 return snd_pmac_pcm_open(chip, &chip->capture, subs);
599} 602}
600 603
601static int snd_pmac_playback_close(snd_pcm_substream_t *subs) 604static int snd_pmac_playback_close(struct snd_pcm_substream *subs)
602{ 605{
603 pmac_t *chip = snd_pcm_substream_chip(subs); 606 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
604 607
605 return snd_pmac_pcm_close(chip, &chip->playback, subs); 608 return snd_pmac_pcm_close(chip, &chip->playback, subs);
606} 609}
607 610
608static int snd_pmac_capture_close(snd_pcm_substream_t *subs) 611static int snd_pmac_capture_close(struct snd_pcm_substream *subs)
609{ 612{
610 pmac_t *chip = snd_pcm_substream_chip(subs); 613 struct snd_pmac *chip = snd_pcm_substream_chip(subs);
611 614
612 return snd_pmac_pcm_close(chip, &chip->capture, subs); 615 return snd_pmac_pcm_close(chip, &chip->capture, subs);
613} 616}
@@ -615,7 +618,7 @@ static int snd_pmac_capture_close(snd_pcm_substream_t *subs)
615/* 618/*
616 */ 619 */
617 620
618static snd_pcm_ops_t snd_pmac_playback_ops = { 621static struct snd_pcm_ops snd_pmac_playback_ops = {
619 .open = snd_pmac_playback_open, 622 .open = snd_pmac_playback_open,
620 .close = snd_pmac_playback_close, 623 .close = snd_pmac_playback_close,
621 .ioctl = snd_pcm_lib_ioctl, 624 .ioctl = snd_pcm_lib_ioctl,
@@ -626,7 +629,7 @@ static snd_pcm_ops_t snd_pmac_playback_ops = {
626 .pointer = snd_pmac_playback_pointer, 629 .pointer = snd_pmac_playback_pointer,
627}; 630};
628 631
629static snd_pcm_ops_t snd_pmac_capture_ops = { 632static struct snd_pcm_ops snd_pmac_capture_ops = {
630 .open = snd_pmac_capture_open, 633 .open = snd_pmac_capture_open,
631 .close = snd_pmac_capture_close, 634 .close = snd_pmac_capture_close,
632 .ioctl = snd_pcm_lib_ioctl, 635 .ioctl = snd_pcm_lib_ioctl,
@@ -637,9 +640,9 @@ static snd_pcm_ops_t snd_pmac_capture_ops = {
637 .pointer = snd_pmac_capture_pointer, 640 .pointer = snd_pmac_capture_pointer,
638}; 641};
639 642
640int __init snd_pmac_pcm_new(pmac_t *chip) 643int __init snd_pmac_pcm_new(struct snd_pmac *chip)
641{ 644{
642 snd_pcm_t *pcm; 645 struct snd_pcm *pcm;
643 int err; 646 int err;
644 int num_captures = 1; 647 int num_captures = 1;
645 648
@@ -676,7 +679,7 @@ int __init snd_pmac_pcm_new(pmac_t *chip)
676} 679}
677 680
678 681
679static void snd_pmac_dbdma_reset(pmac_t *chip) 682static void snd_pmac_dbdma_reset(struct snd_pmac *chip)
680{ 683{
681 out_le32(&chip->playback.dma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16); 684 out_le32(&chip->playback.dma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16);
682 snd_pmac_wait_ack(&chip->playback); 685 snd_pmac_wait_ack(&chip->playback);
@@ -688,9 +691,9 @@ static void snd_pmac_dbdma_reset(pmac_t *chip)
688/* 691/*
689 * handling beep 692 * handling beep
690 */ 693 */
691void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int speed) 694void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long addr, int speed)
692{ 695{
693 pmac_stream_t *rec = &chip->playback; 696 struct pmac_stream *rec = &chip->playback;
694 697
695 snd_pmac_dma_stop(rec); 698 snd_pmac_dma_stop(rec);
696 st_le16(&chip->extra_dma.cmds->req_count, bytes); 699 st_le16(&chip->extra_dma.cmds->req_count, bytes);
@@ -706,7 +709,7 @@ void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int sp
706 snd_pmac_dma_run(rec, RUN); 709 snd_pmac_dma_run(rec, RUN);
707} 710}
708 711
709void snd_pmac_beep_dma_stop(pmac_t *chip) 712void snd_pmac_beep_dma_stop(struct snd_pmac *chip)
710{ 713{
711 snd_pmac_dma_stop(&chip->playback); 714 snd_pmac_dma_stop(&chip->playback);
712 st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP); 715 st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP);
@@ -720,7 +723,7 @@ void snd_pmac_beep_dma_stop(pmac_t *chip)
720static irqreturn_t 723static irqreturn_t
721snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs) 724snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
722{ 725{
723 pmac_t *chip = devid; 726 struct snd_pmac *chip = devid;
724 snd_pmac_pcm_update(chip, &chip->playback); 727 snd_pmac_pcm_update(chip, &chip->playback);
725 return IRQ_HANDLED; 728 return IRQ_HANDLED;
726} 729}
@@ -729,7 +732,7 @@ snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
729static irqreturn_t 732static irqreturn_t
730snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs) 733snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
731{ 734{
732 pmac_t *chip = devid; 735 struct snd_pmac *chip = devid;
733 snd_pmac_pcm_update(chip, &chip->capture); 736 snd_pmac_pcm_update(chip, &chip->capture);
734 return IRQ_HANDLED; 737 return IRQ_HANDLED;
735} 738}
@@ -738,7 +741,7 @@ snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
738static irqreturn_t 741static irqreturn_t
739snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs) 742snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs)
740{ 743{
741 pmac_t *chip = devid; 744 struct snd_pmac *chip = devid;
742 int ctrl = in_le32(&chip->awacs->control); 745 int ctrl = in_le32(&chip->awacs->control);
743 746
744 /*printk("pmac: control interrupt.. 0x%x\n", ctrl);*/ 747 /*printk("pmac: control interrupt.. 0x%x\n", ctrl);*/
@@ -761,7 +764,7 @@ snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs)
761/* 764/*
762 * a wrapper to feature call for compatibility 765 * a wrapper to feature call for compatibility
763 */ 766 */
764static void snd_pmac_sound_feature(pmac_t *chip, int enable) 767static void snd_pmac_sound_feature(struct snd_pmac *chip, int enable)
765{ 768{
766 if (ppc_md.feature_call) 769 if (ppc_md.feature_call)
767 ppc_md.feature_call(PMAC_FTR_SOUND_CHIP_ENABLE, chip->node, 0, enable); 770 ppc_md.feature_call(PMAC_FTR_SOUND_CHIP_ENABLE, chip->node, 0, enable);
@@ -771,7 +774,7 @@ static void snd_pmac_sound_feature(pmac_t *chip, int enable)
771 * release resources 774 * release resources
772 */ 775 */
773 776
774static int snd_pmac_free(pmac_t *chip) 777static int snd_pmac_free(struct snd_pmac *chip)
775{ 778{
776 /* stop sounds */ 779 /* stop sounds */
777 if (chip->initialized) { 780 if (chip->initialized) {
@@ -836,9 +839,9 @@ static int snd_pmac_free(pmac_t *chip)
836/* 839/*
837 * free the device 840 * free the device
838 */ 841 */
839static int snd_pmac_dev_free(snd_device_t *device) 842static int snd_pmac_dev_free(struct snd_device *device)
840{ 843{
841 pmac_t *chip = device->device_data; 844 struct snd_pmac *chip = device->device_data;
842 return snd_pmac_free(chip); 845 return snd_pmac_free(chip);
843} 846}
844 847
@@ -847,7 +850,7 @@ static int snd_pmac_dev_free(snd_device_t *device)
847 * check the machine support byteswap (little-endian) 850 * check the machine support byteswap (little-endian)
848 */ 851 */
849 852
850static void __init detect_byte_swap(pmac_t *chip) 853static void __init detect_byte_swap(struct snd_pmac *chip)
851{ 854{
852 struct device_node *mio; 855 struct device_node *mio;
853 856
@@ -873,7 +876,7 @@ static void __init detect_byte_swap(pmac_t *chip)
873/* 876/*
874 * detect a sound chip 877 * detect a sound chip
875 */ 878 */
876static int __init snd_pmac_detect(pmac_t *chip) 879static int __init snd_pmac_detect(struct snd_pmac *chip)
877{ 880{
878 struct device_node *sound = NULL; 881 struct device_node *sound = NULL;
879 unsigned int *prop, l; 882 unsigned int *prop, l;
@@ -1061,8 +1064,8 @@ static int __init snd_pmac_detect(pmac_t *chip)
1061/* 1064/*
1062 * exported - boolean info callbacks for ease of programming 1065 * exported - boolean info callbacks for ease of programming
1063 */ 1066 */
1064int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, 1067int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol,
1065 snd_ctl_elem_info_t *uinfo) 1068 struct snd_ctl_elem_info *uinfo)
1066{ 1069{
1067 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1070 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1068 uinfo->count = 2; 1071 uinfo->count = 2;
@@ -1071,8 +1074,8 @@ int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol,
1071 return 0; 1074 return 0;
1072} 1075}
1073 1076
1074int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, 1077int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol,
1075 snd_ctl_elem_info_t *uinfo) 1078 struct snd_ctl_elem_info *uinfo)
1076{ 1079{
1077 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1080 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1078 uinfo->count = 1; 1081 uinfo->count = 1;
@@ -1085,16 +1088,18 @@ int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol,
1085/* 1088/*
1086 * auto-mute 1089 * auto-mute
1087 */ 1090 */
1088static int pmac_auto_mute_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1091static int pmac_auto_mute_get(struct snd_kcontrol *kcontrol,
1092 struct snd_ctl_elem_value *ucontrol)
1089{ 1093{
1090 pmac_t *chip = snd_kcontrol_chip(kcontrol); 1094 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
1091 ucontrol->value.integer.value[0] = chip->auto_mute; 1095 ucontrol->value.integer.value[0] = chip->auto_mute;
1092 return 0; 1096 return 0;
1093} 1097}
1094 1098
1095static int pmac_auto_mute_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1099static int pmac_auto_mute_put(struct snd_kcontrol *kcontrol,
1100 struct snd_ctl_elem_value *ucontrol)
1096{ 1101{
1097 pmac_t *chip = snd_kcontrol_chip(kcontrol); 1102 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
1098 if (ucontrol->value.integer.value[0] != chip->auto_mute) { 1103 if (ucontrol->value.integer.value[0] != chip->auto_mute) {
1099 chip->auto_mute = ucontrol->value.integer.value[0]; 1104 chip->auto_mute = ucontrol->value.integer.value[0];
1100 if (chip->update_automute) 1105 if (chip->update_automute)
@@ -1104,9 +1109,10 @@ static int pmac_auto_mute_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
1104 return 0; 1109 return 0;
1105} 1110}
1106 1111
1107static int pmac_hp_detect_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 1112static int pmac_hp_detect_get(struct snd_kcontrol *kcontrol,
1113 struct snd_ctl_elem_value *ucontrol)
1108{ 1114{
1109 pmac_t *chip = snd_kcontrol_chip(kcontrol); 1115 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
1110 if (chip->detect_headphone) 1116 if (chip->detect_headphone)
1111 ucontrol->value.integer.value[0] = chip->detect_headphone(chip); 1117 ucontrol->value.integer.value[0] = chip->detect_headphone(chip);
1112 else 1118 else
@@ -1114,7 +1120,7 @@ static int pmac_hp_detect_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
1114 return 0; 1120 return 0;
1115} 1121}
1116 1122
1117static snd_kcontrol_new_t auto_mute_controls[] __initdata = { 1123static struct snd_kcontrol_new auto_mute_controls[] __initdata = {
1118 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1124 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1119 .name = "Auto Mute Switch", 1125 .name = "Auto Mute Switch",
1120 .info = snd_pmac_boolean_mono_info, 1126 .info = snd_pmac_boolean_mono_info,
@@ -1129,7 +1135,7 @@ static snd_kcontrol_new_t auto_mute_controls[] __initdata = {
1129 }, 1135 },
1130}; 1136};
1131 1137
1132int __init snd_pmac_add_automute(pmac_t *chip) 1138int __init snd_pmac_add_automute(struct snd_pmac *chip)
1133{ 1139{
1134 int err; 1140 int err;
1135 chip->auto_mute = 1; 1141 chip->auto_mute = 1;
@@ -1146,13 +1152,13 @@ int __init snd_pmac_add_automute(pmac_t *chip)
1146/* 1152/*
1147 * create and detect a pmac chip record 1153 * create and detect a pmac chip record
1148 */ 1154 */
1149int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) 1155int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1150{ 1156{
1151 pmac_t *chip; 1157 struct snd_pmac *chip;
1152 struct device_node *np; 1158 struct device_node *np;
1153 int i, err; 1159 int i, err;
1154 unsigned long ctrl_addr, txdma_addr, rxdma_addr; 1160 unsigned long ctrl_addr, txdma_addr, rxdma_addr;
1155 static snd_device_ops_t ops = { 1161 static struct snd_device_ops ops = {
1156 .dev_free = snd_pmac_dev_free, 1162 .dev_free = snd_pmac_dev_free,
1157 }; 1163 };
1158 1164
@@ -1322,9 +1328,9 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
1322 * Save state when going to sleep, restore it afterwards. 1328 * Save state when going to sleep, restore it afterwards.
1323 */ 1329 */
1324 1330
1325static int snd_pmac_suspend(snd_card_t *card, pm_message_t state) 1331static int snd_pmac_suspend(struct snd_card *card, pm_message_t state)
1326{ 1332{
1327 pmac_t *chip = card->pm_private_data; 1333 struct snd_pmac *chip = card->pm_private_data;
1328 unsigned long flags; 1334 unsigned long flags;
1329 1335
1330 if (chip->suspend) 1336 if (chip->suspend)
@@ -1343,9 +1349,9 @@ static int snd_pmac_suspend(snd_card_t *card, pm_message_t state)
1343 return 0; 1349 return 0;
1344} 1350}
1345 1351
1346static int snd_pmac_resume(snd_card_t *card) 1352static int snd_pmac_resume(struct snd_card *card)
1347{ 1353{
1348 pmac_t *chip = card->pm_private_data; 1354 struct snd_pmac *chip = card->pm_private_data;
1349 1355
1350 snd_pmac_sound_feature(chip, 1); 1356 snd_pmac_sound_feature(chip, 1);
1351 if (chip->resume) 1357 if (chip->resume)
@@ -1372,11 +1378,11 @@ static int snd_pmac_resume(snd_card_t *card)
1372/* the chip is stored statically by snd_pmac_register_sleep_notifier 1378/* the chip is stored statically by snd_pmac_register_sleep_notifier
1373 * because we can't have any private data for notify callback. 1379 * because we can't have any private data for notify callback.
1374 */ 1380 */
1375static pmac_t *sleeping_pmac = NULL; 1381static struct snd_pmac *sleeping_pmac = NULL;
1376 1382
1377static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when) 1383static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when)
1378{ 1384{
1379 pmac_t *chip; 1385 struct snd_pmac *chip;
1380 1386
1381 chip = sleeping_pmac; 1387 chip = sleeping_pmac;
1382 if (! chip) 1388 if (! chip)
@@ -1397,7 +1403,7 @@ static struct pmu_sleep_notifier snd_pmac_sleep_notifier = {
1397 snd_pmac_sleep_notify, SLEEP_LEVEL_SOUND, 1403 snd_pmac_sleep_notify, SLEEP_LEVEL_SOUND,
1398}; 1404};
1399 1405
1400static int __init snd_pmac_register_sleep_notifier(pmac_t *chip) 1406static int __init snd_pmac_register_sleep_notifier(struct snd_pmac *chip)
1401{ 1407{
1402 /* should be protected here.. */ 1408 /* should be protected here.. */
1403 snd_assert(! sleeping_pmac, return -EBUSY); 1409 snd_assert(! sleeping_pmac, return -EBUSY);
@@ -1406,7 +1412,7 @@ static int __init snd_pmac_register_sleep_notifier(pmac_t *chip)
1406 return 0; 1412 return 0;
1407} 1413}
1408 1414
1409static int snd_pmac_unregister_sleep_notifier(pmac_t *chip) 1415static int snd_pmac_unregister_sleep_notifier(struct snd_pmac *chip)
1410{ 1416{
1411 /* should be protected here.. */ 1417 /* should be protected here.. */
1412 snd_assert(sleeping_pmac == chip, return -ENODEV); 1418 snd_assert(sleeping_pmac == chip, return -ENODEV);
diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h
index bfff788e9847..e223884ccb20 100644
--- a/sound/ppc/pmac.h
+++ b/sound/ppc/pmac.h
@@ -47,18 +47,9 @@
47#define PMAC_SUPPORT_AUTOMUTE 47#define PMAC_SUPPORT_AUTOMUTE
48 48
49/* 49/*
50 * typedefs
51 */
52typedef struct snd_pmac pmac_t;
53typedef struct snd_pmac_stream pmac_stream_t;
54typedef struct snd_pmac_beep pmac_beep_t;
55typedef struct snd_pmac_dbdma pmac_dbdma_t;
56
57
58/*
59 * DBDMA space 50 * DBDMA space
60 */ 51 */
61struct snd_pmac_dbdma { 52struct pmac_dbdma {
62 dma_addr_t dma_base; 53 dma_addr_t dma_base;
63 dma_addr_t addr; 54 dma_addr_t addr;
64 struct dbdma_cmd __iomem *cmds; 55 struct dbdma_cmd __iomem *cmds;
@@ -69,7 +60,7 @@ struct snd_pmac_dbdma {
69/* 60/*
70 * playback/capture stream 61 * playback/capture stream
71 */ 62 */
72struct snd_pmac_stream { 63struct pmac_stream {
73 int running; /* boolean */ 64 int running; /* boolean */
74 65
75 int stream; /* PLAYBACK/CAPTURE */ 66 int stream; /* PLAYBACK/CAPTURE */
@@ -79,10 +70,10 @@ struct snd_pmac_stream {
79 int buffer_size; /* in kbytes */ 70 int buffer_size; /* in kbytes */
80 int nperiods, cur_period; 71 int nperiods, cur_period;
81 72
82 pmac_dbdma_t cmd; 73 struct pmac_dbdma cmd;
83 volatile struct dbdma_regs __iomem *dma; 74 volatile struct dbdma_regs __iomem *dma;
84 75
85 snd_pcm_substream_t *substream; 76 struct snd_pcm_substream *substream;
86 77
87 unsigned int cur_freqs; /* currently available frequencies */ 78 unsigned int cur_freqs; /* currently available frequencies */
88 unsigned int cur_formats; /* currently available formats */ 79 unsigned int cur_formats; /* currently available formats */
@@ -98,7 +89,7 @@ enum snd_pmac_model {
98}; 89};
99 90
100struct snd_pmac { 91struct snd_pmac {
101 snd_card_t *card; 92 struct snd_card *card;
102 93
103 /* h/w info */ 94 /* h/w info */
104 struct device_node *node; 95 struct device_node *node;
@@ -140,75 +131,75 @@ struct snd_pmac {
140 unsigned char __iomem *latch_base; 131 unsigned char __iomem *latch_base;
141 unsigned char __iomem *macio_base; 132 unsigned char __iomem *macio_base;
142 133
143 pmac_stream_t playback; 134 struct pmac_stream playback;
144 pmac_stream_t capture; 135 struct pmac_stream capture;
145 136
146 pmac_dbdma_t extra_dma; 137 struct pmac_dbdma extra_dma;
147 138
148 int irq, tx_irq, rx_irq; 139 int irq, tx_irq, rx_irq;
149 140
150 snd_pcm_t *pcm; 141 struct snd_pcm *pcm;
151 142
152 pmac_beep_t *beep; 143 struct pmac_beep *beep;
153 144
154 unsigned int control_mask; /* control mask */ 145 unsigned int control_mask; /* control mask */
155 146
156 /* mixer stuffs */ 147 /* mixer stuffs */
157 void *mixer_data; 148 void *mixer_data;
158 void (*mixer_free)(pmac_t *); 149 void (*mixer_free)(struct snd_pmac *);
159 snd_kcontrol_t *master_sw_ctl; 150 struct snd_kcontrol *master_sw_ctl;
160 snd_kcontrol_t *speaker_sw_ctl; 151 struct snd_kcontrol *speaker_sw_ctl;
161 snd_kcontrol_t *drc_sw_ctl; /* only used for tumbler -ReneR */ 152 struct snd_kcontrol *drc_sw_ctl; /* only used for tumbler -ReneR */
162 snd_kcontrol_t *hp_detect_ctl; 153 struct snd_kcontrol *hp_detect_ctl;
163 snd_kcontrol_t *lineout_sw_ctl; 154 struct snd_kcontrol *lineout_sw_ctl;
164 155
165 /* lowlevel callbacks */ 156 /* lowlevel callbacks */
166 void (*set_format)(pmac_t *chip); 157 void (*set_format)(struct snd_pmac *chip);
167 void (*update_automute)(pmac_t *chip, int do_notify); 158 void (*update_automute)(struct snd_pmac *chip, int do_notify);
168 int (*detect_headphone)(pmac_t *chip); 159 int (*detect_headphone)(struct snd_pmac *chip);
169#ifdef CONFIG_PM 160#ifdef CONFIG_PM
170 void (*suspend)(pmac_t *chip); 161 void (*suspend)(struct snd_pmac *chip);
171 void (*resume)(pmac_t *chip); 162 void (*resume)(struct snd_pmac *chip);
172#endif 163#endif
173 164
174}; 165};
175 166
176 167
177/* exported functions */ 168/* exported functions */
178int snd_pmac_new(snd_card_t *card, pmac_t **chip_return); 169int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return);
179int snd_pmac_pcm_new(pmac_t *chip); 170int snd_pmac_pcm_new(struct snd_pmac *chip);
180int snd_pmac_attach_beep(pmac_t *chip); 171int snd_pmac_attach_beep(struct snd_pmac *chip);
181void snd_pmac_detach_beep(pmac_t *chip); 172void snd_pmac_detach_beep(struct snd_pmac *chip);
182void snd_pmac_beep_stop(pmac_t *chip); 173void snd_pmac_beep_stop(struct snd_pmac *chip);
183unsigned int snd_pmac_rate_index(pmac_t *chip, pmac_stream_t *rec, unsigned int rate); 174unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, unsigned int rate);
184 175
185void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int speed); 176void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long addr, int speed);
186void snd_pmac_beep_dma_stop(pmac_t *chip); 177void snd_pmac_beep_dma_stop(struct snd_pmac *chip);
187 178
188/* initialize mixer */ 179/* initialize mixer */
189int snd_pmac_awacs_init(pmac_t *chip); 180int snd_pmac_awacs_init(struct snd_pmac *chip);
190int snd_pmac_burgundy_init(pmac_t *chip); 181int snd_pmac_burgundy_init(struct snd_pmac *chip);
191int snd_pmac_daca_init(pmac_t *chip); 182int snd_pmac_daca_init(struct snd_pmac *chip);
192int snd_pmac_tumbler_init(pmac_t *chip); 183int snd_pmac_tumbler_init(struct snd_pmac *chip);
193int snd_pmac_tumbler_post_init(void); 184int snd_pmac_tumbler_post_init(void);
194int snd_pmac_toonie_init(pmac_t *chip); 185int snd_pmac_toonie_init(struct snd_pmac *chip);
195 186
196/* i2c functions */ 187/* i2c functions */
197typedef struct snd_pmac_keywest { 188struct pmac_keywest {
198 int addr; 189 int addr;
199 struct i2c_client *client; 190 struct i2c_client *client;
200 int id; 191 int id;
201 int (*init_client)(struct snd_pmac_keywest *i2c); 192 int (*init_client)(struct pmac_keywest *i2c);
202 char *name; 193 char *name;
203} pmac_keywest_t; 194};
204 195
205int snd_pmac_keywest_init(pmac_keywest_t *i2c); 196int snd_pmac_keywest_init(struct pmac_keywest *i2c);
206void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c); 197void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c);
207 198
208/* misc */ 199/* misc */
209int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo); 200int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
210int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo); 201int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
211 202
212int snd_pmac_add_automute(pmac_t *chip); 203int snd_pmac_add_automute(struct snd_pmac *chip);
213 204
214#endif /* __PMAC_H */ 205#endif /* __PMAC_H */
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index a6d8cbf4064f..db139cdee28b 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -49,15 +49,15 @@ MODULE_PARM_DESC(enable_beep, "Enable beep using PCM.");
49 * card entry 49 * card entry
50 */ 50 */
51 51
52static snd_card_t *snd_pmac_card = NULL; 52static struct snd_card *snd_pmac_card = NULL;
53 53
54/* 54/*
55 */ 55 */
56 56
57static int __init snd_pmac_probe(void) 57static int __init snd_pmac_probe(void)
58{ 58{
59 snd_card_t *card; 59 struct snd_card *card;
60 pmac_t *chip; 60 struct snd_pmac *chip;
61 char *name_ext; 61 char *name_ext;
62 int err; 62 int err;
63 63
diff --git a/sound/ppc/toonie.c b/sound/ppc/toonie.c
index 082bc4babab5..053b8f24e4dc 100644
--- a/sound/ppc/toonie.c
+++ b/sound/ppc/toonie.c
@@ -101,10 +101,10 @@ static int read_audio_gpio(struct pmac_gpio *gp)
101 101
102enum { TOONIE_MUTE_HP, TOONIE_MUTE_AMP }; 102enum { TOONIE_MUTE_HP, TOONIE_MUTE_AMP };
103 103
104static int toonie_get_mute_switch(snd_kcontrol_t *kcontrol, 104static int toonie_get_mute_switch(struct snd_kcontrol *kcontrol,
105 snd_ctl_elem_value_t *ucontrol) 105 struct snd_ctl_elem_value *ucontrol)
106{ 106{
107 pmac_t *chip = snd_kcontrol_chip(kcontrol); 107 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
108 struct pmac_toonie *mix = chip->mixer_data; 108 struct pmac_toonie *mix = chip->mixer_data;
109 struct pmac_gpio *gp; 109 struct pmac_gpio *gp;
110 110
@@ -124,10 +124,10 @@ static int toonie_get_mute_switch(snd_kcontrol_t *kcontrol,
124 return 0; 124 return 0;
125} 125}
126 126
127static int toonie_put_mute_switch(snd_kcontrol_t *kcontrol, 127static int toonie_put_mute_switch(struct snd_kcontrol *kcontrol,
128 snd_ctl_elem_value_t *ucontrol) 128 struct snd_ctl_elem_value *ucontrol)
129{ 129{
130 pmac_t *chip = snd_kcontrol_chip(kcontrol); 130 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
131 struct pmac_toonie *mix = chip->mixer_data; 131 struct pmac_toonie *mix = chip->mixer_data;
132 struct pmac_gpio *gp; 132 struct pmac_gpio *gp;
133 int val; 133 int val;
@@ -156,7 +156,7 @@ static int toonie_put_mute_switch(snd_kcontrol_t *kcontrol,
156 return 0; 156 return 0;
157} 157}
158 158
159static snd_kcontrol_new_t toonie_hp_sw __initdata = { 159static struct snd_kcontrol_new toonie_hp_sw __initdata = {
160 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 160 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
161 .name = "Headphone Playback Switch", 161 .name = "Headphone Playback Switch",
162 .info = snd_pmac_boolean_mono_info, 162 .info = snd_pmac_boolean_mono_info,
@@ -164,7 +164,7 @@ static snd_kcontrol_new_t toonie_hp_sw __initdata = {
164 .put = toonie_put_mute_switch, 164 .put = toonie_put_mute_switch,
165 .private_value = TOONIE_MUTE_HP, 165 .private_value = TOONIE_MUTE_HP,
166}; 166};
167static snd_kcontrol_new_t toonie_speaker_sw __initdata = { 167static struct snd_kcontrol_new toonie_speaker_sw __initdata = {
168 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 168 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
169 .name = "PC Speaker Playback Switch", 169 .name = "PC Speaker Playback Switch",
170 .info = snd_pmac_boolean_mono_info, 170 .info = snd_pmac_boolean_mono_info,
@@ -176,7 +176,7 @@ static snd_kcontrol_new_t toonie_speaker_sw __initdata = {
176/* 176/*
177 * auto-mute stuffs 177 * auto-mute stuffs
178 */ 178 */
179static int toonie_detect_headphone(pmac_t *chip) 179static int toonie_detect_headphone(struct snd_pmac *chip)
180{ 180{
181 struct pmac_toonie *mix = chip->mixer_data; 181 struct pmac_toonie *mix = chip->mixer_data;
182 int detect = 0; 182 int detect = 0;
@@ -186,8 +186,8 @@ static int toonie_detect_headphone(pmac_t *chip)
186 return detect; 186 return detect;
187} 187}
188 188
189static void toonie_check_mute(pmac_t *chip, struct pmac_gpio *gp, int val, 189static void toonie_check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val,
190 int do_notify, snd_kcontrol_t *sw) 190 int do_notify, struct snd_kcontrol *sw)
191{ 191{
192 if (check_audio_gpio(gp) != val) { 192 if (check_audio_gpio(gp) != val) {
193 write_audio_gpio(gp, val); 193 write_audio_gpio(gp, val);
@@ -199,7 +199,7 @@ static void toonie_check_mute(pmac_t *chip, struct pmac_gpio *gp, int val,
199 199
200static void toonie_detect_handler(void *self) 200static void toonie_detect_handler(void *self)
201{ 201{
202 pmac_t *chip = (pmac_t*) self; 202 struct snd_pmac *chip = (struct snd_pmac *) self;
203 struct pmac_toonie *mix; 203 struct pmac_toonie *mix;
204 int headphone; 204 int headphone;
205 205
@@ -232,7 +232,7 @@ static void toonie_detect_handler(void *self)
232 } 232 }
233} 233}
234 234
235static void toonie_update_automute(pmac_t *chip, int do_notify) 235static void toonie_update_automute(struct snd_pmac *chip, int do_notify)
236{ 236{
237 if (chip->auto_mute) { 237 if (chip->auto_mute) {
238 struct pmac_toonie *mix; 238 struct pmac_toonie *mix;
@@ -246,7 +246,7 @@ static void toonie_update_automute(pmac_t *chip, int do_notify)
246/* interrupt - headphone plug changed */ 246/* interrupt - headphone plug changed */
247static irqreturn_t toonie_hp_intr(int irq, void *devid, struct pt_regs *regs) 247static irqreturn_t toonie_hp_intr(int irq, void *devid, struct pt_regs *regs)
248{ 248{
249 pmac_t *chip = devid; 249 struct snd_pmac *chip = devid;
250 250
251 if (chip->update_automute && chip->initialized) { 251 if (chip->update_automute && chip->initialized) {
252 chip->update_automute(chip, 1); 252 chip->update_automute(chip, 1);
@@ -325,7 +325,7 @@ static int find_audio_gpio(const char *name, const char *platform,
325 return (np->n_intrs > 0) ? np->intrs[0].line : 0; 325 return (np->n_intrs > 0) ? np->intrs[0].line : 0;
326} 326}
327 327
328static void toonie_cleanup(pmac_t *chip) 328static void toonie_cleanup(struct snd_pmac *chip)
329{ 329{
330 struct pmac_toonie *mix = chip->mixer_data; 330 struct pmac_toonie *mix = chip->mixer_data;
331 if (! mix) 331 if (! mix)
@@ -336,7 +336,7 @@ static void toonie_cleanup(pmac_t *chip)
336 chip->mixer_data = NULL; 336 chip->mixer_data = NULL;
337} 337}
338 338
339int snd_pmac_toonie_init(pmac_t *chip) 339int snd_pmac_toonie_init(struct snd_pmac *chip)
340{ 340{
341 struct pmac_toonie *mix; 341 struct pmac_toonie *mix;
342 342
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index d74bfabe5300..15c63cb2ccba 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -82,21 +82,21 @@ enum {
82 VOL_IDX_LAST_MIX 82 VOL_IDX_LAST_MIX
83}; 83};
84 84
85typedef struct pmac_gpio { 85struct pmac_gpio {
86 unsigned int addr; 86 unsigned int addr;
87 u8 active_val; 87 u8 active_val;
88 u8 inactive_val; 88 u8 inactive_val;
89 u8 active_state; 89 u8 active_state;
90} pmac_gpio_t; 90};
91 91
92typedef struct pmac_tumbler_t { 92struct pmac_tumbler {
93 pmac_keywest_t i2c; 93 struct pmac_keywest i2c;
94 pmac_gpio_t audio_reset; 94 struct pmac_gpio audio_reset;
95 pmac_gpio_t amp_mute; 95 struct pmac_gpio amp_mute;
96 pmac_gpio_t line_mute; 96 struct pmac_gpio line_mute;
97 pmac_gpio_t line_detect; 97 struct pmac_gpio line_detect;
98 pmac_gpio_t hp_mute; 98 struct pmac_gpio hp_mute;
99 pmac_gpio_t hp_detect; 99 struct pmac_gpio hp_detect;
100 int headphone_irq; 100 int headphone_irq;
101 int lineout_irq; 101 int lineout_irq;
102 unsigned int save_master_vol[2]; 102 unsigned int save_master_vol[2];
@@ -112,13 +112,13 @@ typedef struct pmac_tumbler_t {
112 int auto_mute_notify; 112 int auto_mute_notify;
113 int reset_on_sleep; 113 int reset_on_sleep;
114 u8 acs; 114 u8 acs;
115} pmac_tumbler_t; 115};
116 116
117 117
118/* 118/*
119 */ 119 */
120 120
121static int send_init_client(pmac_keywest_t *i2c, unsigned int *regs) 121static int send_init_client(struct pmac_keywest *i2c, unsigned int *regs)
122{ 122{
123 while (*regs > 0) { 123 while (*regs > 0) {
124 int err, count = 10; 124 int err, count = 10;
@@ -138,7 +138,7 @@ static int send_init_client(pmac_keywest_t *i2c, unsigned int *regs)
138} 138}
139 139
140 140
141static int tumbler_init_client(pmac_keywest_t *i2c) 141static int tumbler_init_client(struct pmac_keywest *i2c)
142{ 142{
143 static unsigned int regs[] = { 143 static unsigned int regs[] = {
144 /* normal operation, SCLK=64fps, i2s output, i2s input, 16bit width */ 144 /* normal operation, SCLK=64fps, i2s output, i2s input, 16bit width */
@@ -149,7 +149,7 @@ static int tumbler_init_client(pmac_keywest_t *i2c)
149 return send_init_client(i2c, regs); 149 return send_init_client(i2c, regs);
150} 150}
151 151
152static int snapper_init_client(pmac_keywest_t *i2c) 152static int snapper_init_client(struct pmac_keywest *i2c)
153{ 153{
154 static unsigned int regs[] = { 154 static unsigned int regs[] = {
155 /* normal operation, SCLK=64fps, i2s output, 16bit width */ 155 /* normal operation, SCLK=64fps, i2s output, 16bit width */
@@ -173,7 +173,7 @@ static int snapper_init_client(pmac_keywest_t *i2c)
173 pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, (gp)->addr, 0) 173 pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, (gp)->addr, 0)
174#define tumbler_gpio_free(gp) /* NOP */ 174#define tumbler_gpio_free(gp) /* NOP */
175 175
176static void write_audio_gpio(pmac_gpio_t *gp, int active) 176static void write_audio_gpio(struct pmac_gpio *gp, int active)
177{ 177{
178 if (! gp->addr) 178 if (! gp->addr)
179 return; 179 return;
@@ -182,7 +182,7 @@ static void write_audio_gpio(pmac_gpio_t *gp, int active)
182 DBG("(I) gpio %x write %d\n", gp->addr, active); 182 DBG("(I) gpio %x write %d\n", gp->addr, active);
183} 183}
184 184
185static int check_audio_gpio(pmac_gpio_t *gp) 185static int check_audio_gpio(struct pmac_gpio *gp)
186{ 186{
187 int ret; 187 int ret;
188 188
@@ -194,7 +194,7 @@ static int check_audio_gpio(pmac_gpio_t *gp)
194 return (ret & 0xd) == (gp->active_val & 0xd); 194 return (ret & 0xd) == (gp->active_val & 0xd);
195} 195}
196 196
197static int read_audio_gpio(pmac_gpio_t *gp) 197static int read_audio_gpio(struct pmac_gpio *gp)
198{ 198{
199 int ret; 199 int ret;
200 if (! gp->addr) 200 if (! gp->addr)
@@ -206,7 +206,7 @@ static int read_audio_gpio(pmac_gpio_t *gp)
206/* 206/*
207 * update master volume 207 * update master volume
208 */ 208 */
209static int tumbler_set_master_volume(pmac_tumbler_t *mix) 209static int tumbler_set_master_volume(struct pmac_tumbler *mix)
210{ 210{
211 unsigned char block[6]; 211 unsigned char block[6];
212 unsigned int left_vol, right_vol; 212 unsigned int left_vol, right_vol;
@@ -249,7 +249,8 @@ static int tumbler_set_master_volume(pmac_tumbler_t *mix)
249 249
250 250
251/* output volume */ 251/* output volume */
252static int tumbler_info_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 252static int tumbler_info_master_volume(struct snd_kcontrol *kcontrol,
253 struct snd_ctl_elem_info *uinfo)
253{ 254{
254 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 255 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
255 uinfo->count = 2; 256 uinfo->count = 2;
@@ -258,20 +259,22 @@ static int tumbler_info_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
258 return 0; 259 return 0;
259} 260}
260 261
261static int tumbler_get_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 262static int tumbler_get_master_volume(struct snd_kcontrol *kcontrol,
263 struct snd_ctl_elem_value *ucontrol)
262{ 264{
263 pmac_t *chip = snd_kcontrol_chip(kcontrol); 265 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
264 pmac_tumbler_t *mix = chip->mixer_data; 266 struct pmac_tumbler *mix = chip->mixer_data;
265 snd_assert(mix, return -ENODEV); 267 snd_assert(mix, return -ENODEV);
266 ucontrol->value.integer.value[0] = mix->master_vol[0]; 268 ucontrol->value.integer.value[0] = mix->master_vol[0];
267 ucontrol->value.integer.value[1] = mix->master_vol[1]; 269 ucontrol->value.integer.value[1] = mix->master_vol[1];
268 return 0; 270 return 0;
269} 271}
270 272
271static int tumbler_put_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 273static int tumbler_put_master_volume(struct snd_kcontrol *kcontrol,
274 struct snd_ctl_elem_value *ucontrol)
272{ 275{
273 pmac_t *chip = snd_kcontrol_chip(kcontrol); 276 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
274 pmac_tumbler_t *mix = chip->mixer_data; 277 struct pmac_tumbler *mix = chip->mixer_data;
275 int change; 278 int change;
276 279
277 snd_assert(mix, return -ENODEV); 280 snd_assert(mix, return -ENODEV);
@@ -286,20 +289,22 @@ static int tumbler_put_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
286} 289}
287 290
288/* output switch */ 291/* output switch */
289static int tumbler_get_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 292static int tumbler_get_master_switch(struct snd_kcontrol *kcontrol,
293 struct snd_ctl_elem_value *ucontrol)
290{ 294{
291 pmac_t *chip = snd_kcontrol_chip(kcontrol); 295 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
292 pmac_tumbler_t *mix = chip->mixer_data; 296 struct pmac_tumbler *mix = chip->mixer_data;
293 snd_assert(mix, return -ENODEV); 297 snd_assert(mix, return -ENODEV);
294 ucontrol->value.integer.value[0] = mix->master_switch[0]; 298 ucontrol->value.integer.value[0] = mix->master_switch[0];
295 ucontrol->value.integer.value[1] = mix->master_switch[1]; 299 ucontrol->value.integer.value[1] = mix->master_switch[1];
296 return 0; 300 return 0;
297} 301}
298 302
299static int tumbler_put_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 303static int tumbler_put_master_switch(struct snd_kcontrol *kcontrol,
304 struct snd_ctl_elem_value *ucontrol)
300{ 305{
301 pmac_t *chip = snd_kcontrol_chip(kcontrol); 306 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
302 pmac_tumbler_t *mix = chip->mixer_data; 307 struct pmac_tumbler *mix = chip->mixer_data;
303 int change; 308 int change;
304 309
305 snd_assert(mix, return -ENODEV); 310 snd_assert(mix, return -ENODEV);
@@ -320,7 +325,7 @@ static int tumbler_put_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
320 325
321#define TAS3001_DRC_MAX 0x5f 326#define TAS3001_DRC_MAX 0x5f
322 327
323static int tumbler_set_drc(pmac_tumbler_t *mix) 328static int tumbler_set_drc(struct pmac_tumbler *mix)
324{ 329{
325 unsigned char val[2]; 330 unsigned char val[2];
326 331
@@ -354,7 +359,7 @@ static int tumbler_set_drc(pmac_tumbler_t *mix)
354 359
355#define TAS3004_DRC_MAX 0xef 360#define TAS3004_DRC_MAX 0xef
356 361
357static int snapper_set_drc(pmac_tumbler_t *mix) 362static int snapper_set_drc(struct pmac_tumbler *mix)
358{ 363{
359 unsigned char val[6]; 364 unsigned char val[6];
360 365
@@ -384,9 +389,10 @@ static int snapper_set_drc(pmac_tumbler_t *mix)
384 return 0; 389 return 0;
385} 390}
386 391
387static int tumbler_info_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 392static int tumbler_info_drc_value(struct snd_kcontrol *kcontrol,
393 struct snd_ctl_elem_info *uinfo)
388{ 394{
389 pmac_t *chip = snd_kcontrol_chip(kcontrol); 395 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
390 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 396 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
391 uinfo->count = 1; 397 uinfo->count = 1;
392 uinfo->value.integer.min = 0; 398 uinfo->value.integer.min = 0;
@@ -395,20 +401,22 @@ static int tumbler_info_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
395 return 0; 401 return 0;
396} 402}
397 403
398static int tumbler_get_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 404static int tumbler_get_drc_value(struct snd_kcontrol *kcontrol,
405 struct snd_ctl_elem_value *ucontrol)
399{ 406{
400 pmac_t *chip = snd_kcontrol_chip(kcontrol); 407 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
401 pmac_tumbler_t *mix; 408 struct pmac_tumbler *mix;
402 if (! (mix = chip->mixer_data)) 409 if (! (mix = chip->mixer_data))
403 return -ENODEV; 410 return -ENODEV;
404 ucontrol->value.integer.value[0] = mix->drc_range; 411 ucontrol->value.integer.value[0] = mix->drc_range;
405 return 0; 412 return 0;
406} 413}
407 414
408static int tumbler_put_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 415static int tumbler_put_drc_value(struct snd_kcontrol *kcontrol,
416 struct snd_ctl_elem_value *ucontrol)
409{ 417{
410 pmac_t *chip = snd_kcontrol_chip(kcontrol); 418 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
411 pmac_tumbler_t *mix; 419 struct pmac_tumbler *mix;
412 int change; 420 int change;
413 421
414 if (! (mix = chip->mixer_data)) 422 if (! (mix = chip->mixer_data))
@@ -424,20 +432,22 @@ static int tumbler_put_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
424 return change; 432 return change;
425} 433}
426 434
427static int tumbler_get_drc_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 435static int tumbler_get_drc_switch(struct snd_kcontrol *kcontrol,
436 struct snd_ctl_elem_value *ucontrol)
428{ 437{
429 pmac_t *chip = snd_kcontrol_chip(kcontrol); 438 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
430 pmac_tumbler_t *mix; 439 struct pmac_tumbler *mix;
431 if (! (mix = chip->mixer_data)) 440 if (! (mix = chip->mixer_data))
432 return -ENODEV; 441 return -ENODEV;
433 ucontrol->value.integer.value[0] = mix->drc_enable; 442 ucontrol->value.integer.value[0] = mix->drc_enable;
434 return 0; 443 return 0;
435} 444}
436 445
437static int tumbler_put_drc_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 446static int tumbler_put_drc_switch(struct snd_kcontrol *kcontrol,
447 struct snd_ctl_elem_value *ucontrol)
438{ 448{
439 pmac_t *chip = snd_kcontrol_chip(kcontrol); 449 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
440 pmac_tumbler_t *mix; 450 struct pmac_tumbler *mix;
441 int change; 451 int change;
442 452
443 if (! (mix = chip->mixer_data)) 453 if (! (mix = chip->mixer_data))
@@ -466,7 +476,8 @@ struct tumbler_mono_vol {
466 unsigned int *table; 476 unsigned int *table;
467}; 477};
468 478
469static int tumbler_set_mono_volume(pmac_tumbler_t *mix, struct tumbler_mono_vol *info) 479static int tumbler_set_mono_volume(struct pmac_tumbler *mix,
480 struct tumbler_mono_vol *info)
470{ 481{
471 unsigned char block[4]; 482 unsigned char block[4];
472 unsigned int vol; 483 unsigned int vol;
@@ -489,7 +500,8 @@ static int tumbler_set_mono_volume(pmac_tumbler_t *mix, struct tumbler_mono_vol
489 return 0; 500 return 0;
490} 501}
491 502
492static int tumbler_info_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 503static int tumbler_info_mono(struct snd_kcontrol *kcontrol,
504 struct snd_ctl_elem_info *uinfo)
493{ 505{
494 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value; 506 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
495 507
@@ -500,22 +512,24 @@ static int tumbler_info_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
500 return 0; 512 return 0;
501} 513}
502 514
503static int tumbler_get_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 515static int tumbler_get_mono(struct snd_kcontrol *kcontrol,
516 struct snd_ctl_elem_value *ucontrol)
504{ 517{
505 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value; 518 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
506 pmac_t *chip = snd_kcontrol_chip(kcontrol); 519 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
507 pmac_tumbler_t *mix; 520 struct pmac_tumbler *mix;
508 if (! (mix = chip->mixer_data)) 521 if (! (mix = chip->mixer_data))
509 return -ENODEV; 522 return -ENODEV;
510 ucontrol->value.integer.value[0] = mix->mono_vol[info->index]; 523 ucontrol->value.integer.value[0] = mix->mono_vol[info->index];
511 return 0; 524 return 0;
512} 525}
513 526
514static int tumbler_put_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 527static int tumbler_put_mono(struct snd_kcontrol *kcontrol,
528 struct snd_ctl_elem_value *ucontrol)
515{ 529{
516 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value; 530 struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
517 pmac_t *chip = snd_kcontrol_chip(kcontrol); 531 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
518 pmac_tumbler_t *mix; 532 struct pmac_tumbler *mix;
519 int change; 533 int change;
520 534
521 if (! (mix = chip->mixer_data)) 535 if (! (mix = chip->mixer_data))
@@ -594,7 +608,7 @@ static struct tumbler_mono_vol snapper_treble_vol_info = {
594 * snapper mixer volumes 608 * snapper mixer volumes
595 */ 609 */
596 610
597static int snapper_set_mix_vol1(pmac_tumbler_t *mix, int idx, int ch, int reg) 611static int snapper_set_mix_vol1(struct pmac_tumbler *mix, int idx, int ch, int reg)
598{ 612{
599 int i, j, vol; 613 int i, j, vol;
600 unsigned char block[9]; 614 unsigned char block[9];
@@ -618,7 +632,7 @@ static int snapper_set_mix_vol1(pmac_tumbler_t *mix, int idx, int ch, int reg)
618 return 0; 632 return 0;
619} 633}
620 634
621static int snapper_set_mix_vol(pmac_tumbler_t *mix, int idx) 635static int snapper_set_mix_vol(struct pmac_tumbler *mix, int idx)
622{ 636{
623 if (! mix->i2c.client) 637 if (! mix->i2c.client)
624 return -ENODEV; 638 return -ENODEV;
@@ -628,7 +642,8 @@ static int snapper_set_mix_vol(pmac_tumbler_t *mix, int idx)
628 return 0; 642 return 0;
629} 643}
630 644
631static int snapper_info_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 645static int snapper_info_mix(struct snd_kcontrol *kcontrol,
646 struct snd_ctl_elem_info *uinfo)
632{ 647{
633 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 648 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
634 uinfo->count = 2; 649 uinfo->count = 2;
@@ -637,11 +652,12 @@ static int snapper_info_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
637 return 0; 652 return 0;
638} 653}
639 654
640static int snapper_get_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 655static int snapper_get_mix(struct snd_kcontrol *kcontrol,
656 struct snd_ctl_elem_value *ucontrol)
641{ 657{
642 int idx = (int)kcontrol->private_value; 658 int idx = (int)kcontrol->private_value;
643 pmac_t *chip = snd_kcontrol_chip(kcontrol); 659 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
644 pmac_tumbler_t *mix; 660 struct pmac_tumbler *mix;
645 if (! (mix = chip->mixer_data)) 661 if (! (mix = chip->mixer_data))
646 return -ENODEV; 662 return -ENODEV;
647 ucontrol->value.integer.value[0] = mix->mix_vol[idx][0]; 663 ucontrol->value.integer.value[0] = mix->mix_vol[idx][0];
@@ -649,11 +665,12 @@ static int snapper_get_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
649 return 0; 665 return 0;
650} 666}
651 667
652static int snapper_put_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 668static int snapper_put_mix(struct snd_kcontrol *kcontrol,
669 struct snd_ctl_elem_value *ucontrol)
653{ 670{
654 int idx = (int)kcontrol->private_value; 671 int idx = (int)kcontrol->private_value;
655 pmac_t *chip = snd_kcontrol_chip(kcontrol); 672 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
656 pmac_tumbler_t *mix; 673 struct pmac_tumbler *mix;
657 int change; 674 int change;
658 675
659 if (! (mix = chip->mixer_data)) 676 if (! (mix = chip->mixer_data))
@@ -676,11 +693,12 @@ static int snapper_put_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
676 693
677enum { TUMBLER_MUTE_HP, TUMBLER_MUTE_AMP, TUMBLER_MUTE_LINE }; 694enum { TUMBLER_MUTE_HP, TUMBLER_MUTE_AMP, TUMBLER_MUTE_LINE };
678 695
679static int tumbler_get_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 696static int tumbler_get_mute_switch(struct snd_kcontrol *kcontrol,
697 struct snd_ctl_elem_value *ucontrol)
680{ 698{
681 pmac_t *chip = snd_kcontrol_chip(kcontrol); 699 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
682 pmac_tumbler_t *mix; 700 struct pmac_tumbler *mix;
683 pmac_gpio_t *gp; 701 struct pmac_gpio *gp;
684 if (! (mix = chip->mixer_data)) 702 if (! (mix = chip->mixer_data))
685 return -ENODEV; 703 return -ENODEV;
686 switch(kcontrol->private_value) { 704 switch(kcontrol->private_value) {
@@ -699,11 +717,12 @@ static int tumbler_get_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_
699 return 0; 717 return 0;
700} 718}
701 719
702static int tumbler_put_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 720static int tumbler_put_mute_switch(struct snd_kcontrol *kcontrol,
721 struct snd_ctl_elem_value *ucontrol)
703{ 722{
704 pmac_t *chip = snd_kcontrol_chip(kcontrol); 723 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
705 pmac_tumbler_t *mix; 724 struct pmac_tumbler *mix;
706 pmac_gpio_t *gp; 725 struct pmac_gpio *gp;
707 int val; 726 int val;
708#ifdef PMAC_SUPPORT_AUTOMUTE 727#ifdef PMAC_SUPPORT_AUTOMUTE
709 if (chip->update_automute && chip->auto_mute) 728 if (chip->update_automute && chip->auto_mute)
@@ -731,7 +750,7 @@ static int tumbler_put_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_
731 return 0; 750 return 0;
732} 751}
733 752
734static int snapper_set_capture_source(pmac_tumbler_t *mix) 753static int snapper_set_capture_source(struct pmac_tumbler *mix)
735{ 754{
736 if (! mix->i2c.client) 755 if (! mix->i2c.client)
737 return -ENODEV; 756 return -ENODEV;
@@ -742,7 +761,8 @@ static int snapper_set_capture_source(pmac_tumbler_t *mix)
742 return i2c_smbus_write_byte_data(mix->i2c.client, TAS_REG_ACS, mix->acs); 761 return i2c_smbus_write_byte_data(mix->i2c.client, TAS_REG_ACS, mix->acs);
743} 762}
744 763
745static int snapper_info_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 764static int snapper_info_capture_source(struct snd_kcontrol *kcontrol,
765 struct snd_ctl_elem_info *uinfo)
746{ 766{
747 static char *texts[2] = { 767 static char *texts[2] = {
748 "Line", "Mic" 768 "Line", "Mic"
@@ -756,20 +776,22 @@ static int snapper_info_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_in
756 return 0; 776 return 0;
757} 777}
758 778
759static int snapper_get_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 779static int snapper_get_capture_source(struct snd_kcontrol *kcontrol,
780 struct snd_ctl_elem_value *ucontrol)
760{ 781{
761 pmac_t *chip = snd_kcontrol_chip(kcontrol); 782 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
762 pmac_tumbler_t *mix = chip->mixer_data; 783 struct pmac_tumbler *mix = chip->mixer_data;
763 784
764 snd_assert(mix, return -ENODEV); 785 snd_assert(mix, return -ENODEV);
765 ucontrol->value.integer.value[0] = mix->capture_source; 786 ucontrol->value.integer.value[0] = mix->capture_source;
766 return 0; 787 return 0;
767} 788}
768 789
769static int snapper_put_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 790static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,
791 struct snd_ctl_elem_value *ucontrol)
770{ 792{
771 pmac_t *chip = snd_kcontrol_chip(kcontrol); 793 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
772 pmac_tumbler_t *mix = chip->mixer_data; 794 struct pmac_tumbler *mix = chip->mixer_data;
773 int change; 795 int change;
774 796
775 snd_assert(mix, return -ENODEV); 797 snd_assert(mix, return -ENODEV);
@@ -794,7 +816,7 @@ static int snapper_put_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
794 816
795/* 817/*
796 */ 818 */
797static snd_kcontrol_new_t tumbler_mixers[] __initdata = { 819static struct snd_kcontrol_new tumbler_mixers[] __initdata = {
798 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 820 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
799 .name = "Master Playback Volume", 821 .name = "Master Playback Volume",
800 .info = tumbler_info_master_volume, 822 .info = tumbler_info_master_volume,
@@ -818,7 +840,7 @@ static snd_kcontrol_new_t tumbler_mixers[] __initdata = {
818 }, 840 },
819}; 841};
820 842
821static snd_kcontrol_new_t snapper_mixers[] __initdata = { 843static struct snd_kcontrol_new snapper_mixers[] __initdata = {
822 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 844 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
823 .name = "Master Playback Volume", 845 .name = "Master Playback Volume",
824 .info = tumbler_info_master_volume, 846 .info = tumbler_info_master_volume,
@@ -850,7 +872,7 @@ static snd_kcontrol_new_t snapper_mixers[] __initdata = {
850 }, 872 },
851}; 873};
852 874
853static snd_kcontrol_new_t tumbler_hp_sw __initdata = { 875static struct snd_kcontrol_new tumbler_hp_sw __initdata = {
854 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 876 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
855 .name = "Headphone Playback Switch", 877 .name = "Headphone Playback Switch",
856 .info = snd_pmac_boolean_mono_info, 878 .info = snd_pmac_boolean_mono_info,
@@ -858,7 +880,7 @@ static snd_kcontrol_new_t tumbler_hp_sw __initdata = {
858 .put = tumbler_put_mute_switch, 880 .put = tumbler_put_mute_switch,
859 .private_value = TUMBLER_MUTE_HP, 881 .private_value = TUMBLER_MUTE_HP,
860}; 882};
861static snd_kcontrol_new_t tumbler_speaker_sw __initdata = { 883static struct snd_kcontrol_new tumbler_speaker_sw __initdata = {
862 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 884 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
863 .name = "PC Speaker Playback Switch", 885 .name = "PC Speaker Playback Switch",
864 .info = snd_pmac_boolean_mono_info, 886 .info = snd_pmac_boolean_mono_info,
@@ -866,7 +888,7 @@ static snd_kcontrol_new_t tumbler_speaker_sw __initdata = {
866 .put = tumbler_put_mute_switch, 888 .put = tumbler_put_mute_switch,
867 .private_value = TUMBLER_MUTE_AMP, 889 .private_value = TUMBLER_MUTE_AMP,
868}; 890};
869static snd_kcontrol_new_t tumbler_lineout_sw __initdata = { 891static struct snd_kcontrol_new tumbler_lineout_sw __initdata = {
870 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 892 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
871 .name = "Line Out Playback Switch", 893 .name = "Line Out Playback Switch",
872 .info = snd_pmac_boolean_mono_info, 894 .info = snd_pmac_boolean_mono_info,
@@ -874,7 +896,7 @@ static snd_kcontrol_new_t tumbler_lineout_sw __initdata = {
874 .put = tumbler_put_mute_switch, 896 .put = tumbler_put_mute_switch,
875 .private_value = TUMBLER_MUTE_LINE, 897 .private_value = TUMBLER_MUTE_LINE,
876}; 898};
877static snd_kcontrol_new_t tumbler_drc_sw __initdata = { 899static struct snd_kcontrol_new tumbler_drc_sw __initdata = {
878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 900 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .name = "DRC Switch", 901 .name = "DRC Switch",
880 .info = snd_pmac_boolean_mono_info, 902 .info = snd_pmac_boolean_mono_info,
@@ -887,9 +909,9 @@ static snd_kcontrol_new_t tumbler_drc_sw __initdata = {
887/* 909/*
888 * auto-mute stuffs 910 * auto-mute stuffs
889 */ 911 */
890static int tumbler_detect_headphone(pmac_t *chip) 912static int tumbler_detect_headphone(struct snd_pmac *chip)
891{ 913{
892 pmac_tumbler_t *mix = chip->mixer_data; 914 struct pmac_tumbler *mix = chip->mixer_data;
893 int detect = 0; 915 int detect = 0;
894 916
895 if (mix->hp_detect.addr) 917 if (mix->hp_detect.addr)
@@ -897,9 +919,9 @@ static int tumbler_detect_headphone(pmac_t *chip)
897 return detect; 919 return detect;
898} 920}
899 921
900static int tumbler_detect_lineout(pmac_t *chip) 922static int tumbler_detect_lineout(struct snd_pmac *chip)
901{ 923{
902 pmac_tumbler_t *mix = chip->mixer_data; 924 struct pmac_tumbler *mix = chip->mixer_data;
903 int detect = 0; 925 int detect = 0;
904 926
905 if (mix->line_detect.addr) 927 if (mix->line_detect.addr)
@@ -907,7 +929,8 @@ static int tumbler_detect_lineout(pmac_t *chip)
907 return detect; 929 return detect;
908} 930}
909 931
910static void check_mute(pmac_t *chip, pmac_gpio_t *gp, int val, int do_notify, snd_kcontrol_t *sw) 932static void check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val, int do_notify,
933 struct snd_kcontrol *sw)
911{ 934{
912 if (check_audio_gpio(gp) != val) { 935 if (check_audio_gpio(gp) != val) {
913 write_audio_gpio(gp, val); 936 write_audio_gpio(gp, val);
@@ -921,8 +944,8 @@ static struct work_struct device_change;
921 944
922static void device_change_handler(void *self) 945static void device_change_handler(void *self)
923{ 946{
924 pmac_t *chip = (pmac_t*) self; 947 struct snd_pmac *chip = self;
925 pmac_tumbler_t *mix; 948 struct pmac_tumbler *mix;
926 int headphone, lineout; 949 int headphone, lineout;
927 950
928 if (!chip) 951 if (!chip)
@@ -979,10 +1002,10 @@ static void device_change_handler(void *self)
979 tumbler_set_master_volume(mix); 1002 tumbler_set_master_volume(mix);
980} 1003}
981 1004
982static void tumbler_update_automute(pmac_t *chip, int do_notify) 1005static void tumbler_update_automute(struct snd_pmac *chip, int do_notify)
983{ 1006{
984 if (chip->auto_mute) { 1007 if (chip->auto_mute) {
985 pmac_tumbler_t *mix; 1008 struct pmac_tumbler *mix;
986 mix = chip->mixer_data; 1009 mix = chip->mixer_data;
987 snd_assert(mix, return); 1010 snd_assert(mix, return);
988 mix->auto_mute_notify = do_notify; 1011 mix->auto_mute_notify = do_notify;
@@ -995,7 +1018,7 @@ static void tumbler_update_automute(pmac_t *chip, int do_notify)
995/* interrupt - headphone plug changed */ 1018/* interrupt - headphone plug changed */
996static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs) 1019static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs)
997{ 1020{
998 pmac_t *chip = devid; 1021 struct snd_pmac *chip = devid;
999 if (chip->update_automute && chip->initialized) { 1022 if (chip->update_automute && chip->initialized) {
1000 chip->update_automute(chip, 1); 1023 chip->update_automute(chip, 1);
1001 return IRQ_HANDLED; 1024 return IRQ_HANDLED;
@@ -1035,7 +1058,8 @@ static struct device_node *find_compatible_audio_device(const char *name)
1035} 1058}
1036 1059
1037/* find an audio device and get its address */ 1060/* find an audio device and get its address */
1038static long tumbler_find_device(const char *device, const char *platform, pmac_gpio_t *gp, int is_compatible) 1061static long tumbler_find_device(const char *device, const char *platform,
1062 struct pmac_gpio *gp, int is_compatible)
1039{ 1063{
1040 struct device_node *node; 1064 struct device_node *node;
1041 u32 *base, addr; 1065 u32 *base, addr;
@@ -1101,9 +1125,9 @@ static long tumbler_find_device(const char *device, const char *platform, pmac_g
1101} 1125}
1102 1126
1103/* reset audio */ 1127/* reset audio */
1104static void tumbler_reset_audio(pmac_t *chip) 1128static void tumbler_reset_audio(struct snd_pmac *chip)
1105{ 1129{
1106 pmac_tumbler_t *mix = chip->mixer_data; 1130 struct pmac_tumbler *mix = chip->mixer_data;
1107 1131
1108 if (mix->anded_reset) { 1132 if (mix->anded_reset) {
1109 DBG("(I) codec anded reset !\n"); 1133 DBG("(I) codec anded reset !\n");
@@ -1130,9 +1154,9 @@ static void tumbler_reset_audio(pmac_t *chip)
1130 1154
1131#ifdef CONFIG_PM 1155#ifdef CONFIG_PM
1132/* suspend mixer */ 1156/* suspend mixer */
1133static void tumbler_suspend(pmac_t *chip) 1157static void tumbler_suspend(struct snd_pmac *chip)
1134{ 1158{
1135 pmac_tumbler_t *mix = chip->mixer_data; 1159 struct pmac_tumbler *mix = chip->mixer_data;
1136 1160
1137 if (mix->headphone_irq >= 0) 1161 if (mix->headphone_irq >= 0)
1138 disable_irq(mix->headphone_irq); 1162 disable_irq(mix->headphone_irq);
@@ -1160,9 +1184,9 @@ static void tumbler_suspend(pmac_t *chip)
1160} 1184}
1161 1185
1162/* resume mixer */ 1186/* resume mixer */
1163static void tumbler_resume(pmac_t *chip) 1187static void tumbler_resume(struct snd_pmac *chip)
1164{ 1188{
1165 pmac_tumbler_t *mix = chip->mixer_data; 1189 struct pmac_tumbler *mix = chip->mixer_data;
1166 1190
1167 snd_assert(mix, return); 1191 snd_assert(mix, return);
1168 1192
@@ -1208,10 +1232,10 @@ static void tumbler_resume(pmac_t *chip)
1208#endif 1232#endif
1209 1233
1210/* initialize tumbler */ 1234/* initialize tumbler */
1211static int __init tumbler_init(pmac_t *chip) 1235static int __init tumbler_init(struct snd_pmac *chip)
1212{ 1236{
1213 int irq; 1237 int irq;
1214 pmac_tumbler_t *mix = chip->mixer_data; 1238 struct pmac_tumbler *mix = chip->mixer_data;
1215 snd_assert(mix, return -EINVAL); 1239 snd_assert(mix, return -EINVAL);
1216 1240
1217 if (tumbler_find_device("audio-hw-reset", 1241 if (tumbler_find_device("audio-hw-reset",
@@ -1259,9 +1283,9 @@ static int __init tumbler_init(pmac_t *chip)
1259 return 0; 1283 return 0;
1260} 1284}
1261 1285
1262static void tumbler_cleanup(pmac_t *chip) 1286static void tumbler_cleanup(struct snd_pmac *chip)
1263{ 1287{
1264 pmac_tumbler_t *mix = chip->mixer_data; 1288 struct pmac_tumbler *mix = chip->mixer_data;
1265 if (! mix) 1289 if (! mix)
1266 return; 1290 return;
1267 1291
@@ -1279,10 +1303,10 @@ static void tumbler_cleanup(pmac_t *chip)
1279} 1303}
1280 1304
1281/* exported */ 1305/* exported */
1282int __init snd_pmac_tumbler_init(pmac_t *chip) 1306int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
1283{ 1307{
1284 int i, err; 1308 int i, err;
1285 pmac_tumbler_t *mix; 1309 struct pmac_tumbler *mix;
1286 u32 *paddr; 1310 u32 *paddr;
1287 struct device_node *tas_node, *np; 1311 struct device_node *tas_node, *np;
1288 char *chipname; 1312 char *chipname;