Half-duplex rs-485 on full-duplex UART.

From: Sergey Lapin
Date: Thu Jun 26 2008 - 16:56:44 EST


Hi, all!

I have a device with normal serial ports (at91sam9260-based) and
RS-485 half-duplex transceiver
installed for it and 1 GPIO for duplex control, 1=writing, 0=reading.
A problem is that I need to hack serial driver to support this GPIO
control, which I don't like.
I just need to set it to 1 before transmission and back to 0 when
transmission ends.

Most important thing is to set this bit to 1 before transfer starts,
so I can't just poll UART registers
from tasklet. So I had to hack into serial driver for that.

So questions are:

1. Is there some generic enough mechanism in kernel to handle such
tasks? so I mean external
serial transcievers support?

2. Is there any way to implement this task without touching, in my
case, drivers/serial/atmel_serial.c?

Thanks a lot,
S.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/