Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353211
b: refs/heads/master
c: 1f57825
h: refs/heads/master
i:
  353209: 82ff918
  353207: 9c4c26c
v: v3
  • Loading branch information
Takashi Iwai committed Jan 23, 2013
1 parent b29b0b6 commit 6894866
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 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: 3e367f155f3ba90b761497ab9e0343dc54778469
refs/heads/master: 1f57825077dc2fa4e3d4a4e6b3af6c75f81112e7
18 changes: 11 additions & 7 deletions trunk/sound/pci/hda/hda_auto_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,20 +696,18 @@ static void set_pin_targets(struct hda_codec *codec,
snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
}

void snd_hda_apply_fixup(struct hda_codec *codec, int action)
static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
{
int id = codec->fixup_id;
#ifdef CONFIG_SND_DEBUG_VERBOSE
const char *modelname = codec->fixup_name;
#endif
int depth = 0;

if (!codec->fixup_list)
return;

while (id >= 0) {
const struct hda_fixup *fix = codec->fixup_list + id;

if (fix->chained_before)
apply_fixup(codec, fix->chain_id, action, depth + 1);

switch (fix->type) {
case HDA_FIXUP_PINS:
if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins)
Expand Down Expand Up @@ -749,13 +747,19 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action)
codec->chip_name, fix->type);
break;
}
if (!fix->chained)
if (!fix->chained || fix->chained_before)
break;
if (++depth > 10)
break;
id = fix->chain_id;
}
}

void snd_hda_apply_fixup(struct hda_codec *codec, int action)
{
if (codec->fixup_list)
apply_fixup(codec, codec->fixup_id, action, 0);
}
EXPORT_SYMBOL_HDA(snd_hda_apply_fixup);

void snd_hda_pick_fixup(struct hda_codec *codec,
Expand Down
3 changes: 2 additions & 1 deletion trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ struct hda_model_fixup {

struct hda_fixup {
int type;
bool chained;
bool chained:1; /* call the chained fixup(s) after this */
bool chained_before:1; /* call the chained fixup(s) before this */
int chain_id;
union {
const struct hda_pintbl *pins;
Expand Down

0 comments on commit 6894866

Please sign in to comment.