Update of /cvsroot/alsa/alsa-kernel/pci/ac97 In directory sc8-pr-cvs1:/tmp/cvs-serv32731/ac97
Modified Files: ac97_codec.c ac97_local.h ac97_patch.c Log Message: - use ADI-compatible mode on AD1980 for more better controls. - swap master and headphone on AD1980 and AD1985 as default. - export remove_ctl, swap_ctl and rename_ctl for patch functions. - removed AD1980/AD1985 master-swap quirks (since it's set as default). Index: ac97_codec.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v retrieving revision 1.106 retrieving revision 1.107 diff -u -r1.106 -r1.107 --- ac97_codec.c 14 Oct 2003 14:33:03 -0000 1.106 +++ ac97_codec.c 16 Oct 2003 15:13:54 -0000 1.107 @@ -2234,7 +2234,7 @@ /* */ -static int remove_ctl(ac97_t *ac97, const char *name) +int snd_ac97_remove_ctl(ac97_t *ac97, const char *name) { snd_ctl_elem_id_t id; memset(&id, 0, sizeof(id)); @@ -2252,7 +2252,7 @@ return snd_ctl_find_id(ac97->card, &sid); } -static int rename_ctl(ac97_t *ac97, const char *src, const char *dst) +int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst) { snd_kcontrol_t *kctl = ctl_find(ac97, src); if (kctl) { @@ -2262,7 +2262,7 @@ return -ENOENT; } -static int swap_ctl(ac97_t *ac97, const char *s1, const char *s2) +int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2) { snd_kcontrol_t *kctl1, *kctl2; kctl1 = ctl_find(ac97, s1); @@ -2279,22 +2279,22 @@ { /* FIXME: error checks.. */ if (remove_master) { - remove_ctl(ac97, "Master Playback Switch"); - remove_ctl(ac97, "Master Playback Volume"); + snd_ac97_remove_ctl(ac97, "Master Playback Switch"); + snd_ac97_remove_ctl(ac97, "Master Playback Volume"); } else { - rename_ctl(ac97, "Master Playback Switch", "Line-Out Playback Switch"); - rename_ctl(ac97, "Master Playback Volume", "Line-Out Playback Volume"); + snd_ac97_rename_ctl(ac97, "Master Playback Switch", "Line-Out Playback Switch"); + snd_ac97_rename_ctl(ac97, "Master Playback Volume", "Line-Out Playback Volume"); } - rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch"); - rename_ctl(ac97, "Headphone Playback Volume", "Master Playback Volume"); + snd_ac97_rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch"); + snd_ac97_rename_ctl(ac97, "Headphone Playback Volume", "Master Playback Volume"); return 0; } static int swap_surround(ac97_t *ac97) { /* FIXME: error checks.. */ - swap_ctl(ac97, "Master Playback Switch", "Surround Playback Switch"); - swap_ctl(ac97, "Master Playback Volume", "Surround Playback Volume"); + snd_ac97_swap_ctl(ac97, "Master Playback Switch", "Surround Playback Switch"); + snd_ac97_swap_ctl(ac97, "Master Playback Volume", "Surround Playback Volume"); return 0; } @@ -2304,7 +2304,7 @@ /* Turn on OMS bit to route microphone to back panel */ scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG); snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x0200); - return swap_headphone(ac97, 1); + return 0; } /** Index: ac97_local.h =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_local.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ac97_local.h 27 Aug 2003 16:17:32 -0000 1.2 +++ ac97_local.h 16 Oct 2003 15:13:54 -0000 1.3 @@ -37,6 +37,9 @@ int snd_ac97_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); int snd_ac97_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit); +int snd_ac97_remove_ctl(ac97_t *ac97, const char *name); +int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst); +int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2); /* ac97_proc.c */ void snd_ac97_proc_init(snd_card_t * card, ac97_t * ac97, const char *prefix); Index: ac97_patch.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ac97_patch.c 6 Oct 2003 10:55:25 -0000 1.24 +++ ac97_patch.c 16 Oct 2003 15:13:54 -0000 1.25 @@ -764,8 +764,19 @@ return patch_build_controls(ac97, &snd_ac97_ad1980_spdif_source, 1); } +static int patch_ad1980_specific(ac97_t *ac97) +{ + /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ + snd_ac97_rename_ctl(ac97, "Master Playback Switch", "Master Surround Playback Switch"); + snd_ac97_rename_ctl(ac97, "Master Playback Volume", "Master Surround Playback Volume"); + snd_ac97_rename_ctl(ac97, "Headphone Playback Switch", "Master Playback Switch"); + snd_ac97_rename_ctl(ac97, "Headphone Playback Volume", "Headphone Playback Volume"); + return 0; +} + static struct snd_ac97_build_ops patch_ad1980_build_ops = { - .build_post_spdif = &patch_ad1980_post_spdif + .build_post_spdif = patch_ad1980_post_spdif, + .build_specific = patch_ad1980_specific }; int patch_ad1980(ac97_t * ac97) @@ -776,12 +787,14 @@ ac97->build_ops = &patch_ad1980_build_ops; /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */ /* it seems that most vendors connect line-out connector to headphone out of AC'97 */ + /* AD-compatible mode */ /* Stereo mutes enabled */ misc = snd_ac97_read(ac97, AC97_AD_MISC); snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | AC97_AD198X_LOSEL | AC97_AD198X_HPSEL | - AC97_AD198X_MSPLT); + AC97_AD198X_MSPLT | + AC97_AD198X_AC97NC); ac97->flags |= AC97_STEREO_MUTES; return 0; } ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog