提交 3a571870 编写于 作者: A Andrzej Pietrasiewicz 提交者: Felipe Balbi

usb: gadget: configfs: add suspend/resume

USB gadgets composed with configfs lack suspend and resume
methods. This patch uses composite_suspend()/composite_resume()
the same way e.g. composite_setup() or composite_disconnect()
are used in a configfs-based gadget.
Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 60b388be
...@@ -2064,8 +2064,7 @@ static int composite_bind(struct usb_gadget *gadget, ...@@ -2064,8 +2064,7 @@ static int composite_bind(struct usb_gadget *gadget,
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void void composite_suspend(struct usb_gadget *gadget)
composite_suspend(struct usb_gadget *gadget)
{ {
struct usb_composite_dev *cdev = get_gadget_data(gadget); struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_function *f; struct usb_function *f;
...@@ -2088,8 +2087,7 @@ composite_suspend(struct usb_gadget *gadget) ...@@ -2088,8 +2087,7 @@ composite_suspend(struct usb_gadget *gadget)
usb_gadget_vbus_draw(gadget, 2); usb_gadget_vbus_draw(gadget, 2);
} }
static void void composite_resume(struct usb_gadget *gadget)
composite_resume(struct usb_gadget *gadget)
{ {
struct usb_composite_dev *cdev = get_gadget_data(gadget); struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_function *f; struct usb_function *f;
......
...@@ -1453,6 +1453,9 @@ static const struct usb_gadget_driver configfs_driver_template = { ...@@ -1453,6 +1453,9 @@ static const struct usb_gadget_driver configfs_driver_template = {
.reset = composite_disconnect, .reset = composite_disconnect,
.disconnect = composite_disconnect, .disconnect = composite_disconnect,
.suspend = composite_suspend,
.resume = composite_resume,
.max_speed = USB_SPEED_SUPER, .max_speed = USB_SPEED_SUPER,
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -506,6 +506,8 @@ extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); ...@@ -506,6 +506,8 @@ extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n);
extern void composite_disconnect(struct usb_gadget *gadget); extern void composite_disconnect(struct usb_gadget *gadget);
extern int composite_setup(struct usb_gadget *gadget, extern int composite_setup(struct usb_gadget *gadget,
const struct usb_ctrlrequest *ctrl); const struct usb_ctrlrequest *ctrl);
extern void composite_suspend(struct usb_gadget *gadget);
extern void composite_resume(struct usb_gadget *gadget);
/* /*
* Some systems will need runtime overrides for the product identifiers * Some systems will need runtime overrides for the product identifiers
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册