aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2009-09-30 09:27:24 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-10-02 11:23:21 +0100
commiteaeae5d9b783a62e435645122bed90561924a2d6 (patch)
treede35298c98dc4f83d30021dfddabb659494cc37e /sound/soc/soc-dapm.c
parent834eb6c599a8efa1fe9b77d469562e0c78c876e1 (diff)
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/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f79711b9fa5..8de6f9dec4a 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;
}