diff options
author | Andreas Mohr <andi@lisas.de> | 2006-05-17 05:03:16 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-06-22 15:33:39 -0400 |
commit | 13769e3f21d6e9c59999c9bf6908278b878d05c5 (patch) | |
tree | 255c4fb239afbd2f6d6f1d4ccb824c81e3d52f82 /sound/pci/azt3328.c | |
parent | ca54bde3634360afecd0dada9c59399bbe88bd32 (diff) |
[ALSA] azt3328.c: add 3D sound mixer switch/rename controls
- add 3D sound pre-3D/post-3D switch, as seen in standard AC-97
- rename controls to shorter and more accurate strings
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/azt3328.c')
-rw-r--r-- | sound/pci/azt3328.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index f197fbac10ab..c9af04ed200f 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -39,8 +39,15 @@ | |||
39 | * for compatibility reasons) has the following features: | 39 | * for compatibility reasons) has the following features: |
40 | * | 40 | * |
41 | * - builtin AC97 conformant codec (SNR over 80dB) | 41 | * - builtin AC97 conformant codec (SNR over 80dB) |
42 | * (really AC97 compliant?? I really doubt it when looking | 42 | * Note that "conformant" != "compliant"!! this chip's mixer register layout |
43 | * at the mixer register layout) | 43 | * *differs* from the standard AC97 layout: |
44 | * they chose to not implement the headphone register (which is not a | ||
45 | * problem since it's merely optional), yet when doing this, they committed | ||
46 | * the grave sin of letting other registers follow immediately instead of | ||
47 | * keeping a headphone dummy register, thereby shifting the mixer register | ||
48 | * addresses illegally. So far unfortunately it looks like the very flexible | ||
49 | * ALSA AC97 support is still not enough to easily compensate for such a | ||
50 | * grave layout violation despite all tweaks and quirks mechanisms it offers. | ||
44 | * - builtin genuine OPL3 | 51 | * - builtin genuine OPL3 |
45 | * - full duplex 16bit playback/record at independent sampling rate | 52 | * - full duplex 16bit playback/record at independent sampling rate |
46 | * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr?? | 53 | * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr?? |
@@ -96,6 +103,9 @@ | |||
96 | * The standard suspend/resume functionality could probably make use of | 103 | * The standard suspend/resume functionality could probably make use of |
97 | * some improvement, too... | 104 | * some improvement, too... |
98 | * - figure out what all unknown port bits are responsible for | 105 | * - figure out what all unknown port bits are responsible for |
106 | * - figure out some cleverly evil scheme to possibly make ALSA AC97 code | ||
107 | * fully accept our quite incompatible ""AC97"" mixer and thus save some | ||
108 | * code (but I'm not too optimistic that doing this is possible at all) | ||
99 | */ | 109 | */ |
100 | 110 | ||
101 | #include <sound/driver.h> | 111 | #include <sound/driver.h> |
@@ -526,15 +536,18 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol, | |||
526 | struct snd_ctl_elem_info *uinfo) | 536 | struct snd_ctl_elem_info *uinfo) |
527 | { | 537 | { |
528 | static const char * const texts1[] = { | 538 | static const char * const texts1[] = { |
529 | "ModemOut1", "ModemOut2" | 539 | "Mic1", "Mic2" |
530 | }; | 540 | }; |
531 | static const char * const texts2[] = { | 541 | static const char * const texts2[] = { |
532 | "MonoSelectSource1", "MonoSelectSource2" | 542 | "Mix", "Mic" |
533 | }; | 543 | }; |
534 | static const char * const texts3[] = { | 544 | static const char * const texts3[] = { |
535 | "Mic", "CD", "Video", "Aux", | 545 | "Mic", "CD", "Video", "Aux", |
536 | "Line", "Mix", "Mix Mono", "Phone" | 546 | "Line", "Mix", "Mix Mono", "Phone" |
537 | }; | 547 | }; |
548 | static const char * const texts4[] = { | ||
549 | "pre 3D", "post 3D" | ||
550 | }; | ||
538 | struct azf3328_mixer_reg reg; | 551 | struct azf3328_mixer_reg reg; |
539 | 552 | ||
540 | snd_azf3328_mixer_reg_decode(®, kcontrol->private_value); | 553 | snd_azf3328_mixer_reg_decode(®, kcontrol->private_value); |
@@ -545,10 +558,17 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol, | |||
545 | uinfo->value.enumerated.item = reg.enum_c - 1U; | 558 | uinfo->value.enumerated.item = reg.enum_c - 1U; |
546 | if (reg.reg == IDX_MIXER_ADVCTL2) | 559 | if (reg.reg == IDX_MIXER_ADVCTL2) |
547 | { | 560 | { |
548 | if (reg.lchan_shift == 8) /* modem out sel */ | 561 | switch(reg.lchan_shift) { |
562 | case 8: /* modem out sel */ | ||
549 | strcpy(uinfo->value.enumerated.name, texts1[uinfo->value.enumerated.item]); | 563 | strcpy(uinfo->value.enumerated.name, texts1[uinfo->value.enumerated.item]); |
550 | else /* mono sel source */ | 564 | break; |
565 | case 9: /* mono sel source */ | ||
551 | strcpy(uinfo->value.enumerated.name, texts2[uinfo->value.enumerated.item]); | 566 | strcpy(uinfo->value.enumerated.name, texts2[uinfo->value.enumerated.item]); |
567 | break; | ||
568 | case 15: /* PCM Out Path */ | ||
569 | strcpy(uinfo->value.enumerated.name, texts4[uinfo->value.enumerated.item]); | ||
570 | break; | ||
571 | } | ||
552 | } | 572 | } |
553 | else | 573 | else |
554 | strcpy(uinfo->value.enumerated.name, texts3[uinfo->value.enumerated.item] | 574 | strcpy(uinfo->value.enumerated.name, texts3[uinfo->value.enumerated.item] |
@@ -641,13 +661,14 @@ static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata | |||
641 | AZF3328_MIXER_VOL_MONO("Modem Playback Volume", IDX_MIXER_MODEMOUT, 0x1f, 1), | 661 | AZF3328_MIXER_VOL_MONO("Modem Playback Volume", IDX_MIXER_MODEMOUT, 0x1f, 1), |
642 | AZF3328_MIXER_SWITCH("Modem Capture Switch", IDX_MIXER_MODEMIN, 15, 1), | 662 | AZF3328_MIXER_SWITCH("Modem Capture Switch", IDX_MIXER_MODEMIN, 15, 1), |
643 | AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1), | 663 | AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1), |
644 | AZF3328_MIXER_ENUM("Modem Out Select", IDX_MIXER_ADVCTL2, 2, 8), | 664 | AZF3328_MIXER_ENUM("Mic Select", IDX_MIXER_ADVCTL2, 2, 8), |
645 | AZF3328_MIXER_ENUM("Mono Select Source", IDX_MIXER_ADVCTL2, 2, 9), | 665 | AZF3328_MIXER_ENUM("Mono Output Select", IDX_MIXER_ADVCTL2, 2, 9), |
666 | AZF3328_MIXER_ENUM("PCM", IDX_MIXER_ADVCTL2, 2, 15), /* PCM Out Path, place in front since it controls *both* 3D and Bass/Treble! */ | ||
646 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0), | 667 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0), |
647 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0), | 668 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0), |
648 | AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0), | 669 | AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0), |
649 | AZF3328_MIXER_VOL_SPECIAL("3D Control - Wide", IDX_MIXER_ADVCTL1, 0x07, 1, 0), /* "3D Width" */ | 670 | AZF3328_MIXER_VOL_SPECIAL("3D Control - Width", IDX_MIXER_ADVCTL1, 0x07, 1, 0), /* "3D Width" */ |
650 | AZF3328_MIXER_VOL_SPECIAL("3D Control - Space", IDX_MIXER_ADVCTL1, 0x03, 8, 0), /* "Hifi 3D" */ | 671 | AZF3328_MIXER_VOL_SPECIAL("3D Control - Depth", IDX_MIXER_ADVCTL1, 0x03, 8, 0), /* "Hifi 3D" */ |
651 | #if MIXER_TESTING | 672 | #if MIXER_TESTING |
652 | AZF3328_MIXER_SWITCH("0", IDX_MIXER_ADVCTL2, 0, 0), | 673 | AZF3328_MIXER_SWITCH("0", IDX_MIXER_ADVCTL2, 0, 0), |
653 | AZF3328_MIXER_SWITCH("1", IDX_MIXER_ADVCTL2, 1, 0), | 674 | AZF3328_MIXER_SWITCH("1", IDX_MIXER_ADVCTL2, 1, 0), |