summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-17 10:25:15 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-17 10:25:15 +0100
commit7a71bbf310cda13a713aab0c1dcf888707a54286 (patch)
treeaae9a68b6db526fb64f7443d1642d0efea0386e8 /sound/pci
parent29476558deb3017993366a3b0b45dff2acad495b (diff)
downloadblackbird-op-linux-7a71bbf310cda13a713aab0c1dcf888707a54286.tar.gz
blackbird-op-linux-7a71bbf310cda13a713aab0c1dcf888707a54286.zip
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_generic.c8
-rw-r--r--sound/pci/hda/hda_generic.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 878556b8ea32..9c06749738b1 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -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]);
if (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);
@@ -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 (!spec->no_analog &&
!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",
- vmaster_tlv, slave_pfxs,
+ spec->vmaster_tlv, slave_pfxs,
"Playback Volume");
if (err < 0)
return err;
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 142a571ecd5b..43a8482ed2b3 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -214,6 +214,7 @@ struct hda_gen_spec {
/* for virtual master */
hda_nid_t vmaster_nid;
+ unsigned int vmaster_tlv[4];
struct hda_vmaster_mute_hook vmaster_mute;
#ifdef CONFIG_PM
struct hda_loopback_check loopback;
OpenPOWER on IntegriCloud