[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1587642956-8157-4-git-send-email-fabrice.gasnier@st.com>
Date: Thu, 23 Apr 2020 13:55:55 +0200
From: Fabrice Gasnier <fabrice.gasnier@...com>
To: <hminas@...opsys.com>, <gregkh@...uxfoundation.org>,
<balbi@...nel.org>
CC: <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<amelie.delaunay@...com>, <fabrice.gasnier@...com>
Subject: [PATCH v2 3/4] usb: gadget: f_serial: add suspend resume callbacks
Add suspend resume callbacks to notify u_serial of the bus suspend/resume
state.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@...com>
---
drivers/usb/gadget/function/f_serial.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/usb/gadget/function/f_serial.c b/drivers/usb/gadget/function/f_serial.c
index 1406255..e627138 100644
--- a/drivers/usb/gadget/function/f_serial.c
+++ b/drivers/usb/gadget/function/f_serial.c
@@ -348,6 +348,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;
@@ -369,6 +383,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;
}
--
2.7.4
Powered by blists - more mailing lists