Skip to content

Commit

Permalink
usb: gadget: f_serial: add suspend resume callbacks
Browse files Browse the repository at this point in the history
Add suspend resume callbacks to notify u_serial of the bus suspend/resume
state.

Signed-off-by: Fabrice Gasnier <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
(cherry picked from commit e702a7c)

Change-Id: I8ee0039a7d07045278d6fb6534f94297fb615f9a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/167811
Reviewed-by: CITOOLS <[email protected]>
Reviewed-by: Amelie DELAUNAY <[email protected]>
Reviewed-by: Fabrice GASNIER <[email protected]>
Tested-by: Fabrice GASNIER <[email protected]>
  • Loading branch information
Fabrice Gasnier authored and atorgue committed May 29, 2020
1 parent 79cfd19 commit 982f6f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/usb/gadget/function/f_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ static void gser_unbind(struct usb_configuration *c, struct usb_function *f)
usb_free_all_descriptors(f);
}

static void gser_resume(struct usb_function *f)
{
struct f_gser *gser = func_to_gser(f);

gserial_resume(&gser->port);
}

static void gser_suspend(struct usb_function *f)
{
struct f_gser *gser = func_to_gser(f);

gserial_suspend(&gser->port);
}

static struct usb_function *gser_alloc(struct usb_function_instance *fi)
{
struct f_gser *gser;
Expand All @@ -348,6 +362,8 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi)
gser->port.func.set_alt = gser_set_alt;
gser->port.func.disable = gser_disable;
gser->port.func.free_func = gser_free;
gser->port.func.resume = gser_resume;
gser->port.func.suspend = gser_suspend;

return &gser->port.func;
}
Expand Down

0 comments on commit 982f6f7

Please sign in to comment.