mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
7010f5b94f
commit
4eec44d84f
1 changed files with 6 additions and 0 deletions
|
@ -411,6 +411,7 @@ struct usb_gadget_ops {
|
|||
|
||||
struct device {
|
||||
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)
|
|||
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 */
|
||||
#define gadget_for_each_ep(tmp, gadget) \
|
||||
list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
|
||||
|
|
Loading…
Reference in a new issue