提交 cad9d566 编写于 作者: L Linus Torvalds

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

Pull tty/serial fixes from Greg Kroah-Hartman:
 "Here are some tty/serial driver fixes for 3.9

  We finally mute the annoying WARN_ON that lots of people are hitting
  and it turns out isn't needed anymore.  Also add a few new device ids
  and a some other minor fixes."

* tag 'tty-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: serial: fix typo "SERIAL_S3C2412"
  serial: 8250: Keep 8250.<xxxx> module options functional after driver rename
  tty: serial: fix typo "ARCH_S5P6450"
  tty/8250_pnp: serial port detection regression since v3.7
  serial: bcm63xx_uart: fix compilation after "TTY: switch tty_insert_flip_char"
  serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller
  Fix 4 port and add support for 8 port 'Unknown' PCI serial port cards
  tty/serial: Add support for Altera serial port
  tty: serial: vt8500: Unneccessary duplicated clock code removed
  tty: serial: mpc5xxx: fix PSC clock name bug
  TTY: disable debugging warning
...@@ -11,6 +11,9 @@ Required properties: ...@@ -11,6 +11,9 @@ Required properties:
- "nvidia,tegra20-uart" - "nvidia,tegra20-uart"
- "nxp,lpc3220-uart" - "nxp,lpc3220-uart"
- "ibm,qpace-nwp-serial" - "ibm,qpace-nwp-serial"
- "altr,16550-FIFO32"
- "altr,16550-FIFO64"
- "altr,16550-FIFO128"
- "serial" if the port type is unknown. - "serial" if the port type is unknown.
- reg : offset and length of the register set for the device. - reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt. - interrupts : should contain uart interrupt.
......
...@@ -301,7 +301,28 @@ static const struct serial8250_config uart_config[] = { ...@@ -301,7 +301,28 @@ static const struct serial8250_config uart_config[] = {
}, },
[PORT_8250_CIR] = { [PORT_8250_CIR] = {
.name = "CIR port" .name = "CIR port"
} },
[PORT_ALTR_16550_F32] = {
.name = "Altera 16550 FIFO32",
.fifo_size = 32,
.tx_loadsz = 32,
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags = UART_CAP_FIFO | UART_CAP_AFE,
},
[PORT_ALTR_16550_F64] = {
.name = "Altera 16550 FIFO64",
.fifo_size = 64,
.tx_loadsz = 64,
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags = UART_CAP_FIFO | UART_CAP_AFE,
},
[PORT_ALTR_16550_F128] = {
.name = "Altera 16550 FIFO128",
.fifo_size = 128,
.tx_loadsz = 128,
.fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags = UART_CAP_FIFO | UART_CAP_AFE,
},
}; };
/* Uart divisor latch read */ /* Uart divisor latch read */
...@@ -3396,3 +3417,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); ...@@ -3396,3 +3417,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
#endif #endif
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
#ifndef MODULE
/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
* working as well for the module options so we don't break people. We
* need to keep the names identical and the convenient macros will happily
* refuse to let us do that by failing the build with redefinition errors
* of global variables. So we stick them inside a dummy function to avoid
* those conflicts. The options still get parsed, and the redefined
* MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
*
* This is hacky. I'm sorry.
*/
static void __used s8250_options(void)
{
#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX "8250."
module_param_cb(share_irqs, &param_ops_uint, &share_irqs, 0644);
module_param_cb(nr_uarts, &param_ops_uint, &nr_uarts, 0644);
module_param_cb(skip_txen_test, &param_ops_uint, &skip_txen_test, 0644);
#ifdef CONFIG_SERIAL_8250_RSA
__module_param_call(MODULE_PARAM_PREFIX, probe_rsa,
&param_array_ops, .arr = &__param_arr_probe_rsa,
0444, -1);
#endif
}
#else
MODULE_ALIAS("8250");
#endif
...@@ -1571,6 +1571,7 @@ pci_wch_ch353_setup(struct serial_private *priv, ...@@ -1571,6 +1571,7 @@ pci_wch_ch353_setup(struct serial_private *priv,
/* Unknown vendors/cards - this should not be in linux/pci_ids.h */ /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
/* /*
* Master list of serial port init/setup/exit quirks. * Master list of serial port init/setup/exit quirks.
...@@ -1850,15 +1851,6 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { ...@@ -1850,15 +1851,6 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
.setup = pci_default_setup, .setup = pci_default_setup,
.exit = pci_plx9050_exit, .exit = pci_plx9050_exit,
}, },
{
.vendor = PCI_VENDOR_ID_PLX,
.device = PCI_DEVICE_ID_PLX_9050,
.subvendor = PCI_VENDOR_ID_PLX,
.subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
.init = pci_plx9050_init,
.setup = pci_default_setup,
.exit = pci_plx9050_exit,
},
{ {
.vendor = PCI_VENDOR_ID_PLX, .vendor = PCI_VENDOR_ID_PLX,
.device = PCI_DEVICE_ID_PLX_ROMULUS, .device = PCI_DEVICE_ID_PLX_ROMULUS,
...@@ -3733,7 +3725,12 @@ static struct pci_device_id serial_pci_tbl[] = { ...@@ -3733,7 +3725,12 @@ static struct pci_device_id serial_pci_tbl[] = {
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_VENDOR_ID_PLX, PCI_VENDOR_ID_PLX,
PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0, PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
pbn_b0_4_115200 }, pbn_b2_4_115200 },
/* Unknown card - subdevice 0x1588 */
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_VENDOR_ID_PLX,
PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
pbn_b2_8_115200 },
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_SUBVENDOR_ID_KEYSPAN, PCI_SUBVENDOR_ID_KEYSPAN,
PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0, PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
...@@ -4791,6 +4788,10 @@ static struct pci_device_id serial_pci_tbl[] = { ...@@ -4791,6 +4788,10 @@ static struct pci_device_id serial_pci_tbl[] = {
PCI_VENDOR_ID_IBM, 0x0299, PCI_VENDOR_ID_IBM, 0x0299,
0, 0, pbn_b0_bt_2_115200 }, 0, 0, pbn_b0_bt_2_115200 },
{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
0x1000, 0x0012,
0, 0, pbn_b0_bt_2_115200 },
{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
0xA000, 0x1000, 0xA000, 0x1000,
0, 0, pbn_b0_1_115200 }, 0, 0, pbn_b0_1_115200 },
......
...@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
{ {
struct uart_8250_port uart; struct uart_8250_port uart;
int ret, line, flags = dev_id->driver_data; int ret, line, flags = dev_id->driver_data;
struct resource *res = NULL;
if (flags & UNKNOWN_DEV) { if (flags & UNKNOWN_DEV) {
ret = serial_pnp_guess_board(dev); ret = serial_pnp_guess_board(dev);
...@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
memset(&uart, 0, sizeof(uart)); memset(&uart, 0, sizeof(uart));
if (pnp_irq_valid(dev, 0)) if (pnp_irq_valid(dev, 0))
uart.port.irq = pnp_irq(dev, 0); uart.port.irq = pnp_irq(dev, 0);
if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { if ((flags & CIR_PORT) && pnp_port_valid(dev, 2))
uart.port.iobase = pnp_port_start(dev, 2); res = pnp_get_resource(dev, IORESOURCE_IO, 2);
uart.port.iotype = UPIO_PORT; else if (pnp_port_valid(dev, 0))
} else if (pnp_port_valid(dev, 0)) { res = pnp_get_resource(dev, IORESOURCE_IO, 0);
uart.port.iobase = pnp_port_start(dev, 0); if (pnp_resource_enabled(res)) {
uart.port.iobase = res->start;
uart.port.iotype = UPIO_PORT; uart.port.iotype = UPIO_PORT;
} else if (pnp_mem_valid(dev, 0)) { } else if (pnp_mem_valid(dev, 0)) {
uart.port.mapbase = pnp_mem_start(dev, 0); uart.port.mapbase = pnp_mem_start(dev, 0);
......
...@@ -211,14 +211,14 @@ config SERIAL_SAMSUNG ...@@ -211,14 +211,14 @@ config SERIAL_SAMSUNG
config SERIAL_SAMSUNG_UARTS_4 config SERIAL_SAMSUNG_UARTS_4
bool bool
depends on PLAT_SAMSUNG depends on PLAT_SAMSUNG
default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442) default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
help help
Internal node for the common case of 4 Samsung compatible UARTs Internal node for the common case of 4 Samsung compatible UARTs
config SERIAL_SAMSUNG_UARTS config SERIAL_SAMSUNG_UARTS
int int
depends on PLAT_SAMSUNG depends on PLAT_SAMSUNG
default 6 if ARCH_S5P6450 default 6 if CPU_S5P6450
default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
default 3 default 3
help help
......
...@@ -235,7 +235,7 @@ static const char *bcm_uart_type(struct uart_port *port) ...@@ -235,7 +235,7 @@ static const char *bcm_uart_type(struct uart_port *port)
*/ */
static void bcm_uart_do_rx(struct uart_port *port) static void bcm_uart_do_rx(struct uart_port *port)
{ {
struct tty_port *port = &port->state->port; struct tty_port *tty_port = &port->state->port;
unsigned int max_count; unsigned int max_count;
/* limit number of char read in interrupt, should not be /* limit number of char read in interrupt, should not be
...@@ -260,7 +260,7 @@ static void bcm_uart_do_rx(struct uart_port *port) ...@@ -260,7 +260,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
bcm_uart_writel(port, val, UART_CTL_REG); bcm_uart_writel(port, val, UART_CTL_REG);
port->icount.overrun++; port->icount.overrun++;
tty_insert_flip_char(port, 0, TTY_OVERRUN); tty_insert_flip_char(tty_port, 0, TTY_OVERRUN);
} }
if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY))) if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY)))
...@@ -299,11 +299,11 @@ static void bcm_uart_do_rx(struct uart_port *port) ...@@ -299,11 +299,11 @@ static void bcm_uart_do_rx(struct uart_port *port)
if ((cstat & port->ignore_status_mask) == 0) if ((cstat & port->ignore_status_mask) == 0)
tty_insert_flip_char(port, c, flag); tty_insert_flip_char(tty_port, c, flag);
} while (--max_count); } while (--max_count);
tty_flip_buffer_push(port); tty_flip_buffer_push(tty_port);
} }
/* /*
......
...@@ -550,7 +550,7 @@ static int mpc512x_psc_clock(struct uart_port *port, int enable) ...@@ -550,7 +550,7 @@ static int mpc512x_psc_clock(struct uart_port *port, int enable)
return 0; return 0;
psc_num = (port->mapbase & 0xf00) >> 8; psc_num = (port->mapbase & 0xf00) >> 8;
snprintf(clk_name, sizeof(clk_name), "psc%d_clk", psc_num); snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
psc_clk = clk_get(port->dev, clk_name); psc_clk = clk_get(port->dev, clk_name);
if (IS_ERR(psc_clk)) { if (IS_ERR(psc_clk)) {
dev_err(port->dev, "Failed to get PSC clock entry!\n"); dev_err(port->dev, "Failed to get PSC clock entry!\n");
......
...@@ -241,6 +241,12 @@ static struct of_device_id of_platform_serial_table[] = { ...@@ -241,6 +241,12 @@ static struct of_device_id of_platform_serial_table[] = {
{ .compatible = "ns16850", .data = (void *)PORT_16850, }, { .compatible = "ns16850", .data = (void *)PORT_16850, },
{ .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, },
{ .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, },
{ .compatible = "altr,16550-FIFO32",
.data = (void *)PORT_ALTR_16550_F32, },
{ .compatible = "altr,16550-FIFO64",
.data = (void *)PORT_ALTR_16550_F64, },
{ .compatible = "altr,16550-FIFO128",
.data = (void *)PORT_ALTR_16550_F128, },
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
{ .compatible = "ibm,qpace-nwp-serial", { .compatible = "ibm,qpace-nwp-serial",
.data = (void *)PORT_NWPSERIAL, }, .data = (void *)PORT_NWPSERIAL, },
......
...@@ -611,14 +611,7 @@ static int vt8500_serial_probe(struct platform_device *pdev) ...@@ -611,14 +611,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
vt8500_port->uart.dev = &pdev->dev; vt8500_port->uart.dev = &pdev->dev;
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);
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 {
/* use the default of 24Mhz if not specified and warn */
pr_warn("%s: serial clock source not specified\n", __func__);
vt8500_port->uart.uartclk = 24000000;
}
snprintf(vt8500_port->name, sizeof(vt8500_port->name), snprintf(vt8500_port->name, sizeof(vt8500_port->name),
"VT8500 UART%d", pdev->id); "VT8500 UART%d", pdev->id);
......
...@@ -425,7 +425,7 @@ static void flush_to_ldisc(struct work_struct *work) ...@@ -425,7 +425,7 @@ static void flush_to_ldisc(struct work_struct *work)
struct tty_ldisc *disc; struct tty_ldisc *disc;
tty = port->itty; tty = port->itty;
if (WARN_RATELIMIT(tty == NULL, "tty is NULL\n")) if (tty == NULL)
return; return;
disc = tty_ldisc_ref(tty); disc = tty_ldisc_ref(tty);
......
...@@ -51,7 +51,10 @@ ...@@ -51,7 +51,10 @@
#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_BRCM_TRUMANAGE 25 #define PORT_BRCM_TRUMANAGE 25
#define PORT_MAX_8250 25 /* max port ID */ #define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */
#define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */
#define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */
#define PORT_MAX_8250 28 /* 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册