From f48cf80f93ba974eb3201ab2d0f2c4cef950f3fc Mon Sep 17 00:00:00 2001 From: Fabien Chouteau Date: Fri, 23 Apr 2010 14:21:26 +0200 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- include/linux/usb/gadget.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/usb/gadget.h') diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index f4b7ca516cdd..db6141cdb77b 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) { dev_set_drvdata(&gadget->dev, data); } static inline void *get_gadget_data(struct usb_gadget *gadget) { return dev_get_drvdata(&gadget->dev); } +static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) +{ + return container_of(dev, struct usb_gadget, dev); +} /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ #define gadget_for_each_ep(tmp,gadget) \ -- cgit v1.2.3