aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-06-28 09:33:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-28 14:12:51 -0400
commit2ccea03a8f7ec93641791f2760d7cdc6cab6205f (patch)
tree2bdc0eae68d899420769584d64fa8282dfe1424b /include/linux/usb
parent664a51a81f6ba39db30cd7b7de61577ca0b2d20d (diff)
usb: gadget: introduce UDC Class
this class will be used to abstract away several of the duplicated operations scattered among the USB gadget controller drivers. Later, we can add an atomic notifier to tell interested drivers about what's happening with the controller. Notifications such as suspend, resume, enumerated, etc. will be useful, at a minimum, for implementing usb charger detection. As part of the converting process usb_gadget_probe_driver() is no longer part of each udc but pushed into the ->stap() callback. The same for his couterpart. The core is currently set explicit to 'n'. It will be changed to 'y' once all users are converted since it provides functions which clash with other drivers. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 55d1a88ff11f..18979cfb6d66 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -418,6 +418,7 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
418/*-------------------------------------------------------------------------*/ 418/*-------------------------------------------------------------------------*/
419 419
420struct usb_gadget; 420struct usb_gadget;
421struct usb_gadget_driver;
421 422
422/* the rest of the api to the controller hardware: device operations, 423/* the rest of the api to the controller hardware: device operations,
423 * which don't involve endpoints (or i/o). 424 * which don't involve endpoints (or i/o).
@@ -431,6 +432,9 @@ struct usb_gadget_ops {
431 int (*pullup) (struct usb_gadget *, int is_on); 432 int (*pullup) (struct usb_gadget *, int is_on);
432 int (*ioctl)(struct usb_gadget *, 433 int (*ioctl)(struct usb_gadget *,
433 unsigned code, unsigned long param); 434 unsigned code, unsigned long param);
435 int (*start)(struct usb_gadget_driver *,
436 int (*bind)(struct usb_gadget *));
437 int (*stop)(struct usb_gadget_driver *);
434}; 438};
435 439
436/** 440/**
@@ -822,6 +826,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
822 */ 826 */
823int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 827int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
824 828
829extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
830extern void usb_del_gadget_udc(struct usb_gadget *gadget);
831
825/*-------------------------------------------------------------------------*/ 832/*-------------------------------------------------------------------------*/
826 833
827/* utility to simplify dealing with string descriptors */ 834/* utility to simplify dealing with string descriptors */