blob: 328016813dd5287c11fe7036b5ac5bc6f7fb49f7 [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>
21
22struct android_usb_function {
23 struct list_head list;
24 char *name;
25 int (*bind_config)(struct usb_configuration *c);
26};
27
28struct android_usb_product {
29 /* Default product ID. */
30 __u16 product_id;
31
32 /* List of function names associated with this product.
33 * This is used to compute the USB product ID dynamically
34 * based on which functions are enabled.
35 */
36 int num_functions;
37 char **functions;
38};
39
40struct android_usb_platform_data {
41 /* USB device descriptor fields */
42 __u16 vendor_id;
43
44 /* Default product ID. */
45 __u16 product_id;
46
47 __u16 version;
48
49 char *product_name;
50 char *manufacturer_name;
51 char *serial_number;
52
53 /* List of available USB products.
54 * This is used to compute the USB product ID dynamically
55 * based on which functions are enabled.
56 * if num_products is zero or no match can be found,
57 * we use the default product ID
58 */
59 int num_products;
60 struct android_usb_product *products;
61
62 /* List of all supported USB functions.
63 * This list is used to define the order in which
64 * the functions appear in the configuration's list of USB interfaces.
65 * This is necessary to avoid depending upon the order in which
66 * the individual function drivers are initialized.
67 */
68 int num_functions;
69 char **functions;
70};
71
72/* Platform data for "usb_mass_storage" driver. */
73struct usb_mass_storage_platform_data {
74 /* Contains values for the SC_INQUIRY SCSI command. */
75 char *vendor;
76 char *product;
77 int release;
78
79 /* number of LUNS */
80 int nluns;
81};
82
83extern void android_usb_set_connected(int on);
84
85extern void android_register_function(struct android_usb_function *f);
86
87extern void android_enable_function(struct usb_function *f, int enable);
88
89
90#endif /* __LINUX_USB_ANDROID_H */