diff mbox series

[RFC,4/4] ASoC: Propagate DETECT trigger

Message ID 20241016130228.1013227-5-amadeuszx.slawinski@linux.intel.com (mailing list archive)
State Superseded
Headers show
Series Add support for detection | expand

Commit Message

Amadeusz Sławiński Oct. 16, 2024, 1:02 p.m. UTC
Adds support for DETECT trigger in ASoC API, so it can be propagated to
ALSA core.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/soc-component.c | 2 ++
 sound/soc/soc-dai.c       | 2 ++
 sound/soc/soc-link.c      | 2 ++
 3 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index b67ef78f405c3..1ac8acb326623 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -1237,6 +1237,7 @@  int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+	case SNDRV_PCM_TRIGGER_DETECT_START:
 		for_each_rtd_components(rtd, i, component) {
 			ret = soc_component_trigger(component, substream, cmd);
 			if (ret < 0)
@@ -1247,6 +1248,7 @@  int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+	case SNDRV_PCM_TRIGGER_DETECT_STOP:
 		for_each_rtd_components(rtd, i, component) {
 			if (rollback && !soc_component_mark_match(component, substream, trigger))
 				continue;
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 4a1c85ad5a8d6..41fc4ce682a63 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -616,6 +616,7 @@  int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+	case SNDRV_PCM_TRIGGER_DETECT_START:
 		for_each_rtd_dais(rtd, i, dai) {
 			ret = soc_dai_trigger(dai, substream, cmd);
 			if (ret < 0)
@@ -630,6 +631,7 @@  int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+	case SNDRV_PCM_TRIGGER_DETECT_STOP:
 		for_each_rtd_dais(rtd, i, dai) {
 			if (rollback && !soc_dai_mark_match(dai, substream, trigger))
 				continue;
diff --git a/sound/soc/soc-link.c b/sound/soc/soc-link.c
index 7f1f1bc717e2c..30d283062baee 100644
--- a/sound/soc/soc-link.c
+++ b/sound/soc/soc-link.c
@@ -163,6 +163,7 @@  int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+	case SNDRV_PCM_TRIGGER_DETECT_START:
 		ret = soc_link_trigger(substream, cmd);
 		if (ret < 0)
 			break;
@@ -171,6 +172,7 @@  int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+	case SNDRV_PCM_TRIGGER_DETECT_STOP:
 		if (rollback && !soc_link_mark_match(rtd, substream, trigger))
 			break;