2 * Platform data for Android USB
4 * Copyright (C) 2008 Google, Inc.
5 * Author: Mike Lockwood <lockwood@android.com>
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef __LINUX_USB_ANDROID_H
18 #define __LINUX_USB_ANDROID_H
20 #include <linux/usb/composite.h>
21 #include <linux/if_ether.h>
23 struct android_usb_function {
24 struct list_head list;
26 int (*bind_config)(struct usb_configuration *c);
27 #ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE_ADVANCED
28 int (*bind_upper_config)(struct usb_composite_dev *cdev);
32 struct android_usb_product {
33 /* Default product ID. */
36 /* List of function names associated with this product.
37 * This is used to compute the USB product ID dynamically
38 * based on which functions are enabled.
42 #ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
45 /* soonyong.cho : Below variables are used for Samsung composite framework. */
49 int mode; /* if product id is same, you have to refer this mode value. */
53 struct android_usb_platform_data {
54 /* USB device descriptor fields */
57 /* Default product ID. */
63 char *manufacturer_name;
66 /* List of available USB products.
67 * This is used to compute the USB product ID dynamically
68 * based on which functions are enabled.
69 * if num_products is zero or no match can be found,
70 * we use the default product ID
73 struct android_usb_product *products;
75 /* List of all supported USB functions.
76 * This list is used to define the order in which
77 * the functions appear in the configuration's list of USB interfaces.
78 * This is necessary to avoid depending upon the order in which
79 * the individual function drivers are initialized.
85 /* Platform data for "usb_mass_storage" driver. */
86 struct usb_mass_storage_platform_data {
87 /* Contains values for the SC_INQUIRY SCSI command. */
96 /* Platform data for USB ethernet driver. */
97 struct usb_ether_platform_data {
100 const char *vendorDescr;
103 extern void android_register_function(struct android_usb_function *f);
105 extern void android_enable_function(struct usb_function *f, int enable);
108 #endif /* __LINUX_USB_ANDROID_H */