diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-12-22 12:57:02 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-12-22 12:57:02 -0500 |
commit | 4b7bd364700d9ac8372eff48832062b936d0793b (patch) | |
tree | 0dbf78c95456a0b02d07fcd473281f04a87e266d /drivers/serial/crisv10.c | |
parent | c0d8768af260e2cbb4bf659ae6094a262c86b085 (diff) | |
parent | 90a8a73c06cc32b609a880d48449d7083327e11a (diff) |
Merge branch 'master' into for-next
Conflicts:
MAINTAINERS
arch/arm/mach-omap2/pm24xx.c
drivers/scsi/bfa/bfa_fcpim.c
Needed to update to apply fixes for which the old branch was too
outdated.
Diffstat (limited to 'drivers/serial/crisv10.c')
-rw-r--r-- | drivers/serial/crisv10.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index c856905bb3bd..bcc31f2140ac 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
@@ -18,7 +18,6 @@ static char *serial_version = "$Revision: 1.25 $"; | |||
18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
19 | #include <linux/tty_flip.h> | 19 | #include <linux/tty_flip.h> |
20 | #include <linux/major.h> | 20 | #include <linux/major.h> |
21 | #include <linux/smp_lock.h> | ||
22 | #include <linux/string.h> | 21 | #include <linux/string.h> |
23 | #include <linux/fcntl.h> | 22 | #include <linux/fcntl.h> |
24 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
@@ -1411,11 +1410,12 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r) | |||
1411 | CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1); | 1410 | CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1); |
1412 | #endif | 1411 | #endif |
1413 | 1412 | ||
1414 | info->rs485.flags = r->flags; | 1413 | info->rs485 = *r; |
1415 | if (r->delay_rts_before_send >= 1000) | 1414 | |
1415 | /* Maximum delay before RTS equal to 1000 */ | ||
1416 | if (info->rs485.delay_rts_before_send >= 1000) | ||
1416 | info->rs485.delay_rts_before_send = 1000; | 1417 | info->rs485.delay_rts_before_send = 1000; |
1417 | else | 1418 | |
1418 | info->rs485.delay_rts_before_send = r->delay_rts_before_send; | ||
1419 | /* printk("rts: on send = %i, after = %i, enabled = %i", | 1419 | /* printk("rts: on send = %i, after = %i, enabled = %i", |
1420 | info->rs485.rts_on_send, | 1420 | info->rs485.rts_on_send, |
1421 | info->rs485.rts_after_sent, | 1421 | info->rs485.rts_after_sent, |
@@ -3234,9 +3234,9 @@ rs_write(struct tty_struct *tty, | |||
3234 | e100_disable_rx(info); | 3234 | e100_disable_rx(info); |
3235 | e100_enable_rx_irq(info); | 3235 | e100_enable_rx_irq(info); |
3236 | #endif | 3236 | #endif |
3237 | 3237 | if ((info->rs485.flags & SER_RS485_RTS_BEFORE_SEND) && | |
3238 | if (info->rs485.delay_rts_before_send > 0) | 3238 | (info->rs485.delay_rts_before_send > 0)) |
3239 | msleep(info->rs485.delay_rts_before_send); | 3239 | msleep(info->rs485.delay_rts_before_send); |
3240 | } | 3240 | } |
3241 | #endif /* CONFIG_ETRAX_RS485 */ | 3241 | #endif /* CONFIG_ETRAX_RS485 */ |
3242 | 3242 | ||
@@ -3694,6 +3694,11 @@ rs_ioctl(struct tty_struct *tty, struct file * file, | |||
3694 | 3694 | ||
3695 | rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send; | 3695 | rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send; |
3696 | rs485data.flags = 0; | 3696 | rs485data.flags = 0; |
3697 | if (rs485data.delay_rts_before_send != 0) | ||
3698 | rs485data.flags |= SER_RS485_RTS_BEFORE_SEND; | ||
3699 | else | ||
3700 | rs485data.flags &= ~(SER_RS485_RTS_BEFORE_SEND); | ||
3701 | |||
3697 | if (rs485ctrl.enabled) | 3702 | if (rs485ctrl.enabled) |
3698 | rs485data.flags |= SER_RS485_ENABLED; | 3703 | rs485data.flags |= SER_RS485_ENABLED; |
3699 | else | 3704 | else |
@@ -3731,7 +3736,7 @@ rs_ioctl(struct tty_struct *tty, struct file * file, | |||
3731 | /* This is the ioctl to get RS485 data from user-space */ | 3736 | /* This is the ioctl to get RS485 data from user-space */ |
3732 | if (copy_to_user((struct serial_rs485 *) arg, | 3737 | if (copy_to_user((struct serial_rs485 *) arg, |
3733 | rs485data, | 3738 | rs485data, |
3734 | sizeof(serial_rs485))) | 3739 | sizeof(struct serial_rs485))) |
3735 | return -EFAULT; | 3740 | return -EFAULT; |
3736 | break; | 3741 | break; |
3737 | } | 3742 | } |
@@ -4527,6 +4532,7 @@ static int __init rs_init(void) | |||
4527 | /* Set sane defaults */ | 4532 | /* Set sane defaults */ |
4528 | info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND); | 4533 | info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND); |
4529 | info->rs485.flags |= SER_RS485_RTS_AFTER_SEND; | 4534 | info->rs485.flags |= SER_RS485_RTS_AFTER_SEND; |
4535 | info->rs485.flags &= ~(SER_RS485_RTS_BEFORE_SEND); | ||
4530 | info->rs485.delay_rts_before_send = 0; | 4536 | info->rs485.delay_rts_before_send = 0; |
4531 | info->rs485.flags &= ~(SER_RS485_ENABLED); | 4537 | info->rs485.flags &= ~(SER_RS485_ENABLED); |
4532 | #endif | 4538 | #endif |