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
|
#ifndef USB6FIRE_PCM_H
#define USB6FIRE_PCM_H
#include <sound/pcm.h>
#include <linux/mutex.h>
#include "common.h"
enum
{
PCM_N_URBS = 16, PCM_N_PACKETS_PER_URB = 8, PCM_MAX_PACKET_SIZE = 604
};
struct pcm_urb {
struct sfire_chip *chip;
struct urb instance;
struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB];
u8 *buffer;
struct pcm_urb *peer;
};
struct pcm_substream {
spinlock_t lock;
struct snd_pcm_substream *instance;
bool active;
snd_pcm_uframes_t dma_off;
snd_pcm_uframes_t period_off;
};
struct pcm_runtime {
struct sfire_chip *chip;
struct snd_pcm *instance;
struct pcm_substream playback;
struct pcm_substream capture;
bool panic;
struct pcm_urb in_urbs[PCM_N_URBS];
struct pcm_urb out_urbs[PCM_N_URBS];
int in_packet_size;
int out_packet_size;
int in_n_analog;
int out_n_analog;
struct mutex stream_mutex;
u8 stream_state;
u8 rate;
wait_queue_head_t stream_wait_queue;
bool stream_wait_cond;
};
int usb6fire_pcm_init(struct sfire_chip *chip);
void usb6fire_pcm_abort(struct sfire_chip *chip);
void usb6fire_pcm_destroy(struct sfire_chip *chip);
#endif /* USB6FIRE_PCM_H */
|