ASoC: Ensure supplies are maintained for force enabled widgets
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 11 Feb 2011 11:42:19 +0000 (11:42 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 13 Feb 2011 19:49:47 +0000 (19:49 +0000)
If a widget has been force enabled then not only do we need to keep the
widget itself enabled, we also need to keep any supplies the widget
requires enabled. The user could force all the individual widgets on but
this requires too much knowledge of device internals.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

sound/soc/soc-dapm.c

index 4df96ec..25e5423 100644 (file)
@@ -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;