aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8de6f9dec4a2..8eaf1b6e7ef2 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -719,6 +719,10 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w)
719 719
720 /* Check if one of our outputs is connected */ 720 /* Check if one of our outputs is connected */
721 list_for_each_entry(path, &w->sinks, list_source) { 721 list_for_each_entry(path, &w->sinks, list_source) {
722 if (path->connected &&
723 !path->connected(path->source, path->sink))
724 continue;
725
722 if (path->sink && path->sink->power_check && 726 if (path->sink && path->sink->power_check &&
723 path->sink->power_check(path->sink)) { 727 path->sink->power_check(path->sink)) {
724 power = 1; 728 power = 1;
@@ -1138,6 +1142,9 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
1138 w->active ? "active" : "inactive"); 1142 w->active ? "active" : "inactive");
1139 1143
1140 list_for_each_entry(p, &w->sources, list_sink) { 1144 list_for_each_entry(p, &w->sources, list_sink) {
1145 if (p->connected && !p->connected(w, p->sink))
1146 continue;
1147
1141 if (p->connect) 1148 if (p->connect)
1142 ret += snprintf(buf + ret, PAGE_SIZE - ret, 1149 ret += snprintf(buf + ret, PAGE_SIZE - ret,
1143 " in %s %s\n", 1150 " in %s %s\n",
@@ -1145,6 +1152,9 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
1145 p->source->name); 1152 p->source->name);
1146 } 1153 }
1147 list_for_each_entry(p, &w->sinks, list_source) { 1154 list_for_each_entry(p, &w->sinks, list_source) {
1155 if (p->connected && !p->connected(w, p->sink))
1156 continue;
1157
1148 if (p->connect) 1158 if (p->connect)
1149 ret += snprintf(buf + ret, PAGE_SIZE - ret, 1159 ret += snprintf(buf + ret, PAGE_SIZE - ret,
1150 " out %s %s\n", 1160 " out %s %s\n",
@@ -1387,10 +1397,13 @@ int snd_soc_dapm_sync(struct snd_soc_codec *codec)
1387EXPORT_SYMBOL_GPL(snd_soc_dapm_sync); 1397EXPORT_SYMBOL_GPL(snd_soc_dapm_sync);
1388 1398
1389static int snd_soc_dapm_add_route(struct snd_soc_codec *codec, 1399static int snd_soc_dapm_add_route(struct snd_soc_codec *codec,
1390 const char *sink, const char *control, const char *source) 1400 const struct snd_soc_dapm_route *route)
1391{ 1401{
1392 struct snd_soc_dapm_path *path; 1402 struct snd_soc_dapm_path *path;
1393 struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; 1403 struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w;
1404 const char *sink = route->sink;
1405 const char *control = route->control;
1406 const char *source = route->source;
1394 int ret = 0; 1407 int ret = 0;
1395 1408
1396 /* find src and dest widgets */ 1409 /* find src and dest widgets */
@@ -1414,6 +1427,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec,
1414 1427
1415 path->source = wsource; 1428 path->source = wsource;
1416 path->sink = wsink; 1429 path->sink = wsink;
1430 path->connected = route->connected;
1417 INIT_LIST_HEAD(&path->list); 1431 INIT_LIST_HEAD(&path->list);
1418 INIT_LIST_HEAD(&path->list_source); 1432 INIT_LIST_HEAD(&path->list_source);
1419 INIT_LIST_HEAD(&path->list_sink); 1433 INIT_LIST_HEAD(&path->list_sink);
@@ -1514,8 +1528,7 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
1514 int i, ret; 1528 int i, ret;
1515 1529
1516 for (i = 0; i < num; i++) { 1530 for (i = 0; i < num; i++) {
1517 ret = snd_soc_dapm_add_route(codec, route->sink, 1531 ret = snd_soc_dapm_add_route(codec, route);
1518 route->control, route->source);
1519 if (ret < 0) { 1532 if (ret < 0) {
1520 printk(KERN_ERR "Failed to add route %s->%s\n", 1533 printk(KERN_ERR "Failed to add route %s->%s\n",
1521 route->source, 1534 route->source,