Skip to content
Snippets Groups Projects
Commit 4eec44d8 authored by Łukasz Majewski's avatar Łukasz Majewski Committed by Marek Vasut
Browse files

usb:gadget:composite: Support for composite at gadget.h


Add device data pointer to the USB gadget's device struct.
Wrapper for extracting usb_gadget from Linux's usb device

Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
parent 7010f5b9
No related branches found
No related tags found
No related merge requests found
...@@ -411,6 +411,7 @@ struct usb_gadget_ops { ...@@ -411,6 +411,7 @@ struct usb_gadget_ops {
struct device { struct device {
void *driver_data; /* data private to the driver */ void *driver_data; /* data private to the driver */
void *device_data; /* data private to the device */
}; };
/** /**
...@@ -481,6 +482,11 @@ static inline void *get_gadget_data(struct usb_gadget *gadget) ...@@ -481,6 +482,11 @@ static inline void *get_gadget_data(struct usb_gadget *gadget)
return gadget->dev.driver_data; return gadget->dev.driver_data;
} }
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 */ /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
#define gadget_for_each_ep(tmp, gadget) \ #define gadget_for_each_ep(tmp, gadget) \
list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment