upload tizen1.0 source
[kernel/linux-2.6.36.git] / include / linux / usb / android_composite.h
1 /*
2  * Platform data for Android USB
3  *
4  * Copyright (C) 2008 Google, Inc.
5  * Author: Mike Lockwood <lockwood@android.com>
6  *
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.
10  *
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.
15  *
16  */
17 #ifndef __LINUX_USB_ANDROID_H
18 #define __LINUX_USB_ANDROID_H
19
20 #include <linux/usb/composite.h>
21 #include <linux/if_ether.h>
22
23 struct android_usb_function {
24         struct list_head        list;
25         char                    *name;
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);
29 #endif
30 };
31
32 struct android_usb_product {
33         /* Default product ID. */
34         __u16 product_id;
35
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.
39          */
40         int num_functions;
41         char **functions;
42 #ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
43         int se_num_functions;
44         char **se_functions;
45 /* soonyong.cho : Below variables are used for Samsung composite framework. */
46         __u8 bDeviceClass;
47         __u8 bDeviceSubClass;
48         __u8 bDeviceProtocol;
49         int  mode; /* if product id is same, you have to refer this mode value. */
50 #endif
51 };
52
53 struct android_usb_platform_data {
54         /* USB device descriptor fields */
55         __u16 vendor_id;
56
57         /* Default product ID. */
58         __u16 product_id;
59
60         __u16 version;
61
62         char *product_name;
63         char *manufacturer_name;
64         char *serial_number;
65
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
71          */
72         int num_products;
73         struct android_usb_product *products;
74
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.
80          */
81         int num_functions;
82         char **functions;
83 };
84
85 /* Platform data for "usb_mass_storage" driver. */
86 struct usb_mass_storage_platform_data {
87         /* Contains values for the SC_INQUIRY SCSI command. */
88         char *vendor;
89         char *product;
90         int release;
91
92         /* number of LUNS */
93         int nluns;
94 };
95
96 /* Platform data for USB ethernet driver. */
97 struct usb_ether_platform_data {
98         u8      ethaddr[ETH_ALEN];
99         u32     vendorID;
100         const char *vendorDescr;
101 };
102
103 extern void android_register_function(struct android_usb_function *f);
104
105 extern void android_enable_function(struct usb_function *f, int enable);
106
107
108 #endif  /* __LINUX_USB_ANDROID_H */