diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 22:52:08 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 22:52:08 +0000 |
commit | 866fd9366a5b2c7d17eb10f7e7b1c17393ed0beb (patch) | |
tree | 51b384c53fdb6c89c09efafeaeec701c25444572 /sound/soc/soc-dapm.c | |
parent | e12adab00222817213fcdc68c5fd6ee2e5dfb247 (diff) | |
parent | b66a70d5e9929f3b0df5a7177bba75652d2f4c3e (diff) |
Merge branch 'for-2.6.38' into for-2.6.39
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d0342aab2c1..b30eda6cc96 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1664,6 +1664,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) { @@ -1712,6 +1713,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; } |