diff options
author | Lydia Wang <lydiawang@viatech.com.cn> | 2009-10-10 07:08:27 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-11 11:57:51 -0400 |
commit | 9645c2039d5cfdbdcebe297420e180b6cd262836 (patch) | |
tree | b3c72ab15777486456a40dd62bdc86fb3a252b4f | |
parent | c873cc25280113d71463ad5075413d283be6b766 (diff) |
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>
Signed-off-by: Logan Li <loganli@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_via.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 4d3c447342b0..efadacd60835 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1553,7 +1553,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
1553 | { | 1553 | { |
1554 | char name[32]; | 1554 | char name[32]; |
1555 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; | 1555 | static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; |
1556 | hda_nid_t nid, nid_vol = 0; | 1556 | hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; |
1557 | int i, err; | 1557 | int i, err; |
1558 | 1558 | ||
1559 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { | 1559 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { |
@@ -1562,8 +1562,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
1562 | if (!nid) | 1562 | if (!nid) |
1563 | continue; | 1563 | continue; |
1564 | 1564 | ||
1565 | if (i != AUTO_SEQ_FRONT) | 1565 | nid_vol = nid_vols[i]; |
1566 | nid_vol = 0x18 + i; | ||
1567 | 1566 | ||
1568 | if (i == AUTO_SEQ_CENLFE) { | 1567 | if (i == AUTO_SEQ_CENLFE) { |
1569 | /* Center/LFE */ | 1568 | /* Center/LFE */ |
@@ -1595,13 +1594,13 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
1595 | /* add control to mixer index 0 */ | 1594 | /* add control to mixer index 0 */ |
1596 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, | 1595 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, |
1597 | "Master Front Playback Volume", | 1596 | "Master Front Playback Volume", |
1598 | HDA_COMPOSE_AMP_VAL(0x17, 3, 0, | 1597 | HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, |
1599 | HDA_INPUT)); | 1598 | HDA_INPUT)); |
1600 | if (err < 0) | 1599 | if (err < 0) |
1601 | return err; | 1600 | return err; |
1602 | err = via_add_control(spec, VIA_CTL_WIDGET_MUTE, | 1601 | err = via_add_control(spec, VIA_CTL_WIDGET_MUTE, |
1603 | "Master Front Playback Switch", | 1602 | "Master Front Playback Switch", |
1604 | HDA_COMPOSE_AMP_VAL(0x17, 3, 0, | 1603 | HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, |
1605 | HDA_INPUT)); | 1604 | HDA_INPUT)); |
1606 | if (err < 0) | 1605 | if (err < 0) |
1607 | return err; | 1606 | return err; |