diff options
author | Fabrice Gasnier <fabrice.gasnier@st.com> | 2020-04-23 14:55:54 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-05-25 11:09:39 +0300 |
commit | aba3a8d01d623a5efef48ab8e78752d58d4c90c3 (patch) | |
tree | 94c0c4c190824030aec36c5f7efb4b308a6b25af /drivers/usb/gadget/function/u_serial.h | |
parent | 8c935deacebb8fac8f41378701eb79d12f3c2e2d (diff) | |
download | linux-aba3a8d01d623a5efef48ab8e78752d58d4c90c3.tar.xz |
usb: gadget: u_serial: add suspend resume callbacks
Add suspend resume callbacks to handle the case seen when the bus is
suspended by the HOST, and the device opens the port (cat /dev/ttyGS0).
Gadget controller (like DWC2) doesn't accept usb requests to be queued in
this case (when in L2 state), from the gs_open() call. Error log is printed
- configfs-gadget gadget: acm ttyGS0 can't notify serial state, -11
If the HOST resumes (opens) the bus, the port still isn't functional.
Use suspend/resume callbacks to monitor the gadget suspended state by using
'suspended' flag. In case the port gets opened (cat /dev/ttyGS0), the I/O
stream will be delayed until the bus gets resumed by the HOST.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/function/u_serial.h')
-rw-r--r-- | drivers/usb/gadget/function/u_serial.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/u_serial.h b/drivers/usb/gadget/function/u_serial.h index dbe75b289be6..cadb76eecbc7 100644 --- a/drivers/usb/gadget/function/u_serial.h +++ b/drivers/usb/gadget/function/u_serial.h @@ -68,6 +68,8 @@ ssize_t gserial_get_console(unsigned char port_num, char *page); /* connect/disconnect is handled by individual functions */ int gserial_connect(struct gserial *, u8 port_num); void gserial_disconnect(struct gserial *); +void gserial_suspend(struct gserial *p); +void gserial_resume(struct gserial *p); /* functions are bound to configurations by a config or gadget driver */ int gser_bind_config(struct usb_configuration *c, u8 port_num); |