aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-component.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-11-21 20:07:09 +0100
committerTakashi Iwai <tiwai@suse.de>2019-11-22 14:38:01 +0100
commit1e5ddb6ba73894e6186e6379dde870979852af6d (patch)
treed249a309352e1952669115ae954e274c83d6805c /sound/soc/soc-component.c
parentASoC: pcm: Make ioctl ops optional (diff)
downloadlinux-dev-1e5ddb6ba73894e6186e6379dde870979852af6d.tar.xz
linux-dev-1e5ddb6ba73894e6186e6379dde870979852af6d.zip
ASoC: component: Add sync_stop PCM ops
Add the support of the new PCM sync_stop ops in ASoC component. It's optional and can be NULL unless you need the sync operation. Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191121190709.29121-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/soc-component.c')
-rw-r--r--sound/soc/soc-component.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 98ef0666add2..58c1320a3521 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -444,6 +444,25 @@ int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
return snd_pcm_lib_ioctl(substream, cmd, arg);
}
+int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_component *component;
+ struct snd_soc_rtdcom_list *rtdcom;
+ int ret;
+
+ for_each_rtd_components(rtd, rtdcom, component) {
+ if (component->driver->ioctl) {
+ ret = component->driver->sync_stop(component,
+ substream);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
void __user *buf, unsigned long bytes)