Commit 7a71bbf3 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Move vmaster TLV parsing to snd_hda_gen_parse_auto_config()

Add vmaster_tlv[] to hda_gen_spec and store the suggested TLV data
in snd_hda_gen_parse_auto_config().  This allows the codec driver to
correct the TLV data (e.g. mute capability) before actually creating
vmaster instance.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 29476558
...@@ -1601,6 +1601,9 @@ static int parse_output_paths(struct hda_codec *codec) ...@@ -1601,6 +1601,9 @@ static int parse_output_paths(struct hda_codec *codec)
path = snd_hda_get_path_from_idx(codec, spec->out_paths[0]); path = snd_hda_get_path_from_idx(codec, spec->out_paths[0]);
if (path) if (path)
spec->vmaster_nid = look_for_out_vol_nid(codec, path); spec->vmaster_nid = look_for_out_vol_nid(codec, path);
if (spec->vmaster_nid)
snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid,
HDA_OUTPUT, spec->vmaster_tlv);
} }
kfree(best_cfg); kfree(best_cfg);
...@@ -3752,11 +3755,8 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) ...@@ -3752,11 +3755,8 @@ int snd_hda_gen_build_controls(struct hda_codec *codec)
/* if we have no master control, let's create it */ /* if we have no master control, let's create it */
if (!spec->no_analog && if (!spec->no_analog &&
!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
unsigned int vmaster_tlv[4];
snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid,
HDA_OUTPUT, vmaster_tlv);
err = snd_hda_add_vmaster(codec, "Master Playback Volume", err = snd_hda_add_vmaster(codec, "Master Playback Volume",
vmaster_tlv, slave_pfxs, spec->vmaster_tlv, slave_pfxs,
"Playback Volume"); "Playback Volume");
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -214,6 +214,7 @@ struct hda_gen_spec { ...@@ -214,6 +214,7 @@ struct hda_gen_spec {
/* for virtual master */ /* for virtual master */
hda_nid_t vmaster_nid; hda_nid_t vmaster_nid;
unsigned int vmaster_tlv[4];
struct hda_vmaster_mute_hook vmaster_mute; struct hda_vmaster_mute_hook vmaster_mute;
#ifdef CONFIG_PM #ifdef CONFIG_PM
struct hda_loopback_check loopback; struct hda_loopback_check loopback;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment