aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRisto Suominen <Risto.Suominen@gmail.com>2008-08-25 02:02:12 -0400
committerTakashi Iwai <tiwai@suse.de>2008-10-02 06:50:04 -0400
commit4dbf95ba6c344186ec6d38ff514dc675da464bec (patch)
treec65ae09213f1043a73c28080d475264aac4385fa
parent24918b61b55c21e09a3e07cd82e1b3a8154782dc (diff)
ALSA: snd-powermac: mixers for PowerMac G4 AGP
Add mixer controls for PowerMac G4 AGP (Screamer). This patch fixes the regression in the recent snd-powermac which doesn't support some G3/G4 PowerMacs: http://lkml.org/lkml/2008/10/1/220 Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com> Tested-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/ppc/awacs.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 566a6d0daf4a..543d4f1784a5 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -621,6 +621,13 @@ static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __initdata = {
621 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), 621 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
622}; 622};
623 623
624static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] __initdata = {
625 AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),
626 AWACS_VOLUME("Master Playback Volume", 5, 6, 1),
627 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
628 AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),
629};
630
624static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = { 631static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = {
625 AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), 632 AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),
626 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), 633 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
@@ -768,6 +775,7 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip)
768#define IS_IMAC (machine_is_compatible("PowerMac2,1") \ 775#define IS_IMAC (machine_is_compatible("PowerMac2,1") \
769 || machine_is_compatible("PowerMac2,2") \ 776 || machine_is_compatible("PowerMac2,2") \
770 || machine_is_compatible("PowerMac4,1")) 777 || machine_is_compatible("PowerMac4,1"))
778#define IS_G4AGP (machine_is_compatible("PowerMac3,1"))
771 779
772static int imac; 780static int imac;
773 781
@@ -850,6 +858,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
850{ 858{
851 int pm7500 = IS_PM7500; 859 int pm7500 = IS_PM7500;
852 int beige = IS_BEIGE; 860 int beige = IS_BEIGE;
861 int g4agp = IS_G4AGP;
853 int err, vol; 862 int err, vol;
854 863
855 imac = IS_IMAC; 864 imac = IS_IMAC;
@@ -939,7 +948,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
939 snd_pmac_awacs_mixers); 948 snd_pmac_awacs_mixers);
940 if (err < 0) 949 if (err < 0)
941 return err; 950 return err;
942 if (beige) 951 if (beige || g4agp)
943 ; 952 ;
944 else if (chip->model == PMAC_SCREAMER) 953 else if (chip->model == PMAC_SCREAMER)
945 err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), 954 err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2),
@@ -961,13 +970,17 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
961 err = build_mixers(chip, 970 err = build_mixers(chip,
962 ARRAY_SIZE(snd_pmac_screamer_mixers_imac), 971 ARRAY_SIZE(snd_pmac_screamer_mixers_imac),
963 snd_pmac_screamer_mixers_imac); 972 snd_pmac_screamer_mixers_imac);
973 else if (g4agp)
974 err = build_mixers(chip,
975 ARRAY_SIZE(snd_pmac_screamer_mixers_g4agp),
976 snd_pmac_screamer_mixers_g4agp);
964 else 977 else
965 err = build_mixers(chip, 978 err = build_mixers(chip,
966 ARRAY_SIZE(snd_pmac_awacs_mixers_pmac), 979 ARRAY_SIZE(snd_pmac_awacs_mixers_pmac),
967 snd_pmac_awacs_mixers_pmac); 980 snd_pmac_awacs_mixers_pmac);
968 if (err < 0) 981 if (err < 0)
969 return err; 982 return err;
970 chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac) 983 chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac || g4agp)
971 ? &snd_pmac_awacs_master_sw_imac 984 ? &snd_pmac_awacs_master_sw_imac
972 : &snd_pmac_awacs_master_sw, chip); 985 : &snd_pmac_awacs_master_sw, chip);
973 err = snd_ctl_add(chip->card, chip->master_sw_ctl); 986 err = snd_ctl_add(chip->card, chip->master_sw_ctl);
@@ -1012,7 +1025,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
1012 return err; 1025 return err;
1013 } 1026 }
1014 1027
1015 if (beige) 1028 if (beige || g4agp)
1016 err = build_mixers(chip, 1029 err = build_mixers(chip,
1017 ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), 1030 ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige),
1018 snd_pmac_screamer_mic_boost_beige); 1031 snd_pmac_screamer_mic_boost_beige);