Skip to content

Commit 0788c39

Browse files
Heikki Krogerusgregkh
authored andcommitted
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>
1 parent 6f0c309 commit 0788c39

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/tty/serial/8250/8250_dw.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,16 @@ static int dw8250_probe_of(struct uart_port *p,
377377
return 0;
378378
}
379379

380+
static bool dw8250_idma_filter(struct dma_chan *chan, void *param)
381+
{
382+
struct device *dev = param;
383+
384+
if (dev != chan->device->dev->parent)
385+
return false;
386+
387+
return true;
388+
}
389+
380390
static int dw8250_probe_acpi(struct uart_8250_port *up,
381391
struct dw8250_data *data)
382392
{
@@ -389,8 +399,15 @@ static int dw8250_probe_acpi(struct uart_8250_port *up,
389399
p->serial_out = dw8250_serial_out32;
390400
p->regshift = 2;
391401

392-
up->dma = &data->dma;
402+
/* Platforms with iDMA */
403+
if (platform_get_resource_byname(to_platform_device(up->port.dev),
404+
IORESOURCE_MEM, "lpss_priv")) {
405+
data->dma.rx_param = up->port.dev->parent;
406+
data->dma.tx_param = up->port.dev->parent;
407+
data->dma.fn = dw8250_idma_filter;
408+
}
393409

410+
up->dma = &data->dma;
394411
up->dma->rxconf.src_maxburst = p->fifosize / 4;
395412
up->dma->txconf.dst_maxburst = p->fifosize / 4;
396413

0 commit comments

Comments
 (0)