diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/audio-v2.h | 7 | ||||
-rw-r--r-- | include/linux/usb/audio-v3.h | 40 | ||||
-rw-r--r-- | include/sound/core.h | 2 | ||||
-rw-r--r-- | include/sound/emu10k1.h | 4 | ||||
-rw-r--r-- | include/sound/hdaudio.h | 5 | ||||
-rw-r--r-- | include/sound/memalloc.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/usb/audio.h | 19 | ||||
-rw-r--r-- | include/uapi/sound/tlv.h | 16 |
8 files changed, 87 insertions, 8 deletions
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h index aaafecf073ff..a96ed2ce3254 100644 --- a/include/linux/usb/audio-v2.h +++ b/include/linux/usb/audio-v2.h | |||
@@ -189,6 +189,13 @@ struct uac2_iso_endpoint_descriptor { | |||
189 | #define UAC2_CONTROL_DATA_OVERRUN (3 << 2) | 189 | #define UAC2_CONTROL_DATA_OVERRUN (3 << 2) |
190 | #define UAC2_CONTROL_DATA_UNDERRUN (3 << 4) | 190 | #define UAC2_CONTROL_DATA_UNDERRUN (3 << 4) |
191 | 191 | ||
192 | /* 5.2.5.4.2 Connector Control Parameter Block */ | ||
193 | struct uac2_connectors_ctl_blk { | ||
194 | __u8 bNrChannels; | ||
195 | __le32 bmChannelConfig; | ||
196 | __u8 iChannelNames; | ||
197 | } __attribute__((packed)); | ||
198 | |||
192 | /* 6.1 Interrupt Data Message */ | 199 | /* 6.1 Interrupt Data Message */ |
193 | 200 | ||
194 | #define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) | 201 | #define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) |
diff --git a/include/linux/usb/audio-v3.h b/include/linux/usb/audio-v3.h index a8959aaba0ae..a710e28b5215 100644 --- a/include/linux/usb/audio-v3.h +++ b/include/linux/usb/audio-v3.h | |||
@@ -221,6 +221,12 @@ struct uac3_iso_endpoint_descriptor { | |||
221 | __le16 wLockDelay; | 221 | __le16 wLockDelay; |
222 | } __attribute__((packed)); | 222 | } __attribute__((packed)); |
223 | 223 | ||
224 | /* 5.2.1.6.1 INSERTION CONTROL PARAMETER BLOCK */ | ||
225 | struct uac3_insertion_ctl_blk { | ||
226 | __u8 bSize; | ||
227 | __u8 bmConInserted; | ||
228 | } __attribute__ ((packed)); | ||
229 | |||
224 | /* 6.1 INTERRUPT DATA MESSAGE */ | 230 | /* 6.1 INTERRUPT DATA MESSAGE */ |
225 | struct uac3_interrupt_data_msg { | 231 | struct uac3_interrupt_data_msg { |
226 | __u8 bInfo; | 232 | __u8 bInfo; |
@@ -392,4 +398,38 @@ struct uac3_interrupt_data_msg { | |||
392 | #define UAC3_AC_ACTIVE_INTERFACE_CONTROL 0x01 | 398 | #define UAC3_AC_ACTIVE_INTERFACE_CONTROL 0x01 |
393 | #define UAC3_AC_POWER_DOMAIN_CONTROL 0x02 | 399 | #define UAC3_AC_POWER_DOMAIN_CONTROL 0x02 |
394 | 400 | ||
401 | /* A.23.5 TERMINAL CONTROL SELECTORS */ | ||
402 | #define UAC3_TE_UNDEFINED 0x00 | ||
403 | #define UAC3_TE_INSERTION 0x01 | ||
404 | #define UAC3_TE_OVERLOAD 0x02 | ||
405 | #define UAC3_TE_UNDERFLOW 0x03 | ||
406 | #define UAC3_TE_OVERFLOW 0x04 | ||
407 | #define UAC3_TE_LATENCY 0x05 | ||
408 | |||
409 | /* BADD predefined Unit/Terminal values */ | ||
410 | #define UAC3_BADD_IT_ID1 1 /* Input Terminal ID1: bTerminalID = 1 */ | ||
411 | #define UAC3_BADD_FU_ID2 2 /* Feature Unit ID2: bUnitID = 2 */ | ||
412 | #define UAC3_BADD_OT_ID3 3 /* Output Terminal ID3: bTerminalID = 3 */ | ||
413 | #define UAC3_BADD_IT_ID4 4 /* Input Terminal ID4: bTerminalID = 4 */ | ||
414 | #define UAC3_BADD_FU_ID5 5 /* Feature Unit ID5: bUnitID = 5 */ | ||
415 | #define UAC3_BADD_OT_ID6 6 /* Output Terminal ID6: bTerminalID = 6 */ | ||
416 | #define UAC3_BADD_FU_ID7 7 /* Feature Unit ID7: bUnitID = 7 */ | ||
417 | #define UAC3_BADD_MU_ID8 8 /* Mixer Unit ID8: bUnitID = 8 */ | ||
418 | #define UAC3_BADD_CS_ID9 9 /* Clock Source Entity ID9: bClockID = 9 */ | ||
419 | #define UAC3_BADD_PD_ID10 10 /* Power Domain ID10: bPowerDomainID = 10 */ | ||
420 | #define UAC3_BADD_PD_ID11 11 /* Power Domain ID11: bPowerDomainID = 11 */ | ||
421 | |||
422 | /* BADD wMaxPacketSize of AS endpoints */ | ||
423 | #define UAC3_BADD_EP_MAXPSIZE_SYNC_MONO_16 0x0060 | ||
424 | #define UAC3_BADD_EP_MAXPSIZE_ASYNC_MONO_16 0x0062 | ||
425 | #define UAC3_BADD_EP_MAXPSIZE_SYNC_MONO_24 0x0090 | ||
426 | #define UAC3_BADD_EP_MAXPSIZE_ASYNC_MONO_24 0x0093 | ||
427 | #define UAC3_BADD_EP_MAXPSIZE_SYNC_STEREO_16 0x00C0 | ||
428 | #define UAC3_BADD_EP_MAXPSIZE_ASYNC_STEREO_16 0x00C4 | ||
429 | #define UAC3_BADD_EP_MAXPSIZE_SYNC_STEREO_24 0x0120 | ||
430 | #define UAC3_BADD_EP_MAXPSIZE_ASYNC_STEREO_24 0x0126 | ||
431 | |||
432 | /* BADD sample rate is always fixed to 48kHz */ | ||
433 | #define UAC3_BADD_SAMPLING_RATE 48000 | ||
434 | |||
395 | #endif /* __LINUX_USB_AUDIO_V3_H */ | 435 | #endif /* __LINUX_USB_AUDIO_V3_H */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 5f181b875c2f..36a5934cf4b1 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -51,7 +51,6 @@ struct completion; | |||
51 | */ | 51 | */ |
52 | enum snd_device_type { | 52 | enum snd_device_type { |
53 | SNDRV_DEV_LOWLEVEL, | 53 | SNDRV_DEV_LOWLEVEL, |
54 | SNDRV_DEV_CONTROL, | ||
55 | SNDRV_DEV_INFO, | 54 | SNDRV_DEV_INFO, |
56 | SNDRV_DEV_BUS, | 55 | SNDRV_DEV_BUS, |
57 | SNDRV_DEV_CODEC, | 56 | SNDRV_DEV_CODEC, |
@@ -62,6 +61,7 @@ enum snd_device_type { | |||
62 | SNDRV_DEV_SEQUENCER, | 61 | SNDRV_DEV_SEQUENCER, |
63 | SNDRV_DEV_HWDEP, | 62 | SNDRV_DEV_HWDEP, |
64 | SNDRV_DEV_JACK, | 63 | SNDRV_DEV_JACK, |
64 | SNDRV_DEV_CONTROL, /* NOTE: this must be the last one */ | ||
65 | }; | 65 | }; |
66 | 66 | ||
67 | enum snd_device_state { | 67 | enum snd_device_state { |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 5ebcc51c0a6a..8c1572de44c5 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -1610,7 +1610,7 @@ struct snd_emu10k1_fx8010_pcm { | |||
1610 | struct snd_pcm_indirect pcm_rec; | 1610 | struct snd_pcm_indirect pcm_rec; |
1611 | unsigned int tram_pos; | 1611 | unsigned int tram_pos; |
1612 | unsigned int tram_shift; | 1612 | unsigned int tram_shift; |
1613 | struct snd_emu10k1_fx8010_irq *irq; | 1613 | struct snd_emu10k1_fx8010_irq irq; |
1614 | }; | 1614 | }; |
1615 | 1615 | ||
1616 | struct snd_emu10k1_fx8010 { | 1616 | struct snd_emu10k1_fx8010 { |
@@ -1902,7 +1902,7 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu, | |||
1902 | snd_fx8010_irq_handler_t *handler, | 1902 | snd_fx8010_irq_handler_t *handler, |
1903 | unsigned char gpr_running, | 1903 | unsigned char gpr_running, |
1904 | void *private_data, | 1904 | void *private_data, |
1905 | struct snd_emu10k1_fx8010_irq **r_irq); | 1905 | struct snd_emu10k1_fx8010_irq *irq); |
1906 | int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, | 1906 | int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, |
1907 | struct snd_emu10k1_fx8010_irq *irq); | 1907 | struct snd_emu10k1_fx8010_irq *irq); |
1908 | 1908 | ||
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index 06536e01ed94..c052afc27547 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h | |||
@@ -571,4 +571,9 @@ static inline unsigned int snd_array_index(struct snd_array *array, void *ptr) | |||
571 | return (unsigned long)(ptr - array->list) / array->elem_size; | 571 | return (unsigned long)(ptr - array->list) / array->elem_size; |
572 | } | 572 | } |
573 | 573 | ||
574 | /* a helper macro to iterate for each snd_array element */ | ||
575 | #define snd_array_for_each(array, idx, ptr) \ | ||
576 | for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \ | ||
577 | (ptr) = snd_array_elem(array, ++(idx))) | ||
578 | |||
574 | #endif /* __SOUND_HDAUDIO_H */ | 579 | #endif /* __SOUND_HDAUDIO_H */ |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 782d1df34208..9c3db3dce32b 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -34,11 +34,9 @@ struct snd_dma_device { | |||
34 | struct device *dev; /* generic device */ | 34 | struct device *dev; /* generic device */ |
35 | }; | 35 | }; |
36 | 36 | ||
37 | #ifndef snd_dma_pci_data | ||
38 | #define snd_dma_pci_data(pci) (&(pci)->dev) | 37 | #define snd_dma_pci_data(pci) (&(pci)->dev) |
39 | #define snd_dma_isa_data() NULL | 38 | #define snd_dma_isa_data() NULL |
40 | #define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x)) | 39 | #define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x)) |
41 | #endif | ||
42 | 40 | ||
43 | 41 | ||
44 | /* | 42 | /* |
diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h index 3a78e7145689..13d98e6e0db1 100644 --- a/include/uapi/linux/usb/audio.h +++ b/include/uapi/linux/usb/audio.h | |||
@@ -285,9 +285,22 @@ static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor | |||
285 | static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc, | 285 | static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc, |
286 | int protocol) | 286 | int protocol) |
287 | { | 287 | { |
288 | return (protocol == UAC_VERSION_1) ? | 288 | switch (protocol) { |
289 | &desc->baSourceID[desc->bNrInPins + 4] : | 289 | case UAC_VERSION_1: |
290 | &desc->baSourceID[desc->bNrInPins + 6]; | 290 | return &desc->baSourceID[desc->bNrInPins + 4]; |
291 | case UAC_VERSION_2: | ||
292 | return &desc->baSourceID[desc->bNrInPins + 6]; | ||
293 | case UAC_VERSION_3: | ||
294 | return &desc->baSourceID[desc->bNrInPins + 2]; | ||
295 | default: | ||
296 | return NULL; | ||
297 | } | ||
298 | } | ||
299 | |||
300 | static inline __u16 uac3_mixer_unit_wClusterDescrID(struct uac_mixer_unit_descriptor *desc) | ||
301 | { | ||
302 | return (desc->baSourceID[desc->bNrInPins + 1] << 8) | | ||
303 | desc->baSourceID[desc->bNrInPins]; | ||
291 | } | 304 | } |
292 | 305 | ||
293 | static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc) | 306 | static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc) |
diff --git a/include/uapi/sound/tlv.h b/include/uapi/sound/tlv.h index be5371f09a62..7d6d65f60a42 100644 --- a/include/uapi/sound/tlv.h +++ b/include/uapi/sound/tlv.h | |||
@@ -42,6 +42,10 @@ | |||
42 | #define SNDRV_CTL_TLVD_LENGTH(...) \ | 42 | #define SNDRV_CTL_TLVD_LENGTH(...) \ |
43 | ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ })) | 43 | ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ })) |
44 | 44 | ||
45 | /* Accessor offsets for TLV data items */ | ||
46 | #define SNDRV_CTL_TLVO_TYPE 0 | ||
47 | #define SNDRV_CTL_TLVO_LEN 1 | ||
48 | |||
45 | #define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \ | 49 | #define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \ |
46 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__) | 50 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__) |
47 | #define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \ | 51 | #define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \ |
@@ -61,6 +65,10 @@ | |||
61 | SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \ | 65 | SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \ |
62 | } | 66 | } |
63 | 67 | ||
68 | /* Accessor offsets for min, mute and step items in dB scale type TLV */ | ||
69 | #define SNDRV_CTL_TLVO_DB_SCALE_MIN 2 | ||
70 | #define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP 3 | ||
71 | |||
64 | /* dB scale specified with min/max values instead of step */ | 72 | /* dB scale specified with min/max values instead of step */ |
65 | #define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \ | 73 | #define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \ |
66 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB)) | 74 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB)) |
@@ -75,6 +83,10 @@ | |||
75 | SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ | 83 | SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ |
76 | } | 84 | } |
77 | 85 | ||
86 | /* Accessor offsets for min, max items in db-minmax types of TLV. */ | ||
87 | #define SNDRV_CTL_TLVO_DB_MINMAX_MIN 2 | ||
88 | #define SNDRV_CTL_TLVO_DB_MINMAX_MAX 3 | ||
89 | |||
78 | /* linear volume between min_dB and max_dB (.01dB unit) */ | 90 | /* linear volume between min_dB and max_dB (.01dB unit) */ |
79 | #define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ | 91 | #define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ |
80 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB)) | 92 | SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB)) |
@@ -83,6 +95,10 @@ | |||
83 | SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ | 95 | SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ |
84 | } | 96 | } |
85 | 97 | ||
98 | /* Accessor offsets for min, max items in db-linear type of TLV. */ | ||
99 | #define SNDRV_CTL_TLVO_DB_LINEAR_MIN 2 | ||
100 | #define SNDRV_CTL_TLVO_DB_LINEAR_MAX 3 | ||
101 | |||
86 | /* dB range container: | 102 | /* dB range container: |
87 | * Items in dB range container must be ordered by their values and by their | 103 | * Items in dB range container must be ordered by their values and by their |
88 | * dB values. This implies that larger values must correspond with larger | 104 | * dB values. This implies that larger values must correspond with larger |