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