diff options
author | Mike Lockwood <lockwood@android.com> | 2011-02-02 11:52:56 -0500 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-06-03 14:36:33 -0700 |
commit | 3fd2d736484e72e329f238299bdaa1c20c1e2055 (patch) | |
tree | 0a8339ae3db9ef48d8d32e823f4e7a1e45f72033 /include | |
parent | 06e9c673c5a1fc0b876902721eb4a97a49cf9975 (diff) |
USB: gadget: f_accessory: New gadget driver for android USB accesories
(cherry picked from commit 20368beb29603300a351a443119b51df3bf3c7a4)
Change-Id: I93f56ecb0dab049a6d4cc8e13907c45079c73c99
Reviewed-on: http://git-master/r/34670
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/f_accessory.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/linux/usb/f_accessory.h b/include/linux/usb/f_accessory.h new file mode 100644 index 000000000000..474f12eb0181 --- /dev/null +++ b/include/linux/usb/f_accessory.h @@ -0,0 +1,59 @@ +/* + * Gadget Function Driver for Android USB accessories + * + * Copyright (C) 2011 Google, Inc. + * Author: Mike Lockwood <lockwood@android.com> + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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. + * + */ + +#ifndef __LINUX_USB_F_ACCESSORY_H +#define __LINUX_USB_F_ACCESSORY_H + +/* Use Google Vendor ID when in accessory mode */ +#define USB_ACCESSORY_VENDOR_ID 0x18D1 + + +/* Product ID to use when in accessory mode */ +#define USB_ACCESSORY_PRODUCT_ID 0x2D00 + +/* Product ID to use when in accessory mode and adb is enabled */ +#define USB_ACCESSORY_ADB_PRODUCT_ID 0x2D01 + +/* + * Indexes for strings sent by the host to identify the accessory. + * The host sends these as vendor requests: + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_SEND_STRING + * value: 0 + * index: string ID + * data zero terminated UTF8 string + * + * The device can later retrieve these strings via the + * ACCESSORY_GET_STRING_* ioctls + */ +#define ACCESSORY_STRING_MANUFACTURER 0 +#define ACCESSORY_STRING_MODEL 1 +#define ACCESSORY_STRING_TYPE 2 +#define ACCESSORY_STRING_VERSION 3 + +/* control requests */ +#define ACCESSORY_SEND_STRING 52 +#define ACCESSORY_START 53 + +/* Sends an event to the accessory via the interrupt endpoint */ +#define ACCESSORY_GET_STRING_MANUFACTURER _IOW('M', 1, char[256]) +#define ACCESSORY_GET_STRING_MODEL _IOW('M', 2, char[256]) +#define ACCESSORY_GET_STRING_TYPE _IOW('M', 3, char[256]) +#define ACCESSORY_GET_STRING_VERSION _IOW('M', 4, char[256]) + +#endif /* __LINUX_USB_F_ACCESSORY_H */ |