Hardware Flow control Bug in SC16IS7XX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hardware Flow control Bug in SC16IS7XX

382 Views
Abi__1289
Contributor II

Hi ,

I am working on the I2C-to-UART converter IC(SC16IS74XX), and I was able to communicate with an external UART port with software flow control and no flow control enabled. But when I configured the device UART port with hardware flow control, communication was not working out.

After debugging, I understood there is a bug in the sc16is7xx_set_baud and sc16is7xx_set_termios functions of the driver. We have two bugs that are causing the communication to fail with auto CTS and auto RTS enabled.

These are the changes I've made to get communication working with auto RTS and CTS enabled. 

@@ -523,8 +523,13 @@ static sc16is7xx_set_baud()

/* Enable enhanced features */

- sc16is7xx_port_write(port, SC16IS7XX_EFR_REG,
- SC16IS7XX_EFR_ENABLE_BIT);
+ /* using "update" instead of "write" to
+ * remove the bug ,which over writes the
+ * EFR register
+ */
+ sc16is7xx_port_update(port, SC16IS7XX_EFR_REG,
+ SC16IS7XX_EFR_ENABLE_BIT |
+ SC16IS7XX_EFR_ENABLE_BIT );
regcache_cache_bypass(s->regmap, false);

@@ -932,8 +937,12 @@ static void sc16is7xx_set_termios(struct uart_port *port,
sc16is7xx_port_write(port, SC16IS7XX_XON1_REG, termios->c_cc[VSTART]);
sc16is7xx_port_write(port, SC16IS7XX_XOFF1_REG, termios->c_cc[VSTOP]);
if (termios->c_cflag & CRTSCTS)
+ {
flow |= SC16IS7XX_EFR_AUTOCTS_BIT |
SC16IS7XX_EFR_AUTORTS_BIT;
+ /* Updating the port with autocts enabled */
+ port->status |= UPSTAT_AUTOCTS;
+ }

 

Is there any reason or point why this bug is still not addressed in the latest driver in the code-aurora Linux-IMX OS version? git.kernel.org/linux-stable/linux-5.10.y

https://source.codeaurora.org/external/imx/linux-imx

#SC16IS7XX #imx8 @imx community

0 Kudos
0 Replies