Commit 550ac958791399266c20e15e8048cd12bfce08ae

Authored by Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: snd-powermac: HP detection for 1st iMac G3 SL
  ALSA: snd-powermac: mixers for PowerMac G4 AGP
  ASoC: Set correct name for WM8753 rec mixer output

Showing 2 changed files Side-by-side Diff

... ... @@ -621,6 +621,13 @@
621 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 631 static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = {
625 632 AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),
626 633 AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
... ... @@ -688,7 +695,10 @@
688 695 static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata =
689 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 702 AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 0);
693 703  
694 704  
695 705  
696 706  
... ... @@ -765,11 +775,12 @@
765 775  
766 776 #define IS_PM7500 (machine_is_compatible("AAPL,7500"))
767 777 #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer"))
768   -#define IS_IMAC (machine_is_compatible("PowerMac2,1") \
769   - || machine_is_compatible("PowerMac2,2") \
  778 +#define IS_IMAC1 (machine_is_compatible("PowerMac2,1"))
  779 +#define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \
770 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 785 #ifdef PMAC_SUPPORT_AUTOMUTE
775 786 /*
776 787  
777 788  
... ... @@ -815,13 +826,18 @@
815 826 {
816 827 int reg = chip->awacs_reg[1]
817 828 | (MASK_HDMUTE | MASK_SPKMUTE);
818   - if (imac) {
  829 + if (imac1) {
819 830 reg &= ~MASK_SPKMUTE;
  831 + reg |= MASK_PAROUT1;
  832 + } else if (imac2) {
  833 + reg &= ~MASK_SPKMUTE;
820 834 reg &= ~MASK_PAROUT1;
821 835 }
822 836 if (snd_pmac_awacs_detect_headphone(chip))
823 837 reg &= ~MASK_HDMUTE;
824   - else if (imac)
  838 + else if (imac1)
  839 + reg &= ~MASK_PAROUT1;
  840 + else if (imac2)
825 841 reg |= MASK_PAROUT1;
826 842 else
827 843 reg &= ~MASK_SPKMUTE;
828 844  
... ... @@ -850,9 +866,13 @@
850 866 {
851 867 int pm7500 = IS_PM7500;
852 868 int beige = IS_BEIGE;
  869 + int g4agp = IS_G4AGP;
  870 + int imac;
853 871 int err, vol;
854 872  
855   - imac = IS_IMAC;
  873 + imac1 = IS_IMAC1;
  874 + imac2 = IS_IMAC2;
  875 + imac = imac1 || imac2;
856 876 /* looks like MASK_GAINLINE triggers something, so we set here
857 877 * as start-up
858 878 */
... ... @@ -939,7 +959,7 @@
939 959 snd_pmac_awacs_mixers);
940 960 if (err < 0)
941 961 return err;
942   - if (beige)
  962 + if (beige || g4agp)
943 963 ;
944 964 else if (chip->model == PMAC_SCREAMER)
945 965 err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2),
946 966  
... ... @@ -961,13 +981,17 @@
961 981 err = build_mixers(chip,
962 982 ARRAY_SIZE(snd_pmac_screamer_mixers_imac),
963 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 988 else
965 989 err = build_mixers(chip,
966 990 ARRAY_SIZE(snd_pmac_awacs_mixers_pmac),
967 991 snd_pmac_awacs_mixers_pmac);
968 992 if (err < 0)
969 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 995 ? &snd_pmac_awacs_master_sw_imac
972 996 : &snd_pmac_awacs_master_sw, chip);
973 997 err = snd_ctl_add(chip->card, chip->master_sw_ctl);
974 998  
... ... @@ -1004,15 +1028,17 @@
1004 1028 snd_pmac_awacs_speaker_vol);
1005 1029 if (err < 0)
1006 1030 return err;
1007   - chip->speaker_sw_ctl = snd_ctl_new1(imac
1008   - ? &snd_pmac_awacs_speaker_sw_imac
  1031 + chip->speaker_sw_ctl = snd_ctl_new1(imac1
  1032 + ? &snd_pmac_awacs_speaker_sw_imac1
  1033 + : imac2
  1034 + ? &snd_pmac_awacs_speaker_sw_imac2
1009 1035 : &snd_pmac_awacs_speaker_sw, chip);
1010 1036 err = snd_ctl_add(chip->card, chip->speaker_sw_ctl);
1011 1037 if (err < 0)
1012 1038 return err;
1013 1039 }
1014 1040  
1015   - if (beige)
  1041 + if (beige || g4agp)
1016 1042 err = build_mixers(chip,
1017 1043 ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige),
1018 1044 snd_pmac_screamer_mic_boost_beige);
sound/soc/codecs/wm8753.c
... ... @@ -583,7 +583,7 @@
583 583  
584 584 /* out 4 */
585 585 {"Out4 Mux", "VREF", "VREF"},
586   - {"Out4 Mux", "Capture ST", "Capture ST Mixer"},
  586 + {"Out4 Mux", "Capture ST", "Playback Mixer"},
587 587 {"Out4 Mux", "LOUT2", "LOUT2"},
588 588 {"Out 4", NULL, "Out4 Mux"},
589 589 {"OUT4", NULL, "Out 4"},
... ... @@ -607,7 +607,7 @@
607 607 /* Capture Right Mux */
608 608 {"Capture Right Mux", "PGA", "Right Capture Volume"},
609 609 {"Capture Right Mux", "Line or RXP-RXN", "Line Right Mux"},
610   - {"Capture Right Mux", "Sidetone", "Capture ST Mixer"},
  610 + {"Capture Right Mux", "Sidetone", "Playback Mixer"},
611 611  
612 612 /* Mono Capture mixer-mux */
613 613 {"Capture Right Mixer", "Stereo", "Capture Right Mux"},