mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
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>
This commit is contained in:
parent
c873cc2528
commit
9645c2039d
1 changed files with 4 additions and 5 deletions
|
@ -1553,7 +1553,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
|
||||||
{
|
{
|
||||||
char name[32];
|
char name[32];
|
||||||
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
|
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;
|
int i, err;
|
||||||
|
|
||||||
for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
|
for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
|
||||||
|
@ -1562,8 +1562,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
|
||||||
if (!nid)
|
if (!nid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i != AUTO_SEQ_FRONT)
|
nid_vol = nid_vols[i];
|
||||||
nid_vol = 0x18 + i;
|
|
||||||
|
|
||||||
if (i == AUTO_SEQ_CENLFE) {
|
if (i == AUTO_SEQ_CENLFE) {
|
||||||
/* Center/LFE */
|
/* Center/LFE */
|
||||||
|
@ -1595,13 +1594,13 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
|
||||||
/* add control to mixer index 0 */
|
/* add control to mixer index 0 */
|
||||||
err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
|
err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
|
||||||
"Master Front Playback Volume",
|
"Master Front Playback Volume",
|
||||||
HDA_COMPOSE_AMP_VAL(0x17, 3, 0,
|
HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0,
|
||||||
HDA_INPUT));
|
HDA_INPUT));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
err = via_add_control(spec, VIA_CTL_WIDGET_MUTE,
|
err = via_add_control(spec, VIA_CTL_WIDGET_MUTE,
|
||||||
"Master Front Playback Switch",
|
"Master Front Playback Switch",
|
||||||
HDA_COMPOSE_AMP_VAL(0x17, 3, 0,
|
HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0,
|
||||||
HDA_INPUT));
|
HDA_INPUT));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Add table
Reference in a new issue