Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221536
b: refs/heads/master
c: c7213fc
h: refs/heads/master
v: v3
  • Loading branch information
Jesper Nilsson committed Oct 28, 2010
1 parent db8b033 commit 87f3439
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94479c017b58f69e2304d88c2826ba445cd4cd99
refs/heads/master: c7213fc4ed592070f1010da39b0bf0eb2395b619
21 changes: 14 additions & 7 deletions trunk/drivers/serial/crisv10.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,11 +1411,12 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r)
CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1);
#endif

info->rs485.flags = r->flags;
if (r->delay_rts_before_send >= 1000)
info->rs485 = *r;

/* Maximum delay before RTS equal to 1000 */
if (info->rs485.delay_rts_before_send >= 1000)
info->rs485.delay_rts_before_send = 1000;
else
info->rs485.delay_rts_before_send = r->delay_rts_before_send;

/* printk("rts: on send = %i, after = %i, enabled = %i",
info->rs485.rts_on_send,
info->rs485.rts_after_sent,
Expand Down Expand Up @@ -3234,9 +3235,9 @@ rs_write(struct tty_struct *tty,
e100_disable_rx(info);
e100_enable_rx_irq(info);
#endif

if (info->rs485.delay_rts_before_send > 0)
msleep(info->rs485.delay_rts_before_send);
if ((info->rs485.flags & SER_RS485_RTS_BEFORE_SEND) &&
(info->rs485.delay_rts_before_send > 0))
msleep(info->rs485.delay_rts_before_send);
}
#endif /* CONFIG_ETRAX_RS485 */

Expand Down Expand Up @@ -3694,6 +3695,11 @@ rs_ioctl(struct tty_struct *tty, struct file * file,

rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send;
rs485data.flags = 0;
if (rs485data.delay_rts_before_send != 0)
rs485data.flags |= SER_RS485_RTS_BEFORE_SEND;
else
rs485data.flags &= ~(SER_RS485_RTS_BEFORE_SEND);

if (rs485ctrl.enabled)
rs485data.flags |= SER_RS485_ENABLED;
else
Expand Down Expand Up @@ -4527,6 +4533,7 @@ static int __init rs_init(void)
/* Set sane defaults */
info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND);
info->rs485.flags |= SER_RS485_RTS_AFTER_SEND;
info->rs485.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
info->rs485.delay_rts_before_send = 0;
info->rs485.flags &= ~(SER_RS485_ENABLED);
#endif
Expand Down

0 comments on commit 87f3439

Please sign in to comment.