Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef USBUSX2Y_H |
| 2 | #define USBUSX2Y_H |
| 3 | #include "../usbaudio.h" |
| 4 | #include "usbus428ctldefs.h" |
| 5 | |
| 6 | #define NRURBS 2 |
| 7 | |
| 8 | |
| 9 | #define URBS_AsyncSeq 10 |
| 10 | #define URB_DataLen_AsyncSeq 32 |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 11 | struct snd_usX2Y_AsyncSeq { |
| 12 | struct urb *urb[URBS_AsyncSeq]; |
| 13 | char *buffer; |
| 14 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 16 | struct snd_usX2Y_urbSeq { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | int submitted; |
| 18 | int len; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 19 | struct urb *urb[0]; |
| 20 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include "usx2yhwdeppcm.h" |
| 23 | |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 24 | struct usX2Ydev { |
| 25 | struct snd_usb_audio chip; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | int stride; |
| 27 | struct urb *In04urb; |
| 28 | void *In04Buf; |
| 29 | char In04Last[24]; |
| 30 | unsigned In04IntCalls; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 31 | struct snd_usX2Y_urbSeq *US04; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | wait_queue_head_t In04WaitQueue; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 33 | struct snd_usX2Y_AsyncSeq AS04; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | unsigned int rate, |
| 35 | format; |
| 36 | int chip_status; |
Ingo Molnar | 12aa757 | 2006-01-16 16:36:05 +0100 | [diff] [blame] | 37 | struct mutex prepare_mutex; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 38 | struct us428ctls_sharedmem *us428ctls_sharedmem; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | int wait_iso_frame; |
| 40 | wait_queue_head_t us428ctls_wait_queue_head; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 41 | struct snd_usX2Y_hwdep_pcm_shm *hwdep_pcm_shm; |
| 42 | struct snd_usX2Y_substream *subs[4]; |
| 43 | struct snd_usX2Y_substream * volatile prepare_subs; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | wait_queue_head_t prepare_wait_queue; |
Clemens Ladisch | d82af9f | 2009-11-16 12:23:46 +0100 | [diff] [blame^] | 45 | struct list_head midi_list; |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 46 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | |
| 49 | struct snd_usX2Y_substream { |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 50 | struct usX2Ydev *usX2Y; |
| 51 | struct snd_pcm_substream *pcm_substream; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 53 | int endpoint; |
| 54 | unsigned int maxpacksize; /* max packet size in bytes */ |
| 55 | |
| 56 | atomic_t state; |
| 57 | #define state_STOPPED 0 |
| 58 | #define state_STARTING1 1 |
| 59 | #define state_STARTING2 2 |
| 60 | #define state_STARTING3 3 |
| 61 | #define state_PREPARED 4 |
| 62 | #define state_PRERUNNING 6 |
| 63 | #define state_RUNNING 8 |
| 64 | |
| 65 | int hwptr; /* free frame position in the buffer (only for playback) */ |
| 66 | int hwptr_done; /* processed frame position in the buffer */ |
| 67 | int transfer_done; /* processed frames since last period update */ |
| 68 | |
| 69 | struct urb *urb[NRURBS]; /* data urb table */ |
| 70 | struct urb *completed_urb; |
| 71 | char *tmpbuf; /* temporary buffer for playback */ |
| 72 | }; |
| 73 | |
| 74 | |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 75 | #define usX2Y(c) ((struct usX2Ydev *)(c)->private_data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 77 | int usX2Y_audio_create(struct snd_card *card); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Takashi Iwai | bbe85bb | 2005-11-17 15:08:26 +0100 | [diff] [blame] | 79 | int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y); |
| 80 | int usX2Y_In04_init(struct usX2Ydev *usX2Y); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
| 82 | #define NAME_ALLCAPS "US-X2Y" |
| 83 | |
| 84 | #endif |