Hi,
I am using i.MX6 Solo X based custom board (kernel used : - 4.14.200). I have external RS485 transceiver chip connected to the UART2 port of the processor and trying to handle RE/DE pins of the chip in the standard imx6 uart driver (drivers/tty/serial/imx.c) .
I am putting the 485 transceiver in transmit mode (RE=DE=1) in imx_start_tx() function and i can see the data is getting transmitted over AIO bus.
To put the 485 transceiver in receive mode (RE/DE=0), i have added logic in imx_stop_tx() function.
Unfortunately, uart does not receive any data which means imx_stop_tx() function did not get called.
When imx_stop_tx() api gets called...? Or in which api of the driver, i should handle the RE/DE pins to put into receive mode after the transmission is complete...?
Is there any to handle the RS485 chip in the imx6sx uart driver......? Please let me know.
Below is the code snippet for reference
static void imx_start_tx(struct uart_port *port)
{
if(port->line ==1) // For UART2 only
{//485 transmit mode
gpio_direction_output(RE_PIN,1);
gpio_direction_output(DE_PIN,1);
}
.....
}
static void imx_stop_tx(struct uart_port *port)
{
if(port->line ==1) // For UART2 only
{ // 485 receive mode
gpio_direction_output(RE_PIN,0);
gpio_direction_output(DE_PIN,0);
}
....
}