diff options
| author | Krishna, Vamsi <vskrishn@qualcomm.com> | 2009-02-11 21:07:20 +0530 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2010-09-29 17:49:16 -0700 |
| commit | 01acfb833c9400c07cd25a54406143ff0744cd14 (patch) | |
| tree | e036079803c2b897f7300b5efcd677b54439adc0 /include/linux | |
| parent | 19e2a3e2bad18d2669adc8bd0e81b526a750a66e (diff) | |
USB: gadget: android: android USB gadget improvements:
USB: android gadget: add remote wakeup attribute to android function
Add remote wakeup attribute to configuration descriptor of android
function to advertise remote wakeup capability to host
Acked-by: Allam, Suresh Reddy <sallam@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: android: Allow functions to handle setup requests.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Support for specifying the list of USB functions from platform data.
The main android.c gadget driver no longer has hard coded references
to the mass_storage and adb functions.
Support for computing the product ID based on tables in platform data
and the currently enabled functions.
Moved the adb enable/disable logic from android.c to f_adb.c.
Change-Id: I6259d3fb1473ed973f700e55d17744956f3527bb
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/usb/android.h | 50 | ||||
| -rw-r--r-- | include/linux/usb/android_composite.h | 90 |
2 files changed, 90 insertions, 50 deletions
diff --git a/include/linux/usb/android.h b/include/linux/usb/android.h deleted file mode 100644 index 4e7f419149d8..000000000000 --- a/include/linux/usb/android.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Platform data for Android USB - * - * Copyright (C) 2008 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_ANDROID_H -#define __LINUX_USB_ANDROID_H - -struct android_usb_platform_data { - /* USB device descriptor fields */ - __u16 vendor_id; - - /* Default product ID. */ - __u16 product_id; - - /* Product ID when adb is enabled. */ - __u16 adb_product_id; - - __u16 version; - - char *product_name; - char *manufacturer_name; - char *serial_number; - - /* number of LUNS for mass storage function */ - int nluns; -}; - -/* Platform data for "usb_mass_storage" driver. - * Contains values for the SC_INQUIRY SCSI command. */ -struct usb_mass_storage_platform_data { - char *vendor; - char *product; - int release; -}; - -extern void android_usb_set_connected(int on); - -#endif /* __LINUX_USB_ANDROID_H */ diff --git a/include/linux/usb/android_composite.h b/include/linux/usb/android_composite.h new file mode 100644 index 000000000000..328016813dd5 --- /dev/null +++ b/include/linux/usb/android_composite.h @@ -0,0 +1,90 @@ +/* + * Platform data for Android USB + * + * Copyright (C) 2008 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_ANDROID_H +#define __LINUX_USB_ANDROID_H + +#include <linux/usb/composite.h> + +struct android_usb_function { + struct list_head list; + char *name; + int (*bind_config)(struct usb_configuration *c); +}; + +struct android_usb_product { + /* Default product ID. */ + __u16 product_id; + + /* List of function names associated with this product. + * This is used to compute the USB product ID dynamically + * based on which functions are enabled. + */ + int num_functions; + char **functions; +}; + +struct android_usb_platform_data { + /* USB device descriptor fields */ + __u16 vendor_id; + + /* Default product ID. */ + __u16 product_id; + + __u16 version; + + char *product_name; + char *manufacturer_name; + char *serial_number; + + /* List of available USB products. + * This is used to compute the USB product ID dynamically + * based on which functions are enabled. + * if num_products is zero or no match can be found, + * we use the default product ID + */ + int num_products; + struct android_usb_product *products; + + /* List of all supported USB functions. + * This list is used to define the order in which + * the functions appear in the configuration's list of USB interfaces. + * This is necessary to avoid depending upon the order in which + * the individual function drivers are initialized. + */ + int num_functions; + char **functions; +}; + +/* Platform data for "usb_mass_storage" driver. */ +struct usb_mass_storage_platform_data { + /* Contains values for the SC_INQUIRY SCSI command. */ + char *vendor; + char *product; + int release; + + /* number of LUNS */ + int nluns; +}; + +extern void android_usb_set_connected(int on); + +extern void android_register_function(struct android_usb_function *f); + +extern void android_enable_function(struct usb_function *f, int enable); + + +#endif /* __LINUX_USB_ANDROID_H */ |
