diff options
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index f34bbfb705f5..b0fb6c917c38 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -1639,6 +1639,45 @@ static struct snd_kcontrol_new snd_audigy_shared_spdif __devinitdata = | |||
1639 | .put = snd_emu10k1_shared_spdif_put | 1639 | .put = snd_emu10k1_shared_spdif_put |
1640 | }; | 1640 | }; |
1641 | 1641 | ||
1642 | /* workaround for too low volume on Audigy due to 16bit/24bit conversion */ | ||
1643 | |||
1644 | #define snd_audigy_capture_boost_info snd_ctl_boolean_mono_info | ||
1645 | |||
1646 | static int snd_audigy_capture_boost_get(struct snd_kcontrol *kcontrol, | ||
1647 | struct snd_ctl_elem_value *ucontrol) | ||
1648 | { | ||
1649 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | ||
1650 | unsigned int val; | ||
1651 | |||
1652 | /* FIXME: better to use a cached version */ | ||
1653 | val = snd_ac97_read(emu->ac97, AC97_REC_GAIN); | ||
1654 | ucontrol->value.integer.value[0] = !!val; | ||
1655 | return 0; | ||
1656 | } | ||
1657 | |||
1658 | static int snd_audigy_capture_boost_put(struct snd_kcontrol *kcontrol, | ||
1659 | struct snd_ctl_elem_value *ucontrol) | ||
1660 | { | ||
1661 | struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | ||
1662 | unsigned int val; | ||
1663 | |||
1664 | if (ucontrol->value.integer.value[0]) | ||
1665 | val = 0x0f0f; | ||
1666 | else | ||
1667 | val = 0; | ||
1668 | return snd_ac97_update(emu->ac97, AC97_REC_GAIN, val); | ||
1669 | } | ||
1670 | |||
1671 | static struct snd_kcontrol_new snd_audigy_capture_boost __devinitdata = | ||
1672 | { | ||
1673 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
1674 | .name = "Analog Capture Boost", | ||
1675 | .info = snd_audigy_capture_boost_info, | ||
1676 | .get = snd_audigy_capture_boost_get, | ||
1677 | .put = snd_audigy_capture_boost_put | ||
1678 | }; | ||
1679 | |||
1680 | |||
1642 | /* | 1681 | /* |
1643 | */ | 1682 | */ |
1644 | static void snd_emu10k1_mixer_free_ac97(struct snd_ac97 *ac97) | 1683 | static void snd_emu10k1_mixer_free_ac97(struct snd_ac97 *ac97) |
@@ -2087,5 +2126,12 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, | |||
2087 | } | 2126 | } |
2088 | } | 2127 | } |
2089 | 2128 | ||
2129 | if (emu->card_capabilities->ac97_chip && emu->audigy) { | ||
2130 | err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_capture_boost, | ||
2131 | emu)); | ||
2132 | if (err < 0) | ||
2133 | return err; | ||
2134 | } | ||
2135 | |||
2090 | return 0; | 2136 | return 0; |
2091 | } | 2137 | } |