usbaudio.h (3e1aebef6fb55e35668d2d7cf608cf03f30c904f) usbaudio.h (e5779998bf8b70e48a6cc208c8b61b33bd6117ea)
1#ifndef __USBAUDIO_H
2#define __USBAUDIO_H
3/*
4 * (Tentative) USB Audio Driver for ALSA
5 *
6 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
7 *
8 *

--- 13 unchanged lines hidden (view full) ---

22 */
23
24/* handling of USB vendor/product ID pairs as 32-bit numbers */
25#define USB_ID(vendor, product) (((vendor) << 16) | (product))
26#define USB_ID_VENDOR(id) ((id) >> 16)
27#define USB_ID_PRODUCT(id) ((u16)(id))
28
29/*
1#ifndef __USBAUDIO_H
2#define __USBAUDIO_H
3/*
4 * (Tentative) USB Audio Driver for ALSA
5 *
6 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
7 *
8 *

--- 13 unchanged lines hidden (view full) ---

22 */
23
24/* handling of USB vendor/product ID pairs as 32-bit numbers */
25#define USB_ID(vendor, product) (((vendor) << 16) | (product))
26#define USB_ID_VENDOR(id) ((id) >> 16)
27#define USB_ID_PRODUCT(id) ((u16)(id))
28
29/*
30 *
30 */
31
32struct snd_usb_audio {
33 int index;
34 struct usb_device *dev;
35 struct snd_card *card;
36 u32 usb_id;
37 int shutdown;

--- 5 unchanged lines hidden (view full) ---

43 int clock_id;
44
45 struct list_head pcm_list; /* list of pcm streams */
46 int pcm_devs;
47
48 struct list_head midi_list; /* list of midi interfaces */
49
50 struct list_head mixer_list; /* list of mixer interfaces */
31 */
32
33struct snd_usb_audio {
34 int index;
35 struct usb_device *dev;
36 struct snd_card *card;
37 u32 usb_id;
38 int shutdown;

--- 5 unchanged lines hidden (view full) ---

44 int clock_id;
45
46 struct list_head pcm_list; /* list of pcm streams */
47 int pcm_devs;
48
49 struct list_head midi_list; /* list of midi interfaces */
50
51 struct list_head mixer_list; /* list of mixer interfaces */
52
53 int setup; /* from the 'device_setup' module param */
54 int nrpacks; /* from the 'nrpacks' module param */
55 int async_unlink; /* from the 'async_unlink' module param */
51};
52
53/*
54 * Information about devices with broken descriptors
55 */
56
57/* special values for .ifnum */
58#define QUIRK_NO_INTERFACE -2

--- 22 unchanged lines hidden (view full) ---

81struct snd_usb_audio_quirk {
82 const char *vendor_name;
83 const char *product_name;
84 int16_t ifnum;
85 uint16_t type;
86 const void *data;
87};
88
56};
57
58/*
59 * Information about devices with broken descriptors
60 */
61
62/* special values for .ifnum */
63#define QUIRK_NO_INTERFACE -2

--- 22 unchanged lines hidden (view full) ---

86struct snd_usb_audio_quirk {
87 const char *vendor_name;
88 const char *product_name;
89 int16_t ifnum;
90 uint16_t type;
91 const void *data;
92};
93
89/*
90 */
91
92/*E-mu USB samplerate control quirk*/
93enum {
94 EMU_QUIRK_SR_44100HZ = 0,
95 EMU_QUIRK_SR_48000HZ,
96 EMU_QUIRK_SR_88200HZ,
97 EMU_QUIRK_SR_96000HZ,
98 EMU_QUIRK_SR_176400HZ,
99 EMU_QUIRK_SR_192000HZ
100};
101
102#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
103#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
104#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
105
94#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
95#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
96#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
97
106unsigned int snd_usb_combine_bytes(unsigned char *bytes, int size);
107
108void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype);
109void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype);
110
111int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe,
112 __u8 request, __u8 requesttype, __u16 value, __u16 index,
113 void *data, __u16 size, int timeout);
114
115/*
116 * retrieve usb_interface descriptor from the host interface
117 * (conditional for compatibility with the older API)
118 */
119#ifndef get_iface_desc
120#define get_iface_desc(iface) (&(iface)->desc)
121#define get_endpoint(alt,ep) (&(alt)->endpoint[ep].desc)
122#define get_ep_desc(ep) (&(ep)->desc)
123#define get_cfg_desc(cfg) (&(cfg)->desc)
124#endif
125
126#ifndef snd_usb_get_speed
127#define snd_usb_get_speed(dev) ((dev)->speed)
128#endif
129
130#endif /* __USBAUDIO_H */
98#endif /* __USBAUDIO_H */