diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-22 08:20:02 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-22 08:20:02 -0800 |
commit | 609b06f33506d92693cb89c303026f830f769c0d (patch) | |
tree | 768c2fea768f95fa5a507e3520d6dc1d47cc1b93 /sound/soc/soc-dapm.c | |
parent | 790e10ba6c93c123665a3cfa53d6dcf73923e458 (diff) | |
parent | 3017358a75917b5ed5ad361c02ba2a7e257d3b2a (diff) | |
download | talos-obmc-linux-609b06f33506d92693cb89c303026f830f769c0d.tar.gz talos-obmc-linux-609b06f33506d92693cb89c303026f830f769c0d.zip |
Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ASoC: Ensure supplies are maintained for force enabled widgets
ASoC: WM8994: Improve playback robustness
ASoC: WM8994: Improve robustness in some use cases
ASoC: WM8903: Fix mic detection enable logic
ASoC: WM8903: Fix mic detection register definitions
ASoC: CX20442: fix wrong reg_cache_default content
ASoC: Sync initial widget state with hardware
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8194f150bab7..25e54230cc6a 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -712,7 +712,15 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) !path->connected(path->source, path->sink)) continue; - if (path->sink && path->sink->power_check && + if (!path->sink) + continue; + + if (path->sink->force) { + power = 1; + break; + } + + if (path->sink->power_check && path->sink->power_check(path->sink)) { power = 1; break; @@ -1627,6 +1635,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_add_routes); int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) { struct snd_soc_dapm_widget *w; + unsigned int val; list_for_each_entry(w, &dapm->card->widgets, list) { @@ -1675,6 +1684,18 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) case snd_soc_dapm_post: break; } + + /* Read the initial power state from the device */ + if (w->reg >= 0) { + val = snd_soc_read(w->codec, w->reg); + val &= 1 << w->shift; + if (w->invert) + val = !val; + + if (val) + w->power = 1; + } + w->new = 1; } |