6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
#ifndef __SOUND_PCXHR_H
#define __SOUND_PCXHR_H
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <sound/pcm.h>
#define PCXHR_DRIVER_VERSION 0x000906 /* 0.9.6 */
#define PCXHR_DRIVER_VERSION_STRING "0.9.6" /* 0.9.6 */
#define PCXHR_MAX_CARDS 6
#define PCXHR_PLAYBACK_STREAMS 4
#define PCXHR_GRANULARITY 96 /* min 96 and multiple of 48 */
#define PCXHR_GRANULARITY_MIN 96
#define PCXHR_GRANULARITY_HR22 192 /* granularity for stereo cards */
struct snd_pcxhr;
struct pcxhr_mgr;
struct pcxhr_stream;
struct pcxhr_pipe;
enum pcxhr_clock_type {
PCXHR_CLOCK_TYPE_INTERNAL = 0,
PCXHR_CLOCK_TYPE_WORD_CLOCK,
PCXHR_CLOCK_TYPE_AES_SYNC,
PCXHR_CLOCK_TYPE_AES_1,
PCXHR_CLOCK_TYPE_AES_2,
PCXHR_CLOCK_TYPE_AES_3,
PCXHR_CLOCK_TYPE_AES_4,
PCXHR_CLOCK_TYPE_MAX = PCXHR_CLOCK_TYPE_AES_4,
HR22_CLOCK_TYPE_INTERNAL = PCXHR_CLOCK_TYPE_INTERNAL,
HR22_CLOCK_TYPE_AES_SYNC,
HR22_CLOCK_TYPE_AES_1,
HR22_CLOCK_TYPE_MAX = HR22_CLOCK_TYPE_AES_1,
};
struct pcxhr_mgr {
unsigned int num_cards;
struct snd_pcxhr *chip[PCXHR_MAX_CARDS];
struct pci_dev *pci;
int irq;
int granularity;
unsigned long port[3];
char shortname[32];
char longname[96];
struct tasklet_struct msg_taskq;
struct pcxhr_rmh *prmh;
struct tasklet_struct trigger_taskq;
spinlock_t lock;
spinlock_t msg_lock;
struct mutex setup_mutex;
struct mutex mixer_mutex;
unsigned int dsp_loaded;
unsigned int dsp_version;
int playback_chips;
int capture_chips;
int fw_file_set;
int firmware_num;
unsigned int is_hr_stereo:1;
unsigned int board_has_aes1:1;
unsigned int board_has_analog:1;
unsigned int board_has_mic:1;
unsigned int board_aes_in_192k:1;
unsigned int mono_capture:1;
unsigned int capture_ltc:1;
struct snd_dma_buffer hostport;
enum pcxhr_clock_type use_clock_type;
enum pcxhr_clock_type cur_clock_type;
int sample_rate;
int ref_count_rate;
int timer_toggle;
int dsp_time_last;
int dsp_time_err;
unsigned int src_it_dsp;
unsigned int io_num_reg_cont;
unsigned int codec_speed;
unsigned int sample_rate_real;
int last_reg_stat;
int async_err_stream_xrun;
int async_err_pipe_xrun;
int async_err_other_last;
unsigned char xlx_cfg;
unsigned char xlx_selmic;
unsigned char dsp_reset;
};
enum pcxhr_stream_status {
PCXHR_STREAM_STATUS_FREE,
PCXHR_STREAM_STATUS_OPEN,
PCXHR_STREAM_STATUS_SCHEDULE_RUN,
PCXHR_STREAM_STATUS_STARTED,
PCXHR_STREAM_STATUS_RUNNING,
PCXHR_STREAM_STATUS_SCHEDULE_STOP,
PCXHR_STREAM_STATUS_STOPPED,
PCXHR_STREAM_STATUS_PAUSED
};
struct pcxhr_stream {
struct snd_pcm_substream *substream;
snd_pcm_format_t format;
struct pcxhr_pipe *pipe;
enum pcxhr_stream_status status;
u_int64_t timer_abs_periods;
u_int32_t timer_period_frag;
u_int32_t timer_buf_periods;
int timer_is_synced;
int channels;
};
enum pcxhr_pipe_status {
PCXHR_PIPE_UNDEFINED,
PCXHR_PIPE_DEFINED
};
struct pcxhr_pipe {
enum pcxhr_pipe_status status;
int is_capture;
int first_audio;
};
struct snd_pcxhr {
struct snd_card *card;
struct pcxhr_mgr *mgr;
int chip_idx;
struct snd_pcm *pcm;
struct pcxhr_pipe playback_pipe;
struct pcxhr_pipe capture_pipe[2];
struct pcxhr_stream playback_stream[PCXHR_PLAYBACK_STREAMS];
struct pcxhr_stream capture_stream[2];
int nb_streams_play;
int nb_streams_capt;
int analog_playback_active[2];
int analog_playback_volume[2];
int analog_capture_volume[2];
int digital_playback_active[PCXHR_PLAYBACK_STREAMS][2];
int digital_playback_volume[PCXHR_PLAYBACK_STREAMS][2];
int digital_capture_volume[2];
int monitoring_active[2];
int monitoring_volume[2];
int audio_capture_source;
int mic_volume;
int mic_boost;
int mic_active;
int analog_capture_active;
int phantom_power;
unsigned char aes_bits[5];
};
struct pcxhr_hostport
{
char purgebuffer[6];
char reserved[2];
};
int pcxhr_create_pcm(struct snd_pcxhr *chip);
int pcxhr_set_clock(struct pcxhr_mgr *mgr, unsigned int rate);
int pcxhr_get_external_clock(struct pcxhr_mgr *mgr,
enum pcxhr_clock_type clock_type,
int *sample_rate);
#endif /* __SOUND_PCXHR_H */
|