summaryrefslogtreecommitdiff
path: root/include/linux/usb/audio-v3.h
diff options
context:
space:
mode:
authorAjay Agarwal <ajaya@codeaurora.org>2017-02-07 16:40:09 +0530
committerAjay Agarwal <ajaya@codeaurora.org>2017-04-10 16:14:02 +0530
commit2ecedf5dc75bc770ec09bd2238e798063aeafc4b (patch)
treea2a1beeb2a75fb5c1eb2ffc5b5d66b6aaaebf10a /include/linux/usb/audio-v3.h
parent664cdd33f956accabebd29edba6c220b1580744d (diff)
sound: usb: Add support for parsing AudioStreaming intf for BADD devices
BADD(Basic Audio Device Definition) is a subset of UAC3 specifications. It defines standard profiles which provide specific attributes of class descriptors. BADD audio device provides profile id and BADD supporting host will infer attributes from profile-id. Currently USB Audio Host driver has support for UAC1 and UAC2 devices. To handle BADD 3.0 devices, AudioControl and AudioStreaming Interfaces have to be properly parsed. The Host has to derive all class-specific information based on the profile ID that the device exposes. Add support for parsing the AudioStreaming interfaces exposed by the device. Change-Id: I726bbb735708fe8e395011c7228a73d5f65c092d Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Diffstat (limited to 'include/linux/usb/audio-v3.h')
-rw-r--r--include/linux/usb/audio-v3.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/include/linux/usb/audio-v3.h b/include/linux/usb/audio-v3.h
new file mode 100644
index 000000000000..04adabf5648d
--- /dev/null
+++ b/include/linux/usb/audio-v3.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for Audio Devices in version 3.0.
+ * Comments below reference relevant sections of the documents contained
+ * in http://www.usb.org/developers/docs/devclass_docs/USB_Audio_v3.0.zip
+ */
+
+#ifndef __LINUX_USB_AUDIO_V3_H
+#define __LINUX_USB_AUDIO_V3_H
+
+#include <linux/types.h>
+
+#define BADD_MAXPSIZE_SYNC_MONO_16 0x0060
+#define BADD_MAXPSIZE_SYNC_MONO_24 0x0090
+#define BADD_MAXPSIZE_SYNC_STEREO_16 0x00c0
+#define BADD_MAXPSIZE_SYNC_STEREO_24 0x0120
+
+#define BADD_MAXPSIZE_ASYNC_MONO_16 0x0062
+#define BADD_MAXPSIZE_ASYNC_MONO_24 0x0093
+#define BADD_MAXPSIZE_ASYNC_STEREO_16 0x00c4
+#define BADD_MAXPSIZE_ASYNC_STEREO_24 0x0126
+
+#define BIT_RES_16_BIT 0x10
+#define BIT_RES_24_BIT 0x18
+
+#define SUBSLOTSIZE_16_BIT 0x02
+#define SUBSLOTSIZE_24_BIT 0x03
+
+#define BADD_SAMPLING_RATE 48000
+
+#define NUM_CHANNELS_MONO 1
+#define NUM_CHANNELS_STEREO 2
+#define BADD_CH_CONFIG_MONO 0
+#define BADD_CH_CONFIG_STEREO 3
+
+#define FULL_ADC_PROFILE 0x01
+
+/* BADD Profile IDs */
+#define PROF_GENERIC_IO 0x20
+#define PROF_HEADPHONE 0x21
+#define PROF_SPEAKER 0x22
+#define PROF_MICROPHONE 0x23
+#define PROF_HEADSET 0x24
+#define PROF_HEADSET_ADAPTER 0x25
+#define PROF_SPEAKERPHONE 0x26
+
+/* BADD Entity IDs */
+#define BADD_OUT_TERM_ID_BAOF 0x03
+#define BADD_OUT_TERM_ID_BAIF 0x06
+#define BADD_IN_TERM_ID_BAOF 0x01
+#define BADD_IN_TERM_ID_BAIF 0x04
+#define BADD_FU_ID_BAOF 0x02
+#define BADD_FU_ID_BAIF 0x05
+#define BADD_CLOCK_SOURCE 0x09
+#define BADD_FU_ID_BAIOF 0x07
+#define BADD_MU_ID_BAIOF 0x08
+
+#define UAC_BIDIR_TERMINAL_HEADSET 0x0402
+#define UAC_BIDIR_TERMINAL_SPEAKERPHONE 0x0403
+
+#endif /* __LINUX_USB_AUDIO_V3_H */