@@ -1944,11 +1948,15 @@ unsigned int serial8250_do_get_mctrl(struct uart_port *port)
{
struct uart_8250_port *up = up_to_u8250p(port);
unsigned int status;
+ unsigned int val = 0;
serial8250_rpm_get(up);
status = serial8250_modem_status(up);
serial8250_rpm_put(up);
+ if (up->gpios)
+ return mctrl_gpio_get(up->gpios, &val);
+
What happens when you have a mixed setup i.e. CTS controlled by UART
but other status pins controlled by GPIO? In this case CTS status
won't be returned. Do I see it right?
What about something like this:
unsigned int serial8250_do_get_mctrl(struct uart_port *port)
{
struct uart_8250_port *up = up_to_u8250p(port);
unsigned int status;
unsigned int val;
serial8250_rpm_get(up);
status = serial8250_modem_status(up);
serial8250_rpm_put(up);
val = serial8250_MSR_to_TIOCM(status);
if (up->gpios)
mctrl_gpio_get(up->gpios, &val);
return val;
}