// 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 /* 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