diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-08-10 17:11:07 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 15:58:43 +0200 |
commit | 47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f (patch) | |
tree | 920b7e2cdce7120ff96417d74b911c3d5b95c21b /sound/pci/hda/patch_sigmatel.c | |
parent | 82beb8fd365afe3891b277c46425083f13e23c56 (diff) | |
download | kernel_samsung_smdk4412-47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f.tar.gz kernel_samsung_smdk4412-47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f.tar.bz2 kernel_samsung_smdk4412-47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f.zip |
[ALSA] hda-codec - add snd_hda_codec_stereo() function
Added snd_hda_codec_amp_stereo() function that changes both of stereo
channels with the same mask and value bits. It simplifies most of
amp-handling codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 145a5f3c063..1690726c1e1 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -2408,13 +2408,13 @@ static int vaio_master_vol_put(struct snd_kcontrol *kcontrol, int change; change = snd_hda_codec_amp_update(codec, 0x02, 0, HDA_OUTPUT, 0, - 0x7f, valp[0] & 0x7f); + HDA_AMP_VOLMASK, valp[0]); change |= snd_hda_codec_amp_update(codec, 0x02, 1, HDA_OUTPUT, 0, - 0x7f, valp[1] & 0x7f); + HDA_AMP_VOLMASK, valp[1]); snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0, - 0x7f, valp[0] & 0x7f); + HDA_AMP_VOLMASK, valp[0]); snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0, - 0x7f, valp[1] & 0x7f); + HDA_AMP_VOLMASK, valp[1]); return change; } @@ -2427,13 +2427,15 @@ static int vaio_master_sw_put(struct snd_kcontrol *kcontrol, int change; change = snd_hda_codec_amp_update(codec, 0x02, 0, HDA_OUTPUT, 0, - 0x80, (valp[0] ? 0 : 0x80)); + HDA_AMP_MUTE, + (valp[0] ? 0 : HDA_AMP_MUTE)); change |= snd_hda_codec_amp_update(codec, 0x02, 1, HDA_OUTPUT, 0, - 0x80, (valp[1] ? 0 : 0x80)); + HDA_AMP_MUTE, + (valp[1] ? 0 : HDA_AMP_MUTE)); snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0, - 0x80, (valp[0] ? 0 : 0x80)); + HDA_AMP_MUTE, (valp[0] ? 0 : HDA_AMP_MUTE)); snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0, - 0x80, (valp[1] ? 0 : 0x80)); + HDA_AMP_MUTE, (valp[1] ? 0 : HDA_AMP_MUTE)); return change; } |