diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2009-09-30 09:27:24 +0300 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-10-02 11:23:21 +0100 |
commit | eaeae5d9b783a62e435645122bed90561924a2d6 (patch) | |
tree | de35298c98dc4f83d30021dfddabb659494cc37e /sound | |
parent | 834eb6c599a8efa1fe9b77d469562e0c78c876e1 (diff) | |
download | linux-eaeae5d9b783a62e435645122bed90561924a2d6.tar.bz2 |
ASoC: Fix SND_SOC_DAPM_LINE handling
Since the SND_SOC_DAPM_LINE can be input or output, additional check is
needed in order to determine if the widget is connected as input or
output.
When checking for connected outputs, if the widget is line, than check
if the sources list is not empty (line is connected as output)
For input endpoint check, when the widget is line, also check if the
sinks list is not empty (line is connected as input).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-dapm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index f79711b9fa5b..8de6f9dec4a2 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -524,7 +524,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget) /* connected jack or spk ? */ if (widget->id == snd_soc_dapm_hp || widget->id == snd_soc_dapm_spk || - widget->id == snd_soc_dapm_line) + (widget->id == snd_soc_dapm_line && !list_empty(&widget->sources))) return 1; } @@ -573,7 +573,8 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget) return 1; /* connected jack ? */ - if (widget->id == snd_soc_dapm_mic || widget->id == snd_soc_dapm_line) + if (widget->id == snd_soc_dapm_mic || + (widget->id == snd_soc_dapm_line && !list_empty(&widget->sinks))) return 1; } |