From 47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 10 Aug 2007 17:11:07 +0200 Subject: [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 Signed-off-by: Jaroslav Kysela --- sound/pci/hda/hda_generic.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sound/pci/hda/hda_generic.c') diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index d5f1180115ce..91cd9b9ea5d1 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -218,8 +218,7 @@ static int unmute_output(struct hda_codec *codec, struct hda_gnode *node) ofs = (node->amp_out_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT; if (val >= ofs) val -= ofs; - snd_hda_codec_amp_update(codec, node->nid, 0, HDA_OUTPUT, 0, 0xff, val); - snd_hda_codec_amp_update(codec, node->nid, 0, HDA_OUTPUT, 1, 0xff, val); + snd_hda_codec_amp_stereo(codec, node->nid, HDA_OUTPUT, 0, 0xff, val); return 0; } @@ -234,10 +233,7 @@ static int unmute_input(struct hda_codec *codec, struct hda_gnode *node, unsigne ofs = (node->amp_in_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT; if (val >= ofs) val -= ofs; - snd_hda_codec_amp_update(codec, node->nid, 0, HDA_INPUT, index, - 0xff, val); - snd_hda_codec_amp_update(codec, node->nid, 1, HDA_INPUT, index, - 0xff, val); + snd_hda_codec_amp_stereo(codec, node->nid, HDA_INPUT, index, 0xff, val); return 0; } -- cgit v1.2.1