aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/aureon.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/aureon.c')
-rw-r--r--sound/pci/ice1712/aureon.c699
1 files changed, 371 insertions, 328 deletions
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index 868ae291b960..110d16e52733 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -44,10 +44,9 @@
44 * not working: prety much everything else, at least i could verify that 44 * not working: prety much everything else, at least i could verify that
45 * we have no digital output, no capture, pretty bad clicks and poops 45 * we have no digital output, no capture, pretty bad clicks and poops
46 * on mixer switch and other coll stuff. 46 * on mixer switch and other coll stuff.
47 * 47 */
48 */
49 48
50#include <asm/io.h> 49#include <linux/io.h>
51#include <linux/delay.h> 50#include <linux/delay.h>
52#include <linux/interrupt.h> 51#include <linux/interrupt.h>
53#include <linux/init.h> 52#include <linux/init.h>
@@ -131,7 +130,7 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
131 snd_ice1712_gpio_write(ice, tmp); 130 snd_ice1712_gpio_write(ice, tmp);
132 udelay(50); 131 udelay(50);
133 132
134 /* 133 /*
135 * send i2c stop condition and start condition 134 * send i2c stop condition and start condition
136 * to obtain sane state 135 * to obtain sane state
137 */ 136 */
@@ -152,10 +151,16 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
152 * skipping ack cycles inbetween 151 * skipping ack cycles inbetween
153 */ 152 */
154 for (j = 0; j < 3; j++) { 153 for (j = 0; j < 3; j++) {
155 switch(j) { 154 switch (j) {
156 case 0: val = dev; break; 155 case 0:
157 case 1: val = reg; break; 156 val = dev;
158 case 2: val = data; break; 157 break;
158 case 1:
159 val = reg;
160 break;
161 case 2:
162 val = data;
163 break;
159 } 164 }
160 for (i = 7; i >= 0; i--) { 165 for (i = 7; i >= 0; i--) {
161 tmp &= ~AUREON_SPI_CLK; 166 tmp &= ~AUREON_SPI_CLK;
@@ -171,7 +176,7 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
171 snd_ice1712_gpio_write(ice, tmp); 176 snd_ice1712_gpio_write(ice, tmp);
172 udelay(40); 177 udelay(40);
173 } 178 }
174 tmp &= ~AUREON_SPI_CLK; 179 tmp &= ~AUREON_SPI_CLK;
175 snd_ice1712_gpio_write(ice, tmp); 180 snd_ice1712_gpio_write(ice, tmp);
176 udelay(40); 181 udelay(40);
177 tmp |= AUREON_SPI_CLK; 182 tmp |= AUREON_SPI_CLK;
@@ -203,7 +208,7 @@ static int aureon_universe_inmux_info(struct snd_kcontrol *kcontrol,
203 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 208 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
204 uinfo->count = 1; 209 uinfo->count = 1;
205 uinfo->value.enumerated.items = 3; 210 uinfo->value.enumerated.items = 3;
206 if(uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 211 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
207 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 212 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
208 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 213 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
209 return 0; 214 return 0;
@@ -231,12 +236,12 @@ static int aureon_universe_inmux_put(struct snd_kcontrol *kcontrol,
231 return -EINVAL; 236 return -EINVAL;
232 snd_ice1712_save_gpio_status(ice); 237 snd_ice1712_save_gpio_status(ice);
233 oval = spec->pca9554_out; 238 oval = spec->pca9554_out;
234 if ((change = (oval != nval))) { 239 change = (oval != nval);
240 if (change) {
235 aureon_pca9554_write(ice, PCA9554_OUT, nval); 241 aureon_pca9554_write(ice, PCA9554_OUT, nval);
236 spec->pca9554_out = nval; 242 spec->pca9554_out = nval;
237 } 243 }
238 snd_ice1712_restore_gpio_status(ice); 244 snd_ice1712_restore_gpio_status(ice);
239
240 return change; 245 return change;
241} 246}
242 247
@@ -256,7 +261,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
256 udelay(10); 261 udelay(10);
257 tmp &= ~AUREON_AC97_ADDR; 262 tmp &= ~AUREON_AC97_ADDR;
258 snd_ice1712_gpio_write(ice, tmp); 263 snd_ice1712_gpio_write(ice, tmp);
259 udelay(10); 264 udelay(10);
260 265
261 /* Send low-order byte to XILINX chip */ 266 /* Send low-order byte to XILINX chip */
262 tmp &= ~AUREON_AC97_DATA_MASK; 267 tmp &= ~AUREON_AC97_DATA_MASK;
@@ -269,7 +274,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
269 tmp &= ~AUREON_AC97_DATA_LOW; 274 tmp &= ~AUREON_AC97_DATA_LOW;
270 snd_ice1712_gpio_write(ice, tmp); 275 snd_ice1712_gpio_write(ice, tmp);
271 udelay(10); 276 udelay(10);
272 277
273 /* Send high-order byte to XILINX chip */ 278 /* Send high-order byte to XILINX chip */
274 tmp &= ~AUREON_AC97_DATA_MASK; 279 tmp &= ~AUREON_AC97_DATA_MASK;
275 tmp |= (val >> 8) & AUREON_AC97_DATA_MASK; 280 tmp |= (val >> 8) & AUREON_AC97_DATA_MASK;
@@ -282,7 +287,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
282 tmp &= ~AUREON_AC97_DATA_HIGH; 287 tmp &= ~AUREON_AC97_DATA_HIGH;
283 snd_ice1712_gpio_write(ice, tmp); 288 snd_ice1712_gpio_write(ice, tmp);
284 udelay(10); 289 udelay(10);
285 290
286 /* Instruct XILINX chip to parse the data to the STAC9744 chip */ 291 /* Instruct XILINX chip to parse the data to the STAC9744 chip */
287 tmp |= AUREON_AC97_COMMIT; 292 tmp |= AUREON_AC97_COMMIT;
288 snd_ice1712_gpio_write(ice, tmp); 293 snd_ice1712_gpio_write(ice, tmp);
@@ -290,7 +295,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
290 tmp &= ~AUREON_AC97_COMMIT; 295 tmp &= ~AUREON_AC97_COMMIT;
291 snd_ice1712_gpio_write(ice, tmp); 296 snd_ice1712_gpio_write(ice, tmp);
292 udelay(10); 297 udelay(10);
293 298
294 /* Store the data in out private buffer */ 299 /* Store the data in out private buffer */
295 spec->stac9744[(reg & 0x7F) >> 1] = val; 300 spec->stac9744[(reg & 0x7F) >> 1] = val;
296} 301}
@@ -304,7 +309,7 @@ static unsigned short aureon_ac97_read(struct snd_ice1712 *ice, unsigned short r
304/* 309/*
305 * Initialize STAC9744 chip 310 * Initialize STAC9744 chip
306 */ 311 */
307static int aureon_ac97_init (struct snd_ice1712 *ice) 312static int aureon_ac97_init(struct snd_ice1712 *ice)
308{ 313{
309 struct aureon_spec *spec = ice->spec; 314 struct aureon_spec *spec = ice->spec;
310 int i; 315 int i;
@@ -335,20 +340,21 @@ static int aureon_ac97_init (struct snd_ice1712 *ice)
335 tmp = (snd_ice1712_gpio_read(ice) | AUREON_AC97_RESET) & ~AUREON_AC97_DATA_MASK; 340 tmp = (snd_ice1712_gpio_read(ice) | AUREON_AC97_RESET) & ~AUREON_AC97_DATA_MASK;
336 snd_ice1712_gpio_write(ice, tmp); 341 snd_ice1712_gpio_write(ice, tmp);
337 udelay(3); 342 udelay(3);
338 343
339 tmp &= ~AUREON_AC97_RESET; 344 tmp &= ~AUREON_AC97_RESET;
340 snd_ice1712_gpio_write(ice, tmp); 345 snd_ice1712_gpio_write(ice, tmp);
341 udelay(3); 346 udelay(3);
342 347
343 tmp |= AUREON_AC97_RESET; 348 tmp |= AUREON_AC97_RESET;
344 snd_ice1712_gpio_write(ice, tmp); 349 snd_ice1712_gpio_write(ice, tmp);
345 udelay(3); 350 udelay(3);
346 351
347 memset(&spec->stac9744, 0, sizeof(spec->stac9744)); 352 memset(&spec->stac9744, 0, sizeof(spec->stac9744));
348 for (i=0; ac97_defaults[i] != (unsigned short)-1; i+=2) 353 for (i = 0; ac97_defaults[i] != (unsigned short)-1; i += 2)
349 spec->stac9744[(ac97_defaults[i]) >> 1] = ac97_defaults[i+1]; 354 spec->stac9744[(ac97_defaults[i]) >> 1] = ac97_defaults[i+1];
350 355
351 aureon_ac97_write(ice, AC97_MASTER, 0x0000); // Unmute AC'97 master volume permanently - muting is done by WM8770 356 /* Unmute AC'97 master volume permanently - muting is done by WM8770 */
357 aureon_ac97_write(ice, AC97_MASTER, 0x0000);
352 358
353 return 0; 359 return 0;
354} 360}
@@ -388,7 +394,7 @@ static int aureon_ac97_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
388 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 394 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
389 unsigned short ovol, nvol; 395 unsigned short ovol, nvol;
390 int change; 396 int change;
391 397
392 snd_ice1712_save_gpio_status(ice); 398 snd_ice1712_save_gpio_status(ice);
393 399
394 ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F); 400 ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F);
@@ -396,13 +402,14 @@ static int aureon_ac97_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
396 if (kcontrol->private_value & AUREON_AC97_STEREO) 402 if (kcontrol->private_value & AUREON_AC97_STEREO)
397 nvol |= ((0x1F - ucontrol->value.integer.value[1]) << 8) & 0x1F00; 403 nvol |= ((0x1F - ucontrol->value.integer.value[1]) << 8) & 0x1F00;
398 nvol |= ovol & ~0x1F1F; 404 nvol |= ovol & ~0x1F1F;
399 405
400 if ((change = (ovol != nvol))) 406 change = (ovol != nvol);
407 if (change)
401 aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol); 408 aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol);
402 409
403 snd_ice1712_restore_gpio_status(ice); 410 snd_ice1712_restore_gpio_status(ice);
404 411
405 return change; 412 return change;
406} 413}
407 414
408/* 415/*
@@ -416,7 +423,8 @@ static int aureon_ac97_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
416 423
417 mutex_lock(&ice->gpio_mutex); 424 mutex_lock(&ice->gpio_mutex);
418 425
419 ucontrol->value.integer.value[0] = aureon_ac97_read(ice, kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1; 426 ucontrol->value.integer.value[0] = aureon_ac97_read(ice,
427 kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1;
420 428
421 mutex_unlock(&ice->gpio_mutex); 429 mutex_unlock(&ice->gpio_mutex);
422 return 0; 430 return 0;
@@ -429,13 +437,14 @@ static int aureon_ac97_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
429 int change; 437 int change;
430 438
431 snd_ice1712_save_gpio_status(ice); 439 snd_ice1712_save_gpio_status(ice);
432 440
433 ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F); 441 ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F);
434 nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x8000) | (ovol & ~ 0x8000); 442 nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x8000) | (ovol & ~0x8000);
435 443
436 if ((change = (ovol != nvol))) 444 change = (ovol != nvol);
445 if (change)
437 aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol); 446 aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol);
438 447
439 snd_ice1712_restore_gpio_status(ice); 448 snd_ice1712_restore_gpio_status(ice);
440 449
441 return change; 450 return change;
@@ -465,13 +474,14 @@ static int aureon_ac97_micboost_put(struct snd_kcontrol *kcontrol, struct snd_ct
465 int change; 474 int change;
466 475
467 snd_ice1712_save_gpio_status(ice); 476 snd_ice1712_save_gpio_status(ice);
468 477
469 ovol = aureon_ac97_read(ice, AC97_MIC); 478 ovol = aureon_ac97_read(ice, AC97_MIC);
470 nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x0020) | (ovol & ~0x0020); 479 nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x0020) | (ovol & ~0x0020);
471 480
472 if ((change = (ovol != nvol))) 481 change = (ovol != nvol);
482 if (change)
473 aureon_ac97_write(ice, AC97_MIC, nvol); 483 aureon_ac97_write(ice, AC97_MIC, nvol);
474 484
475 snd_ice1712_restore_gpio_status(ice); 485 snd_ice1712_restore_gpio_status(ice);
476 486
477 return change; 487 return change;
@@ -493,16 +503,15 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned
493 snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS)); 503 snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS));
494 mosi = PRODIGY_SPI_MOSI; 504 mosi = PRODIGY_SPI_MOSI;
495 clk = PRODIGY_SPI_CLK; 505 clk = PRODIGY_SPI_CLK;
496 } 506 } else {
497 else {
498 snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_SPI_MOSI|AUREON_SPI_CLK| 507 snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_SPI_MOSI|AUREON_SPI_CLK|
499 AUREON_WM_CS|AUREON_CS8415_CS)); 508 AUREON_WM_CS|AUREON_CS8415_CS));
500 mosi = AUREON_SPI_MOSI; 509 mosi = AUREON_SPI_MOSI;
501 clk = AUREON_SPI_CLK; 510 clk = AUREON_SPI_CLK;
502 511
503 tmp |= AUREON_WM_RW; 512 tmp |= AUREON_WM_RW;
504 } 513 }
505 514
506 tmp &= ~cs; 515 tmp &= ~cs;
507 snd_ice1712_gpio_write(ice, tmp); 516 snd_ice1712_gpio_write(ice, tmp);
508 udelay(1); 517 udelay(1);
@@ -534,7 +543,9 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned
534/* 543/*
535 * Read data in SPI mode 544 * Read data in SPI mode
536 */ 545 */
537static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned int data, int bits, unsigned char *buffer, int size) { 546static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs,
547 unsigned int data, int bits, unsigned char *buffer, int size)
548{
538 int i, j; 549 int i, j;
539 unsigned int tmp; 550 unsigned int tmp;
540 551
@@ -544,7 +555,7 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
544 snd_ice1712_gpio_write(ice, tmp); 555 snd_ice1712_gpio_write(ice, tmp);
545 udelay(1); 556 udelay(1);
546 557
547 for (i=bits-1; i>=0; i--) { 558 for (i = bits-1; i >= 0; i--) {
548 if (data & (1 << i)) 559 if (data & (1 << i))
549 tmp |= AUREON_SPI_MOSI; 560 tmp |= AUREON_SPI_MOSI;
550 else 561 else
@@ -561,9 +572,9 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
561 udelay(1); 572 udelay(1);
562 } 573 }
563 574
564 for (j=0; j<size; j++) { 575 for (j = 0; j < size; j++) {
565 unsigned char outdata = 0; 576 unsigned char outdata = 0;
566 for (i=7; i>=0; i--) { 577 for (i = 7; i >= 0; i--) {
567 tmp = snd_ice1712_gpio_read(ice); 578 tmp = snd_ice1712_gpio_read(ice);
568 outdata <<= 1; 579 outdata <<= 1;
569 outdata |= (tmp & AUREON_SPI_MISO) ? 1 : 0; 580 outdata |= (tmp & AUREON_SPI_MISO) ? 1 : 0;
@@ -584,19 +595,24 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
584 snd_ice1712_gpio_write(ice, tmp); 595 snd_ice1712_gpio_write(ice, tmp);
585} 596}
586 597
587static unsigned char aureon_cs8415_get(struct snd_ice1712 *ice, int reg) { 598static unsigned char aureon_cs8415_get(struct snd_ice1712 *ice, int reg)
599{
588 unsigned char val; 600 unsigned char val;
589 aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16); 601 aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16);
590 aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, &val, 1); 602 aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, &val, 1);
591 return val; 603 return val;
592} 604}
593 605
594static void aureon_cs8415_read(struct snd_ice1712 *ice, int reg, unsigned char *buffer, int size) { 606static void aureon_cs8415_read(struct snd_ice1712 *ice, int reg,
607 unsigned char *buffer, int size)
608{
595 aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16); 609 aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16);
596 aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, buffer, size); 610 aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, buffer, size);
597} 611}
598 612
599static void aureon_cs8415_put(struct snd_ice1712 *ice, int reg, unsigned char val) { 613static void aureon_cs8415_put(struct snd_ice1712 *ice, int reg,
614 unsigned char val)
615{
600 aureon_spi_write(ice, AUREON_CS8415_CS, 0x200000 | (reg << 8) | val, 24); 616 aureon_spi_write(ice, AUREON_CS8415_CS, 0x200000 | (reg << 8) | val, 24);
601} 617}
602 618
@@ -654,18 +670,20 @@ static int aureon_ac97_mmute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
654 return 0; 670 return 0;
655} 671}
656 672
657static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { 673static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
674{
658 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 675 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
659 unsigned short ovol, nvol; 676 unsigned short ovol, nvol;
660 int change; 677 int change;
661 678
662 snd_ice1712_save_gpio_status(ice); 679 snd_ice1712_save_gpio_status(ice);
663 680
664 ovol = wm_get(ice, WM_OUT_MUX1); 681 ovol = wm_get(ice, WM_OUT_MUX1);
665 nvol = (ovol & ~0x02) | (ucontrol->value.integer.value[0] ? 0x02 : 0x00); 682 nvol = (ovol & ~0x02) | (ucontrol->value.integer.value[0] ? 0x02 : 0x00);
666 if ((change = (ovol != nvol))) 683 change = (ovol != nvol);
684 if (change)
667 wm_put(ice, WM_OUT_MUX1, nvol); 685 wm_put(ice, WM_OUT_MUX1, nvol);
668 686
669 snd_ice1712_restore_gpio_status(ice); 687 snd_ice1712_restore_gpio_status(ice);
670 688
671 return change; 689 return change;
@@ -702,12 +720,12 @@ static const unsigned char wm_vol[256] = {
702static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) 720static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master)
703{ 721{
704 unsigned char nvol; 722 unsigned char nvol;
705 723
706 if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) 724 if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
707 nvol = 0; 725 nvol = 0;
708 else 726 else
709 nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; 727 nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX];
710 728
711 wm_put(ice, index, nvol); 729 wm_put(ice, index, nvol);
712 wm_put_nocache(ice, index, 0x180 | nvol); 730 wm_put_nocache(ice, index, 0x180 | nvol);
713} 731}
@@ -736,7 +754,8 @@ static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va
736 snd_ice1712_save_gpio_status(ice); 754 snd_ice1712_save_gpio_status(ice);
737 oval = wm_get(ice, WM_MUTE); 755 oval = wm_get(ice, WM_MUTE);
738 nval = (oval & ~0x10) | (ucontrol->value.integer.value[0] ? 0 : 0x10); 756 nval = (oval & ~0x10) | (ucontrol->value.integer.value[0] ? 0 : 0x10);
739 if ((change = (nval != oval))) 757 change = (oval != nval);
758 if (change)
740 wm_put(ice, WM_MUTE, nval); 759 wm_put(ice, WM_MUTE, nval);
741 snd_ice1712_restore_gpio_status(ice); 760 snd_ice1712_restore_gpio_status(ice);
742 761
@@ -760,7 +779,7 @@ static int wm_master_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
760 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 779 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
761 struct aureon_spec *spec = ice->spec; 780 struct aureon_spec *spec = ice->spec;
762 int i; 781 int i;
763 for (i=0; i<2; i++) 782 for (i = 0; i < 2; i++)
764 ucontrol->value.integer.value[i] = 783 ucontrol->value.integer.value[i] =
765 spec->master[i] & ~WM_VOL_MUTE; 784 spec->master[i] & ~WM_VOL_MUTE;
766 return 0; 785 return 0;
@@ -849,7 +868,8 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *
849/* 868/*
850 * WM8770 mute control 869 * WM8770 mute control
851 */ 870 */
852static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { 871static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
872{
853 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 873 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
854 uinfo->count = kcontrol->private_value >> 8; 874 uinfo->count = kcontrol->private_value >> 8;
855 uinfo->value.integer.min = 0; 875 uinfo->value.integer.min = 0;
@@ -862,7 +882,7 @@ static int wm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value
862 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 882 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
863 struct aureon_spec *spec = ice->spec; 883 struct aureon_spec *spec = ice->spec;
864 int voices, ofs, i; 884 int voices, ofs, i;
865 885
866 voices = kcontrol->private_value >> 8; 886 voices = kcontrol->private_value >> 8;
867 ofs = kcontrol->private_value & 0xFF; 887 ofs = kcontrol->private_value & 0xFF;
868 888
@@ -907,7 +927,7 @@ static int wm_master_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
907{ 927{
908 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 928 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
909 struct aureon_spec *spec = ice->spec; 929 struct aureon_spec *spec = ice->spec;
910 930
911 ucontrol->value.integer.value[0] = 931 ucontrol->value.integer.value[0] =
912 (spec->master[0] & WM_VOL_MUTE) ? 0 : 1; 932 (spec->master[0] & WM_VOL_MUTE) ? 0 : 1;
913 ucontrol->value.integer.value[1] = 933 ucontrol->value.integer.value[1] =
@@ -1083,21 +1103,21 @@ static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
1083static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1103static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1084{ 1104{
1085 static const char * const texts[] = { 1105 static const char * const texts[] = {
1086 "CD", //AIN1 1106 "CD", /* AIN1 */
1087 "Aux", //AIN2 1107 "Aux", /* AIN2 */
1088 "Line", //AIN3 1108 "Line", /* AIN3 */
1089 "Mic", //AIN4 1109 "Mic", /* AIN4 */
1090 "AC97" //AIN5 1110 "AC97" /* AIN5 */
1091 }; 1111 };
1092 static const char * const universe_texts[] = { 1112 static const char * const universe_texts[] = {
1093 "Aux1", //AIN1 1113 "Aux1", /* AIN1 */
1094 "CD", //AIN2 1114 "CD", /* AIN2 */
1095 "Phono", //AIN3 1115 "Phono", /* AIN3 */
1096 "Line", //AIN4 1116 "Line", /* AIN4 */
1097 "Aux2", //AIN5 1117 "Aux2", /* AIN5 */
1098 "Mic", //AIN6 1118 "Mic", /* AIN6 */
1099 "Aux3", //AIN7 1119 "Aux3", /* AIN7 */
1100 "AC97" //AIN8 1120 "AC97" /* AIN8 */
1101 }; 1121 };
1102 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1122 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1103 1123
@@ -1108,8 +1128,7 @@ static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_in
1108 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 1128 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
1109 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 1129 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
1110 strcpy(uinfo->value.enumerated.name, universe_texts[uinfo->value.enumerated.item]); 1130 strcpy(uinfo->value.enumerated.name, universe_texts[uinfo->value.enumerated.item]);
1111 } 1131 } else {
1112 else {
1113 uinfo->value.enumerated.items = 5; 1132 uinfo->value.enumerated.items = 5;
1114 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 1133 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
1115 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 1134 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
@@ -1156,8 +1175,8 @@ static int aureon_cs8415_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
1156{ 1175{
1157 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1176 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1158 static const char * const aureon_texts[] = { 1177 static const char * const aureon_texts[] = {
1159 "CD", //RXP0 1178 "CD", /* RXP0 */
1160 "Optical" //RXP1 1179 "Optical" /* RXP1 */
1161 }; 1180 };
1162 static const char * const prodigy_texts[] = { 1181 static const char * const prodigy_texts[] = {
1163 "CD", 1182 "CD",
@@ -1180,10 +1199,10 @@ static int aureon_cs8415_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
1180 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1199 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1181 struct aureon_spec *spec = ice->spec; 1200 struct aureon_spec *spec = ice->spec;
1182 1201
1183 //snd_ice1712_save_gpio_status(ice); 1202 /* snd_ice1712_save_gpio_status(ice); */
1184 //val = aureon_cs8415_get(ice, CS8415_CTRL2); 1203 /* val = aureon_cs8415_get(ice, CS8415_CTRL2); */
1185 ucontrol->value.enumerated.item[0] = spec->cs8415_mux; 1204 ucontrol->value.enumerated.item[0] = spec->cs8415_mux;
1186 //snd_ice1712_restore_gpio_status(ice); 1205 /* snd_ice1712_restore_gpio_status(ice); */
1187 return 0; 1206 return 0;
1188} 1207}
1189 1208
@@ -1206,7 +1225,7 @@ static int aureon_cs8415_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
1206 return change; 1225 return change;
1207} 1226}
1208 1227
1209static int aureon_cs8415_rate_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 1228static int aureon_cs8415_rate_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1210{ 1229{
1211 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1230 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1212 uinfo->count = 1; 1231 uinfo->count = 1;
@@ -1215,7 +1234,7 @@ static int aureon_cs8415_rate_info (struct snd_kcontrol *kcontrol, struct snd_ct
1215 return 0; 1234 return 0;
1216} 1235}
1217 1236
1218static int aureon_cs8415_rate_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1237static int aureon_cs8415_rate_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1219{ 1238{
1220 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1239 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1221 unsigned char ratio; 1240 unsigned char ratio;
@@ -1229,7 +1248,7 @@ static int aureon_cs8415_rate_get (struct snd_kcontrol *kcontrol, struct snd_ctl
1229 */ 1248 */
1230#define aureon_cs8415_mute_info snd_ctl_boolean_mono_info 1249#define aureon_cs8415_mute_info snd_ctl_boolean_mono_info
1231 1250
1232static int aureon_cs8415_mute_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1251static int aureon_cs8415_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1233{ 1252{
1234 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1253 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1235 snd_ice1712_save_gpio_status(ice); 1254 snd_ice1712_save_gpio_status(ice);
@@ -1238,7 +1257,7 @@ static int aureon_cs8415_mute_get (struct snd_kcontrol *kcontrol, struct snd_ctl
1238 return 0; 1257 return 0;
1239} 1258}
1240 1259
1241static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1260static int aureon_cs8415_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1242{ 1261{
1243 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1262 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1244 unsigned char oval, nval; 1263 unsigned char oval, nval;
@@ -1249,7 +1268,8 @@ static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl
1249 nval = oval & ~0x20; 1268 nval = oval & ~0x20;
1250 else 1269 else
1251 nval = oval | 0x20; 1270 nval = oval | 0x20;
1252 if ((change = (oval != nval))) 1271 change = (oval != nval);
1272 if (change)
1253 aureon_cs8415_put(ice, CS8415_CTRL1, nval); 1273 aureon_cs8415_put(ice, CS8415_CTRL1, nval);
1254 snd_ice1712_restore_gpio_status(ice); 1274 snd_ice1712_restore_gpio_status(ice);
1255 return change; 1275 return change;
@@ -1258,15 +1278,17 @@ static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl
1258/* 1278/*
1259 * CS8415A Q-Sub info 1279 * CS8415A Q-Sub info
1260 */ 1280 */
1261static int aureon_cs8415_qsub_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { 1281static int aureon_cs8415_qsub_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1282{
1262 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; 1283 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
1263 uinfo->count = 10; 1284 uinfo->count = 10;
1264 return 0; 1285 return 0;
1265} 1286}
1266 1287
1267static int aureon_cs8415_qsub_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { 1288static int aureon_cs8415_qsub_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1289{
1268 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1290 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1269 1291
1270 snd_ice1712_save_gpio_status(ice); 1292 snd_ice1712_save_gpio_status(ice);
1271 aureon_cs8415_read(ice, CS8415_QSUB, ucontrol->value.bytes.data, 10); 1293 aureon_cs8415_read(ice, CS8415_QSUB, ucontrol->value.bytes.data, 10);
1272 snd_ice1712_restore_gpio_status(ice); 1294 snd_ice1712_restore_gpio_status(ice);
@@ -1274,18 +1296,21 @@ static int aureon_cs8415_qsub_get (struct snd_kcontrol *kcontrol, struct snd_ctl
1274 return 0; 1296 return 0;
1275} 1297}
1276 1298
1277static int aureon_cs8415_spdif_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { 1299static int aureon_cs8415_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1300{
1278 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 1301 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
1279 uinfo->count = 1; 1302 uinfo->count = 1;
1280 return 0; 1303 return 0;
1281} 1304}
1282 1305
1283static int aureon_cs8415_mask_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { 1306static int aureon_cs8415_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1307{
1284 memset(ucontrol->value.iec958.status, 0xFF, 24); 1308 memset(ucontrol->value.iec958.status, 0xFF, 24);
1285 return 0; 1309 return 0;
1286} 1310}
1287 1311
1288static int aureon_cs8415_spdif_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { 1312static int aureon_cs8415_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1313{
1289 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1314 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1290 1315
1291 snd_ice1712_save_gpio_status(ice); 1316 snd_ice1712_save_gpio_status(ice);
@@ -1311,9 +1336,9 @@ static int aureon_set_headphone_amp(struct snd_ice1712 *ice, int enable)
1311 else 1336 else
1312 if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && 1337 if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
1313 ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) 1338 ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT)
1314 tmp &= ~ AUREON_HP_SEL; 1339 tmp &= ~AUREON_HP_SEL;
1315 else 1340 else
1316 tmp &= ~ PRODIGY_HP_SEL; 1341 tmp &= ~PRODIGY_HP_SEL;
1317 if (tmp != tmp2) { 1342 if (tmp != tmp2) {
1318 snd_ice1712_gpio_write(ice, tmp); 1343 snd_ice1712_gpio_write(ice, tmp);
1319 return 1; 1344 return 1;
@@ -1325,7 +1350,7 @@ static int aureon_get_headphone_amp(struct snd_ice1712 *ice)
1325{ 1350{
1326 unsigned int tmp = snd_ice1712_gpio_read(ice); 1351 unsigned int tmp = snd_ice1712_gpio_read(ice);
1327 1352
1328 return ( tmp & AUREON_HP_SEL )!= 0; 1353 return (tmp & AUREON_HP_SEL) != 0;
1329} 1354}
1330 1355
1331#define aureon_hpamp_info snd_ctl_boolean_mono_info 1356#define aureon_hpamp_info snd_ctl_boolean_mono_info
@@ -1343,7 +1368,7 @@ static int aureon_hpamp_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
1343{ 1368{
1344 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 1369 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1345 1370
1346 return aureon_set_headphone_amp(ice,ucontrol->value.integer.value[0]); 1371 return aureon_set_headphone_amp(ice, ucontrol->value.integer.value[0]);
1347} 1372}
1348 1373
1349/* 1374/*
@@ -1390,7 +1415,7 @@ static int aureon_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_
1390 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 1415 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
1391 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 1416 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
1392 1417
1393 return 0; 1418 return 0;
1394} 1419}
1395 1420
1396static int aureon_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 1421static int aureon_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
@@ -1434,7 +1459,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1434 { 1459 {
1435 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1460 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1436 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1461 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1437 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1462 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1438 .name = "Master Playback Volume", 1463 .name = "Master Playback Volume",
1439 .info = wm_master_vol_info, 1464 .info = wm_master_vol_info,
1440 .get = wm_master_vol_get, 1465 .get = wm_master_vol_get,
@@ -1452,7 +1477,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1452 { 1477 {
1453 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1478 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1454 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1479 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1455 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1480 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1456 .name = "Front Playback Volume", 1481 .name = "Front Playback Volume",
1457 .info = wm_vol_info, 1482 .info = wm_vol_info,
1458 .get = wm_vol_get, 1483 .get = wm_vol_get,
@@ -1471,7 +1496,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1471 { 1496 {
1472 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1497 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1473 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1498 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1474 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1499 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1475 .name = "Rear Playback Volume", 1500 .name = "Rear Playback Volume",
1476 .info = wm_vol_info, 1501 .info = wm_vol_info,
1477 .get = wm_vol_get, 1502 .get = wm_vol_get,
@@ -1490,7 +1515,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1490 { 1515 {
1491 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1516 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1492 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1517 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1493 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1518 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1494 .name = "Center Playback Volume", 1519 .name = "Center Playback Volume",
1495 .info = wm_vol_info, 1520 .info = wm_vol_info,
1496 .get = wm_vol_get, 1521 .get = wm_vol_get,
@@ -1509,7 +1534,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1509 { 1534 {
1510 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1535 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1511 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1536 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1512 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1537 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1513 .name = "LFE Playback Volume", 1538 .name = "LFE Playback Volume",
1514 .info = wm_vol_info, 1539 .info = wm_vol_info,
1515 .get = wm_vol_get, 1540 .get = wm_vol_get,
@@ -1528,7 +1553,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1528 { 1553 {
1529 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1554 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1530 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1555 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1531 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1556 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1532 .name = "Side Playback Volume", 1557 .name = "Side Playback Volume",
1533 .info = wm_vol_info, 1558 .info = wm_vol_info,
1534 .get = wm_vol_get, 1559 .get = wm_vol_get,
@@ -1539,23 +1564,23 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1539}; 1564};
1540 1565
1541static struct snd_kcontrol_new wm_controls[] __devinitdata = { 1566static struct snd_kcontrol_new wm_controls[] __devinitdata = {
1542 { 1567 {
1543 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1568 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1544 .name = "PCM Playback Switch", 1569 .name = "PCM Playback Switch",
1545 .info = wm_pcm_mute_info, 1570 .info = wm_pcm_mute_info,
1546 .get = wm_pcm_mute_get, 1571 .get = wm_pcm_mute_get,
1547 .put = wm_pcm_mute_put 1572 .put = wm_pcm_mute_put
1548 }, 1573 },
1549 { 1574 {
1550 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1575 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1551 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1576 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1552 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1577 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1553 .name = "PCM Playback Volume", 1578 .name = "PCM Playback Volume",
1554 .info = wm_pcm_vol_info, 1579 .info = wm_pcm_vol_info,
1555 .get = wm_pcm_vol_get, 1580 .get = wm_pcm_vol_get,
1556 .put = wm_pcm_vol_put, 1581 .put = wm_pcm_vol_put,
1557 .tlv = { .p = db_scale_wm_pcm } 1582 .tlv = { .p = db_scale_wm_pcm }
1558 }, 1583 },
1559 { 1584 {
1560 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1585 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1561 .name = "Capture Switch", 1586 .name = "Capture Switch",
@@ -1566,7 +1591,7 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
1566 { 1591 {
1567 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1592 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1568 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1593 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1569 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1594 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1570 .name = "Capture Volume", 1595 .name = "Capture Volume",
1571 .info = wm_adc_vol_info, 1596 .info = wm_adc_vol_info,
1572 .get = wm_adc_vol_get, 1597 .get = wm_adc_vol_get,
@@ -1605,232 +1630,232 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
1605}; 1630};
1606 1631
1607static struct snd_kcontrol_new ac97_controls[] __devinitdata = { 1632static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1608 { 1633 {
1609 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1634 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1610 .name = "AC97 Playback Switch", 1635 .name = "AC97 Playback Switch",
1611 .info = aureon_ac97_mmute_info, 1636 .info = aureon_ac97_mmute_info,
1612 .get = aureon_ac97_mmute_get, 1637 .get = aureon_ac97_mmute_get,
1613 .put = aureon_ac97_mmute_put, 1638 .put = aureon_ac97_mmute_put,
1614 .private_value = AC97_MASTER 1639 .private_value = AC97_MASTER
1615 }, 1640 },
1616 { 1641 {
1617 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1642 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1618 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1643 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1619 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1644 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1620 .name = "AC97 Playback Volume", 1645 .name = "AC97 Playback Volume",
1621 .info = aureon_ac97_vol_info, 1646 .info = aureon_ac97_vol_info,
1622 .get = aureon_ac97_vol_get, 1647 .get = aureon_ac97_vol_get,
1623 .put = aureon_ac97_vol_put, 1648 .put = aureon_ac97_vol_put,
1624 .private_value = AC97_MASTER|AUREON_AC97_STEREO, 1649 .private_value = AC97_MASTER|AUREON_AC97_STEREO,
1625 .tlv = { .p = db_scale_ac97_master } 1650 .tlv = { .p = db_scale_ac97_master }
1626 }, 1651 },
1627 { 1652 {
1628 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1653 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1629 .name = "CD Playback Switch", 1654 .name = "CD Playback Switch",
1630 .info = aureon_ac97_mute_info, 1655 .info = aureon_ac97_mute_info,
1631 .get = aureon_ac97_mute_get, 1656 .get = aureon_ac97_mute_get,
1632 .put = aureon_ac97_mute_put, 1657 .put = aureon_ac97_mute_put,
1633 .private_value = AC97_CD 1658 .private_value = AC97_CD
1634 }, 1659 },
1635 { 1660 {
1636 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1661 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1637 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1662 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1638 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1663 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1639 .name = "CD Playback Volume", 1664 .name = "CD Playback Volume",
1640 .info = aureon_ac97_vol_info, 1665 .info = aureon_ac97_vol_info,
1641 .get = aureon_ac97_vol_get, 1666 .get = aureon_ac97_vol_get,
1642 .put = aureon_ac97_vol_put, 1667 .put = aureon_ac97_vol_put,
1643 .private_value = AC97_CD|AUREON_AC97_STEREO, 1668 .private_value = AC97_CD|AUREON_AC97_STEREO,
1644 .tlv = { .p = db_scale_ac97_gain } 1669 .tlv = { .p = db_scale_ac97_gain }
1645 }, 1670 },
1646 { 1671 {
1647 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1672 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1648 .name = "Aux Playback Switch", 1673 .name = "Aux Playback Switch",
1649 .info = aureon_ac97_mute_info, 1674 .info = aureon_ac97_mute_info,
1650 .get = aureon_ac97_mute_get, 1675 .get = aureon_ac97_mute_get,
1651 .put = aureon_ac97_mute_put, 1676 .put = aureon_ac97_mute_put,
1652 .private_value = AC97_AUX, 1677 .private_value = AC97_AUX,
1653 }, 1678 },
1654 { 1679 {
1655 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1680 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1656 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1681 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1657 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1682 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1658 .name = "Aux Playback Volume", 1683 .name = "Aux Playback Volume",
1659 .info = aureon_ac97_vol_info, 1684 .info = aureon_ac97_vol_info,
1660 .get = aureon_ac97_vol_get, 1685 .get = aureon_ac97_vol_get,
1661 .put = aureon_ac97_vol_put, 1686 .put = aureon_ac97_vol_put,
1662 .private_value = AC97_AUX|AUREON_AC97_STEREO, 1687 .private_value = AC97_AUX|AUREON_AC97_STEREO,
1663 .tlv = { .p = db_scale_ac97_gain } 1688 .tlv = { .p = db_scale_ac97_gain }
1664 }, 1689 },
1665 { 1690 {
1666 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1691 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1667 .name = "Line Playback Switch", 1692 .name = "Line Playback Switch",
1668 .info = aureon_ac97_mute_info, 1693 .info = aureon_ac97_mute_info,
1669 .get = aureon_ac97_mute_get, 1694 .get = aureon_ac97_mute_get,
1670 .put = aureon_ac97_mute_put, 1695 .put = aureon_ac97_mute_put,
1671 .private_value = AC97_LINE 1696 .private_value = AC97_LINE
1672 }, 1697 },
1673 { 1698 {
1674 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1699 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1675 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1700 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1676 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1701 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1677 .name = "Line Playback Volume", 1702 .name = "Line Playback Volume",
1678 .info = aureon_ac97_vol_info, 1703 .info = aureon_ac97_vol_info,
1679 .get = aureon_ac97_vol_get, 1704 .get = aureon_ac97_vol_get,
1680 .put = aureon_ac97_vol_put, 1705 .put = aureon_ac97_vol_put,
1681 .private_value = AC97_LINE|AUREON_AC97_STEREO, 1706 .private_value = AC97_LINE|AUREON_AC97_STEREO,
1682 .tlv = { .p = db_scale_ac97_gain } 1707 .tlv = { .p = db_scale_ac97_gain }
1683 }, 1708 },
1684 { 1709 {
1685 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1710 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1686 .name = "Mic Playback Switch", 1711 .name = "Mic Playback Switch",
1687 .info = aureon_ac97_mute_info, 1712 .info = aureon_ac97_mute_info,
1688 .get = aureon_ac97_mute_get, 1713 .get = aureon_ac97_mute_get,
1689 .put = aureon_ac97_mute_put, 1714 .put = aureon_ac97_mute_put,
1690 .private_value = AC97_MIC 1715 .private_value = AC97_MIC
1691 }, 1716 },
1692 { 1717 {
1693 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1718 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1694 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1719 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1695 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1720 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1696 .name = "Mic Playback Volume", 1721 .name = "Mic Playback Volume",
1697 .info = aureon_ac97_vol_info, 1722 .info = aureon_ac97_vol_info,
1698 .get = aureon_ac97_vol_get, 1723 .get = aureon_ac97_vol_get,
1699 .put = aureon_ac97_vol_put, 1724 .put = aureon_ac97_vol_put,
1700 .private_value = AC97_MIC, 1725 .private_value = AC97_MIC,
1701 .tlv = { .p = db_scale_ac97_gain } 1726 .tlv = { .p = db_scale_ac97_gain }
1702 }, 1727 },
1703 { 1728 {
1704 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1729 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1705 .name = "Mic Boost (+20dB)", 1730 .name = "Mic Boost (+20dB)",
1706 .info = aureon_ac97_micboost_info, 1731 .info = aureon_ac97_micboost_info,
1707 .get = aureon_ac97_micboost_get, 1732 .get = aureon_ac97_micboost_get,
1708 .put = aureon_ac97_micboost_put 1733 .put = aureon_ac97_micboost_put
1709 } 1734 }
1710}; 1735};
1711 1736
1712static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = { 1737static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1713 { 1738 {
1714 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1739 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1715 .name = "AC97 Playback Switch", 1740 .name = "AC97 Playback Switch",
1716 .info = aureon_ac97_mmute_info, 1741 .info = aureon_ac97_mmute_info,
1717 .get = aureon_ac97_mmute_get, 1742 .get = aureon_ac97_mmute_get,
1718 .put = aureon_ac97_mmute_put, 1743 .put = aureon_ac97_mmute_put,
1719 .private_value = AC97_MASTER 1744 .private_value = AC97_MASTER
1720 }, 1745 },
1721 { 1746 {
1722 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1747 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1723 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1748 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1724 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1749 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1725 .name = "AC97 Playback Volume", 1750 .name = "AC97 Playback Volume",
1726 .info = aureon_ac97_vol_info, 1751 .info = aureon_ac97_vol_info,
1727 .get = aureon_ac97_vol_get, 1752 .get = aureon_ac97_vol_get,
1728 .put = aureon_ac97_vol_put, 1753 .put = aureon_ac97_vol_put,
1729 .private_value = AC97_MASTER|AUREON_AC97_STEREO, 1754 .private_value = AC97_MASTER|AUREON_AC97_STEREO,
1730 .tlv = { .p = db_scale_ac97_master } 1755 .tlv = { .p = db_scale_ac97_master }
1731 }, 1756 },
1732 { 1757 {
1733 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1758 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1734 .name = "CD Playback Switch", 1759 .name = "CD Playback Switch",
1735 .info = aureon_ac97_mute_info, 1760 .info = aureon_ac97_mute_info,
1736 .get = aureon_ac97_mute_get, 1761 .get = aureon_ac97_mute_get,
1737 .put = aureon_ac97_mute_put, 1762 .put = aureon_ac97_mute_put,
1738 .private_value = AC97_AUX 1763 .private_value = AC97_AUX
1739 }, 1764 },
1740 { 1765 {
1741 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1766 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1742 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1767 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1743 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1768 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1744 .name = "CD Playback Volume", 1769 .name = "CD Playback Volume",
1745 .info = aureon_ac97_vol_info, 1770 .info = aureon_ac97_vol_info,
1746 .get = aureon_ac97_vol_get, 1771 .get = aureon_ac97_vol_get,
1747 .put = aureon_ac97_vol_put, 1772 .put = aureon_ac97_vol_put,
1748 .private_value = AC97_AUX|AUREON_AC97_STEREO, 1773 .private_value = AC97_AUX|AUREON_AC97_STEREO,
1749 .tlv = { .p = db_scale_ac97_gain } 1774 .tlv = { .p = db_scale_ac97_gain }
1750 }, 1775 },
1751 { 1776 {
1752 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1777 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1753 .name = "Phono Playback Switch", 1778 .name = "Phono Playback Switch",
1754 .info = aureon_ac97_mute_info, 1779 .info = aureon_ac97_mute_info,
1755 .get = aureon_ac97_mute_get, 1780 .get = aureon_ac97_mute_get,
1756 .put = aureon_ac97_mute_put, 1781 .put = aureon_ac97_mute_put,
1757 .private_value = AC97_CD 1782 .private_value = AC97_CD
1758 }, 1783 },
1759 { 1784 {
1760 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1785 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1761 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1786 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1762 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1787 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1763 .name = "Phono Playback Volume", 1788 .name = "Phono Playback Volume",
1764 .info = aureon_ac97_vol_info, 1789 .info = aureon_ac97_vol_info,
1765 .get = aureon_ac97_vol_get, 1790 .get = aureon_ac97_vol_get,
1766 .put = aureon_ac97_vol_put, 1791 .put = aureon_ac97_vol_put,
1767 .private_value = AC97_CD|AUREON_AC97_STEREO, 1792 .private_value = AC97_CD|AUREON_AC97_STEREO,
1768 .tlv = { .p = db_scale_ac97_gain } 1793 .tlv = { .p = db_scale_ac97_gain }
1769 }, 1794 },
1770 { 1795 {
1771 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1796 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1772 .name = "Line Playback Switch", 1797 .name = "Line Playback Switch",
1773 .info = aureon_ac97_mute_info, 1798 .info = aureon_ac97_mute_info,
1774 .get = aureon_ac97_mute_get, 1799 .get = aureon_ac97_mute_get,
1775 .put = aureon_ac97_mute_put, 1800 .put = aureon_ac97_mute_put,
1776 .private_value = AC97_LINE 1801 .private_value = AC97_LINE
1777 }, 1802 },
1778 { 1803 {
1779 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1804 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1780 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1805 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1781 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1806 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1782 .name = "Line Playback Volume", 1807 .name = "Line Playback Volume",
1783 .info = aureon_ac97_vol_info, 1808 .info = aureon_ac97_vol_info,
1784 .get = aureon_ac97_vol_get, 1809 .get = aureon_ac97_vol_get,
1785 .put = aureon_ac97_vol_put, 1810 .put = aureon_ac97_vol_put,
1786 .private_value = AC97_LINE|AUREON_AC97_STEREO, 1811 .private_value = AC97_LINE|AUREON_AC97_STEREO,
1787 .tlv = { .p = db_scale_ac97_gain } 1812 .tlv = { .p = db_scale_ac97_gain }
1788 }, 1813 },
1789 { 1814 {
1790 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1815 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1791 .name = "Mic Playback Switch", 1816 .name = "Mic Playback Switch",
1792 .info = aureon_ac97_mute_info, 1817 .info = aureon_ac97_mute_info,
1793 .get = aureon_ac97_mute_get, 1818 .get = aureon_ac97_mute_get,
1794 .put = aureon_ac97_mute_put, 1819 .put = aureon_ac97_mute_put,
1795 .private_value = AC97_MIC 1820 .private_value = AC97_MIC
1796 }, 1821 },
1797 { 1822 {
1798 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1823 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1799 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1824 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1800 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1825 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1801 .name = "Mic Playback Volume", 1826 .name = "Mic Playback Volume",
1802 .info = aureon_ac97_vol_info, 1827 .info = aureon_ac97_vol_info,
1803 .get = aureon_ac97_vol_get, 1828 .get = aureon_ac97_vol_get,
1804 .put = aureon_ac97_vol_put, 1829 .put = aureon_ac97_vol_put,
1805 .private_value = AC97_MIC, 1830 .private_value = AC97_MIC,
1806 .tlv = { .p = db_scale_ac97_gain } 1831 .tlv = { .p = db_scale_ac97_gain }
1807 }, 1832 },
1808 { 1833 {
1809 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1834 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1810 .name = "Mic Boost (+20dB)", 1835 .name = "Mic Boost (+20dB)",
1811 .info = aureon_ac97_micboost_info, 1836 .info = aureon_ac97_micboost_info,
1812 .get = aureon_ac97_micboost_get, 1837 .get = aureon_ac97_micboost_get,
1813 .put = aureon_ac97_micboost_put 1838 .put = aureon_ac97_micboost_put
1814 }, 1839 },
1815 { 1840 {
1816 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1841 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1817 .name = "Aux Playback Switch", 1842 .name = "Aux Playback Switch",
1818 .info = aureon_ac97_mute_info, 1843 .info = aureon_ac97_mute_info,
1819 .get = aureon_ac97_mute_get, 1844 .get = aureon_ac97_mute_get,
1820 .put = aureon_ac97_mute_put, 1845 .put = aureon_ac97_mute_put,
1821 .private_value = AC97_VIDEO, 1846 .private_value = AC97_VIDEO,
1822 }, 1847 },
1823 { 1848 {
1824 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1849 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1825 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1850 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1826 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1851 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1827 .name = "Aux Playback Volume", 1852 .name = "Aux Playback Volume",
1828 .info = aureon_ac97_vol_info, 1853 .info = aureon_ac97_vol_info,
1829 .get = aureon_ac97_vol_get, 1854 .get = aureon_ac97_vol_get,
1830 .put = aureon_ac97_vol_put, 1855 .put = aureon_ac97_vol_put,
1831 .private_value = AC97_VIDEO|AUREON_AC97_STEREO, 1856 .private_value = AC97_VIDEO|AUREON_AC97_STEREO,
1832 .tlv = { .p = db_scale_ac97_gain } 1857 .tlv = { .p = db_scale_ac97_gain }
1833 }, 1858 },
1834 { 1859 {
1835 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1860 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1836 .name = "Aux Source", 1861 .name = "Aux Source",
@@ -1844,43 +1869,43 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1844static struct snd_kcontrol_new cs8415_controls[] __devinitdata = { 1869static struct snd_kcontrol_new cs8415_controls[] __devinitdata = {
1845 { 1870 {
1846 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1871 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1847 .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 1872 .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH),
1848 .info = aureon_cs8415_mute_info, 1873 .info = aureon_cs8415_mute_info,
1849 .get = aureon_cs8415_mute_get, 1874 .get = aureon_cs8415_mute_get,
1850 .put = aureon_cs8415_mute_put 1875 .put = aureon_cs8415_mute_put
1851 }, 1876 },
1852 { 1877 {
1853 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1854 .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Source", 1879 .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, NONE) "Source",
1855 .info = aureon_cs8415_mux_info, 1880 .info = aureon_cs8415_mux_info,
1856 .get = aureon_cs8415_mux_get, 1881 .get = aureon_cs8415_mux_get,
1857 .put = aureon_cs8415_mux_put, 1882 .put = aureon_cs8415_mux_put,
1858 }, 1883 },
1859 { 1884 {
1860 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1885 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1861 .name = SNDRV_CTL_NAME_IEC958("Q-subcode ",CAPTURE,DEFAULT), 1886 .name = SNDRV_CTL_NAME_IEC958("Q-subcode ", CAPTURE, DEFAULT),
1862 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 1887 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
1863 .info = aureon_cs8415_qsub_info, 1888 .info = aureon_cs8415_qsub_info,
1864 .get = aureon_cs8415_qsub_get, 1889 .get = aureon_cs8415_qsub_get,
1865 }, 1890 },
1866 { 1891 {
1867 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1892 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1868 .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,MASK), 1893 .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, MASK),
1869 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1894 .access = SNDRV_CTL_ELEM_ACCESS_READ,
1870 .info = aureon_cs8415_spdif_info, 1895 .info = aureon_cs8415_spdif_info,
1871 .get = aureon_cs8415_mask_get 1896 .get = aureon_cs8415_mask_get
1872 }, 1897 },
1873 { 1898 {
1874 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1899 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1875 .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,DEFAULT), 1900 .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, DEFAULT),
1876 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 1901 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
1877 .info = aureon_cs8415_spdif_info, 1902 .info = aureon_cs8415_spdif_info,
1878 .get = aureon_cs8415_spdif_get 1903 .get = aureon_cs8415_spdif_get
1879 }, 1904 },
1880 { 1905 {
1881 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1906 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1882 .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Rate", 1907 .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, NONE) "Rate",
1883 .access =SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 1908 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
1884 .info = aureon_cs8415_rate_info, 1909 .info = aureon_cs8415_rate_info,
1885 .get = aureon_cs8415_rate_get 1910 .get = aureon_cs8415_rate_get
1886 } 1911 }
@@ -1905,15 +1930,14 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
1905 if (err < 0) 1930 if (err < 0)
1906 return err; 1931 return err;
1907 } 1932 }
1908 1933
1909 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON71_UNIVERSE) { 1934 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON71_UNIVERSE) {
1910 for (i = 0; i < ARRAY_SIZE(universe_ac97_controls); i++) { 1935 for (i = 0; i < ARRAY_SIZE(universe_ac97_controls); i++) {
1911 err = snd_ctl_add(ice->card, snd_ctl_new1(&universe_ac97_controls[i], ice)); 1936 err = snd_ctl_add(ice->card, snd_ctl_new1(&universe_ac97_controls[i], ice));
1912 if (err < 0) 1937 if (err < 0)
1913 return err; 1938 return err;
1914 } 1939 }
1915 } 1940 } else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
1916 else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
1917 ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) { 1941 ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) {
1918 for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) { 1942 for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) {
1919 err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice)); 1943 err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice));
@@ -1932,7 +1956,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
1932 else if ((id & 0x0F) != 0x01) 1956 else if ((id & 0x0F) != 0x01)
1933 snd_printk(KERN_INFO "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1)); 1957 snd_printk(KERN_INFO "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1));
1934 else { 1958 else {
1935 for (i = 0; i< ARRAY_SIZE(cs8415_controls); i++) { 1959 for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) {
1936 struct snd_kcontrol *kctl; 1960 struct snd_kcontrol *kctl;
1937 err = snd_ctl_add(ice->card, (kctl = snd_ctl_new1(&cs8415_controls[i], ice))); 1961 err = snd_ctl_add(ice->card, (kctl = snd_ctl_new1(&cs8415_controls[i], ice)));
1938 if (err < 0) 1962 if (err < 0)
@@ -1943,7 +1967,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
1943 } 1967 }
1944 snd_ice1712_restore_gpio_status(ice); 1968 snd_ice1712_restore_gpio_status(ice);
1945 } 1969 }
1946 1970
1947 return 0; 1971 return 0;
1948} 1972}
1949 1973
@@ -2059,11 +2083,12 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
2059 2083
2060 /* to remeber the register values of CS8415 */ 2084 /* to remeber the register values of CS8415 */
2061 ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); 2085 ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
2062 if (! ice->akm) 2086 if (!ice->akm)
2063 return -ENOMEM; 2087 return -ENOMEM;
2064 ice->akm_codecs = 1; 2088 ice->akm_codecs = 1;
2065 2089
2066 if ((err = aureon_ac97_init(ice)) != 0) 2090 err = aureon_ac97_init(ice);
2091 if (err != 0)
2067 return err; 2092 return err;
2068 2093
2069 snd_ice1712_gpio_set_dir(ice, 0x5fffff); /* fix this for the time being */ 2094 snd_ice1712_gpio_set_dir(ice, 0x5fffff); /* fix this for the time being */
@@ -2086,7 +2111,7 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
2086 /* initialize WM8770 codec */ 2111 /* initialize WM8770 codec */
2087 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 || 2112 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 ||
2088 ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT || 2113 ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT ||
2089 ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT) 2114 ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT)
2090 p = wm_inits_prodigy; 2115 p = wm_inits_prodigy;
2091 else 2116 else
2092 p = wm_inits_aureon; 2117 p = wm_inits_aureon;
@@ -2105,10 +2130,10 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
2105 2130
2106 snd_ice1712_restore_gpio_status(ice); 2131 snd_ice1712_restore_gpio_status(ice);
2107 2132
2108 /* initialize PCA9554 pin directions & set default input*/ 2133 /* initialize PCA9554 pin directions & set default input */
2109 aureon_pca9554_write(ice, PCA9554_DIR, 0x00); 2134 aureon_pca9554_write(ice, PCA9554_DIR, 0x00);
2110 aureon_pca9554_write(ice, PCA9554_OUT, 0x00); /* internal AUX */ 2135 aureon_pca9554_write(ice, PCA9554_OUT, 0x00); /* internal AUX */
2111 2136
2112 spec->master[0] = WM_VOL_MUTE; 2137 spec->master[0] = WM_VOL_MUTE;
2113 spec->master[1] = WM_VOL_MUTE; 2138 spec->master[1] = WM_VOL_MUTE;
2114 for (i = 0; i < ice->num_total_dacs; i++) { 2139 for (i = 0; i < ice->num_total_dacs; i++) {
@@ -2158,6 +2183,24 @@ static unsigned char aureon71_eeprom[] __devinitdata = {
2158}; 2183};
2159#define prodigy71_eeprom aureon71_eeprom 2184#define prodigy71_eeprom aureon71_eeprom
2160 2185
2186static unsigned char aureon71_universe_eeprom[] __devinitdata = {
2187 [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/ADC,
2188 * 4DACs
2189 */
2190 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
2191 [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */
2192 [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */
2193 [ICE_EEP2_GPIO_DIR] = 0xff,
2194 [ICE_EEP2_GPIO_DIR1] = 0xff,
2195 [ICE_EEP2_GPIO_DIR2] = 0x5f,
2196 [ICE_EEP2_GPIO_MASK] = 0x00,
2197 [ICE_EEP2_GPIO_MASK1] = 0x00,
2198 [ICE_EEP2_GPIO_MASK2] = 0x00,
2199 [ICE_EEP2_GPIO_STATE] = 0x00,
2200 [ICE_EEP2_GPIO_STATE1] = 0x00,
2201 [ICE_EEP2_GPIO_STATE2] = 0x00,
2202};
2203
2161static unsigned char prodigy71lt_eeprom[] __devinitdata = { 2204static unsigned char prodigy71lt_eeprom[] __devinitdata = {
2162 [ICE_EEP2_SYSCONF] = 0x4b, /* clock 384, spdif-in/ADC, 4DACs */ 2205 [ICE_EEP2_SYSCONF] = 0x4b, /* clock 384, spdif-in/ADC, 4DACs */
2163 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 2206 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
@@ -2197,14 +2240,14 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
2197 .eeprom_data = aureon71_eeprom, 2240 .eeprom_data = aureon71_eeprom,
2198 .driver = "Aureon71", 2241 .driver = "Aureon71",
2199 }, 2242 },
2200 { 2243 {
2201 .subvendor = VT1724_SUBDEVICE_AUREON71_UNIVERSE, 2244 .subvendor = VT1724_SUBDEVICE_AUREON71_UNIVERSE,
2202 .name = "Terratec Aureon 7.1-Universe", 2245 .name = "Terratec Aureon 7.1-Universe",
2203 .model = "universe", 2246 .model = "universe",
2204 .chip_init = aureon_init, 2247 .chip_init = aureon_init,
2205 .build_controls = aureon_add_controls, 2248 .build_controls = aureon_add_controls,
2206 .eeprom_size = sizeof(aureon71_eeprom), 2249 .eeprom_size = sizeof(aureon71_universe_eeprom),
2207 .eeprom_data = aureon71_eeprom, 2250 .eeprom_data = aureon71_universe_eeprom,
2208 .driver = "Aureon71Univ", /* keep in 15 letters */ 2251 .driver = "Aureon71Univ", /* keep in 15 letters */
2209 }, 2252 },
2210 { 2253 {