diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 999bb08cdfb1..32ab7fc4579a 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -325,6 +325,7 @@ static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm, | |||
325 | } | 325 | } |
326 | 326 | ||
327 | static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, | 327 | static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, |
328 | struct snd_soc_dapm_widget *kcontrolw, | ||
328 | const struct snd_kcontrol_new *kcontrol_new, | 329 | const struct snd_kcontrol_new *kcontrol_new, |
329 | struct snd_kcontrol **kcontrol) | 330 | struct snd_kcontrol **kcontrol) |
330 | { | 331 | { |
@@ -334,6 +335,8 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, | |||
334 | *kcontrol = NULL; | 335 | *kcontrol = NULL; |
335 | 336 | ||
336 | list_for_each_entry(w, &dapm->card->widgets, list) { | 337 | list_for_each_entry(w, &dapm->card->widgets, list) { |
338 | if (w == kcontrolw || w->dapm != kcontrolw->dapm) | ||
339 | continue; | ||
337 | for (i = 0; i < w->num_kcontrols; i++) { | 340 | for (i = 0; i < w->num_kcontrols; i++) { |
338 | if (&w->kcontrol_news[i] == kcontrol_new) { | 341 | if (&w->kcontrol_news[i] == kcontrol_new) { |
339 | if (w->kcontrols) | 342 | if (w->kcontrols) |
@@ -347,9 +350,9 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, | |||
347 | } | 350 | } |
348 | 351 | ||
349 | /* create new dapm mixer control */ | 352 | /* create new dapm mixer control */ |
350 | static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, | 353 | static int dapm_new_mixer(struct snd_soc_dapm_widget *w) |
351 | struct snd_soc_dapm_widget *w) | ||
352 | { | 354 | { |
355 | struct snd_soc_dapm_context *dapm = w->dapm; | ||
353 | int i, ret = 0; | 356 | int i, ret = 0; |
354 | size_t name_len, prefix_len; | 357 | size_t name_len, prefix_len; |
355 | struct snd_soc_dapm_path *path; | 358 | struct snd_soc_dapm_path *path; |
@@ -447,9 +450,9 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, | |||
447 | } | 450 | } |
448 | 451 | ||
449 | /* create new dapm mux control */ | 452 | /* create new dapm mux control */ |
450 | static int dapm_new_mux(struct snd_soc_dapm_context *dapm, | 453 | static int dapm_new_mux(struct snd_soc_dapm_widget *w) |
451 | struct snd_soc_dapm_widget *w) | ||
452 | { | 454 | { |
455 | struct snd_soc_dapm_context *dapm = w->dapm; | ||
453 | struct snd_soc_dapm_path *path = NULL; | 456 | struct snd_soc_dapm_path *path = NULL; |
454 | struct snd_kcontrol *kcontrol; | 457 | struct snd_kcontrol *kcontrol; |
455 | struct snd_card *card = dapm->card->snd_card; | 458 | struct snd_card *card = dapm->card->snd_card; |
@@ -468,7 +471,7 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm, | |||
468 | return -EINVAL; | 471 | return -EINVAL; |
469 | } | 472 | } |
470 | 473 | ||
471 | shared = dapm_is_shared_kcontrol(dapm, &w->kcontrol_news[0], | 474 | shared = dapm_is_shared_kcontrol(dapm, w, &w->kcontrol_news[0], |
472 | &kcontrol); | 475 | &kcontrol); |
473 | if (kcontrol) { | 476 | if (kcontrol) { |
474 | wlist = kcontrol->private_data; | 477 | wlist = kcontrol->private_data; |
@@ -532,8 +535,7 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm, | |||
532 | } | 535 | } |
533 | 536 | ||
534 | /* create new dapm volume control */ | 537 | /* create new dapm volume control */ |
535 | static int dapm_new_pga(struct snd_soc_dapm_context *dapm, | 538 | static int dapm_new_pga(struct snd_soc_dapm_widget *w) |
536 | struct snd_soc_dapm_widget *w) | ||
537 | { | 539 | { |
538 | if (w->num_kcontrols) | 540 | if (w->num_kcontrols) |
539 | dev_err(w->dapm->dev, | 541 | dev_err(w->dapm->dev, |
@@ -1823,13 +1825,13 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) | |||
1823 | case snd_soc_dapm_mixer: | 1825 | case snd_soc_dapm_mixer: |
1824 | case snd_soc_dapm_mixer_named_ctl: | 1826 | case snd_soc_dapm_mixer_named_ctl: |
1825 | w->power_check = dapm_generic_check_power; | 1827 | w->power_check = dapm_generic_check_power; |
1826 | dapm_new_mixer(dapm, w); | 1828 | dapm_new_mixer(w); |
1827 | break; | 1829 | break; |
1828 | case snd_soc_dapm_mux: | 1830 | case snd_soc_dapm_mux: |
1829 | case snd_soc_dapm_virt_mux: | 1831 | case snd_soc_dapm_virt_mux: |
1830 | case snd_soc_dapm_value_mux: | 1832 | case snd_soc_dapm_value_mux: |
1831 | w->power_check = dapm_generic_check_power; | 1833 | w->power_check = dapm_generic_check_power; |
1832 | dapm_new_mux(dapm, w); | 1834 | dapm_new_mux(w); |
1833 | break; | 1835 | break; |
1834 | case snd_soc_dapm_adc: | 1836 | case snd_soc_dapm_adc: |
1835 | case snd_soc_dapm_aif_out: | 1837 | case snd_soc_dapm_aif_out: |
@@ -1842,7 +1844,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) | |||
1842 | case snd_soc_dapm_pga: | 1844 | case snd_soc_dapm_pga: |
1843 | case snd_soc_dapm_out_drv: | 1845 | case snd_soc_dapm_out_drv: |
1844 | w->power_check = dapm_generic_check_power; | 1846 | w->power_check = dapm_generic_check_power; |
1845 | dapm_new_pga(dapm, w); | 1847 | dapm_new_pga(w); |
1846 | break; | 1848 | break; |
1847 | case snd_soc_dapm_input: | 1849 | case snd_soc_dapm_input: |
1848 | case snd_soc_dapm_output: | 1850 | case snd_soc_dapm_output: |