Commit 793388a7 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tty-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg Kroah-Hartman:
 "Here are a few tty/serial driver fixes for 3.8-rc4 that resolve a
  number of problems that people have been having, including the ptys
  ioctl issue that is a regression fix"

* tag 'tty-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  8250/16?50: Add support for Broadcom TruManage redirected serial port
  pty: return EINVAL for TIOCGPTN for BSD ptys
  serial:ifx6x60:Keep word size accordance with SPI controller
  tty: 8250_dw: Fix inverted arguments to serial_out in IRQ handler
  serial: samsung: remove redundant setting of line config during port reset
  serial:ifx6x60:Delete SPI timer when shut down port
  tty/8250: The correct device id for this card is 0x0022
  tty/8250: pbn_b0_8_1152000_200 is supposed to be an 8 port definition
  tty: serial: vt8500: fix return value check in vt8500_serial_probe()
  serial: mxs-auart: Index is unsigned
  mxs: uart: fix setting RTS from software
parents abad21a8 ebebd49a
...@@ -441,6 +441,8 @@ static int pty_bsd_ioctl(struct tty_struct *tty, ...@@ -441,6 +441,8 @@ static int pty_bsd_ioctl(struct tty_struct *tty,
return pty_get_pktmode(tty, (int __user *)arg); return pty_get_pktmode(tty, (int __user *)arg);
case TIOCSIG: /* Send signal to other side of pty */ case TIOCSIG: /* Send signal to other side of pty */
return pty_signal(tty, (int) arg); return pty_signal(tty, (int) arg);
case TIOCGPTN: /* TTY returns ENOTTY, but glibc expects EINVAL here */
return -EINVAL;
} }
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
...@@ -300,6 +300,12 @@ static const struct serial8250_config uart_config[] = { ...@@ -300,6 +300,12 @@ static const struct serial8250_config uart_config[] = {
UART_FCR_R_TRIG_00 | UART_FCR_T_TRIG_00, UART_FCR_R_TRIG_00 | UART_FCR_T_TRIG_00,
.flags = UART_CAP_FIFO, .flags = UART_CAP_FIFO,
}, },
[PORT_BRCM_TRUMANAGE] = {
.name = "TruManage",
.fifo_size = 1,
.tx_loadsz = 1024,
.flags = UART_CAP_HFIFO,
},
[PORT_8250_CIR] = { [PORT_8250_CIR] = {
.name = "CIR port" .name = "CIR port"
} }
...@@ -1490,6 +1496,11 @@ void serial8250_tx_chars(struct uart_8250_port *up) ...@@ -1490,6 +1496,11 @@ void serial8250_tx_chars(struct uart_8250_port *up)
port->icount.tx++; port->icount.tx++;
if (uart_circ_empty(xmit)) if (uart_circ_empty(xmit))
break; break;
if (up->capabilities & UART_CAP_HFIFO) {
if ((serial_port_in(port, UART_LSR) & BOTH_EMPTY) !=
BOTH_EMPTY)
break;
}
} while (--count > 0); } while (--count > 0);
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
......
...@@ -40,6 +40,7 @@ struct serial8250_config { ...@@ -40,6 +40,7 @@ struct serial8250_config {
#define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */ #define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
#define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */ #define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
#define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */ #define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */
#define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */
#define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
#define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
......
...@@ -79,7 +79,7 @@ static int dw8250_handle_irq(struct uart_port *p) ...@@ -79,7 +79,7 @@ static int dw8250_handle_irq(struct uart_port *p)
} else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) { } else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
/* Clear the USR and write the LCR again. */ /* Clear the USR and write the LCR again. */
(void)p->serial_in(p, UART_USR); (void)p->serial_in(p, UART_USR);
p->serial_out(p, d->last_lcr, UART_LCR); p->serial_out(p, UART_LCR, d->last_lcr);
return 1; return 1;
} }
......
...@@ -1085,6 +1085,18 @@ pci_omegapci_setup(struct serial_private *priv, ...@@ -1085,6 +1085,18 @@ pci_omegapci_setup(struct serial_private *priv,
return setup_port(priv, port, 2, idx * 8, 0); return setup_port(priv, port, 2, idx * 8, 0);
} }
static int
pci_brcm_trumanage_setup(struct serial_private *priv,
const struct pciserial_board *board,
struct uart_8250_port *port, int idx)
{
int ret = pci_default_setup(priv, board, port, idx);
port->port.type = PORT_BRCM_TRUMANAGE;
port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
return ret;
}
static int skip_tx_en_setup(struct serial_private *priv, static int skip_tx_en_setup(struct serial_private *priv,
const struct pciserial_board *board, const struct pciserial_board *board,
struct uart_8250_port *port, int idx) struct uart_8250_port *port, int idx)
...@@ -1301,9 +1313,10 @@ pci_wch_ch353_setup(struct serial_private *priv, ...@@ -1301,9 +1313,10 @@ pci_wch_ch353_setup(struct serial_private *priv,
#define PCI_VENDOR_ID_AGESTAR 0x5372 #define PCI_VENDOR_ID_AGESTAR 0x5372
#define PCI_DEVICE_ID_AGESTAR_9375 0x6872 #define PCI_DEVICE_ID_AGESTAR_9375 0x6872
#define PCI_VENDOR_ID_ASIX 0x9710 #define PCI_VENDOR_ID_ASIX 0x9710
#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0019
#define PCI_DEVICE_ID_COMMTECH_4224PCIE 0x0020 #define PCI_DEVICE_ID_COMMTECH_4224PCIE 0x0020
#define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021 #define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021
#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022
#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
/* Unknown vendors/cards - this should not be in linux/pci_ids.h */ /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
...@@ -1953,6 +1966,17 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { ...@@ -1953,6 +1966,17 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.subdevice = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
.setup = pci_xr17v35x_setup, .setup = pci_xr17v35x_setup,
}, },
/*
* Broadcom TruManage (NetXtreme)
*/
{
.vendor = PCI_VENDOR_ID_BROADCOM,
.device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_brcm_trumanage_setup,
},
/* /*
* Default "match everything" terminator entry * Default "match everything" terminator entry
*/ */
...@@ -2148,6 +2172,7 @@ enum pci_board_num_t { ...@@ -2148,6 +2172,7 @@ enum pci_board_num_t {
pbn_ce4100_1_115200, pbn_ce4100_1_115200,
pbn_omegapci, pbn_omegapci,
pbn_NETMOS9900_2s_115200, pbn_NETMOS9900_2s_115200,
pbn_brcm_trumanage,
}; };
/* /*
...@@ -2246,7 +2271,7 @@ static struct pciserial_board pci_boards[] = { ...@@ -2246,7 +2271,7 @@ static struct pciserial_board pci_boards[] = {
[pbn_b0_8_1152000_200] = { [pbn_b0_8_1152000_200] = {
.flags = FL_BASE0, .flags = FL_BASE0,
.num_ports = 2, .num_ports = 8,
.base_baud = 1152000, .base_baud = 1152000,
.uart_offset = 0x200, .uart_offset = 0x200,
}, },
...@@ -2892,6 +2917,12 @@ static struct pciserial_board pci_boards[] = { ...@@ -2892,6 +2917,12 @@ static struct pciserial_board pci_boards[] = {
.num_ports = 2, .num_ports = 2,
.base_baud = 115200, .base_baud = 115200,
}, },
[pbn_brcm_trumanage] = {
.flags = FL_BASE0,
.num_ports = 1,
.reg_shift = 2,
.base_baud = 115200,
},
}; };
static const struct pci_device_id blacklist[] = { static const struct pci_device_id blacklist[] = {
...@@ -4470,6 +4501,13 @@ static struct pci_device_id serial_pci_tbl[] = { ...@@ -4470,6 +4501,13 @@ static struct pci_device_id serial_pci_tbl[] = {
PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
pbn_omegapci }, pbn_omegapci },
/*
* Broadcom TruManage
*/
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
pbn_brcm_trumanage },
/* /*
* AgeStar as-prs2-009 * AgeStar as-prs2-009
*/ */
......
...@@ -637,6 +637,7 @@ static void ifx_port_shutdown(struct tty_port *port) ...@@ -637,6 +637,7 @@ static void ifx_port_shutdown(struct tty_port *port)
clear_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags); clear_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags);
mrdy_set_low(ifx_dev); mrdy_set_low(ifx_dev);
del_timer(&ifx_dev->spi_timer);
clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags); clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags);
tasklet_kill(&ifx_dev->io_work_tasklet); tasklet_kill(&ifx_dev->io_work_tasklet);
} }
...@@ -810,7 +811,8 @@ static void ifx_spi_io(unsigned long data) ...@@ -810,7 +811,8 @@ static void ifx_spi_io(unsigned long data)
ifx_dev->spi_xfer.cs_change = 0; ifx_dev->spi_xfer.cs_change = 0;
ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz; ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz;
/* ifx_dev->spi_xfer.speed_hz = 390625; */ /* ifx_dev->spi_xfer.speed_hz = 390625; */
ifx_dev->spi_xfer.bits_per_word = spi_bpw; ifx_dev->spi_xfer.bits_per_word =
ifx_dev->spi_dev->bits_per_word;
ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer; ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer;
ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer; ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer;
......
...@@ -253,7 +253,7 @@ static void mxs_auart_tx_chars(struct mxs_auart_port *s) ...@@ -253,7 +253,7 @@ static void mxs_auart_tx_chars(struct mxs_auart_port *s)
struct circ_buf *xmit = &s->port.state->xmit; struct circ_buf *xmit = &s->port.state->xmit;
if (auart_dma_enabled(s)) { if (auart_dma_enabled(s)) {
int i = 0; u32 i = 0;
int size; int size;
void *buffer = s->tx_dma_buf; void *buffer = s->tx_dma_buf;
...@@ -412,10 +412,12 @@ static void mxs_auart_set_mctrl(struct uart_port *u, unsigned mctrl) ...@@ -412,10 +412,12 @@ static void mxs_auart_set_mctrl(struct uart_port *u, unsigned mctrl)
u32 ctrl = readl(u->membase + AUART_CTRL2); u32 ctrl = readl(u->membase + AUART_CTRL2);
ctrl &= ~AUART_CTRL2_RTSEN; ctrl &= ~(AUART_CTRL2_RTSEN | AUART_CTRL2_RTS);
if (mctrl & TIOCM_RTS) { if (mctrl & TIOCM_RTS) {
if (tty_port_cts_enabled(&u->state->port)) if (tty_port_cts_enabled(&u->state->port))
ctrl |= AUART_CTRL2_RTSEN; ctrl |= AUART_CTRL2_RTSEN;
else
ctrl |= AUART_CTRL2_RTS;
} }
s->ctrl = mctrl; s->ctrl = mctrl;
......
...@@ -1006,7 +1006,6 @@ static void s3c24xx_serial_resetport(struct uart_port *port, ...@@ -1006,7 +1006,6 @@ static void s3c24xx_serial_resetport(struct uart_port *port,
ucon &= ucon_mask; ucon &= ucon_mask;
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
wr_regl(port, S3C2410_ULCON, cfg->ulcon);
/* reset both fifos */ /* reset both fifos */
wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
......
...@@ -604,7 +604,7 @@ static int vt8500_serial_probe(struct platform_device *pdev) ...@@ -604,7 +604,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0); vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
if (vt8500_port->clk) { if (!IS_ERR(vt8500_port->clk)) {
vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
} else { } else {
/* use the default of 24Mhz if not specified and warn */ /* use the default of 24Mhz if not specified and warn */
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
#define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
#define PORT_MAX_8250 24 /* max port ID */ #define PORT_BRCM_TRUMANAGE 24
#define PORT_MAX_8250 25 /* max port ID */
/* /*
* ARM specific type numbers. These are not currently guaranteed * ARM specific type numbers. These are not currently guaranteed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment