aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorFabien Chouteau <fabien.chouteau@barco.com>2010-04-23 08:21:26 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:39 -0400
commitf48cf80f93ba974eb3201ab2d0f2c4cef950f3fc (patch)
treea90ec04a891d1698110372791d01a03d90c6da3f /include/linux/usb
parent326b4810cc995209e31136af4202ed0414814ed5 (diff)
USB: Composite framework: Add suspended sysfs entry
This patch adds a sysfs entry (/sys/devices/platform/_UDC_/gadget/suspended) to show the suspend state of an USB composite gadget. Signed-off-by: Fabien Chouteau <fabien.chouteau@barco.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/composite.h1
-rw-r--r--include/linux/usb/gadget.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 738ea1a691c..139353efad3 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -326,6 +326,7 @@ struct usb_composite_dev {
326 326
327 /* private: */ 327 /* private: */
328 /* internals */ 328 /* internals */
329 unsigned int suspended:1;
329 struct usb_device_descriptor desc; 330 struct usb_device_descriptor desc;
330 struct list_head configs; 331 struct list_head configs;
331 struct usb_composite_driver *driver; 332 struct usb_composite_driver *driver;
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index f4b7ca516cd..db6141cdb77 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -494,6 +494,10 @@ static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
494 { dev_set_drvdata(&gadget->dev, data); } 494 { dev_set_drvdata(&gadget->dev, data); }
495static inline void *get_gadget_data(struct usb_gadget *gadget) 495static inline void *get_gadget_data(struct usb_gadget *gadget)
496 { return dev_get_drvdata(&gadget->dev); } 496 { return dev_get_drvdata(&gadget->dev); }
497static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
498{
499 return container_of(dev, struct usb_gadget, dev);
500}
497 501
498/* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ 502/* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
499#define gadget_for_each_ep(tmp,gadget) \ 503#define gadget_for_each_ep(tmp,gadget) \