From 2ccea03a8f7ec93641791f2760d7cdc6cab6205f Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Tue, 28 Jun 2011 16:33:46 +0300 Subject: 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 Signed-off-by: Sebastian Andrzej Siewior Acked-by: Michal Nazarewicz Signed-off-by: Greg Kroah-Hartman --- include/linux/usb/gadget.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/usb') diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 55d1a88ff11..18979cfb6d6 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) /*-------------------------------------------------------------------------*/ struct usb_gadget; +struct usb_gadget_driver; /* the rest of the api to the controller hardware: device operations, * which don't involve endpoints (or i/o). @@ -431,6 +432,9 @@ struct usb_gadget_ops { int (*pullup) (struct usb_gadget *, int is_on); int (*ioctl)(struct usb_gadget *, unsigned code, unsigned long param); + int (*start)(struct usb_gadget_driver *, + int (*bind)(struct usb_gadget *)); + int (*stop)(struct usb_gadget_driver *); }; /** @@ -822,6 +826,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, */ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); +extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); +extern void usb_del_gadget_udc(struct usb_gadget *gadget); + /*-------------------------------------------------------------------------*/ /* utility to simplify dealing with string descriptors */ -- cgit v1.2.3-70-g09d2