X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=sound%2Fcore%2Fvmaster.c;h=4cc57f902e2c9ac03f8b8e6216be27738430d385;hb=a50c22eed593f474e75f693381e4d42e81762de8;hp=7cfd8b8fb4e73c1ffc33a0bc676c03afd9d4ac74;hpb=e922b0028fad87de0d262f9fa51f98595d2df258;p=linux-2.6-omap-h63xx.git diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index 7cfd8b8fb4e..4cc57f902e2 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c @@ -12,6 +12,7 @@ #include #include #include +#include /* * a subset of information returned via ctl info callback @@ -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]; }; /* @@ -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; }