mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
usb: gadget: Send BRK signal to host on flow disable ioctl
Currently in f_cdev driver, we are not handling the TIOCM_CTS signal generared by SIO_IOCTL_INBOUND_FLOW IOCTL. Hence we are not able to send BRK signal to the host and it keeps sending data leading to data loss. Fix this by handling TIOCM_CTS in the driver. Change-Id: If8e4774e3e0772cb7189f3400d7e53e258b7d5a3 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org> Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
This commit is contained in:
parent
4d8eb15487
commit
5fa858f5d4
1 changed files with 15 additions and 0 deletions
|
|
@ -1382,6 +1382,9 @@ static int f_cdev_tiocmget(struct f_cdev *port)
|
|||
|
||||
if (cser->serial_state & TIOCM_DSR)
|
||||
result |= TIOCM_DSR;
|
||||
|
||||
if (cser->serial_state & TIOCM_CTS)
|
||||
result |= TIOCM_CTS;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -1428,6 +1431,18 @@ static int f_cdev_tiocmset(struct f_cdev *port,
|
|||
if (clear & TIOCM_DSR)
|
||||
cser->serial_state &= ~TIOCM_DSR;
|
||||
|
||||
if (set & TIOCM_CTS) {
|
||||
if (cser->send_break) {
|
||||
cser->serial_state |= TIOCM_CTS;
|
||||
status = cser->send_break(cser, 0);
|
||||
}
|
||||
}
|
||||
if (clear & TIOCM_CTS) {
|
||||
if (cser->send_break) {
|
||||
cser->serial_state &= ~TIOCM_CTS;
|
||||
status = cser->send_break(cser, 1);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue