diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2015-05-26 15:59:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-01 06:55:12 +0900 |
commit | 0788c39b955151d92711800ce14f41154095bfa6 (patch) | |
tree | cab103edc82aa9bc47b2d62c90af56f27c90fe47 /drivers/tty | |
parent | 6f0c3091e73df7ad1393c3400d168b9777b4a63c (diff) |
serial: 8250_dw: support ACPI platforms with integrated DMA engine
On many new Intel SoCs the UART has an integrated DMA engine
(iDMA). In order to use it a special filter function is needed.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/8250/8250_dw.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 176f18f2e3ab..d48b50641e9a 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -377,6 +377,16 @@ static int dw8250_probe_of(struct uart_port *p, return 0; } +static bool dw8250_idma_filter(struct dma_chan *chan, void *param) +{ + struct device *dev = param; + + if (dev != chan->device->dev->parent) + return false; + + return true; +} + static int dw8250_probe_acpi(struct uart_8250_port *up, struct dw8250_data *data) { @@ -389,8 +399,15 @@ static int dw8250_probe_acpi(struct uart_8250_port *up, p->serial_out = dw8250_serial_out32; p->regshift = 2; - up->dma = &data->dma; + /* Platforms with iDMA */ + if (platform_get_resource_byname(to_platform_device(up->port.dev), + IORESOURCE_MEM, "lpss_priv")) { + data->dma.rx_param = up->port.dev->parent; + data->dma.tx_param = up->port.dev->parent; + data->dma.fn = dw8250_idma_filter; + } + up->dma = &data->dma; up->dma->rxconf.src_maxburst = p->fifosize / 4; up->dma->txconf.dst_maxburst = p->fifosize / 4; |