0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LX6464ES_H
0010 #define LX6464ES_H
0011
0012 #include <linux/spinlock.h>
0013 #include <linux/atomic.h>
0014
0015 #include <sound/core.h>
0016 #include <sound/pcm.h>
0017
0018 #include "lx_core.h"
0019
0020 #define LXP "LX6464ES: "
0021
0022 enum {
0023 ES_cmd_free = 0,
0024 ES_cmd_processing = 1,
0025 ES_read_pending = 2,
0026 ES_read_finishing = 3,
0027
0028 };
0029
0030 enum lx_stream_status {
0031 LX_STREAM_STATUS_FREE,
0032
0033 LX_STREAM_STATUS_SCHEDULE_RUN,
0034
0035 LX_STREAM_STATUS_RUNNING,
0036 LX_STREAM_STATUS_SCHEDULE_STOP,
0037
0038
0039 };
0040
0041
0042 struct lx_stream {
0043 struct snd_pcm_substream *stream;
0044 snd_pcm_uframes_t frame_pos;
0045 enum lx_stream_status status;
0046
0047 unsigned int is_capture:1;
0048 };
0049
0050
0051 struct lx6464es {
0052 struct snd_card *card;
0053 struct pci_dev *pci;
0054 int irq;
0055
0056 u8 mac_address[6];
0057
0058 struct mutex lock;
0059 struct mutex setup_mutex;
0060
0061
0062
0063 unsigned long port_plx;
0064 void __iomem *port_plx_remapped;
0065 void __iomem *port_dsp_bar;
0066
0067
0068
0069
0070 struct mutex msg_lock;
0071 struct lx_rmh rmh;
0072 u32 irqsrc;
0073
0074
0075 uint freq_ratio : 2;
0076 uint playback_mute : 1;
0077 uint hardware_running[2];
0078 u32 board_sample_rate;
0079
0080 u16 pcm_granularity;
0081
0082
0083 struct snd_dma_buffer capture_dma_buf;
0084 struct snd_dma_buffer playback_dma_buf;
0085
0086
0087 struct snd_pcm *pcm;
0088
0089
0090 struct lx_stream capture_stream;
0091 struct lx_stream playback_stream;
0092 };
0093
0094
0095 #endif