Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133042
b: refs/heads/master
c: f1eaaee
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Feb 13, 2009
1 parent bd33e2d commit 8483df2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 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: c98041f7d71890ac6aa2257d78ef175db44d2cd3
refs/heads/master: f1eaaeec11982c6b529d4255987fdf507a5fa69e
24 changes: 17 additions & 7 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ struct azx {

/* HD codec */
unsigned short codec_mask;
int codec_probe_mask; /* copied from probe_mask option */
struct hda_bus *bus;

/* CORB/RIRB */
Expand Down Expand Up @@ -1228,7 +1229,6 @@ static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] __devinitdata = {
};

static int __devinit azx_codec_create(struct azx *chip, const char *model,
unsigned int codec_probe_mask,
int no_init)
{
struct hda_bus_template bus_temp;
Expand Down Expand Up @@ -1261,7 +1261,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,

/* First try to probe all given codec slots */
for (c = 0; c < max_slots; c++) {
if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
if ((chip->codec_mask & (1 << c)) & chip->codec_probe_mask) {
if (probe_codec(chip, c) < 0) {
/* Some BIOSen give you wrong codec addresses
* that don't exist
Expand All @@ -1285,7 +1285,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,

/* Then create codec instances */
for (c = 0; c < max_slots; c++) {
if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
if ((chip->codec_mask & (1 << c)) & chip->codec_probe_mask) {
struct hda_codec *codec;
err = snd_hda_codec_new(chip->bus, c, !no_init, &codec);
if (err < 0)
Expand Down Expand Up @@ -2101,20 +2101,31 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = {
{}
};

#define AZX_FORCE_CODEC_MASK 0x100

static void __devinit check_probe_mask(struct azx *chip, int dev)
{
const struct snd_pci_quirk *q;

if (probe_mask[dev] == -1) {
chip->codec_probe_mask = probe_mask[dev];
if (chip->codec_probe_mask == -1) {
q = snd_pci_quirk_lookup(chip->pci, probe_mask_list);
if (q) {
printk(KERN_INFO
"hda_intel: probe_mask set to 0x%x "
"for device %04x:%04x\n",
q->value, q->subvendor, q->subdevice);
probe_mask[dev] = q->value;
chip->codec_probe_mask = q->value;
}
}

/* check forced option */
if (chip->codec_probe_mask != -1 &&
(chip->codec_probe_mask & AZX_FORCE_CODEC_MASK)) {
chip->codec_mask = chip->codec_probe_mask & 0xff;
printk(KERN_INFO "hda_intel: codec_mask forced to 0x%x\n",
chip->codec_mask);
}
}


Expand Down Expand Up @@ -2347,8 +2358,7 @@ static int __devinit azx_probe(struct pci_dev *pci,
card->private_data = chip;

/* create codec instances */
err = azx_codec_create(chip, model[dev], probe_mask[dev],
probe_only[dev]);
err = azx_codec_create(chip, model[dev], probe_only[dev]);
if (err < 0)
goto out_free;

Expand Down

0 comments on commit 8483df2

Please sign in to comment.