ASoC: component: Add sync_stop PCM ops
[sfrench/cifs-2.6.git] / sound / soc / soc-component.c
index 98ef0666add2afd4e7253849712e27f7ca88e5e1..58c1320a3521f8deb58b5b19b62b26f591aee2b1 100644 (file)
@@ -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)