Commit 8f3207c7 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull tty/serial updates from Greg KH:
 "Here is the "big" TTY/Serial patch updates for 4.12-rc1

  Not a lot of new things here, the normal number of serial driver
  updates and additions, tiny bugs fixed, and some core files split up
  to make future changes a bit easier for Nicolas's "tiny-tty" work.

  All of these have been in linux-next for a while"

* tag 'tty-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (62 commits)
  serial: small Makefile reordering
  tty: split job control support into a file of its own
  tty: move baudrate handling code to a file of its own
  console: move console_init() out of tty_io.c
  serial: 8250_early: Add earlycon support for Palmchip UART
  tty: pl011: use "qdf2400_e44" as the earlycon name for QDF2400 E44
  vt: make mouse selection of non-ASCII consistent
  vt: set mouse selection word-chars to gpm's default
  imx-serial: Reduce RX DMA startup latency when opening for reading
  serial: omap: suspend device on probe errors
  serial: omap: fix runtime-pm handling on unbind
  tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT init
  serial: samsung: Remove useless spinlock
  serial: samsung: Add missing checks for dma_map_single failure
  serial: samsung: Use right device for DMA-mapping calls
  serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off
  tty: fix comment typo s/repsonsible/responsible/
  tty: amba-pl011: Fix spurious TX interrupts
  serial: xuartps: Enable clocks in the pm disable case also
  serial: core: Re-use struct uart_port {name} field
  ...
parents bf5f8946 8e1c21f4
Spreadtrum SoC Platforms Device Tree Bindings Spreadtrum SoC Platforms Device Tree Bindings
---------------------------------------------------- ----------------------------------------------------
Sharkl64 is a Spreadtrum's SoC Platform which is based SC9836 openphone Board
on ARM 64-bit processor. Required root node properties:
- compatible = "sprd,sc9836-openphone", "sprd,sc9836";
SC9836 openphone board with SC9836 SoC based on the SC9860 SoC
Sharkl64 Platform shall have the following properties. Required root node properties:
- compatible = "sprd,sc9860"
SP9860G 3GFHD Board
Required root node properties: Required root node properties:
- compatible = "sprd,sc9836-openphone", "sprd,sc9836"; - compatible = "sprd,sp9860g-1h10", "sprd,sc9860";
* Spreadtrum serial UART * Spreadtrum serial UART
Required properties: Required properties:
- compatible: must be "sprd,sc9836-uart" - compatible: must be one of:
* "sprd,sc9836-uart"
* "sprd,sc9860-uart", "sprd,sc9836-uart"
- reg: offset and length of the register set for the device - reg: offset and length of the register set for the device
- interrupts: exactly one interrupt specifier - interrupts: exactly one interrupt specifier
- clocks: phandles to input clocks. - clocks: phandles to input clocks.
Example:
uart0: serial@0 {
compatible = "sprd,sc9860-uart",
"sprd,sc9836-uart";
reg = <0x0 0x100>;
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ext_26m>;
};
...@@ -8418,7 +8418,7 @@ MICROCHIP / ATMEL AT91 / AT32 SERIAL DRIVER ...@@ -8418,7 +8418,7 @@ MICROCHIP / ATMEL AT91 / AT32 SERIAL DRIVER
M: Richard Genoud <richard.genoud@gmail.com> M: Richard Genoud <richard.genoud@gmail.com>
S: Maintained S: Maintained
F: drivers/tty/serial/atmel_serial.c F: drivers/tty/serial/atmel_serial.c
F: include/linux/atmel_serial.h F: drivers/tty/serial/atmel_serial.h
MICROCHIP / ATMEL DMA DRIVER MICROCHIP / ATMEL DMA DRIVER
M: Ludovic Desroches <ludovic.desroches@microchip.com> M: Ludovic Desroches <ludovic.desroches@microchip.com>
......
obj-$(CONFIG_TTY) += tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o \ obj-$(CONFIG_TTY) += tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o \
tty_buffer.o tty_port.o tty_mutex.o tty_ldsem.o tty_buffer.o tty_port.o tty_mutex.o \
tty_ldsem.o tty_baudrate.o tty_jobctrl.o
obj-$(CONFIG_LEGACY_PTYS) += pty.o obj-$(CONFIG_LEGACY_PTYS) += pty.o
obj-$(CONFIG_UNIX98_PTYS) += pty.o obj-$(CONFIG_UNIX98_PTYS) += pty.o
obj-$(CONFIG_AUDIT) += tty_audit.o obj-$(CONFIG_AUDIT) += tty_audit.o
......
...@@ -920,17 +920,17 @@ int hvc_remove(struct hvc_struct *hp) ...@@ -920,17 +920,17 @@ int hvc_remove(struct hvc_struct *hp)
tty = tty_port_tty_get(&hp->port); tty = tty_port_tty_get(&hp->port);
console_lock();
spin_lock_irqsave(&hp->lock, flags); spin_lock_irqsave(&hp->lock, flags);
if (hp->index < MAX_NR_HVC_CONSOLES) { if (hp->index < MAX_NR_HVC_CONSOLES) {
console_lock();
vtermnos[hp->index] = -1; vtermnos[hp->index] = -1;
cons_ops[hp->index] = NULL; cons_ops[hp->index] = NULL;
console_unlock();
} }
/* Don't whack hp->irq because tty_hangup() will need to free the irq. */ /* Don't whack hp->irq because tty_hangup() will need to free the irq. */
spin_unlock_irqrestore(&hp->lock, flags); spin_unlock_irqrestore(&hp->lock, flags);
console_unlock();
/* /*
* We 'put' the instance that was grabbed when the kref instance * We 'put' the instance that was grabbed when the kref instance
......
...@@ -1575,7 +1575,7 @@ static int __init hvcs_module_init(void) ...@@ -1575,7 +1575,7 @@ static int __init hvcs_module_init(void)
*/ */
rc = driver_create_file(&(hvcs_vio_driver.driver), &driver_attr_rescan); rc = driver_create_file(&(hvcs_vio_driver.driver), &driver_attr_rescan);
if (rc) if (rc)
pr_warning("HVCS: Failed to create rescan file (err %d)\n", rc); pr_warn("HVCS: Failed to create rescan file (err %d)\n", rc);
return 0; return 0;
} }
......
...@@ -89,18 +89,14 @@ module_param(debug, int, 0600); ...@@ -89,18 +89,14 @@ module_param(debug, int, 0600);
/** /**
* struct gsm_mux_net - network interface * struct gsm_mux_net - network interface
* @struct gsm_dlci* dlci * @struct gsm_dlci* dlci
* @struct net_device_stats stats;
* *
* Created when net interface is initialized. * Created when net interface is initialized.
**/ **/
struct gsm_mux_net { struct gsm_mux_net {
struct kref ref; struct kref ref;
struct gsm_dlci *dlci; struct gsm_dlci *dlci;
struct net_device_stats stats;
}; };
#define STATS(net) (((struct gsm_mux_net *)netdev_priv(net))->stats)
/* /*
* Each block of data we have queued to go out is in the form of * Each block of data we have queued to go out is in the form of
* a gsm_msg which holds everything we need in a link layer independent * a gsm_msg which holds everything we need in a link layer independent
...@@ -2613,10 +2609,6 @@ static int gsm_mux_net_close(struct net_device *net) ...@@ -2613,10 +2609,6 @@ static int gsm_mux_net_close(struct net_device *net)
return 0; return 0;
} }
static struct net_device_stats *gsm_mux_net_get_stats(struct net_device *net)
{
return &((struct gsm_mux_net *)netdev_priv(net))->stats;
}
static void dlci_net_free(struct gsm_dlci *dlci) static void dlci_net_free(struct gsm_dlci *dlci)
{ {
if (!dlci->net) { if (!dlci->net) {
...@@ -2660,8 +2652,8 @@ static int gsm_mux_net_start_xmit(struct sk_buff *skb, ...@@ -2660,8 +2652,8 @@ static int gsm_mux_net_start_xmit(struct sk_buff *skb,
muxnet_get(mux_net); muxnet_get(mux_net);
skb_queue_head(&dlci->skb_list, skb); skb_queue_head(&dlci->skb_list, skb);
STATS(net).tx_packets++; net->stats.tx_packets++;
STATS(net).tx_bytes += skb->len; net->stats.tx_bytes += skb->len;
gsm_dlci_data_kick(dlci); gsm_dlci_data_kick(dlci);
/* And tell the kernel when the last transmit started. */ /* And tell the kernel when the last transmit started. */
netif_trans_update(net); netif_trans_update(net);
...@@ -2676,7 +2668,7 @@ static void gsm_mux_net_tx_timeout(struct net_device *net) ...@@ -2676,7 +2668,7 @@ static void gsm_mux_net_tx_timeout(struct net_device *net)
dev_dbg(&net->dev, "Tx timed out.\n"); dev_dbg(&net->dev, "Tx timed out.\n");
/* Update statistics */ /* Update statistics */
STATS(net).tx_errors++; net->stats.tx_errors++;
} }
static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
...@@ -2691,7 +2683,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, ...@@ -2691,7 +2683,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
skb = dev_alloc_skb(size + NET_IP_ALIGN); skb = dev_alloc_skb(size + NET_IP_ALIGN);
if (!skb) { if (!skb) {
/* We got no receive buffer. */ /* We got no receive buffer. */
STATS(net).rx_dropped++; net->stats.rx_dropped++;
muxnet_put(mux_net); muxnet_put(mux_net);
return; return;
} }
...@@ -2705,8 +2697,8 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, ...@@ -2705,8 +2697,8 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
netif_rx(skb); netif_rx(skb);
/* update out statistics */ /* update out statistics */
STATS(net).rx_packets++; net->stats.rx_packets++;
STATS(net).rx_bytes += size; net->stats.rx_bytes += size;
muxnet_put(mux_net); muxnet_put(mux_net);
return; return;
} }
...@@ -2718,7 +2710,6 @@ static void gsm_mux_net_init(struct net_device *net) ...@@ -2718,7 +2710,6 @@ static void gsm_mux_net_init(struct net_device *net)
.ndo_stop = gsm_mux_net_close, .ndo_stop = gsm_mux_net_close,
.ndo_start_xmit = gsm_mux_net_start_xmit, .ndo_start_xmit = gsm_mux_net_start_xmit,
.ndo_tx_timeout = gsm_mux_net_tx_timeout, .ndo_tx_timeout = gsm_mux_net_tx_timeout,
.ndo_get_stats = gsm_mux_net_get_stats,
}; };
net->netdev_ops = &gsm_netdev_ops; net->netdev_ops = &gsm_netdev_ops;
......
...@@ -216,16 +216,11 @@ static int pty_signal(struct tty_struct *tty, int sig) ...@@ -216,16 +216,11 @@ static int pty_signal(struct tty_struct *tty, int sig)
static void pty_flush_buffer(struct tty_struct *tty) static void pty_flush_buffer(struct tty_struct *tty)
{ {
struct tty_struct *to = tty->link; struct tty_struct *to = tty->link;
struct tty_ldisc *ld;
if (!to) if (!to)
return; return;
ld = tty_ldisc_ref(to); tty_buffer_flush(to, NULL);
tty_buffer_flush(to, ld);
if (ld)
tty_ldisc_deref(ld);
if (to->packet) { if (to->packet) {
spin_lock_irq(&tty->ctrl_lock); spin_lock_irq(&tty->ctrl_lock);
tty->ctrl_status |= TIOCPKT_FLUSHWRITE; tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
......
...@@ -116,17 +116,41 @@ void serdev_device_close(struct serdev_device *serdev) ...@@ -116,17 +116,41 @@ void serdev_device_close(struct serdev_device *serdev)
} }
EXPORT_SYMBOL_GPL(serdev_device_close); EXPORT_SYMBOL_GPL(serdev_device_close);
int serdev_device_write_buf(struct serdev_device *serdev, void serdev_device_write_wakeup(struct serdev_device *serdev)
const unsigned char *buf, size_t count) {
complete(&serdev->write_comp);
}
EXPORT_SYMBOL_GPL(serdev_device_write_wakeup);
int serdev_device_write(struct serdev_device *serdev,
const unsigned char *buf, size_t count,
unsigned long timeout)
{ {
struct serdev_controller *ctrl = serdev->ctrl; struct serdev_controller *ctrl = serdev->ctrl;
int ret;
if (!ctrl || !ctrl->ops->write_buf) if (!ctrl || !ctrl->ops->write_buf ||
(timeout && !serdev->ops->write_wakeup))
return -EINVAL; return -EINVAL;
return ctrl->ops->write_buf(ctrl, buf, count); mutex_lock(&serdev->write_lock);
do {
reinit_completion(&serdev->write_comp);
ret = ctrl->ops->write_buf(ctrl, buf, count);
if (ret < 0)
break;
buf += ret;
count -= ret;
} while (count &&
(timeout = wait_for_completion_timeout(&serdev->write_comp,
timeout)));
mutex_unlock(&serdev->write_lock);
return ret < 0 ? ret : (count ? -ETIMEDOUT : 0);
} }
EXPORT_SYMBOL_GPL(serdev_device_write_buf); EXPORT_SYMBOL_GPL(serdev_device_write);
void serdev_device_write_flush(struct serdev_device *serdev) void serdev_device_write_flush(struct serdev_device *serdev)
{ {
...@@ -262,6 +286,8 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl) ...@@ -262,6 +286,8 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl)
serdev->dev.parent = &ctrl->dev; serdev->dev.parent = &ctrl->dev;
serdev->dev.bus = &serdev_bus_type; serdev->dev.bus = &serdev_bus_type;
serdev->dev.type = &serdev_device_type; serdev->dev.type = &serdev_device_type;
init_completion(&serdev->write_comp);
mutex_init(&serdev->write_lock);
return serdev; return serdev;
} }
EXPORT_SYMBOL_GPL(serdev_device_alloc); EXPORT_SYMBOL_GPL(serdev_device_alloc);
......
...@@ -218,7 +218,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up) ...@@ -218,7 +218,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
spin_unlock_irq(&i->lock); spin_unlock_irq(&i->lock);
irq_flags |= up->port.irqflags; irq_flags |= up->port.irqflags;
ret = request_irq(up->port.irq, serial8250_interrupt, ret = request_irq(up->port.irq, serial8250_interrupt,
irq_flags, "serial", i); irq_flags, up->port.name, i);
if (ret < 0) if (ret < 0)
serial_do_unlink(i, up); serial_do_unlink(i, up);
} }
......
...@@ -530,12 +530,11 @@ static int dw8250_probe(struct platform_device *pdev) ...@@ -530,12 +530,11 @@ static int dw8250_probe(struct platform_device *pdev)
} }
data->rst = devm_reset_control_get_optional(dev, NULL); data->rst = devm_reset_control_get_optional(dev, NULL);
if (IS_ERR(data->rst) && PTR_ERR(data->rst) == -EPROBE_DEFER) { if (IS_ERR(data->rst)) {
err = -EPROBE_DEFER; err = PTR_ERR(data->rst);
goto err_pclk; goto err_pclk;
} }
if (!IS_ERR(data->rst)) reset_control_deassert(data->rst);
reset_control_deassert(data->rst);
dw8250_quirks(p, data); dw8250_quirks(p, data);
...@@ -567,8 +566,7 @@ static int dw8250_probe(struct platform_device *pdev) ...@@ -567,8 +566,7 @@ static int dw8250_probe(struct platform_device *pdev)
return 0; return 0;
err_reset: err_reset:
if (!IS_ERR(data->rst)) reset_control_assert(data->rst);
reset_control_assert(data->rst);
err_pclk: err_pclk:
if (!IS_ERR(data->pclk)) if (!IS_ERR(data->pclk))
...@@ -589,8 +587,7 @@ static int dw8250_remove(struct platform_device *pdev) ...@@ -589,8 +587,7 @@ static int dw8250_remove(struct platform_device *pdev)
serial8250_unregister_port(data->line); serial8250_unregister_port(data->line);
if (!IS_ERR(data->rst)) reset_control_assert(data->rst);
reset_control_assert(data->rst);
if (!IS_ERR(data->pclk)) if (!IS_ERR(data->pclk))
clk_disable_unprepare(data->pclk); clk_disable_unprepare(data->pclk);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
static unsigned int __init serial8250_early_in(struct uart_port *port, int offset) static unsigned int __init serial8250_early_in(struct uart_port *port, int offset)
{ {
int reg_offset = offset;
offset <<= port->regshift; offset <<= port->regshift;
switch (port->iotype) { switch (port->iotype) {
...@@ -52,6 +53,8 @@ static unsigned int __init serial8250_early_in(struct uart_port *port, int offse ...@@ -52,6 +53,8 @@ static unsigned int __init serial8250_early_in(struct uart_port *port, int offse
return ioread32be(port->membase + offset); return ioread32be(port->membase + offset);
case UPIO_PORT: case UPIO_PORT:
return inb(port->iobase + offset); return inb(port->iobase + offset);
case UPIO_AU:
return port->serial_in(port, reg_offset);
default: default:
return 0; return 0;
} }
...@@ -59,6 +62,7 @@ static unsigned int __init serial8250_early_in(struct uart_port *port, int offse ...@@ -59,6 +62,7 @@ static unsigned int __init serial8250_early_in(struct uart_port *port, int offse
static void __init serial8250_early_out(struct uart_port *port, int offset, int value) static void __init serial8250_early_out(struct uart_port *port, int offset, int value)
{ {
int reg_offset = offset;
offset <<= port->regshift; offset <<= port->regshift;
switch (port->iotype) { switch (port->iotype) {
...@@ -77,6 +81,9 @@ static void __init serial8250_early_out(struct uart_port *port, int offset, int ...@@ -77,6 +81,9 @@ static void __init serial8250_early_out(struct uart_port *port, int offset, int
case UPIO_PORT: case UPIO_PORT:
outb(value, port->iobase + offset); outb(value, port->iobase + offset);
break; break;
case UPIO_AU:
port->serial_out(port, reg_offset, value);
break;
} }
} }
...@@ -172,3 +179,20 @@ OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup); ...@@ -172,3 +179,20 @@ OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup);
OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup); OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup);
#endif #endif
#ifdef CONFIG_SERIAL_8250_RT288X
unsigned int au_serial_in(struct uart_port *p, int offset);
void au_serial_out(struct uart_port *p, int offset, int value);
static int __init early_au_setup(struct earlycon_device *dev, const char *opt)
{
dev->port.serial_in = au_serial_in;
dev->port.serial_out = au_serial_out;
dev->port.iotype = UPIO_AU;
dev->con->write = early_serial8250_write;
return 0;
}
OF_EARLYCON_DECLARE(palmchip, "ralink,rt2880-uart", early_au_setup);
#endif
...@@ -483,5 +483,5 @@ static struct pci_driver exar_pci_driver = { ...@@ -483,5 +483,5 @@ static struct pci_driver exar_pci_driver = {
module_pci_driver(exar_pci_driver); module_pci_driver(exar_pci_driver);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Exar Serial Dricer"); MODULE_DESCRIPTION("Exar Serial Driver");
MODULE_AUTHOR("Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>"); MODULE_AUTHOR("Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>");
...@@ -61,6 +61,12 @@ ...@@ -61,6 +61,12 @@
* The IRQ setting mode of F81866 is not the same with F81216 series. * The IRQ setting mode of F81866 is not the same with F81216 series.
* Level/Low: IRQ_MODE0:0, IRQ_MODE1:0 * Level/Low: IRQ_MODE0:0, IRQ_MODE1:0
* Edge/High: IRQ_MODE0:1, IRQ_MODE1:0 * Edge/High: IRQ_MODE0:1, IRQ_MODE1:0
*
* Clock speeds for UART (register F2h)
* 00: 1.8432MHz.
* 01: 18.432MHz.
* 10: 24MHz.
* 11: 14.769MHz.
*/ */
#define F81866_IRQ_MODE 0xf0 #define F81866_IRQ_MODE 0xf0
#define F81866_IRQ_SHARE BIT(0) #define F81866_IRQ_SHARE BIT(0)
...@@ -72,6 +78,13 @@ ...@@ -72,6 +78,13 @@
#define F81866_LDN_LOW 0x10 #define F81866_LDN_LOW 0x10
#define F81866_LDN_HIGH 0x16 #define F81866_LDN_HIGH 0x16
#define F81866_UART_CLK 0xF2
#define F81866_UART_CLK_MASK (BIT(1) | BIT(0))
#define F81866_UART_CLK_1_8432MHZ 0
#define F81866_UART_CLK_14_769MHZ (BIT(1) | BIT(0))
#define F81866_UART_CLK_18_432MHZ BIT(0)
#define F81866_UART_CLK_24MHZ BIT(1)
struct fintek_8250 { struct fintek_8250 {
u16 pid; u16 pid;
u16 base_port; u16 base_port;
...@@ -256,8 +269,26 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata) ...@@ -256,8 +269,26 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata)
} }
} }
static int probe_setup_port(struct fintek_8250 *pdata, u16 io_address, static void fintek_8250_goto_highspeed(struct uart_8250_port *uart,
unsigned int irq) struct fintek_8250 *pdata)
{
sio_write_reg(pdata, LDN, pdata->index);
switch (pdata->pid) {
case CHIP_ID_F81866: /* set uart clock for high speed serial mode */
sio_write_mask_reg(pdata, F81866_UART_CLK,
F81866_UART_CLK_MASK,
F81866_UART_CLK_14_769MHZ);
uart->port.uartclk = 921600 * 16;
break;
default: /* leave clock speed untouched */
break;
}
}
static int probe_setup_port(struct fintek_8250 *pdata,
struct uart_8250_port *uart)
{ {
static const u16 addr[] = {0x4e, 0x2e}; static const u16 addr[] = {0x4e, 0x2e};
static const u8 keys[] = {0x77, 0xa0, 0x87, 0x67}; static const u8 keys[] = {0x77, 0xa0, 0x87, 0x67};
...@@ -284,18 +315,20 @@ static int probe_setup_port(struct fintek_8250 *pdata, u16 io_address, ...@@ -284,18 +315,20 @@ static int probe_setup_port(struct fintek_8250 *pdata, u16 io_address,
sio_write_reg(pdata, LDN, k); sio_write_reg(pdata, LDN, k);
aux = sio_read_reg(pdata, IO_ADDR1); aux = sio_read_reg(pdata, IO_ADDR1);
aux |= sio_read_reg(pdata, IO_ADDR2) << 8; aux |= sio_read_reg(pdata, IO_ADDR2) << 8;
if (aux != io_address) if (aux != uart->port.iobase)
continue; continue;
pdata->index = k; pdata->index = k;
irq_data = irq_get_irq_data(irq); irq_data = irq_get_irq_data(uart->port.irq);
if (irq_data) if (irq_data)
level_mode = level_mode =
irqd_is_level_type(irq_data); irqd_is_level_type(irq_data);
fintek_8250_set_irq_mode(pdata, level_mode); fintek_8250_set_irq_mode(pdata, level_mode);
fintek_8250_set_max_fifo(pdata); fintek_8250_set_max_fifo(pdata);
fintek_8250_goto_highspeed(uart, pdata);
fintek_8250_exit_key(addr[i]); fintek_8250_exit_key(addr[i]);
return 0; return 0;
...@@ -330,7 +363,7 @@ int fintek_8250_probe(struct uart_8250_port *uart) ...@@ -330,7 +363,7 @@ int fintek_8250_probe(struct uart_8250_port *uart)
struct fintek_8250 *pdata; struct fintek_8250 *pdata;
struct fintek_8250 probe_data; struct fintek_8250 probe_data;
if (probe_setup_port(&probe_data, uart->port.iobase, uart->port.irq)) if (probe_setup_port(&probe_data, uart))
return -ENODEV; return -ENODEV;
pdata = devm_kzalloc(uart->port.dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(uart->port.dev, sizeof(*pdata), GFP_KERNEL);
......
...@@ -183,7 +183,6 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) ...@@ -183,7 +183,6 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port)
if (ret) if (ret)
return; return;
pci_set_master(pdev);
pci_try_set_mwi(pdev); pci_try_set_mwi(pdev);
/* Special DMA address for UART */ /* Special DMA address for UART */
...@@ -216,6 +215,8 @@ static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port *port) ...@@ -216,6 +215,8 @@ static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port *port)
struct pci_dev *pdev = to_pci_dev(port->dev); struct pci_dev *pdev = to_pci_dev(port->dev);
int ret; int ret;
pci_set_master(pdev);
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -328,7 +328,7 @@ static const s8 au_io_out_map[8] = { ...@@ -328,7 +328,7 @@ static const s8 au_io_out_map[8] = {
-1, /* UART_SCR (unmapped) */ -1, /* UART_SCR (unmapped) */
}; };
static unsigned int au_serial_in(struct uart_port *p, int offset) unsigned int au_serial_in(struct uart_port *p, int offset)
{ {
if (offset >= ARRAY_SIZE(au_io_in_map)) if (offset >= ARRAY_SIZE(au_io_in_map))
return UINT_MAX; return UINT_MAX;
...@@ -338,7 +338,7 @@ static unsigned int au_serial_in(struct uart_port *p, int offset) ...@@ -338,7 +338,7 @@ static unsigned int au_serial_in(struct uart_port *p, int offset)
return __raw_readl(p->membase + (offset << p->regshift)); return __raw_readl(p->membase + (offset << p->regshift));
} }
static void au_serial_out(struct uart_port *p, int offset, int value) void au_serial_out(struct uart_port *p, int offset, int value)
{ {
if (offset >= ARRAY_SIZE(au_io_out_map)) if (offset >= ARRAY_SIZE(au_io_out_map))
return; return;
......
...@@ -630,6 +630,15 @@ config SERIAL_UARTLITE_CONSOLE ...@@ -630,6 +630,15 @@ config SERIAL_UARTLITE_CONSOLE
console (the system console is the device which receives all kernel console (the system console is the device which receives all kernel
messages and warnings and which allows logins in single user mode). messages and warnings and which allows logins in single user mode).
config SERIAL_UARTLITE_NR_UARTS
int "Maximum number of uartlite serial ports"
depends on SERIAL_UARTLITE
range 1 256
default 1
help
Set this to the number of uartlites in your system, or the number
you think you might implement.