summaryrefslogtreecommitdiff
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 617068134ae8..f491e48b21e6 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -36,8 +36,10 @@
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
+#include <linux/switch.h>
+struct usb_composite_dev;
struct usb_configuration;
/**
@@ -101,6 +103,9 @@ struct usb_function {
struct usb_configuration *config;
+ /* disabled is zero if the function is enabled */
+ int disabled;
+
/* REVISIT: bind() functions can be marked __init, which
* makes trouble for section mismatch analysis. See if
* we can't restructure things to avoid mismatching.
@@ -128,6 +133,7 @@ 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 *);
@@ -137,6 +143,9 @@ int usb_function_activate(struct usb_function *);
int usb_interface_id(struct usb_configuration *, struct usb_function *);
+void usb_function_set_enabled(struct usb_function *, int);
+void usb_composite_force_reset(struct usb_composite_dev *);
+
/**
* ep_choose - select descriptor endpoint at current device speed
* @g: gadget, connected and running at some speed
@@ -269,6 +278,9 @@ struct usb_composite_driver {
const struct usb_device_descriptor *dev;
struct usb_gadget_strings **strings;
+ struct class *class;
+ atomic_t function_count;
+
/* REVISIT: bind() functions can be marked __init, which
* makes trouble for section mismatch analysis. See if
* we can't restructure things to avoid mismatching...
@@ -282,6 +294,8 @@ 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_register(struct usb_composite_driver *);
@@ -342,6 +356,11 @@ struct usb_composite_dev {
/* protects at least deactivation count */
spinlock_t lock;
+
+ struct switch_dev sdev;
+ /* used by usb_composite_force_reset to avoid signalling switch changes */
+ bool mute_switch;
+ struct work_struct switch_work;
};
extern int usb_string_id(struct usb_composite_dev *c);