aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclink_gt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-22 06:18:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-22 16:03:28 -0400
commit9e98966c7bb94355689478bc84cc3e0c190f977e (patch)
tree928aebbfee524a48aa94a3d3def5249c8846a79a /drivers/char/synclink_gt.c
parentabbe629ae4011d2020047f41bea9f9e4b0ec4361 (diff)
tty: rework break handling
Some hardware needs to do break handling itself and may have partial support only. Make break_ctl return an error code. Add a tty driver flag so you can indicate driver hardware side break support. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/synclink_gt.c')
-rw-r--r--drivers/char/synclink_gt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 2c3e43bb2cc9..cf87bb89a77d 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -165,7 +165,7 @@ static int read_proc(char *page, char **start, off_t off, int count,int *eof, v
165static int chars_in_buffer(struct tty_struct *tty); 165static int chars_in_buffer(struct tty_struct *tty);
166static void throttle(struct tty_struct * tty); 166static void throttle(struct tty_struct * tty);
167static void unthrottle(struct tty_struct * tty); 167static void unthrottle(struct tty_struct * tty);
168static void set_break(struct tty_struct *tty, int break_state); 168static int set_break(struct tty_struct *tty, int break_state);
169 169
170/* 170/*
171 * generic HDLC support and callbacks 171 * generic HDLC support and callbacks
@@ -513,7 +513,7 @@ static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr);
513static int tiocmget(struct tty_struct *tty, struct file *file); 513static int tiocmget(struct tty_struct *tty, struct file *file);
514static int tiocmset(struct tty_struct *tty, struct file *file, 514static int tiocmset(struct tty_struct *tty, struct file *file,
515 unsigned int set, unsigned int clear); 515 unsigned int set, unsigned int clear);
516static void set_break(struct tty_struct *tty, int break_state); 516static int set_break(struct tty_struct *tty, int break_state);
517static int get_interface(struct slgt_info *info, int __user *if_mode); 517static int get_interface(struct slgt_info *info, int __user *if_mode);
518static int set_interface(struct slgt_info *info, int if_mode); 518static int set_interface(struct slgt_info *info, int if_mode);
519static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); 519static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
@@ -1452,14 +1452,14 @@ static void unthrottle(struct tty_struct * tty)
1452 * set or clear transmit break condition 1452 * set or clear transmit break condition
1453 * break_state -1=set break condition, 0=clear 1453 * break_state -1=set break condition, 0=clear
1454 */ 1454 */
1455static void set_break(struct tty_struct *tty, int break_state) 1455static int set_break(struct tty_struct *tty, int break_state)
1456{ 1456{
1457 struct slgt_info *info = tty->driver_data; 1457 struct slgt_info *info = tty->driver_data;
1458 unsigned short value; 1458 unsigned short value;
1459 unsigned long flags; 1459 unsigned long flags;
1460 1460
1461 if (sanity_check(info, tty->name, "set_break")) 1461 if (sanity_check(info, tty->name, "set_break"))
1462 return; 1462 return -EINVAL;
1463 DBGINFO(("%s set_break(%d)\n", info->device_name, break_state)); 1463 DBGINFO(("%s set_break(%d)\n", info->device_name, break_state));
1464 1464
1465 spin_lock_irqsave(&info->lock,flags); 1465 spin_lock_irqsave(&info->lock,flags);
@@ -1470,6 +1470,7 @@ static void set_break(struct tty_struct *tty, int break_state)
1470 value &= ~BIT6; 1470 value &= ~BIT6;
1471 wr_reg16(info, TCR, value); 1471 wr_reg16(info, TCR, value);
1472 spin_unlock_irqrestore(&info->lock,flags); 1472 spin_unlock_irqrestore(&info->lock,flags);
1473 return 0;
1473} 1474}
1474 1475
1475#if SYNCLINK_GENERIC_HDLC 1476#if SYNCLINK_GENERIC_HDLC