Skip to content

Commit

Permalink
usb: gadget: f_acm: 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 3affccd)

Change-Id: I3519dd834a246fafe0162f6c0d8eeae89211f136
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/167812
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 982f6f7 commit 4a2f297
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/usb/gadget/function/f_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,20 @@ static void acm_free_func(struct usb_function *f)
kfree(acm);
}

static void acm_resume(struct usb_function *f)
{
struct f_acm *acm = func_to_acm(f);

gserial_resume(&acm->port);
}

static void acm_suspend(struct usb_function *f)
{
struct f_acm *acm = func_to_acm(f);

gserial_suspend(&acm->port);
}

static struct usb_function *acm_alloc_func(struct usb_function_instance *fi)
{
struct f_serial_opts *opts;
Expand Down Expand Up @@ -750,6 +764,8 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi)
acm->port_num = opts->port_num;
acm->port.func.unbind = acm_unbind;
acm->port.func.free_func = acm_free_func;
acm->port.func.resume = acm_resume;
acm->port.func.suspend = acm_suspend;

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

0 comments on commit 4a2f297

Please sign in to comment.