diff options
author | Andreas Mohr <andi@lisas.de> | 2011-02-18 18:49:48 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-19 10:03:08 -0500 |
commit | 6ba9256c09b0ab394d0fadbfb86d8f4dfba8846b (patch) | |
tree | 1eaa9fb7a0d41ca537646a8bd3eb45caad5d480b /sound/pci/ac97 | |
parent | b5dc20cd21357ea3663d428e42fcf9d167bb7aa2 (diff) |
ALSA: azt3328: hook up new emulated AC97 on AC97 patch side
Make newly created AC97 emulation of azt3328 known to the AC97 layer
side.
- relocate common functions to the top (due to definition after use)
- rename control names
- adjust 3D settings to the card's custom layout of this register
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ac97')
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 7 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 52 |
2 files changed, 59 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 2cc56b5c5397..7f4d619f4ddb 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -71,6 +71,12 @@ static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = { | |||
71 | { 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL }, | 71 | { 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL }, |
72 | { 0x414c4300, 0xffffff00, "Realtek", NULL, NULL }, | 72 | { 0x414c4300, 0xffffff00, "Realtek", NULL, NULL }, |
73 | { 0x414c4700, 0xffffff00, "Realtek", NULL, NULL }, | 73 | { 0x414c4700, 0xffffff00, "Realtek", NULL, NULL }, |
74 | /* | ||
75 | * This is an _inofficial_ Aztech Labs entry | ||
76 | * (value might differ from unknown official Aztech ID), | ||
77 | * currently used by the AC97 emulation of the almost-AC97 PCI168 card. | ||
78 | */ | ||
79 | { 0x415a5400, 0xffffff00, "Aztech Labs (emulated)", NULL, NULL }, | ||
74 | { 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL }, | 80 | { 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL }, |
75 | { 0x43525900, 0xffffff00, "Cirrus Logic", NULL, NULL }, | 81 | { 0x43525900, 0xffffff00, "Cirrus Logic", NULL, NULL }, |
76 | { 0x43585400, 0xffffff00, "Conexant", NULL, NULL }, | 82 | { 0x43585400, 0xffffff00, "Conexant", NULL, NULL }, |
@@ -127,6 +133,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { | |||
127 | { 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */ | 133 | { 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */ |
128 | { 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL }, | 134 | { 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL }, |
129 | { 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL }, | 135 | { 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL }, |
136 | { 0x415a5401, 0xffffffff, "AZF3328", patch_aztech_azf3328, NULL }, | ||
130 | { 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL }, | 137 | { 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL }, |
131 | { 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL }, | 138 | { 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL }, |
132 | { 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL }, | 139 | { 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL }, |
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index bf47574ca1f0..200c9a1d48b7 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -27,6 +27,15 @@ | |||
27 | #include "ac97_patch.h" | 27 | #include "ac97_patch.h" |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Forward declarations | ||
31 | */ | ||
32 | |||
33 | static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97, | ||
34 | const char *name); | ||
35 | static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, | ||
36 | const unsigned int *tlv, const char **slaves); | ||
37 | |||
38 | /* | ||
30 | * Chip specific initialization | 39 | * Chip specific initialization |
31 | */ | 40 | */ |
32 | 41 | ||
@@ -2940,6 +2949,49 @@ static int patch_alc850(struct snd_ac97 *ac97) | |||
2940 | return 0; | 2949 | return 0; |
2941 | } | 2950 | } |
2942 | 2951 | ||
2952 | static int patch_aztech_azf3328_specific(struct snd_ac97 *ac97) | ||
2953 | { | ||
2954 | struct snd_kcontrol *kctl_3d_center = | ||
2955 | snd_ac97_find_mixer_ctl(ac97, "3D Control - Center"); | ||
2956 | struct snd_kcontrol *kctl_3d_depth = | ||
2957 | snd_ac97_find_mixer_ctl(ac97, "3D Control - Depth"); | ||
2958 | |||
2959 | /* | ||
2960 | * 3D register is different from AC97 standard layout | ||
2961 | * (also do some renaming, to resemble Windows driver naming) | ||
2962 | */ | ||
2963 | if (kctl_3d_center) { | ||
2964 | kctl_3d_center->private_value = | ||
2965 | AC97_SINGLE_VALUE(AC97_3D_CONTROL, 1, 0x07, 0); | ||
2966 | snd_ac97_rename_vol_ctl(ac97, | ||
2967 | "3D Control - Center", "3D Control - Width" | ||
2968 | ); | ||
2969 | } | ||
2970 | if (kctl_3d_depth) | ||
2971 | kctl_3d_depth->private_value = | ||
2972 | AC97_SINGLE_VALUE(AC97_3D_CONTROL, 8, 0x03, 0); | ||
2973 | |||
2974 | /* Aztech Windows driver calls the | ||
2975 | equivalent control "Modem Playback", thus rename it: */ | ||
2976 | snd_ac97_rename_vol_ctl(ac97, | ||
2977 | "Master Mono Playback", "Modem Playback" | ||
2978 | ); | ||
2979 | snd_ac97_rename_vol_ctl(ac97, | ||
2980 | "Headphone Playback", "FM Synth Playback" | ||
2981 | ); | ||
2982 | |||
2983 | return 0; | ||
2984 | } | ||
2985 | |||
2986 | static const struct snd_ac97_build_ops patch_aztech_azf3328_ops = { | ||
2987 | .build_specific = patch_aztech_azf3328_specific | ||
2988 | }; | ||
2989 | |||
2990 | static int patch_aztech_azf3328(struct snd_ac97 *ac97) | ||
2991 | { | ||
2992 | ac97->build_ops = &patch_aztech_azf3328_ops; | ||
2993 | return 0; | ||
2994 | } | ||
2943 | 2995 | ||
2944 | /* | 2996 | /* |
2945 | * C-Media CM97xx codecs | 2997 | * C-Media CM97xx codecs |