Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92050
b: refs/heads/master
c: 1c82ed1
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Apr 24, 2008
1 parent 30b3cb7 commit 148c57e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e922b0028fad87de0d262f9fa51f98595d2df258
refs/heads/master: 1c82ed1bc531746a8fa9b46c593ddce546f28026
9 changes: 6 additions & 3 deletions trunk/sound/core/vmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>

/*
* a subset of information returned via ctl info callback
Expand All @@ -34,6 +35,7 @@ struct link_master {
struct list_head slaves;
struct link_ctl_info info;
int val; /* the master value */
unsigned int tlv[4];
};

/*
Expand Down Expand Up @@ -357,11 +359,12 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
kctl->private_free = master_free;

/* additional (constant) TLV read */
if (tlv) {
/* FIXME: this assumes that the max volume is 0 dB */
if (tlv && tlv[0] == SNDRV_CTL_TLVT_DB_SCALE) {
kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
kctl->tlv.p = tlv;
memcpy(master->tlv, tlv, sizeof(master->tlv));
kctl->tlv.p = master->tlv;
}

return kctl;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ snd-hda-intel-y := hda_intel.o
# since snd-hda-intel is the only driver using hda-codec,
# merge it into a single module although it was originally
# designed to be individual modules
snd-hda-intel-y += hda_codec.o vmaster.o
snd-hda-intel-y += hda_codec.o
snd-hda-intel-$(CONFIG_PROC_FS) += hda_proc.o
snd-hda-intel-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
snd-hda-intel-$(CONFIG_SND_HDA_GENERIC) += hda_generic.o
Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct ad198x_spec {
#endif
/* for virtual master */
hda_nid_t vmaster_nid;
u32 vmaster_tlv[4];
const char **slave_vols;
const char **slave_sws;
};
Expand Down Expand Up @@ -185,10 +184,11 @@ static int ad198x_build_controls(struct hda_codec *codec)

/* if we have no master control, let's create it */
if (!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, spec->vmaster_tlv);
HDA_OUTPUT, vmaster_tlv);
err = snd_hda_add_vmaster(codec, "Master Playback Volume",
spec->vmaster_tlv,
vmaster_tlv,
(spec->slave_vols ?
spec->slave_vols : ad_slave_vols));
if (err < 0)
Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ struct alc_spec {

/* for virtual master */
hda_nid_t vmaster_nid;
u32 vmaster_tlv[4];
#ifdef CONFIG_SND_HDA_POWER_SAVE
struct hda_loopback_check loopback;
#endif
Expand Down Expand Up @@ -1534,10 +1533,11 @@ static int alc_build_controls(struct hda_codec *codec)

/* if we have no master control, let's create it */
if (!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, spec->vmaster_tlv);
HDA_OUTPUT, vmaster_tlv);
err = snd_hda_add_vmaster(codec, "Master Playback Volume",
spec->vmaster_tlv, alc_slave_vols);
vmaster_tlv, alc_slave_vols);
if (err < 0)
return err;
}
Expand Down
8 changes: 3 additions & 5 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ struct sigmatel_spec {
struct hda_input_mux private_dimux;
struct hda_input_mux private_imux;
struct hda_input_mux private_mono_mux;

/* virtual master */
unsigned int vmaster_tlv[4];
};

static hda_nid_t stac9200_adc_nids[1] = {
Expand Down Expand Up @@ -930,10 +927,11 @@ static int stac92xx_build_controls(struct hda_codec *codec)

/* if we have no master control, let's create it */
if (!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
unsigned int vmaster_tlv[4];
snd_hda_set_vmaster_tlv(codec, spec->multiout.dac_nids[0],
HDA_OUTPUT, spec->vmaster_tlv);
HDA_OUTPUT, vmaster_tlv);
err = snd_hda_add_vmaster(codec, "Master Playback Volume",
spec->vmaster_tlv, slave_vols);
vmaster_tlv, slave_vols);
if (err < 0)
return err;
}
Expand Down

0 comments on commit 148c57e

Please sign in to comment.