aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 11:11:07 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:43 -0400
commit47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f (patch)
tree920b7e2cdce7120ff96417d74b911c3d5b95c21b /sound/pci/hda/hda_generic.c
parent82beb8fd365afe3891b277c46425083f13e23c56 (diff)
[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/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index d5f1180115c..91cd9b9ea5d 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)
218 ofs = (node->amp_out_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT; 218 ofs = (node->amp_out_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;
219 if (val >= ofs) 219 if (val >= ofs)
220 val -= ofs; 220 val -= ofs;
221 snd_hda_codec_amp_update(codec, node->nid, 0, HDA_OUTPUT, 0, 0xff, val); 221 snd_hda_codec_amp_stereo(codec, node->nid, HDA_OUTPUT, 0, 0xff, val);
222 snd_hda_codec_amp_update(codec, node->nid, 0, HDA_OUTPUT, 1, 0xff, val);
223 return 0; 222 return 0;
224} 223}
225 224
@@ -234,10 +233,7 @@ static int unmute_input(struct hda_codec *codec, struct hda_gnode *node, unsigne
234 ofs = (node->amp_in_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT; 233 ofs = (node->amp_in_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;
235 if (val >= ofs) 234 if (val >= ofs)
236 val -= ofs; 235 val -= ofs;
237 snd_hda_codec_amp_update(codec, node->nid, 0, HDA_INPUT, index, 236 snd_hda_codec_amp_stereo(codec, node->nid, HDA_INPUT, index, 0xff, val);
238 0xff, val);
239 snd_hda_codec_amp_update(codec, node->nid, 1, HDA_INPUT, index,
240 0xff, val);
241 return 0; 237 return 0;
242} 238}
243 239