aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-11-01 07:53:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-01 07:53:19 -0400
commitb3b2b6351a3f3342e6669b5c2defc85f6af75ee3 (patch)
tree9b47ae7b0111ab024d719214d2745b128db48beb
parent90ae83f7fc32733e5829d806306c0c590f1a383f (diff)
parent395bc5121828e570bd4bb6455c82b80e2f2b05b4 (diff)
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris: CRIS: Add paths for CRISv10 serial driver CRIS: Fix RS485 delay handling. Add missing "struct" to in sizeof.
-rw-r--r--MAINTAINERS1
-rw-r--r--drivers/serial/crisv10.c23
2 files changed, 16 insertions, 8 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index cb8b58020352..0094224ca79b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1757,6 +1757,7 @@ L: linux-cris-kernel@axis.com
1757W: http://developer.axis.com 1757W: http://developer.axis.com
1758S: Maintained 1758S: Maintained
1759F: arch/cris/ 1759F: arch/cris/
1760F: drivers/serial/crisv10.*
1760 1761
1761CRYPTO API 1762CRYPTO API
1762M: Herbert Xu <herbert@gondor.apana.org.au> 1763M: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index c856905bb3bd..fa62578fcd20 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -1411,11 +1411,12 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r)
1411 CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1); 1411 CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1);
1412#endif 1412#endif
1413 1413
1414 info->rs485.flags = r->flags; 1414 info->rs485 = *r;
1415 if (r->delay_rts_before_send >= 1000) 1415
1416 /* Maximum delay before RTS equal to 1000 */
1417 if (info->rs485.delay_rts_before_send >= 1000)
1416 info->rs485.delay_rts_before_send = 1000; 1418 info->rs485.delay_rts_before_send = 1000;
1417 else 1419
1418 info->rs485.delay_rts_before_send = r->delay_rts_before_send;
1419/* printk("rts: on send = %i, after = %i, enabled = %i", 1420/* printk("rts: on send = %i, after = %i, enabled = %i",
1420 info->rs485.rts_on_send, 1421 info->rs485.rts_on_send,
1421 info->rs485.rts_after_sent, 1422 info->rs485.rts_after_sent,
@@ -3234,9 +3235,9 @@ rs_write(struct tty_struct *tty,
3234 e100_disable_rx(info); 3235 e100_disable_rx(info);
3235 e100_enable_rx_irq(info); 3236 e100_enable_rx_irq(info);
3236#endif 3237#endif
3237 3238 if ((info->rs485.flags & SER_RS485_RTS_BEFORE_SEND) &&
3238 if (info->rs485.delay_rts_before_send > 0) 3239 (info->rs485.delay_rts_before_send > 0))
3239 msleep(info->rs485.delay_rts_before_send); 3240 msleep(info->rs485.delay_rts_before_send);
3240 } 3241 }
3241#endif /* CONFIG_ETRAX_RS485 */ 3242#endif /* CONFIG_ETRAX_RS485 */
3242 3243
@@ -3694,6 +3695,11 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
3694 3695
3695 rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send; 3696 rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send;
3696 rs485data.flags = 0; 3697 rs485data.flags = 0;
3698 if (rs485data.delay_rts_before_send != 0)
3699 rs485data.flags |= SER_RS485_RTS_BEFORE_SEND;
3700 else
3701 rs485data.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
3702
3697 if (rs485ctrl.enabled) 3703 if (rs485ctrl.enabled)
3698 rs485data.flags |= SER_RS485_ENABLED; 3704 rs485data.flags |= SER_RS485_ENABLED;
3699 else 3705 else
@@ -3731,7 +3737,7 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
3731 /* This is the ioctl to get RS485 data from user-space */ 3737 /* This is the ioctl to get RS485 data from user-space */
3732 if (copy_to_user((struct serial_rs485 *) arg, 3738 if (copy_to_user((struct serial_rs485 *) arg,
3733 rs485data, 3739 rs485data,
3734 sizeof(serial_rs485))) 3740 sizeof(struct serial_rs485)))
3735 return -EFAULT; 3741 return -EFAULT;
3736 break; 3742 break;
3737 } 3743 }
@@ -4527,6 +4533,7 @@ static int __init rs_init(void)
4527 /* Set sane defaults */ 4533 /* Set sane defaults */
4528 info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND); 4534 info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND);
4529 info->rs485.flags |= SER_RS485_RTS_AFTER_SEND; 4535 info->rs485.flags |= SER_RS485_RTS_AFTER_SEND;
4536 info->rs485.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
4530 info->rs485.delay_rts_before_send = 0; 4537 info->rs485.delay_rts_before_send = 0;
4531 info->rs485.flags &= ~(SER_RS485_ENABLED); 4538 info->rs485.flags &= ~(SER_RS485_ENABLED);
4532#endif 4539#endif