diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-10-15 04:32:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-10-17 04:45:30 -0400 |
commit | de8c85f7840e5e29629de95f5af24297fb325e0b (patch) | |
tree | 79f9a1cff3ff4b5baec72186f5d0709803b9125e /sound/pci/hda/hda_codec.c | |
parent | c3d226ab8b44fe31e5e6d5739eb353597cea4029 (diff) |
ALSA: HDA: Sigmatel: work around incorrect master muting
The HDA specification does not allow for a codec to mute itself just
because the volume is reduced, so _of course_ somebody had to go and do
it. This wouldn'\''t hurt too much when the volume is adjusted by hand,
but programs like PA that try to set the volume automatically could
inadvertently mute the output.
To work around this, change the TLV dB information for the Master volume
on all Sigmatel HDA codecs to indicate the the minimal volume setting
actually mutes.
Reported-by: Colin Guthrie <gmane@colin.guthr.ie>
Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com>
Tested-by: Colin Guthrie <cguthrie@mandriva.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 053f827d2c2c..8c933c8006f4 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1831,6 +1831,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1831 | hda_nid_t nid = get_amp_nid(kcontrol); | 1831 | hda_nid_t nid = get_amp_nid(kcontrol); |
1832 | int dir = get_amp_direction(kcontrol); | 1832 | int dir = get_amp_direction(kcontrol); |
1833 | unsigned int ofs = get_amp_offset(kcontrol); | 1833 | unsigned int ofs = get_amp_offset(kcontrol); |
1834 | bool min_mute = get_amp_min_mute(kcontrol); | ||
1834 | u32 caps, val1, val2; | 1835 | u32 caps, val1, val2; |
1835 | 1836 | ||
1836 | if (size < 4 * sizeof(unsigned int)) | 1837 | if (size < 4 * sizeof(unsigned int)) |
@@ -1841,6 +1842,8 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1841 | val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT); | 1842 | val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT); |
1842 | val1 += ofs; | 1843 | val1 += ofs; |
1843 | val1 = ((int)val1) * ((int)val2); | 1844 | val1 = ((int)val1) * ((int)val2); |
1845 | if (min_mute) | ||
1846 | val2 |= 0x10000; | ||
1844 | if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) | 1847 | if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) |
1845 | return -EFAULT; | 1848 | return -EFAULT; |
1846 | if (put_user(2 * sizeof(unsigned int), _tlv + 1)) | 1849 | if (put_user(2 * sizeof(unsigned int), _tlv + 1)) |