aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-04 12:48:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-04 12:48:03 -0400
commitbc23416cd4579093acc1e7d819eee747def623da (patch)
tree4fab11d6dac818927e5d80c5fddcf903412dd4fc /include
parentad8456361fa19068cf49b50a4f98e41b73c08e76 (diff)
parentd4376802999d478a103868d7e7b1f473e4a387af (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: hda-intel - fix wallclk variable update and condition ALSA: asihpi - Fix uninitialized variable ALSA: hda: Use LPIB for ASUS M2V usb/gadget: Replace the old USB audio FU definitions in f_audio.c ASoC: MX31ads sound support should depend on MACH_MX31ADS_WM1133_EV1 ASoC: Add missing Kconfig entry for Phytec boards ALSA: usb-audio: export UAC2 clock selectors as mixer controls ALSA: usb-audio: clean up find_audio_control_unit() ALSA: usb-audio: add UAC2 sepecific Feature Unit controls ALSA: usb-audio: unify constants from specification ALSA: usb-audio: parse clock topology of UAC2 devices ALSA: usb-audio: fix selector unit string index accessor include/linux/usb/audio-v2.h: add more UAC2 details ALSA: usb-audio: support partially write-protected UAC2 controls ALSA: usb-audio: UAC2: clean up parsing of bmaControls ALSA: hda: Use LPIB for another mainboard ALSA: hda: Use mb31 quirk for an iMac model ALSA: hda: Use LPIB for an ASUS device
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/audio-v2.h31
-rw-r--r--include/linux/usb/audio.h90
2 files changed, 94 insertions, 27 deletions
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
index 92f1d99f0f17..383b94ba8c20 100644
--- a/include/linux/usb/audio-v2.h
+++ b/include/linux/usb/audio-v2.h
@@ -18,6 +18,16 @@
18/* v1.0 and v2.0 of this standard have many things in common. For the rest 18/* v1.0 and v2.0 of this standard have many things in common. For the rest
19 * of the definitions, please refer to audio.h */ 19 * of the definitions, please refer to audio.h */
20 20
21static inline bool uac2_control_is_readable(u32 bmControls, u8 control)
22{
23 return (bmControls >> (control * 2)) & 0x1;
24}
25
26static inline bool uac2_control_is_writeable(u32 bmControls, u8 control)
27{
28 return (bmControls >> (control * 2)) & 0x2;
29}
30
21/* 4.7.2.1 Clock Source Descriptor */ 31/* 4.7.2.1 Clock Source Descriptor */
22 32
23struct uac_clock_source_descriptor { 33struct uac_clock_source_descriptor {
@@ -31,6 +41,13 @@ struct uac_clock_source_descriptor {
31 __u8 iClockSource; 41 __u8 iClockSource;
32} __attribute__((packed)); 42} __attribute__((packed));
33 43
44/* bmAttribute fields */
45#define UAC_CLOCK_SOURCE_TYPE_EXT 0x0
46#define UAC_CLOCK_SOURCE_TYPE_INT_FIXED 0x1
47#define UAC_CLOCK_SOURCE_TYPE_INT_VAR 0x2
48#define UAC_CLOCK_SOURCE_TYPE_INT_PROG 0x3
49#define UAC_CLOCK_SOURCE_SYNCED_TO_SOF (1 << 2)
50
34/* 4.7.2.2 Clock Source Descriptor */ 51/* 4.7.2.2 Clock Source Descriptor */
35 52
36struct uac_clock_selector_descriptor { 53struct uac_clock_selector_descriptor {
@@ -39,8 +56,20 @@ struct uac_clock_selector_descriptor {
39 __u8 bDescriptorSubtype; 56 __u8 bDescriptorSubtype;
40 __u8 bClockID; 57 __u8 bClockID;
41 __u8 bNrInPins; 58 __u8 bNrInPins;
42 __u8 bmControls;
43 __u8 baCSourceID[]; 59 __u8 baCSourceID[];
60 /* bmControls, bAssocTerminal and iClockSource omitted */
61} __attribute__((packed));
62
63/* 4.7.2.3 Clock Multiplier Descriptor */
64
65struct uac_clock_multiplier_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType;
68 __u8 bDescriptorSubtype;
69 __u8 bClockID;
70 __u8 bCSourceID;
71 __u8 bmControls;
72 __u8 iClockMultiplier;
44} __attribute__((packed)); 73} __attribute__((packed));
45 74
46/* 4.7.2.4 Input terminal descriptor */ 75/* 4.7.2.4 Input terminal descriptor */
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 5d646c388752..c51200c715e5 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -47,6 +47,15 @@
47#define UAC_FORMAT_TYPE 0x02 47#define UAC_FORMAT_TYPE 0x02
48#define UAC_FORMAT_SPECIFIC 0x03 48#define UAC_FORMAT_SPECIFIC 0x03
49 49
50/* A.7 Processing Unit Process Types */
51#define UAC_PROCESS_UNDEFINED 0x00
52#define UAC_PROCESS_UP_DOWNMIX 0x01
53#define UAC_PROCESS_DOLBY_PROLOGIC 0x02
54#define UAC_PROCESS_STEREO_EXTENDER 0x03
55#define UAC_PROCESS_REVERB 0x04
56#define UAC_PROCESS_CHORUS 0x05
57#define UAC_PROCESS_DYN_RANGE_COMP 0x06
58
50/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ 59/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
51#define UAC_EP_GENERAL 0x01 60#define UAC_EP_GENERAL 0x01
52 61
@@ -73,6 +82,60 @@
73 82
74#define UAC_GET_STAT 0xff 83#define UAC_GET_STAT 0xff
75 84
85/* A.10 Control Selector Codes */
86
87/* A.10.1 Terminal Control Selectors */
88#define UAC_TERM_COPY_PROTECT 0x01
89
90/* A.10.2 Feature Unit Control Selectors */
91#define UAC_FU_MUTE 0x01
92#define UAC_FU_VOLUME 0x02
93#define UAC_FU_BASS 0x03
94#define UAC_FU_MID 0x04
95#define UAC_FU_TREBLE 0x05
96#define UAC_FU_GRAPHIC_EQUALIZER 0x06
97#define UAC_FU_AUTOMATIC_GAIN 0x07
98#define UAC_FU_DELAY 0x08
99#define UAC_FU_BASS_BOOST 0x09
100#define UAC_FU_LOUDNESS 0x0a
101
102#define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1))
103
104/* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */
105#define UAC_UD_ENABLE 0x01
106#define UAC_UD_MODE_SELECT 0x02
107
108/* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */
109#define UAC_DP_ENABLE 0x01
110#define UAC_DP_MODE_SELECT 0x02
111
112/* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */
113#define UAC_3D_ENABLE 0x01
114#define UAC_3D_SPACE 0x02
115
116/* A.10.3.4 Reverberation Processing Unit Control Selectors */
117#define UAC_REVERB_ENABLE 0x01
118#define UAC_REVERB_LEVEL 0x02
119#define UAC_REVERB_TIME 0x03
120#define UAC_REVERB_FEEDBACK 0x04
121
122/* A.10.3.5 Chorus Processing Unit Control Selectors */
123#define UAC_CHORUS_ENABLE 0x01
124#define UAC_CHORUS_LEVEL 0x02
125#define UAC_CHORUS_RATE 0x03
126#define UAC_CHORUS_DEPTH 0x04
127
128/* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */
129#define UAC_DCR_ENABLE 0x01
130#define UAC_DCR_RATE 0x02
131#define UAC_DCR_MAXAMPL 0x03
132#define UAC_DCR_THRESHOLD 0x04
133#define UAC_DCR_ATTACK_TIME 0x05
134#define UAC_DCR_RELEASE_TIME 0x06
135
136/* A.10.4 Extension Unit Control Selectors */
137#define UAC_XU_ENABLE 0x01
138
76/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 139/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
77#define UAC_MS_HEADER 0x01 140#define UAC_MS_HEADER 0x01
78#define UAC_MIDI_IN_JACK 0x02 141#define UAC_MIDI_IN_JACK 0x02
@@ -244,7 +307,7 @@ struct uac_selector_unit_descriptor {
244static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) 307static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
245{ 308{
246 __u8 *raw = (__u8 *) desc; 309 __u8 *raw = (__u8 *) desc;
247 return raw[9 + desc->bLength - 1]; 310 return raw[desc->bLength - 1];
248} 311}
249 312
250/* 4.3.2.5 Feature Unit Descriptor */ 313/* 4.3.2.5 Feature Unit Descriptor */
@@ -463,31 +526,6 @@ struct uac_iso_endpoint_descriptor {
463#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 526#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
464#define UAC_EP_CS_ATTR_FILL_MAX 0x80 527#define UAC_EP_CS_ATTR_FILL_MAX 0x80
465 528
466/* A.10.2 Feature Unit Control Selectors */
467
468#define UAC_FU_CONTROL_UNDEFINED 0x00
469#define UAC_MUTE_CONTROL 0x01
470#define UAC_VOLUME_CONTROL 0x02
471#define UAC_BASS_CONTROL 0x03
472#define UAC_MID_CONTROL 0x04
473#define UAC_TREBLE_CONTROL 0x05
474#define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06
475#define UAC_AUTOMATIC_GAIN_CONTROL 0x07
476#define UAC_DELAY_CONTROL 0x08
477#define UAC_BASS_BOOST_CONTROL 0x09
478#define UAC_LOUDNESS_CONTROL 0x0a
479
480#define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1))
481#define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1))
482#define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1))
483#define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1))
484#define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1))
485#define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1))
486#define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1))
487#define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1))
488#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1))
489#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1))
490
491/* status word format (3.7.1.1) */ 529/* status word format (3.7.1.1) */
492 530
493#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f 531#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f