]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - sound/firewire/amdtp.c
ALSA: firewire-lib: flush completed packets when reading PCM position
[linux-imx.git] / sound / firewire / amdtp.c
index 3284ee9c1ecac7b86ec33a2d0953b886e3c4d4a1..c2685fbd73666635e579e3a5d5bc58fbc68795f0 100644 (file)
@@ -531,6 +531,20 @@ err_unlock:
 }
 EXPORT_SYMBOL(amdtp_out_stream_start);
 
+/**
+ * amdtp_out_stream_pcm_pointer - get the PCM buffer position
+ * @s: the AMDTP output stream that transports the PCM data
+ *
+ * Returns the current buffer position, in frames.
+ */
+unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
+{
+       fw_iso_context_flush_completions(s->context);
+
+       return ACCESS_ONCE(s->pcm_buffer_pointer);
+}
+EXPORT_SYMBOL(amdtp_out_stream_pcm_pointer);
+
 /**
  * amdtp_out_stream_update - update the stream after a bus reset
  * @s: the AMDTP output stream