diff options
| -rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
| -rw-r--r-- | sound/soc/soc-core.c | 3 | ||||
| -rw-r--r-- | sound/soc/soc-dapm.c | 27 |
3 files changed, 13 insertions, 19 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 6b59471cdf44..8db627cc2fbe 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -431,7 +431,7 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | |||
| 431 | const char *pin); | 431 | const char *pin); |
| 432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
| 433 | const char *pin); | 433 | const char *pin); |
| 434 | void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); | 434 | void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card); |
| 435 | 435 | ||
| 436 | /* Mostly internal - should not normally be used */ | 436 | /* Mostly internal - should not normally be used */ |
| 437 | void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); | 437 | void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0944da66538d..bca8a7150a4a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -1928,8 +1928,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) | |||
| 1928 | } | 1928 | } |
| 1929 | 1929 | ||
| 1930 | if (card->fully_routed) | 1930 | if (card->fully_routed) |
| 1931 | list_for_each_entry(codec, &card->codec_dev_list, card_list) | 1931 | snd_soc_dapm_auto_nc_pins(card); |
| 1932 | snd_soc_dapm_auto_nc_codec_pins(codec); | ||
| 1933 | 1932 | ||
| 1934 | snd_soc_dapm_new_widgets(card); | 1933 | snd_soc_dapm_new_widgets(card); |
| 1935 | 1934 | ||
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 074e9ce136f8..3ccbf9ba04b2 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -3763,36 +3763,31 @@ static bool snd_soc_dapm_widget_in_card_paths(struct snd_soc_card *card, | |||
| 3763 | } | 3763 | } |
| 3764 | 3764 | ||
| 3765 | /** | 3765 | /** |
| 3766 | * snd_soc_dapm_auto_nc_codec_pins - call snd_soc_dapm_nc_pin for unused pins | 3766 | * snd_soc_dapm_auto_nc_pins - call snd_soc_dapm_nc_pin for unused pins |
| 3767 | * @codec: The codec whose pins should be processed | 3767 | * @card: The card whose pins should be processed |
| 3768 | * | 3768 | * |
| 3769 | * Automatically call snd_soc_dapm_nc_pin() for any external pins in the codec | 3769 | * Automatically call snd_soc_dapm_nc_pin() for any external pins in the card |
| 3770 | * which are unused. Pins are used if they are connected externally to the | 3770 | * which are unused. Pins are used if they are connected externally to a |
| 3771 | * codec, whether that be to some other device, or a loop-back connection to | 3771 | * component, whether that be to some other device, or a loop-back connection to |
| 3772 | * the codec itself. | 3772 | * the component itself. |
| 3773 | */ | 3773 | */ |
| 3774 | void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec) | 3774 | void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card) |
| 3775 | { | 3775 | { |
| 3776 | struct snd_soc_card *card = codec->card; | ||
| 3777 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
| 3778 | struct snd_soc_dapm_widget *w; | 3776 | struct snd_soc_dapm_widget *w; |
| 3779 | 3777 | ||
| 3780 | dev_dbg(codec->dev, "ASoC: Auto NC: DAPMs: card:%p codec:%p\n", | 3778 | dev_dbg(card->dev, "ASoC: Auto NC: DAPMs: card:%p\n", &card->dapm); |
| 3781 | &card->dapm, &codec->dapm); | ||
| 3782 | 3779 | ||
| 3783 | list_for_each_entry(w, &card->widgets, list) { | 3780 | list_for_each_entry(w, &card->widgets, list) { |
| 3784 | if (w->dapm != dapm) | ||
| 3785 | continue; | ||
| 3786 | switch (w->id) { | 3781 | switch (w->id) { |
| 3787 | case snd_soc_dapm_input: | 3782 | case snd_soc_dapm_input: |
| 3788 | case snd_soc_dapm_output: | 3783 | case snd_soc_dapm_output: |
| 3789 | case snd_soc_dapm_micbias: | 3784 | case snd_soc_dapm_micbias: |
| 3790 | dev_dbg(codec->dev, "ASoC: Auto NC: Checking widget %s\n", | 3785 | dev_dbg(card->dev, "ASoC: Auto NC: Checking widget %s\n", |
| 3791 | w->name); | 3786 | w->name); |
| 3792 | if (!snd_soc_dapm_widget_in_card_paths(card, w)) { | 3787 | if (!snd_soc_dapm_widget_in_card_paths(card, w)) { |
| 3793 | dev_dbg(codec->dev, | 3788 | dev_dbg(card->dev, |
| 3794 | "... Not in map; disabling\n"); | 3789 | "... Not in map; disabling\n"); |
| 3795 | snd_soc_dapm_nc_pin(dapm, w->name); | 3790 | snd_soc_dapm_nc_pin(w->dapm, w->name); |
| 3796 | } | 3791 | } |
| 3797 | break; | 3792 | break; |
| 3798 | default: | 3793 | default: |
