2005-04-17 06:20:36 +08:00
|
|
|
#ifndef USBUSX2Y_H
|
|
|
|
#define USBUSX2Y_H
|
|
|
|
#include "../usbaudio.h"
|
2010-03-05 02:46:13 +08:00
|
|
|
#include "../midi.h"
|
2005-04-17 06:20:36 +08:00
|
|
|
#include "usbus428ctldefs.h"
|
|
|
|
|
|
|
|
#define NRURBS 2
|
|
|
|
|
|
|
|
|
|
|
|
#define URBS_AsyncSeq 10
|
|
|
|
#define URB_DataLen_AsyncSeq 32
|
2005-11-17 22:08:26 +08:00
|
|
|
struct snd_usX2Y_AsyncSeq {
|
|
|
|
struct urb *urb[URBS_AsyncSeq];
|
|
|
|
char *buffer;
|
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-17 22:08:26 +08:00
|
|
|
struct snd_usX2Y_urbSeq {
|
2005-04-17 06:20:36 +08:00
|
|
|
int submitted;
|
|
|
|
int len;
|
2005-11-17 22:08:26 +08:00
|
|
|
struct urb *urb[0];
|
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include "usx2yhwdeppcm.h"
|
|
|
|
|
2005-11-17 22:08:26 +08:00
|
|
|
struct usX2Ydev {
|
2009-11-16 19:26:30 +08:00
|
|
|
struct usb_device *dev;
|
|
|
|
int card_index;
|
2005-04-17 06:20:36 +08:00
|
|
|
int stride;
|
|
|
|
struct urb *In04urb;
|
|
|
|
void *In04Buf;
|
|
|
|
char In04Last[24];
|
|
|
|
unsigned In04IntCalls;
|
2005-11-17 22:08:26 +08:00
|
|
|
struct snd_usX2Y_urbSeq *US04;
|
2005-04-17 06:20:36 +08:00
|
|
|
wait_queue_head_t In04WaitQueue;
|
2005-11-17 22:08:26 +08:00
|
|
|
struct snd_usX2Y_AsyncSeq AS04;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int rate,
|
|
|
|
format;
|
|
|
|
int chip_status;
|
2014-02-14 16:05:47 +08:00
|
|
|
struct mutex pcm_mutex;
|
2005-11-17 22:08:26 +08:00
|
|
|
struct us428ctls_sharedmem *us428ctls_sharedmem;
|
2005-04-17 06:20:36 +08:00
|
|
|
int wait_iso_frame;
|
|
|
|
wait_queue_head_t us428ctls_wait_queue_head;
|
2005-11-17 22:08:26 +08:00
|
|
|
struct snd_usX2Y_hwdep_pcm_shm *hwdep_pcm_shm;
|
|
|
|
struct snd_usX2Y_substream *subs[4];
|
|
|
|
struct snd_usX2Y_substream * volatile prepare_subs;
|
2005-04-17 06:20:36 +08:00
|
|
|
wait_queue_head_t prepare_wait_queue;
|
2009-11-16 19:23:46 +08:00
|
|
|
struct list_head midi_list;
|
2009-11-16 19:26:30 +08:00
|
|
|
struct list_head pcm_list;
|
|
|
|
int pcm_devs;
|
2005-11-17 22:08:26 +08:00
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct snd_usX2Y_substream {
|
2005-11-17 22:08:26 +08:00
|
|
|
struct usX2Ydev *usX2Y;
|
|
|
|
struct snd_pcm_substream *pcm_substream;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
int endpoint;
|
|
|
|
unsigned int maxpacksize; /* max packet size in bytes */
|
|
|
|
|
|
|
|
atomic_t state;
|
|
|
|
#define state_STOPPED 0
|
|
|
|
#define state_STARTING1 1
|
|
|
|
#define state_STARTING2 2
|
|
|
|
#define state_STARTING3 3
|
|
|
|
#define state_PREPARED 4
|
|
|
|
#define state_PRERUNNING 6
|
|
|
|
#define state_RUNNING 8
|
|
|
|
|
|
|
|
int hwptr; /* free frame position in the buffer (only for playback) */
|
|
|
|
int hwptr_done; /* processed frame position in the buffer */
|
|
|
|
int transfer_done; /* processed frames since last period update */
|
|
|
|
|
|
|
|
struct urb *urb[NRURBS]; /* data urb table */
|
|
|
|
struct urb *completed_urb;
|
|
|
|
char *tmpbuf; /* temporary buffer for playback */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-11-17 22:08:26 +08:00
|
|
|
#define usX2Y(c) ((struct usX2Ydev *)(c)->private_data)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-17 22:08:26 +08:00
|
|
|
int usX2Y_audio_create(struct snd_card *card);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-17 22:08:26 +08:00
|
|
|
int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y);
|
|
|
|
int usX2Y_In04_init(struct usX2Ydev *usX2Y);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define NAME_ALLCAPS "US-X2Y"
|
|
|
|
|
|
|
|
#endif
|