Thread (7 messages) 7 messages, 2 authors, 2016-01-23

Re: [PATCH v7 2/3] tty: Add software emulated RS485 support for 8250

From: Andy Shevchenko <hidden>
Date: 2016-01-23 15:15:29
Also in: lkml

On Tue, Jan 19, 2016 at 10:33 PM, Matwey V. Kornilov [off-list ref] wrote:
Implementation of software emulation of RS485 direction handling is based
on omap_serial driver.
Before and after transmission RTS is set to the appropriate value.

Note that before calling serial8250_em485_init the caller has to
ensure that UART will interrupt when shift register empty. Otherwise,
emultaion cannot be used.

Both serial8250_em485_init and serial8250_em485_destroy are
idempotent functions.
Seems you have issues with kernel-doc and commentary styles.

Functions in kernel doc are marked as func(), so don't forget parens.

Multi-line comment blocks are going in the style like:

/*
 * Text line 1.
 * Line 2. New sentence.
 */

You may notice the periods at the end of sentences. There is no need
to keep more heading spaces.
+
+static void serial8250_em485_handle_start_tx(unsigned long arg);
+static void serial8250_em485_handle_stop_tx(unsigned long arg);
+
And you need forward declarations because of some cyclic dependency?
+static void serial8250_start_tx(struct uart_port *port)
+{
+       struct uart_8250_port *up = up_to_u8250p(port);
+
+       serial8250_rpm_get_tx(up);
+
+       if (up->em485 &&
+           up->em485->active_timer == &up->em485->start_tx_timer)
+               return;
struct uart_8250_em485 *em485 = up->em485;

if (em485 && em485->active_timer == &em485->start_tx_timer)

?

Same for the rest of code.
+
+       if (up->em485)
+               start_tx_rs485(port);
+       else
+               __start_tx(port);
+}
+struct uart_8250_em485 {
+       struct timer_list       start_tx_timer;
…/* "rs485 start tx" timer */

-> kernel-doc
+       struct timer_list       stop_tx_timer;  /* "rs485 stop tx" timer */
+       struct timer_list       *active_timer;  /* pointer to active timer */
+};
-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help