USB: serial: cp210x: work around silicon bug setting break
Commit Message
From: Corey Minyard <cmimyard@mvista.com>
At least on the CP2105, sending this once doesn't work, you have to send
it twice to make it happen. If you only send it once, you will get a
really short time (a few bits) where the break is sent, right when the
break is turned off, thus it isn't recognised as a break. Sending it
twice won't hurt anything, so just do it all the time.
Signed-off-by: Corey Minyard <cmimyard@mvista.com>
---
I played with this a bit, and found this change fixes the issue. It's
not ideal, I suppose, but it works.
drivers/usb/serial/cp210x.c | 9 +++++++++
1 file changed, 9 insertions(+)
@@ -1446,6 +1446,15 @@ static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
dev_dbg(&port->dev, "%s - turning break %s\n", __func__,
state == BREAK_OFF ? "off" : "on");
cp210x_write_u16_reg(port, CP210X_SET_BREAK, state);
+ /*
+ * At least on the CP2105, sending this once doesn't work, you
+ * have to send it twice to make it happen. If you only send
+ * it once, you will get a really short time (a few bits) where
+ * the break is sent, right when the break is turned off, thus
+ * it isn't recognised as a break. Sending it twice won't hurt
+ * anything, so just do it all the time.
+ */
+ cp210x_write_u16_reg(port, CP210X_SET_BREAK, state);
}
#ifdef CONFIG_GPIOLIB