diff options
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 3158e17b665c..4604153b7954 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1052,9 +1052,17 @@ static int sci_request_irq(struct sci_port *port) | |||
1052 | if (SCIx_IRQ_IS_MUXED(port)) { | 1052 | if (SCIx_IRQ_IS_MUXED(port)) { |
1053 | i = SCIx_MUX_IRQ; | 1053 | i = SCIx_MUX_IRQ; |
1054 | irq = up->irq; | 1054 | irq = up->irq; |
1055 | } else | 1055 | } else { |
1056 | irq = port->cfg->irqs[i]; | 1056 | irq = port->cfg->irqs[i]; |
1057 | 1057 | ||
1058 | /* | ||
1059 | * Certain port types won't support all of the | ||
1060 | * available interrupt sources. | ||
1061 | */ | ||
1062 | if (unlikely(!irq)) | ||
1063 | continue; | ||
1064 | } | ||
1065 | |||
1058 | desc = sci_irq_desc + i; | 1066 | desc = sci_irq_desc + i; |
1059 | port->irqstr[j] = kasprintf(GFP_KERNEL, "%s:%s", | 1067 | port->irqstr[j] = kasprintf(GFP_KERNEL, "%s:%s", |
1060 | dev_name(up->dev), desc->desc); | 1068 | dev_name(up->dev), desc->desc); |
@@ -1094,6 +1102,15 @@ static void sci_free_irq(struct sci_port *port) | |||
1094 | * IRQ first. | 1102 | * IRQ first. |
1095 | */ | 1103 | */ |
1096 | for (i = 0; i < SCIx_NR_IRQS; i++) { | 1104 | for (i = 0; i < SCIx_NR_IRQS; i++) { |
1105 | unsigned int irq = port->cfg->irqs[i]; | ||
1106 | |||
1107 | /* | ||
1108 | * Certain port types won't support all of the available | ||
1109 | * interrupt sources. | ||
1110 | */ | ||
1111 | if (unlikely(!irq)) | ||
1112 | continue; | ||
1113 | |||
1097 | free_irq(port->cfg->irqs[i], port); | 1114 | free_irq(port->cfg->irqs[i], port); |
1098 | kfree(port->irqstr[i]); | 1115 | kfree(port->irqstr[i]); |
1099 | 1116 | ||
@@ -1564,10 +1581,32 @@ static void sci_enable_ms(struct uart_port *port) | |||
1564 | 1581 | ||
1565 | static void sci_break_ctl(struct uart_port *port, int break_state) | 1582 | static void sci_break_ctl(struct uart_port *port, int break_state) |
1566 | { | 1583 | { |
1567 | /* | 1584 | struct sci_port *s = to_sci_port(port); |
1568 | * Not supported by hardware. Most parts couple break and rx | 1585 | struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR; |
1569 | * interrupts together, with break detection always enabled. | 1586 | unsigned short scscr, scsptr; |
1570 | */ | 1587 | |
1588 | /* check wheter the port has SCSPTR */ | ||
1589 | if (!reg->size) { | ||
1590 | /* | ||
1591 | * Not supported by hardware. Most parts couple break and rx | ||
1592 | * interrupts together, with break detection always enabled. | ||
1593 | */ | ||
1594 | return; | ||
1595 | } | ||
1596 | |||
1597 | scsptr = serial_port_in(port, SCSPTR); | ||
1598 | scscr = serial_port_in(port, SCSCR); | ||
1599 | |||
1600 | if (break_state == -1) { | ||
1601 | scsptr = (scsptr | SCSPTR_SPB2IO) & ~SCSPTR_SPB2DT; | ||
1602 | scscr &= ~SCSCR_TE; | ||
1603 | } else { | ||
1604 | scsptr = (scsptr | SCSPTR_SPB2DT) & ~SCSPTR_SPB2IO; | ||
1605 | scscr |= SCSCR_TE; | ||
1606 | } | ||
1607 | |||
1608 | serial_port_out(port, SCSPTR, scsptr); | ||
1609 | serial_port_out(port, SCSCR, scscr); | ||
1571 | } | 1610 | } |
1572 | 1611 | ||
1573 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1612 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |