aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPraneeth Bajjuri <praneeth@ti.com>2011-09-26 22:18:47 -0700
committerPraneeth Bajjuri <praneeth@ti.com>2011-09-26 22:20:24 -0700
commit4e07805158d1f71bd67990147d5a0fb78470c126 (patch)
treeb60a553c6af8b78330a05618d96e0b856e51f9d9 /include
parent9eaeb052d7c5d19d33295cb8bdcc670963238c3b (diff)
usb: gadget: android: Update android gadget driver
* Functions and the device descriptor are configured from user space: echo 0 > /sys/class/android_usb/android0/enable echo adb,acm > /sys/class/android_usb/android0/functions echo 2 > /sys/class/android_usb/android0/f_acm/instances echo 1 > /sys/class/android_usb/android0/enable * Driver does not require platform data anymore * Moved function initialization to android.c instead of each function file * Replaced switches by uevents Signed-off-by: Benoit Goby <benoit@android.com> Signed-off-by: Mike Lockwood <lockwood@android.com> Resolve merge conflicts Change-Id: I3ce527b8286da1cfa949305b9283c4fadbff73e6 Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/android_composite.h106
-rw-r--r--include/linux/usb/composite.h21
2 files changed, 0 insertions, 127 deletions
diff --git a/include/linux/usb/android_composite.h b/include/linux/usb/android_composite.h
deleted file mode 100644
index 7f9000711f4..00000000000
--- a/include/linux/usb/android_composite.h
+++ /dev/null
@@ -1,106 +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
-
-#include <linux/usb/composite.h>
-#include <linux/if_ether.h>
-
-struct android_usb_function {
- struct list_head list;
- char *name;
- int (*bind_config)(struct usb_configuration *c);
-};
-
-struct android_usb_product {
- /* Vendor ID for this set of functions.
- * Default vendor_id in platform data will be used if this is zero.
- */
- __u16 vendor_id;
-
- /* Product ID for this set of functions. */
- __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;
-};
-
-/* Platform data for USB ethernet driver. */
-struct usb_ether_platform_data {
- u8 ethaddr[ETH_ALEN];
- u32 vendorID;
- const char *vendorDescr;
-};
-
-/* Platform data for ACM driver. */
-struct acm_platform_data {
- u8 num_inst;
-};
-
-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 */
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index cb65fa2c016..6938a8608cf 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -36,7 +36,6 @@
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
-#include <linux/switch.h>
/*
* USB function drivers should return USB_GADGET_DELAYED_STATUS if they
@@ -47,7 +46,6 @@
*/
#define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */
-struct usb_composite_dev;
struct usb_configuration;
/**
@@ -119,7 +117,6 @@ struct usb_function {
struct usb_descriptor_header **ss_descriptors;
struct usb_configuration *config;
- int disabled;
/* REVISIT: bind() functions can be marked __init, which
* makes trouble for section mismatch analysis. See if
@@ -152,7 +149,6 @@ struct usb_function {
/* internals */
struct list_head list;
DECLARE_BITMAP(endpoints, 32);
- struct device *dev;
};
int usb_add_function(struct usb_configuration *, struct usb_function *);
@@ -167,9 +163,6 @@ int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f,
#define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */
-void usb_function_set_enabled(struct usb_function *, int);
-void usb_composite_force_reset(struct usb_composite_dev *);
-
/**
* struct usb_configuration - represents one gadget configuration
* @label: For diagnostics, describes the configuration.
@@ -295,9 +288,6 @@ struct usb_composite_driver {
enum usb_device_speed max_speed;
unsigned needs_serial:1;
- struct class *class;
- atomic_t function_count;
-
int (*unbind)(struct usb_composite_dev *);
void (*disconnect)(struct usb_composite_dev *);
@@ -305,8 +295,6 @@ struct usb_composite_driver {
/* global suspend hooks */
void (*suspend)(struct usb_composite_dev *);
void (*resume)(struct usb_composite_dev *);
-
- void (*enable_function)(struct usb_function *f, int enable);
};
extern int usb_composite_probe(struct usb_composite_driver *driver,
@@ -377,15 +365,6 @@ struct usb_composite_dev {
/* protects deactivations and delayed_status counts*/
spinlock_t lock;
-
- /* switch indicating connected/disconnected state */
- struct switch_dev sw_connected;
- /* switch indicating current configuration */
- struct switch_dev sw_config;
- /* current connected state for sw_connected */
- bool connected;
-
- struct work_struct switch_work;
};
extern int usb_string_id(struct usb_composite_dev *c);