Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80b2502c authored by Peter Chen's avatar Peter Chen Committed by Felipe Balbi
Browse files

usb: gadget: introduce is_selfpowered for usb_gadget



Whether the gadget is selfpowerwed or not can be determined by composite
core, so we can use a common entry to indicate if the self-powered
is supported by gadget, and the related private variable at individual
udc driver can be deleted.

Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 5c7b3b02
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -523,6 +523,7 @@ struct usb_gadget_ops {
 *	enabled HNP support.
 * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to
 *	MaxPacketSize.
 * @is_selfpowered: if the gadget is self-powered.
 *
 * Gadgets have a mostly-portable "gadget driver" implementing device
 * functions, handling all usb configurations and interfaces.  Gadget
@@ -563,6 +564,7 @@ struct usb_gadget {
	unsigned			a_hnp_support:1;
	unsigned			a_alt_hnp_support:1;
	unsigned			quirk_ep_out_aligned_size:1;
	unsigned			is_selfpowered:1;
};
#define work_to_gadget(w)	(container_of((w), struct usb_gadget, work))