[alsa-devel] [PATCH 19/31] HDA patch_via.c: Modify vt1708_auto_create_multi_out_ctls.
[ALSA] HDA VIA: Modify vt1708_auto_create_multi_out_ctls.
Rewrite nid_vol/mute assignment for clearity, and check line connection before adding control for it.
Signed-off-by: Lydia Wang lydiawang@viatech.com.cn
Index: sound-2.6/sound/pci/hda/patch_via.c =================================================================== --- sound-2.6.orig/sound/pci/hda/patch_via.c 2009-10-05 15:11:04.000000000 +0800 +++ sound-2.6/sound/pci/hda/patch_via.c 2009-10-05 15:11:06.000000000 +0800 @@ -1521,7 +1521,7 @@ { char name[32]; static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; - hda_nid_t nid, nid_vol = 0; + hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; int i, err;
for (i = 0; i <= AUTO_SEQ_SIDE; i++) { @@ -1530,8 +1530,7 @@ if (!nid) continue; - if (i != AUTO_SEQ_FRONT) - nid_vol = 0x18 + i; + nid_vol = nid_vols[i];
if (i == AUTO_SEQ_CENLFE) { /* Center/LFE */ @@ -1563,13 +1562,13 @@ /* add control to mixer index 0 */ err = via_add_control(spec, VIA_CTL_WIDGET_VOL, "Master Front Playback Volume", - HDA_COMPOSE_AMP_VAL(0x17, 3, 0, + HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_INPUT)); if (err < 0) return err; err = via_add_control(spec, VIA_CTL_WIDGET_MUTE, "Master Front Playback Switch", - HDA_COMPOSE_AMP_VAL(0x17, 3, 0, + HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_INPUT)); if (err < 0) return err;
[ALSA] HDA VIA: Modify vt1708_auto_create_multi_out_ctls.
Rewrite nid_vol/mute assignment for clearity, and check line connection before adding control for it.
Signed-off-by: Lydia Wang lydiawang@viatech.com.cn
--- sound/pci/hda/patch_via.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
--- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1568,7 +1568,7 @@ { char name[32]; static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; - hda_nid_t nid, nid_vol = 0; + hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; int i, err;
for (i = 0; i <= AUTO_SEQ_SIDE; i++) { @@ -1577,8 +1577,7 @@ if (!nid) continue; - if (i != AUTO_SEQ_FRONT) - nid_vol = 0x18 + i; + nid_vol = nid_vols[i];
if (i == AUTO_SEQ_CENLFE) { /* Center/LFE */ @@ -1610,13 +1609,13 @@ /* add control to mixer index 0 */ err = via_add_control(spec, VIA_CTL_WIDGET_VOL, "Master Front Playback Volume", - HDA_COMPOSE_AMP_VAL(0x17, 3, 0, + HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_INPUT)); if (err < 0) return err; err = via_add_control(spec, VIA_CTL_WIDGET_MUTE, "Master Front Playback Switch", - HDA_COMPOSE_AMP_VAL(0x17, 3, 0, + HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_INPUT)); if (err < 0) return err;
participants (1)
-
Li Bo