1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * ALSA driver for the digigram lx6464es interface
6 * Copyright (c) 2009 Tim Blechmann <tim@klingt.org>
12 #include <linux/spinlock.h>
13 #include <linux/atomic.h>
15 #include <sound/core.h>
16 #include <sound/pcm.h>
20 #define LXP "LX6464ES: "
23 ES_cmd_free
= 0, /* no command executing */
24 ES_cmd_processing
= 1, /* execution of a read/write command */
25 ES_read_pending
= 2, /* a asynchron read command is pending */
26 ES_read_finishing
= 3, /* a read command has finished waiting (set by
27 * Interrupt or CancelIrp) */
30 enum lx_stream_status
{
31 LX_STREAM_STATUS_FREE
,
32 /* LX_STREAM_STATUS_OPEN, */
33 LX_STREAM_STATUS_SCHEDULE_RUN
,
34 /* LX_STREAM_STATUS_STARTED, */
35 LX_STREAM_STATUS_RUNNING
,
36 LX_STREAM_STATUS_SCHEDULE_STOP
,
37 /* LX_STREAM_STATUS_STOPPED, */
38 /* LX_STREAM_STATUS_PAUSED */
43 struct snd_pcm_substream
*stream
;
44 snd_pcm_uframes_t frame_pos
;
45 enum lx_stream_status status
; /* free, open, running, draining
47 unsigned int is_capture
:1;
52 struct snd_card
*card
;
58 struct mutex lock
; /* interrupt lock */
59 struct mutex setup_mutex
; /* mutex used in hw_params, open
63 unsigned long port_plx
; /* io port (size=256) */
64 void __iomem
*port_plx_remapped
; /* remapped plx port */
65 void __iomem
*port_dsp_bar
; /* memory port (32-bit,
70 struct mutex msg_lock
; /* message lock */
76 uint playback_mute
: 1;
77 uint hardware_running
[2];
78 u32 board_sample_rate
; /* sample rate read from
80 u16 pcm_granularity
; /* board blocksize */
83 struct snd_dma_buffer capture_dma_buf
;
84 struct snd_dma_buffer playback_dma_buf
;
90 struct lx_stream capture_stream
;
91 struct lx_stream playback_stream
;
95 #endif /* LX6464ES_H */