| Ben Williamson | f2ebf92c | 2006-08-01 11:28:16 +1000 | [diff] [blame] | 1 | /* | 
|  | 2 | * <linux/usb/audio.h> -- USB Audio definitions. | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | 
|  | 5 | * Developed for Thumtronics by Grey Innovation | 
|  | 6 | * Ben Williamson <ben.williamson@greyinnovation.com> | 
|  | 7 | * | 
|  | 8 | * This software is distributed under the terms of the GNU General Public | 
|  | 9 | * License ("GPL") version 2, as published by the Free Software Foundation. | 
|  | 10 | * | 
|  | 11 | * This file holds USB constants and structures defined | 
|  | 12 | * by the USB Device Class Definition for Audio Devices. | 
|  | 13 | * Comments below reference relevant sections of that document: | 
|  | 14 | * | 
|  | 15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf | 
|  | 16 | */ | 
|  | 17 |  | 
|  | 18 | #ifndef __LINUX_USB_AUDIO_H | 
|  | 19 | #define __LINUX_USB_AUDIO_H | 
|  | 20 |  | 
|  | 21 | #include <linux/types.h> | 
|  | 22 |  | 
|  | 23 | /* A.2 Audio Interface Subclass Codes */ | 
|  | 24 | #define USB_SUBCLASS_AUDIOCONTROL	0x01 | 
|  | 25 | #define USB_SUBCLASS_AUDIOSTREAMING	0x02 | 
|  | 26 | #define USB_SUBCLASS_MIDISTREAMING	0x03 | 
|  | 27 |  | 
|  | 28 | /* 4.3.2  Class-Specific AC Interface Descriptor */ | 
|  | 29 | struct usb_ac_header_descriptor { | 
|  | 30 | __u8  bLength;			// 8+n | 
|  | 31 | __u8  bDescriptorType;		// USB_DT_CS_INTERFACE | 
|  | 32 | __u8  bDescriptorSubtype;	// USB_MS_HEADER | 
|  | 33 | __le16 bcdADC;			// 0x0100 | 
|  | 34 | __le16 wTotalLength;		// includes Unit and Terminal desc. | 
|  | 35 | __u8  bInCollection;		// n | 
|  | 36 | __u8  baInterfaceNr[];		// [n] | 
|  | 37 | } __attribute__ ((packed)); | 
|  | 38 |  | 
|  | 39 | #define USB_DT_AC_HEADER_SIZE(n)	(8+(n)) | 
|  | 40 |  | 
|  | 41 | /* As above, but more useful for defining your own descriptors: */ | 
|  | 42 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) 			\ | 
|  | 43 | struct usb_ac_header_descriptor_##n {				\ | 
|  | 44 | __u8  bLength;						\ | 
|  | 45 | __u8  bDescriptorType;					\ | 
|  | 46 | __u8  bDescriptorSubtype;				\ | 
|  | 47 | __le16 bcdADC;						\ | 
|  | 48 | __le16 wTotalLength;					\ | 
|  | 49 | __u8  bInCollection;					\ | 
|  | 50 | __u8  baInterfaceNr[n];					\ | 
|  | 51 | } __attribute__ ((packed)) | 
|  | 52 |  | 
|  | 53 | #endif |