mirror of https://gitee.com/openkylin/linux.git
USB: gadget: composite: added disconnect callback
Added a disconnect() callback to composite devices which is called by composite glue when its disconnect callback is called by gadget. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c7ba692294
commit
3f3e12d050
|
@ -956,6 +956,8 @@ static void composite_disconnect(struct usb_gadget *gadget)
|
|||
spin_lock_irqsave(&cdev->lock, flags);
|
||||
if (cdev->config)
|
||||
reset_config(cdev);
|
||||
if (composite->disconnect)
|
||||
composite->disconnect(cdev);
|
||||
spin_unlock_irqrestore(&cdev->lock, flags);
|
||||
}
|
||||
|
||||
|
|
|
@ -276,6 +276,8 @@ struct usb_composite_driver {
|
|||
int (*bind)(struct usb_composite_dev *);
|
||||
int (*unbind)(struct usb_composite_dev *);
|
||||
|
||||
void (*disconnect)(struct usb_composite_dev *);
|
||||
|
||||
/* global suspend hooks */
|
||||
void (*suspend)(struct usb_composite_dev *);
|
||||
void (*resume)(struct usb_composite_dev *);
|
||||
|
|
Loading…
Reference in New Issue