diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
commit | 3dd392a407d15250a501fa109cc1f93fee95ef85 (patch) | |
tree | c1faca3fa8bd0f7c8790b3e0887229b4a5a90e8b /sound/ppc/awacs.c | |
parent | b27a43c1e90582facad44de67d02bc9e9f900289 (diff) | |
parent | d403a6484f0341bf0624d17ece46f24f741b6a92 (diff) |
Merge branch 'linus' into x86/pat2
Conflicts:
arch/x86/mm/init_64.c
Diffstat (limited to 'sound/ppc/awacs.c')
-rw-r--r-- | sound/ppc/awacs.c | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 566a6d0daf4a..106c48225bba 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 | ||
624 | static 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 | |||
624 | static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = { | 631 | static 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), |
@@ -688,7 +695,10 @@ static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] __initdata = { | |||
688 | static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata = | 695 | static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata = |
689 | AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1); | 696 | AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1); |
690 | 697 | ||
691 | static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac __initdata = | 698 | static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 __initdata = |
699 | AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 1); | ||
700 | |||
701 | static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 __initdata = | ||
692 | AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 0); | 702 | AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 0); |
693 | 703 | ||
694 | 704 | ||
@@ -765,11 +775,12 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip) | |||
765 | 775 | ||
766 | #define IS_PM7500 (machine_is_compatible("AAPL,7500")) | 776 | #define IS_PM7500 (machine_is_compatible("AAPL,7500")) |
767 | #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer")) | 777 | #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer")) |
768 | #define IS_IMAC (machine_is_compatible("PowerMac2,1") \ | 778 | #define IS_IMAC1 (machine_is_compatible("PowerMac2,1")) |
769 | || machine_is_compatible("PowerMac2,2") \ | 779 | #define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \ |
770 | || machine_is_compatible("PowerMac4,1")) | 780 | || machine_is_compatible("PowerMac4,1")) |
781 | #define IS_G4AGP (machine_is_compatible("PowerMac3,1")) | ||
771 | 782 | ||
772 | static int imac; | 783 | static int imac1, imac2; |
773 | 784 | ||
774 | #ifdef PMAC_SUPPORT_AUTOMUTE | 785 | #ifdef PMAC_SUPPORT_AUTOMUTE |
775 | /* | 786 | /* |
@@ -815,13 +826,18 @@ static void snd_pmac_awacs_update_automute(struct snd_pmac *chip, int do_notify) | |||
815 | { | 826 | { |
816 | int reg = chip->awacs_reg[1] | 827 | int reg = chip->awacs_reg[1] |
817 | | (MASK_HDMUTE | MASK_SPKMUTE); | 828 | | (MASK_HDMUTE | MASK_SPKMUTE); |
818 | if (imac) { | 829 | if (imac1) { |
830 | reg &= ~MASK_SPKMUTE; | ||
831 | reg |= MASK_PAROUT1; | ||
832 | } else if (imac2) { | ||
819 | reg &= ~MASK_SPKMUTE; | 833 | reg &= ~MASK_SPKMUTE; |
820 | reg &= ~MASK_PAROUT1; | 834 | reg &= ~MASK_PAROUT1; |
821 | } | 835 | } |
822 | if (snd_pmac_awacs_detect_headphone(chip)) | 836 | if (snd_pmac_awacs_detect_headphone(chip)) |
823 | reg &= ~MASK_HDMUTE; | 837 | reg &= ~MASK_HDMUTE; |
824 | else if (imac) | 838 | else if (imac1) |
839 | reg &= ~MASK_PAROUT1; | ||
840 | else if (imac2) | ||
825 | reg |= MASK_PAROUT1; | 841 | reg |= MASK_PAROUT1; |
826 | else | 842 | else |
827 | reg &= ~MASK_SPKMUTE; | 843 | reg &= ~MASK_SPKMUTE; |
@@ -850,9 +866,13 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
850 | { | 866 | { |
851 | int pm7500 = IS_PM7500; | 867 | int pm7500 = IS_PM7500; |
852 | int beige = IS_BEIGE; | 868 | int beige = IS_BEIGE; |
869 | int g4agp = IS_G4AGP; | ||
870 | int imac; | ||
853 | int err, vol; | 871 | int err, vol; |
854 | 872 | ||
855 | imac = IS_IMAC; | 873 | imac1 = IS_IMAC1; |
874 | imac2 = IS_IMAC2; | ||
875 | imac = imac1 || imac2; | ||
856 | /* looks like MASK_GAINLINE triggers something, so we set here | 876 | /* looks like MASK_GAINLINE triggers something, so we set here |
857 | * as start-up | 877 | * as start-up |
858 | */ | 878 | */ |
@@ -939,7 +959,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
939 | snd_pmac_awacs_mixers); | 959 | snd_pmac_awacs_mixers); |
940 | if (err < 0) | 960 | if (err < 0) |
941 | return err; | 961 | return err; |
942 | if (beige) | 962 | if (beige || g4agp) |
943 | ; | 963 | ; |
944 | else if (chip->model == PMAC_SCREAMER) | 964 | else if (chip->model == PMAC_SCREAMER) |
945 | err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), | 965 | err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), |
@@ -961,13 +981,17 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
961 | err = build_mixers(chip, | 981 | err = build_mixers(chip, |
962 | ARRAY_SIZE(snd_pmac_screamer_mixers_imac), | 982 | ARRAY_SIZE(snd_pmac_screamer_mixers_imac), |
963 | snd_pmac_screamer_mixers_imac); | 983 | snd_pmac_screamer_mixers_imac); |
984 | else if (g4agp) | ||
985 | err = build_mixers(chip, | ||
986 | ARRAY_SIZE(snd_pmac_screamer_mixers_g4agp), | ||
987 | snd_pmac_screamer_mixers_g4agp); | ||
964 | else | 988 | else |
965 | err = build_mixers(chip, | 989 | err = build_mixers(chip, |
966 | ARRAY_SIZE(snd_pmac_awacs_mixers_pmac), | 990 | ARRAY_SIZE(snd_pmac_awacs_mixers_pmac), |
967 | snd_pmac_awacs_mixers_pmac); | 991 | snd_pmac_awacs_mixers_pmac); |
968 | if (err < 0) | 992 | if (err < 0) |
969 | return err; | 993 | return err; |
970 | chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac) | 994 | chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac || g4agp) |
971 | ? &snd_pmac_awacs_master_sw_imac | 995 | ? &snd_pmac_awacs_master_sw_imac |
972 | : &snd_pmac_awacs_master_sw, chip); | 996 | : &snd_pmac_awacs_master_sw, chip); |
973 | err = snd_ctl_add(chip->card, chip->master_sw_ctl); | 997 | err = snd_ctl_add(chip->card, chip->master_sw_ctl); |
@@ -1004,15 +1028,17 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
1004 | snd_pmac_awacs_speaker_vol); | 1028 | snd_pmac_awacs_speaker_vol); |
1005 | if (err < 0) | 1029 | if (err < 0) |
1006 | return err; | 1030 | return err; |
1007 | chip->speaker_sw_ctl = snd_ctl_new1(imac | 1031 | chip->speaker_sw_ctl = snd_ctl_new1(imac1 |
1008 | ? &snd_pmac_awacs_speaker_sw_imac | 1032 | ? &snd_pmac_awacs_speaker_sw_imac1 |
1033 | : imac2 | ||
1034 | ? &snd_pmac_awacs_speaker_sw_imac2 | ||
1009 | : &snd_pmac_awacs_speaker_sw, chip); | 1035 | : &snd_pmac_awacs_speaker_sw, chip); |
1010 | err = snd_ctl_add(chip->card, chip->speaker_sw_ctl); | 1036 | err = snd_ctl_add(chip->card, chip->speaker_sw_ctl); |
1011 | if (err < 0) | 1037 | if (err < 0) |
1012 | return err; | 1038 | return err; |
1013 | } | 1039 | } |
1014 | 1040 | ||
1015 | if (beige) | 1041 | if (beige || g4agp) |
1016 | err = build_mixers(chip, | 1042 | err = build_mixers(chip, |
1017 | ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), | 1043 | ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), |
1018 | snd_pmac_screamer_mic_boost_beige); | 1044 | snd_pmac_screamer_mic_boost_beige); |