Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110125
b: refs/heads/master
c: 030b655
h: refs/heads/master
i:
  110123: a08bf22
v: v3
  • Loading branch information
Risto Suominen authored and Takashi Iwai committed Oct 2, 2008
1 parent 4e19137 commit 1873a93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4dbf95ba6c344186ec6d38ff514dc675da464bec
refs/heads/master: 030b655b062fe5190fc490e0091ea50307d7a86f
31 changes: 22 additions & 9 deletions trunk/sound/ppc/awacs.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,10 @@ static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] __initdata = {
static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata =
AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1);

static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac __initdata =
static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 __initdata =
AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 1);

static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 __initdata =
AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_PAROUT1, 0);


Expand Down Expand Up @@ -772,12 +775,12 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip)

#define IS_PM7500 (machine_is_compatible("AAPL,7500"))
#define IS_BEIGE (machine_is_compatible("AAPL,Gossamer"))
#define IS_IMAC (machine_is_compatible("PowerMac2,1") \
|| machine_is_compatible("PowerMac2,2") \
#define IS_IMAC1 (machine_is_compatible("PowerMac2,1"))
#define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \
|| machine_is_compatible("PowerMac4,1"))
#define IS_G4AGP (machine_is_compatible("PowerMac3,1"))

static int imac;
static int imac1, imac2;

#ifdef PMAC_SUPPORT_AUTOMUTE
/*
Expand Down Expand Up @@ -823,13 +826,18 @@ static void snd_pmac_awacs_update_automute(struct snd_pmac *chip, int do_notify)
{
int reg = chip->awacs_reg[1]
| (MASK_HDMUTE | MASK_SPKMUTE);
if (imac) {
if (imac1) {
reg &= ~MASK_SPKMUTE;
reg |= MASK_PAROUT1;
} else if (imac2) {
reg &= ~MASK_SPKMUTE;
reg &= ~MASK_PAROUT1;
}
if (snd_pmac_awacs_detect_headphone(chip))
reg &= ~MASK_HDMUTE;
else if (imac)
else if (imac1)
reg &= ~MASK_PAROUT1;
else if (imac2)
reg |= MASK_PAROUT1;
else
reg &= ~MASK_SPKMUTE;
Expand Down Expand Up @@ -859,9 +867,12 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
int pm7500 = IS_PM7500;
int beige = IS_BEIGE;
int g4agp = IS_G4AGP;
int imac;
int err, vol;

imac = IS_IMAC;
imac1 = IS_IMAC1;
imac2 = IS_IMAC2;
imac = imac1 || imac2;
/* looks like MASK_GAINLINE triggers something, so we set here
* as start-up
*/
Expand Down Expand Up @@ -1017,8 +1028,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
snd_pmac_awacs_speaker_vol);
if (err < 0)
return err;
chip->speaker_sw_ctl = snd_ctl_new1(imac
? &snd_pmac_awacs_speaker_sw_imac
chip->speaker_sw_ctl = snd_ctl_new1(imac1
? &snd_pmac_awacs_speaker_sw_imac1
: imac2
? &snd_pmac_awacs_speaker_sw_imac2
: &snd_pmac_awacs_speaker_sw, chip);
err = snd_ctl_add(chip->card, chip->speaker_sw_ctl);
if (err < 0)
Expand Down

0 comments on commit 1873a93

Please sign in to comment.