summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2012-05-11 09:00:40 -0700
committerSimone Willett <swillett@nvidia.com>2012-08-16 13:46:18 -0700
commit23d5fe76cdc190682d1ca7cd1db0b4933631779c (patch)
tree028cfe8c5439f8d95e6e9f23fc6fb38a7afe2026 /include
parent03d9e752a0c3df2031fd57d41e59f71eb6209789 (diff)
Add ACCESSORY_SET_AUDIO_MODE control request and ioctl
The control request will be used by the host to enable/disable USB audio and the ioctl will be used by userspace to read the audio mode Bug 1026047 Signed-off-by: Mike Lockwood <lockwood@google.com> (cherry picked from commit 3e1ff6142761eef148c667e540381d1fbc437d4f) Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Change-Id: I5f449de230ca8f44e2dae30a0f87772310b68f20 Reviewed-on: http://git-master/r/123341 Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/f_accessory.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/usb/f_accessory.h b/include/linux/usb/f_accessory.h
index 5b2dcf9728e1..ddb2fd0e88fb 100644
--- a/include/linux/usb/f_accessory.h
+++ b/include/linux/usb/f_accessory.h
@@ -36,13 +36,15 @@
#define ACCESSORY_STRING_URI 4
#define ACCESSORY_STRING_SERIAL 5
-/* Control request for retrieving device's protocol version (currently 1)
+/* Control request for retrieving device's protocol version
*
* requestType: USB_DIR_IN | USB_TYPE_VENDOR
* request: ACCESSORY_GET_PROTOCOL
* value: 0
* index: 0
* data version number (16 bits little endian)
+ * 1 for original accessory support
+ * 2 adds device to host audio support
*/
#define ACCESSORY_GET_PROTOCOL 51
@@ -70,6 +72,17 @@
*/
#define ACCESSORY_START 53
+/* Control request for setting the audio mode.
+ *
+ * requestType: USB_DIR_OUT | USB_TYPE_VENDOR
+ * request: ACCESSORY_SET_AUDIO_MODE
+ * value: 0 - no audio
+ * 1 - device to host, 44100 16-bit stereo PCM
+ * index: 0
+ * data none
+ */
+#define ACCESSORY_SET_AUDIO_MODE 58
+
/* ioctls for retrieving strings set by the host */
#define ACCESSORY_GET_STRING_MANUFACTURER _IOW('M', 1, char[256])
#define ACCESSORY_GET_STRING_MODEL _IOW('M', 2, char[256])
@@ -79,5 +92,7 @@
#define ACCESSORY_GET_STRING_SERIAL _IOW('M', 6, char[256])
/* returns 1 if there is a start request pending */
#define ACCESSORY_IS_START_REQUESTED _IO('M', 7)
+/* returns audio mode (set via the ACCESSORY_SET_AUDIO_MODE control request) */
+#define ACCESSORY_GET_AUDIO_MODE _IO('M', 8)
#endif /* __LINUX_USB_F_ACCESSORY_H */