summaryrefslogtreecommitdiff
path: root/snd-alpx/alpx_streams.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2024-05-10 18:26:46 (GMT)
committerChristian Pointner <equinox@helsinki.at>2024-05-10 18:26:46 (GMT)
commit627f7d488817e308d6f3a92fd9a877723ac7ae1d (patch)
tree554a3c53c90b20da5bd0da0c8da67a9b169bd10f /snd-alpx/alpx_streams.h
import snd-alpx V3.4.3
Diffstat (limited to 'snd-alpx/alpx_streams.h')
-rw-r--r--snd-alpx/alpx_streams.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/snd-alpx/alpx_streams.h b/snd-alpx/alpx_streams.h
new file mode 100644
index 0000000..bb33554
--- /dev/null
+++ b/snd-alpx/alpx_streams.h
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+* Support for Digigram AlpX PCI-e boards
+*
+* Copyright (c) 2024 Digigram Digital (info@digigram.com)
+*/
+#ifndef _ALPX_STREAMS_EDF_H
+#define _ALPX_STREAMS_EDF_H
+
+#include <sound/pcm.h>
+
+/* Structures */
+
+enum alpx_pipe_status {
+ ALPX_PIPE_STATUS_IDLE = 0,
+ ALPX_PIPE_STATUS_RUNNING,
+ ALPX_PIPE_STATUS_STOPPING,
+ ALPX_PIPE_STATUS_STOPPED,
+};
+
+struct alpx_pipe {
+ u32 period_qty_on_start; /* 2^64-1 periods @ 192kHZ = 2M years ! , u32 => 0.2year , enough to debug*/
+ struct snd_pcm_substream *substream;
+
+ enum alpx_pipe_status status;
+ bool configured;
+ bool xdma_write;
+};
+
+
+/* Pipe */
+
+int alpx_pipe_init(struct alpx_pipe *pipe, bool xdma_write);
+
+/* Playback */
+extern const struct snd_pcm_ops alpx_playback_ops;
+
+int alpx_playback_open(struct snd_pcm_substream *substream);
+int alpx_playback_close(struct snd_pcm_substream *substream);
+int alpx_playback_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params);
+int alpx_playback_hw_free(struct snd_pcm_substream *substream);
+int alpx_playback_prepare(struct snd_pcm_substream *substream);
+int alpx_playback_trigger(struct snd_pcm_substream *substream,
+ int command);
+snd_pcm_uframes_t alpx_playback_pointer(struct snd_pcm_substream *substream);
+
+/* Capture */
+
+extern const struct snd_pcm_ops alpx_capture_ops;
+
+
+int alpx_capture_open(struct snd_pcm_substream *substream);
+int alpx_capture_close(struct snd_pcm_substream *substream);
+int alpx_capture_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params);
+int alpx_capture_hw_free(struct snd_pcm_substream *substream);
+int alpx_capture_prepare(struct snd_pcm_substream *substream);
+int alpx_capture_trigger(struct snd_pcm_substream *substream,
+ int command);
+
+#endif