1
2
3
4
5
6
7
8
9 #ifndef LX6464ES_H
10 #define LX6464ES_H
11
12 #include <linux/spinlock.h>
13 #include <linux/atomic.h>
14
15 #include <sound/core.h>
16 #include <sound/pcm.h>
17
18 #include "lx_core.h"
19
20 #define LXP "LX6464ES: "
21
22 enum {
23 ES_cmd_free = 0,
24 ES_cmd_processing = 1,
25 ES_read_pending = 2,
26 ES_read_finishing = 3,
27
28 };
29
30 enum lx_stream_status {
31 LX_STREAM_STATUS_FREE,
32
33 LX_STREAM_STATUS_SCHEDULE_RUN,
34
35 LX_STREAM_STATUS_RUNNING,
36 LX_STREAM_STATUS_SCHEDULE_STOP,
37
38
39 };
40
41
42 struct lx_stream {
43 struct snd_pcm_substream *stream;
44 snd_pcm_uframes_t frame_pos;
45 enum lx_stream_status status;
46
47 unsigned int is_capture:1;
48 };
49
50
51 struct lx6464es {
52 struct snd_card *card;
53 struct pci_dev *pci;
54 int irq;
55
56 u8 mac_address[6];
57
58 struct mutex lock;
59 struct mutex setup_mutex;
60
61
62
63 unsigned long port_plx;
64 void __iomem *port_plx_remapped;
65 void __iomem *port_dsp_bar;
66
67
68
69
70 struct mutex msg_lock;
71 struct lx_rmh rmh;
72 u32 irqsrc;
73
74
75 uint freq_ratio : 2;
76 uint playback_mute : 1;
77 uint hardware_running[2];
78 u32 board_sample_rate;
79
80 u16 pcm_granularity;
81
82
83 struct snd_dma_buffer capture_dma_buf;
84 struct snd_dma_buffer playback_dma_buf;
85
86
87 struct snd_pcm *pcm;
88
89
90 struct lx_stream capture_stream;
91 struct lx_stream playback_stream;
92 };
93
94
95 #endif