Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0eaa7cbc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Send BRK signal to host on flow disable ioctl"

parents 900719d3 a0ace218
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011, 2013-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011, 2013-2018, The Linux Foundation. All rights reserved.
 * Linux Foundation chooses to take subject only to the GPLv2 license terms,
 * and distributes only under these terms.
 *
@@ -636,6 +636,9 @@ static int gbridge_port_tiocmget(struct gbridge_port *port)

	if (gser->serial_state & TIOCM_DSR)
		result |= TIOCM_DSR;

	if (gser->serial_state & TIOCM_CTS)
		result |= TIOCM_CTS;
fail:
	spin_unlock_irqrestore(&port->port_lock, flags);
	return result;
@@ -689,6 +692,18 @@ static int gbridge_port_tiocmset(struct gbridge_port *port,
		gser->serial_state |= TIOCM_DSR;
	if (clear & TIOCM_DSR)
		gser->serial_state &= ~TIOCM_DSR;
	if (set & TIOCM_CTS) {
		if (gser->send_break) {
			gser->serial_state |= TIOCM_CTS;
			status = gser->send_break(gser, 0);
		}
	}
	if (clear & TIOCM_CTS) {
		if (gser->send_break) {
			gser->serial_state &= ~TIOCM_CTS;
			status = gser->send_break(gser, 1);
		}
	}
fail:
	spin_unlock_irqrestore(&port->port_lock, flags);
	return status;
+3 −1
Original line number Diff line number Diff line
@@ -470,7 +470,7 @@ static unsigned int convert_uart_sigs_to_acm(unsigned uart_sig)
	unsigned int acm_sig = 0;

	/* should this needs to be in calling functions ??? */
	uart_sig &= (TIOCM_RI | TIOCM_CD | TIOCM_DSR);
	uart_sig &= (TIOCM_RI | TIOCM_CD | TIOCM_DSR | TIOCM_CTS);

	if (uart_sig & TIOCM_RI)
		acm_sig |= SMD_ACM_CTRL_RI;
@@ -478,6 +478,8 @@ static unsigned int convert_uart_sigs_to_acm(unsigned uart_sig)
		acm_sig |= SMD_ACM_CTRL_DCD;
	if (uart_sig & TIOCM_DSR)
		acm_sig |= SMD_ACM_CTRL_DSR;
	if (uart_sig & TIOCM_CTS)
		acm_sig |= SMD_ACM_CTRL_BRK;

	return acm_sig;
}