Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276291
b: refs/heads/master
c: cf54d47
h: refs/heads/master
i:
  276289: 3d41fbd
  276287: 67b715b
v: v3
  • Loading branch information
Takashi Iwai committed Dec 1, 2011
1 parent 8e83e9a commit 3a3effd
Show file tree
Hide file tree
Showing 23 changed files with 438 additions and 267 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: bda63586bc5929e97288cdb371bb6456504867ed
refs/heads/master: cf54d47c13c2b171f946289de445102c676d4258
1 change: 1 addition & 0 deletions trunk/Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ STAC92HD83*
ref Reference board
mic-ref Reference board with power management for ports
dell-s14 Dell laptop
dell-vostro-3500 Dell Vostro 3500 laptop
hp HP laptops with (inverted) mute-LED
hp-dv7-4000 HP dv-7 4000
auto BIOS setup (default)
Expand Down
8 changes: 4 additions & 4 deletions trunk/Documentation/sound/alsa/HD-Audio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ Development Tree
~~~~~~~~~~~~~~~~
The latest development codes for HD-audio are found on sound git tree:

- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

The master branch or for-next branches can be used as the main
development branches in general while the HD-audio specific patches
Expand All @@ -594,7 +594,7 @@ is, installed via the usual spells: configure, make and make
install(-modules). See INSTALL in the package. The snapshot tarballs
are found at:

- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/
- ftp://ftp.suse.com/pub/people/tiwai/snapshot/


Sending a Bug Report
Expand Down Expand Up @@ -696,7 +696,7 @@ via hda-verb won't change the mixer value.

The hda-verb program is found in the ftp directory:

- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/
- ftp://ftp.suse.com/pub/people/tiwai/misc/

Also a git repository is available:

Expand Down Expand Up @@ -764,7 +764,7 @@ operation, the jack plugging simulation, etc.

The package is found in:

- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/
- ftp://ftp.suse.com/pub/people/tiwai/misc/

A git repository is available:

Expand Down
18 changes: 14 additions & 4 deletions trunk/sound/core/vmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct link_slave {
struct link_ctl_info info;
int vals[2]; /* current values */
unsigned int flags;
struct snd_kcontrol *kctl; /* original kcontrol pointer */
struct snd_kcontrol slave; /* the copy of original control entry */
};

Expand Down Expand Up @@ -252,6 +253,7 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave,
slave->count * sizeof(*slave->vd), GFP_KERNEL);
if (!srec)
return -ENOMEM;
srec->kctl = slave;
srec->slave = *slave;
memcpy(srec->slave.vd, slave->vd, slave->count * sizeof(*slave->vd));
srec->master = master_link;
Expand Down Expand Up @@ -333,10 +335,18 @@ static int master_put(struct snd_kcontrol *kcontrol,
static void master_free(struct snd_kcontrol *kcontrol)
{
struct link_master *master = snd_kcontrol_chip(kcontrol);
struct link_slave *slave;

list_for_each_entry(slave, &master->slaves, list)
slave->master = NULL;
struct link_slave *slave, *n;

/* free all slave links and retore the original slave kctls */
list_for_each_entry_safe(slave, n, &master->slaves, list) {
struct snd_kcontrol *sctl = slave->kctl;
struct list_head olist = sctl->list;
memcpy(sctl, &slave->slave, sizeof(*sctl));
memcpy(sctl->vd, slave->slave.vd,
sctl->count * sizeof(*sctl->vd));
sctl->list = olist; /* keep the current linked-list */
kfree(slave);
}
kfree(master);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/cs5535audio/cs5535audio_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
struct cs5535audio_dma_desc *desc =
&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
desc->addr = cpu_to_le32(addr);
desc->size = cpu_to_le32(period_bytes);
desc->size = cpu_to_le16(period_bytes);
desc->ctlreserved = cpu_to_le16(PRD_EOP);
desc_addr += sizeof(struct cs5535audio_dma_desc);
addr += period_bytes;
Expand Down
70 changes: 46 additions & 24 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2331,6 +2331,39 @@ int snd_hda_codec_reset(struct hda_codec *codec)
return 0;
}

typedef int (*map_slave_func_t)(void *, struct snd_kcontrol *);

/* apply the function to all matching slave ctls in the mixer list */
static int map_slaves(struct hda_codec *codec, const char * const *slaves,
map_slave_func_t func, void *data)
{
struct hda_nid_item *items;
const char * const *s;
int i, err;

items = codec->mixers.list;
for (i = 0; i < codec->mixers.used; i++) {
struct snd_kcontrol *sctl = items[i].kctl;
if (!sctl || !sctl->id.name ||
sctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER)
continue;
for (s = slaves; *s; s++) {
if (!strcmp(sctl->id.name, *s)) {
err = func(data, sctl);
if (err)
return err;
break;
}
}
}
return 0;
}

static int check_slave_present(void *data, struct snd_kcontrol *sctl)
{
return 1;
}

/**
* snd_hda_add_vmaster - create a virtual master control and add slaves
* @codec: HD-audio codec
Expand All @@ -2351,12 +2384,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char * const *slaves)
{
struct snd_kcontrol *kctl;
const char * const *s;
int err;

for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
;
if (!*s) {
err = map_slaves(codec, slaves, check_slave_present, NULL);
if (err != 1) {
snd_printdd("No slave found for %s\n", name);
return 0;
}
Expand All @@ -2367,23 +2398,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
if (err < 0)
return err;

for (s = slaves; *s; s++) {
struct snd_kcontrol *sctl;
int i = 0;
for (;;) {
sctl = _snd_hda_find_mixer_ctl(codec, *s, i);
if (!sctl) {
if (!i)
snd_printdd("Cannot find slave %s, "
"skipped\n", *s);
break;
}
err = snd_ctl_add_slave(kctl, sctl);
if (err < 0)
return err;
i++;
}
}
err = map_slaves(codec, slaves, (map_slave_func_t)snd_ctl_add_slave,
kctl);
if (err < 0)
return err;
return 0;
}
EXPORT_SYMBOL_HDA(snd_hda_add_vmaster);
Expand Down Expand Up @@ -4028,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,

/* Search for codec ID */
for (q = tbl; q->subvendor; q++) {
unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);

if (vendorid == codec->subsystem_id)
unsigned int mask = 0xffff0000 | q->subdevice_mask;
unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
if ((codec->subsystem_id & mask) == id)
break;
}

Expand Down Expand Up @@ -4752,6 +4770,7 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
memset(sequences_hp, 0, sizeof(sequences_hp));
assoc_line_out = 0;

codec->ignore_misc_bit = true;
end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid);
Expand All @@ -4767,6 +4786,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
continue;

def_conf = snd_hda_codec_get_pincfg(codec, nid);
if (!(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
AC_DEFCFG_MISC_NO_PRESENCE))
codec->ignore_misc_bit = false;
conn = get_defcfg_connect(def_conf);
if (conn == AC_JACK_PORT_NONE)
continue;
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ struct hda_codec {
unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */
unsigned int pins_shutup:1; /* pins are shut up */
unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */
#ifdef CONFIG_SND_HDA_POWER_SAVE
unsigned int power_on :1; /* current (global) power-state */
unsigned int power_transition :1; /* power-state in transition */
Expand Down
41 changes: 28 additions & 13 deletions trunk/sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,18 @@ static int hdmi_update_eld(struct hdmi_eld *e,
buf + ELD_FIXED_BYTES + mnl + 3 * i);
}

/*
* HDMI sink's ELD info cannot always be retrieved for now, e.g.
* in console or for audio devices. Assume the highest speakers
* configuration, to _not_ prohibit multi-channel audio playback.
*/
if (!e->spk_alloc)
e->spk_alloc = 0xffff;

e->eld_valid = true;
return 0;

out_fail:
e->eld_ver = 0;
return -EINVAL;
}

Expand All @@ -323,9 +331,6 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
* ELD is valid, actual eld_size is assigned in hdmi_update_eld()
*/

if (!eld->eld_valid)
return -ENOENT;

size = snd_hdmi_get_eld_size(codec, nid);
if (size == 0) {
/* wfg: workaround for ASUS P5E-VM HDMI board */
Expand All @@ -342,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,

for (i = 0; i < size; i++) {
unsigned int val = hdmi_get_eld_data(codec, nid, i);
/*
* Graphics driver might be writing to ELD buffer right now.
* Just abort. The caller will repoll after a while.
*/
if (!(val & AC_ELDD_ELD_VALID)) {
if (!i) {
snd_printd(KERN_INFO
"HDMI: invalid ELD data\n");
ret = -EINVAL;
goto error;
}
snd_printd(KERN_INFO
"HDMI: invalid ELD data byte %d\n", i);
val = 0;
} else
val &= AC_ELDD_ELD_DATA;
ret = -EINVAL;
goto error;
}
val &= AC_ELDD_ELD_DATA;
/*
* The first byte cannot be zero. This can happen on some DVI
* connections. Some Intel chips may also need some 250ms delay
* to return non-zero ELD data, even when the graphics driver
* correctly writes ELD content before setting ELD_valid bit.
*/
if (!val && !i) {
snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");
ret = -EINVAL;
goto error;
}
buf[i] = val;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
Expand Down
19 changes: 12 additions & 7 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,15 @@ int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);

static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
{
return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) &&
/* disable MISC_NO_PRESENCE check because it may break too
* many devices
*/
/*(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) &
AC_DEFCFG_MISC_NO_PRESENCE)) &&*/
(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP);
if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT))
return false;
if (!codec->ignore_misc_bit &&
(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
AC_DEFCFG_MISC_NO_PRESENCE))
return false;
if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP))
return false;
return true;
}

/* flags for hda_nid_item */
Expand Down Expand Up @@ -651,6 +653,9 @@ struct hdmi_eld {
int spk_alloc;
int sad_count;
struct cea_sad sad[ELD_MAX_SAD];
/*
* all fields above eld_buffer will be cleared before updating ELD
*/
char eld_buffer[ELD_MAX_SIZE];
#ifdef CONFIG_PROC_FS
struct snd_info_entry *proc_entry;
Expand Down
Loading

0 comments on commit 3a3effd

Please sign in to comment.