From 014705940fa2f8c700feb28605f1df6e7c093aa6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sun, 17 Oct 2010 10:40:53 +0200 Subject: [PATCH] --- yaml --- r: 216726 b: refs/heads/master c: c08d91695b2a3349254a62b60f03f7971bd90fa0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/sound/tlv.h | 4 +++- trunk/sound/pci/hda/hda_codec.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index da6152e1f8f5..f9fccdb619ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: de8c85f7840e5e29629de95f5af24297fb325e0b +refs/heads/master: c08d91695b2a3349254a62b60f03f7971bd90fa0 diff --git a/trunk/include/sound/tlv.h b/trunk/include/sound/tlv.h index 9fd5b19ccf5c..7067e2dfb0b9 100644 --- a/trunk/include/sound/tlv.h +++ b/trunk/include/sound/tlv.h @@ -38,9 +38,11 @@ #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ +#define TLV_DB_SCALE_MASK 0xffff +#define TLV_DB_SCALE_MUTE 0x10000 #define TLV_DB_SCALE_ITEM(min, step, mute) \ SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ - (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) + (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0) #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 8c933c8006f4..ee134a25092c 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -1843,7 +1843,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, val1 += ofs; val1 = ((int)val1) * ((int)val2); if (min_mute) - val2 |= 0x10000; + val2 |= TLV_DB_SCALE_MUTE; if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) return -EFAULT; if (put_user(2 * sizeof(unsigned int), _tlv + 1))