Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92342
b: refs/heads/master
c: 7d01b47
h: refs/heads/master
v: v3
  • Loading branch information
Graf Yang authored and Bryan Wu committed Feb 29, 2008
1 parent cf7803e commit 84ba2f2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c11700dbfaf0aa5336bd667373ee09db245f3ea
refs/heads/master: 7d01b475ab17018756c8df27c2ee3c220fab05f8
26 changes: 26 additions & 0 deletions trunk/drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,31 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser)
return 0;
}

/*
* Enable the IrDA function if tty->ldisc.num is N_IRDA.
* In other cases, disable IrDA function.
*/
static void bfin_set_ldisc(struct tty_struct *tty)
{
int line = tty->index;
unsigned short val;

if (line >= tty->driver->num)
return;

switch (tty->ldisc.num) {
case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC);
UART_PUT_GCTL(&bfin_serial_ports[line], val);
break;
default:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val &= ~(IREN | RPOLC);
UART_PUT_GCTL(&bfin_serial_ports[line], val);
}
}

static struct uart_ops bfin_serial_pops = {
.tx_empty = bfin_serial_tx_empty,
.set_mctrl = bfin_serial_set_mctrl,
Expand Down Expand Up @@ -1261,6 +1286,7 @@ static int __init bfin_serial_init(void)

ret = uart_register_driver(&bfin_serial_reg);
if (ret == 0) {
bfin_serial_reg.tty_driver->set_ldisc = bfin_set_ldisc;
ret = platform_driver_register(&bfin_serial_driver);
if (ret) {
pr_debug("uart register failed\n");
Expand Down

0 comments on commit 84ba2f2

Please sign in to comment.