Commit 4dbf95ba authored by Risto Suominen's avatar Risto Suominen Committed by Takashi Iwai

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/220Signed-off-by: default avatarRisto Suominen <Risto.Suominen@gmail.com>
Tested-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: stable@kernel.org
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 24918b61
...@@ -621,6 +621,13 @@ static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __initdata = { ...@@ -621,6 +621,13 @@ static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __initdata = {
AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
}; };
static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] __initdata = {
AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),
AWACS_VOLUME("Master Playback Volume", 5, 6, 1),
AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0),
AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),
};
static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = { static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = {
AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), AWACS_VOLUME("Line out Playback Volume", 2, 6, 1),
AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), 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,6 +775,7 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip)
#define IS_IMAC (machine_is_compatible("PowerMac2,1") \ #define IS_IMAC (machine_is_compatible("PowerMac2,1") \
|| machine_is_compatible("PowerMac2,2") \ || machine_is_compatible("PowerMac2,2") \
|| machine_is_compatible("PowerMac4,1")) || machine_is_compatible("PowerMac4,1"))
#define IS_G4AGP (machine_is_compatible("PowerMac3,1"))
static int imac; static int imac;
...@@ -850,6 +858,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) ...@@ -850,6 +858,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
{ {
int pm7500 = IS_PM7500; int pm7500 = IS_PM7500;
int beige = IS_BEIGE; int beige = IS_BEIGE;
int g4agp = IS_G4AGP;
int err, vol; int err, vol;
imac = IS_IMAC; imac = IS_IMAC;
...@@ -939,7 +948,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) ...@@ -939,7 +948,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
snd_pmac_awacs_mixers); snd_pmac_awacs_mixers);
if (err < 0) if (err < 0)
return err; return err;
if (beige) if (beige || g4agp)
; ;
else if (chip->model == PMAC_SCREAMER) else if (chip->model == PMAC_SCREAMER)
err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2),
...@@ -961,13 +970,17 @@ snd_pmac_awacs_init(struct snd_pmac *chip) ...@@ -961,13 +970,17 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
err = build_mixers(chip, err = build_mixers(chip,
ARRAY_SIZE(snd_pmac_screamer_mixers_imac), ARRAY_SIZE(snd_pmac_screamer_mixers_imac),
snd_pmac_screamer_mixers_imac); snd_pmac_screamer_mixers_imac);
else if (g4agp)
err = build_mixers(chip,
ARRAY_SIZE(snd_pmac_screamer_mixers_g4agp),
snd_pmac_screamer_mixers_g4agp);
else else
err = build_mixers(chip, err = build_mixers(chip,
ARRAY_SIZE(snd_pmac_awacs_mixers_pmac), ARRAY_SIZE(snd_pmac_awacs_mixers_pmac),
snd_pmac_awacs_mixers_pmac); snd_pmac_awacs_mixers_pmac);
if (err < 0) if (err < 0)
return err; return err;
chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac) chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac || g4agp)
? &snd_pmac_awacs_master_sw_imac ? &snd_pmac_awacs_master_sw_imac
: &snd_pmac_awacs_master_sw, chip); : &snd_pmac_awacs_master_sw, chip);
err = snd_ctl_add(chip->card, chip->master_sw_ctl); err = snd_ctl_add(chip->card, chip->master_sw_ctl);
...@@ -1012,7 +1025,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) ...@@ -1012,7 +1025,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
return err; return err;
} }
if (beige) if (beige || g4agp)
err = build_mixers(chip, err = build_mixers(chip,
ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige),
snd_pmac_screamer_mic_boost_beige); snd_pmac_screamer_mic_boost_beige);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment