aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.h
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-05-02 02:51:26 -0400
committerJaroslav Kysela <perex@suse.cz>2005-05-29 04:05:47 -0400
commit27d10f5664c7650af3b2ffadfefaf19b36dc7bd8 (patch)
treeb89c8d639041f460557bf6e9078c7cee7426cd2b /sound/usb/usbaudio.h
parentb259b10c420a59a2fdbcf5a3498253ebcbdffa1e (diff)
[ALSA] usb-audio - cache vendor/product IDs
USB generic driver Cache the decoded values of idVendor/idProduct to get rid of most of those ugly le16_to_cpu() calls. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/usb/usbaudio.h')
-rw-r--r--sound/usb/usbaudio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 41d842dab3e8..aedb42aaa749 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -118,6 +118,11 @@
118/* maximum number of endpoints per interface */ 118/* maximum number of endpoints per interface */
119#define MIDI_MAX_ENDPOINTS 2 119#define MIDI_MAX_ENDPOINTS 2
120 120
121/* handling of USB vendor/product ID pairs as 32-bit numbers */
122#define USB_ID(vendor, product) (((vendor) << 16) | (product))
123#define USB_ID_VENDOR(id) ((id) >> 16)
124#define USB_ID_PRODUCT(id) ((u16)(id))
125
121/* 126/*
122 */ 127 */
123 128
@@ -127,6 +132,7 @@ struct snd_usb_audio {
127 int index; 132 int index;
128 struct usb_device *dev; 133 struct usb_device *dev;
129 snd_card_t *card; 134 snd_card_t *card;
135 u32 usb_id;
130 int shutdown; 136 int shutdown;
131 int num_interfaces; 137 int num_interfaces;
132 138