aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-01-28 03:32:24 -0500
committerFelipe Balbi <balbi@ti.com>2015-01-29 11:32:21 -0500
commit80b2502cea34a965a6b3390691854e753945ca5f (patch)
tree7aa8d93d10a221003a7c802ca75b8a29638a57e9
parent5c7b3b02de766a8634708953e805399e3544a290 (diff)
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: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--include/linux/usb/gadget.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 70ddb3943b62..e2f00fd8cd47 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -523,6 +523,7 @@ struct usb_gadget_ops {
523 * enabled HNP support. 523 * enabled HNP support.
524 * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to 524 * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to
525 * MaxPacketSize. 525 * MaxPacketSize.
526 * @is_selfpowered: if the gadget is self-powered.
526 * 527 *
527 * Gadgets have a mostly-portable "gadget driver" implementing device 528 * Gadgets have a mostly-portable "gadget driver" implementing device
528 * functions, handling all usb configurations and interfaces. Gadget 529 * functions, handling all usb configurations and interfaces. Gadget
@@ -563,6 +564,7 @@ struct usb_gadget {
563 unsigned a_hnp_support:1; 564 unsigned a_hnp_support:1;
564 unsigned a_alt_hnp_support:1; 565 unsigned a_alt_hnp_support:1;
565 unsigned quirk_ep_out_aligned_size:1; 566 unsigned quirk_ep_out_aligned_size:1;
567 unsigned is_selfpowered:1;
566}; 568};
567#define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) 569#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))
568 570