Commit 3affccdd authored by Fabrice Gasnier's avatar Fabrice Gasnier Committed by Felipe Balbi

usb: gadget: f_acm: add suspend resume callbacks

Add suspend resume callbacks to notify u_serial of the bus suspend/resume
state.
Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent e702a7c3
......@@ -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;
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment