blob: 7f9000711f4e3e2001ce46cab5b39afaa6b27ac2 [file] [log] [blame]
Krishna, Vamsi83814ea2009-02-11 21:07:20 +05301/*
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>
Mike Lockwood0d511c42010-03-10 17:05:03 -050021#include <linux/if_ether.h>
Krishna, Vamsi83814ea2009-02-11 21:07:20 +053022
23struct android_usb_function {
24 struct list_head list;
25 char *name;
26 int (*bind_config)(struct usb_configuration *c);
27};
28
29struct android_usb_product {
Mike Lockwoodaecca432011-02-09 09:38:26 -050030 /* Vendor ID for this set of functions.
31 * Default vendor_id in platform data will be used if this is zero.
32 */
33 __u16 vendor_id;
34
35 /* Product ID for this set of functions. */
Krishna, Vamsi83814ea2009-02-11 21:07:20 +053036 __u16 product_id;
37
38 /* List of function names associated with this product.
39 * This is used to compute the USB product ID dynamically
40 * based on which functions are enabled.
41 */
42 int num_functions;
43 char **functions;
44};
45
46struct android_usb_platform_data {
47 /* USB device descriptor fields */
48 __u16 vendor_id;
49
50 /* Default product ID. */
51 __u16 product_id;
52
53 __u16 version;
54
55 char *product_name;
56 char *manufacturer_name;
57 char *serial_number;
58
59 /* List of available USB products.
60 * This is used to compute the USB product ID dynamically
61 * based on which functions are enabled.
62 * if num_products is zero or no match can be found,
63 * we use the default product ID
64 */
65 int num_products;
66 struct android_usb_product *products;
67
68 /* List of all supported USB functions.
69 * This list is used to define the order in which
70 * the functions appear in the configuration's list of USB interfaces.
71 * This is necessary to avoid depending upon the order in which
72 * the individual function drivers are initialized.
73 */
74 int num_functions;
75 char **functions;
76};
77
78/* Platform data for "usb_mass_storage" driver. */
79struct usb_mass_storage_platform_data {
80 /* Contains values for the SC_INQUIRY SCSI command. */
81 char *vendor;
82 char *product;
83 int release;
84
85 /* number of LUNS */
86 int nluns;
87};
88
Mike Lockwood0d511c42010-03-10 17:05:03 -050089/* Platform data for USB ethernet driver. */
90struct usb_ether_platform_data {
91 u8 ethaddr[ETH_ALEN];
92 u32 vendorID;
93 const char *vendorDescr;
94};
95
John Michelau677ba872010-11-08 18:05:37 -060096/* Platform data for ACM driver. */
97struct acm_platform_data {
98 u8 num_inst;
99};
100
Krishna, Vamsi83814ea2009-02-11 21:07:20 +0530101extern void android_register_function(struct android_usb_function *f);
102
103extern void android_enable_function(struct usb_function *f, int enable);
104
105
106#endif /* __LINUX_USB_ANDROID_H */