Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270805
b: refs/heads/master
c: 024dc07
h: refs/heads/master
i:
  270803: 448c147
v: v3
  • Loading branch information
Mark Brown committed Oct 9, 2011
1 parent 1398ef6 commit 9cb0df7
Show file tree
Hide file tree
Showing 3 changed files with 48 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: 7ca3a18b055ac6667f4e7e34eae6637270002402
refs/heads/master: 024dc078558e64e4cebc62c096285430a61dd10e
2 changes: 2 additions & 0 deletions trunk/include/sound/soc-dapm.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ struct snd_soc_dapm_widget {
/* used during DAPM updates */
struct list_head power_list;
struct list_head dirty;
int inputs;
int outputs;
};

struct snd_soc_dapm_update {
Expand Down
60 changes: 45 additions & 15 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
struct snd_soc_dapm_path *path;
int con = 0;

if (widget->outputs >= 0)
return widget->outputs;

DAPM_UPDATE_STAT(widget, path_checks);

if (widget->id == snd_soc_dapm_supply)
Expand All @@ -673,21 +676,29 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
switch (widget->id) {
case snd_soc_dapm_adc:
case snd_soc_dapm_aif_out:
if (widget->active)
return snd_soc_dapm_suspend_check(widget);
if (widget->active) {
widget->outputs = snd_soc_dapm_suspend_check(widget);
return widget->outputs;
}
default:
break;
}

if (widget->connected) {
/* connected pin ? */
if (widget->id == snd_soc_dapm_output && !widget->ext)
return snd_soc_dapm_suspend_check(widget);
if (widget->id == snd_soc_dapm_output && !widget->ext) {
widget->outputs = snd_soc_dapm_suspend_check(widget);
return widget->outputs;
}

/* connected jack or spk ? */
if (widget->id == snd_soc_dapm_hp || widget->id == snd_soc_dapm_spk ||
(widget->id == snd_soc_dapm_line && !list_empty(&widget->sources)))
return snd_soc_dapm_suspend_check(widget);
if (widget->id == snd_soc_dapm_hp ||
widget->id == snd_soc_dapm_spk ||
(widget->id == snd_soc_dapm_line &&
!list_empty(&widget->sources))) {
widget->outputs = snd_soc_dapm_suspend_check(widget);
return widget->outputs;
}
}

list_for_each_entry(path, &widget->sinks, list_source) {
Expand All @@ -705,6 +716,8 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
}
}

widget->outputs = con;

return con;
}

Expand All @@ -717,6 +730,9 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
struct snd_soc_dapm_path *path;
int con = 0;

if (widget->inputs >= 0)
return widget->inputs;

DAPM_UPDATE_STAT(widget, path_checks);

if (widget->id == snd_soc_dapm_supply)
Expand All @@ -726,25 +742,35 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
switch (widget->id) {
case snd_soc_dapm_dac:
case snd_soc_dapm_aif_in:
if (widget->active)
return snd_soc_dapm_suspend_check(widget);
if (widget->active) {
widget->inputs = snd_soc_dapm_suspend_check(widget);
return widget->inputs;
}
default:
break;
}

if (widget->connected) {
/* connected pin ? */
if (widget->id == snd_soc_dapm_input && !widget->ext)
return snd_soc_dapm_suspend_check(widget);
if (widget->id == snd_soc_dapm_input && !widget->ext) {
widget->inputs = snd_soc_dapm_suspend_check(widget);
return widget->inputs;
}

/* connected VMID/Bias for lower pops */
if (widget->id == snd_soc_dapm_vmid)
return snd_soc_dapm_suspend_check(widget);
if (widget->id == snd_soc_dapm_vmid) {
widget->inputs = snd_soc_dapm_suspend_check(widget);
return widget->inputs;
}

/* connected jack ? */
if (widget->id == snd_soc_dapm_mic ||
(widget->id == snd_soc_dapm_line && !list_empty(&widget->sinks)))
return snd_soc_dapm_suspend_check(widget);
(widget->id == snd_soc_dapm_line &&
!list_empty(&widget->sinks))) {
widget->inputs = snd_soc_dapm_suspend_check(widget);
return widget->inputs;
}

}

list_for_each_entry(path, &widget->sources, list_sink) {
Expand All @@ -762,6 +788,8 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
}
}

widget->inputs = con;

return con;
}

Expand Down Expand Up @@ -1335,6 +1363,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)

list_for_each_entry(w, &card->widgets, list) {
w->power_checked = false;
w->inputs = -1;
w->outputs = -1;
}

/* Check which widgets we need to power and store them in
Expand Down

0 comments on commit 9cb0df7

Please sign in to comment.