diff options
Diffstat (limited to 'sound/pci/emu10k1/emumixer.c')
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index fd221209abcb..f34bbfb705f5 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -1578,6 +1578,10 @@ static int snd_emu10k1_shared_spdif_get(struct snd_kcontrol *kcontrol, | |||
1578 | ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0; | 1578 | ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0; |
1579 | else | 1579 | else |
1580 | ucontrol->value.integer.value[0] = inl(emu->port + HCFG) & HCFG_GPOUT0 ? 1 : 0; | 1580 | ucontrol->value.integer.value[0] = inl(emu->port + HCFG) & HCFG_GPOUT0 ? 1 : 0; |
1581 | if (emu->card_capabilities->invert_shared_spdif) | ||
1582 | ucontrol->value.integer.value[0] = | ||
1583 | !ucontrol->value.integer.value[0]; | ||
1584 | |||
1581 | return 0; | 1585 | return 0; |
1582 | } | 1586 | } |
1583 | 1587 | ||
@@ -1586,15 +1590,18 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol, | |||
1586 | { | 1590 | { |
1587 | unsigned long flags; | 1591 | unsigned long flags; |
1588 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 1592 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
1589 | unsigned int reg, val; | 1593 | unsigned int reg, val, sw; |
1590 | int change = 0; | 1594 | int change = 0; |
1591 | 1595 | ||
1596 | sw = ucontrol->value.integer.value[0]; | ||
1597 | if (emu->card_capabilities->invert_shared_spdif) | ||
1598 | sw = !sw; | ||
1592 | spin_lock_irqsave(&emu->reg_lock, flags); | 1599 | spin_lock_irqsave(&emu->reg_lock, flags); |
1593 | if ( emu->card_capabilities->i2c_adc) { | 1600 | if ( emu->card_capabilities->i2c_adc) { |
1594 | /* Do nothing for Audigy 2 ZS Notebook */ | 1601 | /* Do nothing for Audigy 2 ZS Notebook */ |
1595 | } else if (emu->audigy) { | 1602 | } else if (emu->audigy) { |
1596 | reg = inl(emu->port + A_IOCFG); | 1603 | reg = inl(emu->port + A_IOCFG); |
1597 | val = ucontrol->value.integer.value[0] ? A_IOCFG_GPOUT0 : 0; | 1604 | val = sw ? A_IOCFG_GPOUT0 : 0; |
1598 | change = (reg & A_IOCFG_GPOUT0) != val; | 1605 | change = (reg & A_IOCFG_GPOUT0) != val; |
1599 | if (change) { | 1606 | if (change) { |
1600 | reg &= ~A_IOCFG_GPOUT0; | 1607 | reg &= ~A_IOCFG_GPOUT0; |
@@ -1603,7 +1610,7 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol, | |||
1603 | } | 1610 | } |
1604 | } | 1611 | } |
1605 | reg = inl(emu->port + HCFG); | 1612 | reg = inl(emu->port + HCFG); |
1606 | val = ucontrol->value.integer.value[0] ? HCFG_GPOUT0 : 0; | 1613 | val = sw ? HCFG_GPOUT0 : 0; |
1607 | change |= (reg & HCFG_GPOUT0) != val; | 1614 | change |= (reg & HCFG_GPOUT0) != val; |
1608 | if (change) { | 1615 | if (change) { |
1609 | reg &= ~HCFG_GPOUT0; | 1616 | reg &= ~HCFG_GPOUT0; |