1 /* SPDX-License-Identifier: GPL-2.0 */
4 #include "../usbaudio.h"
6 #include "usbus428ctldefs.h"
11 #define URBS_AsyncSeq 10
12 #define URB_DataLen_AsyncSeq 32
13 struct snd_usX2Y_AsyncSeq
{
14 struct urb
*urb
[URBS_AsyncSeq
];
18 struct snd_usX2Y_urbSeq
{
24 #include "usx2yhwdeppcm.h"
27 struct usb_device
*dev
;
33 unsigned In04IntCalls
;
34 struct snd_usX2Y_urbSeq
*US04
;
35 wait_queue_head_t In04WaitQueue
;
36 struct snd_usX2Y_AsyncSeq AS04
;
40 struct mutex pcm_mutex
;
41 struct us428ctls_sharedmem
*us428ctls_sharedmem
;
43 wait_queue_head_t us428ctls_wait_queue_head
;
44 struct snd_usX2Y_hwdep_pcm_shm
*hwdep_pcm_shm
;
45 struct snd_usX2Y_substream
*subs
[4];
46 struct snd_usX2Y_substream
* volatile prepare_subs
;
47 wait_queue_head_t prepare_wait_queue
;
48 struct list_head midi_list
;
49 struct list_head pcm_list
;
54 struct snd_usX2Y_substream
{
55 struct usX2Ydev
*usX2Y
;
56 struct snd_pcm_substream
*pcm_substream
;
59 unsigned int maxpacksize
; /* max packet size in bytes */
62 #define state_STOPPED 0
63 #define state_STARTING1 1
64 #define state_STARTING2 2
65 #define state_STARTING3 3
66 #define state_PREPARED 4
67 #define state_PRERUNNING 6
68 #define state_RUNNING 8
70 int hwptr
; /* free frame position in the buffer (only for playback) */
71 int hwptr_done
; /* processed frame position in the buffer */
72 int transfer_done
; /* processed frames since last period update */
74 struct urb
*urb
[NRURBS
]; /* data urb table */
75 struct urb
*completed_urb
;
76 char *tmpbuf
; /* temporary buffer for playback */
80 #define usX2Y(c) ((struct usX2Ydev *)(c)->private_data)
82 int usX2Y_audio_create(struct snd_card
*card
);
84 int usX2Y_AsyncSeq04_init(struct usX2Ydev
*usX2Y
);
85 int usX2Y_In04_init(struct usX2Ydev
*usX2Y
);
87 #define NAME_ALLCAPS "US-X2Y"