serial: 8250_dw: don't limit DMA support to ACPI

It should be available for DT users as well. This does not
enable DMA by default except with ACPI. DT users can enable
DMA based on a property.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Heikki Krogerus 2013-09-05 17:34:53 +03:00 committed by Greg Kroah-Hartman
parent 2797f6fb67
commit fe95855539
1 changed files with 10 additions and 10 deletions

View File

@ -56,11 +56,12 @@
struct dw8250_data { struct dw8250_data {
int last_lcr; u8 usr_reg;
int last_mcr; int last_lcr;
int line; int last_mcr;
struct clk *clk; int line;
u8 usr_reg; struct clk *clk;
struct uart_8250_dma dma;
}; };
static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value) static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value)
@ -241,7 +242,8 @@ static int dw8250_probe_of(struct uart_port *p,
} }
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static int dw8250_probe_acpi(struct uart_8250_port *up) static int dw8250_probe_acpi(struct uart_8250_port *up,
struct dw8250_data *data)
{ {
const struct acpi_device_id *id; const struct acpi_device_id *id;
struct uart_port *p = &up->port; struct uart_port *p = &up->port;
@ -260,9 +262,7 @@ static int dw8250_probe_acpi(struct uart_8250_port *up)
if (!p->uartclk) if (!p->uartclk)
p->uartclk = (unsigned int)id->driver_data; p->uartclk = (unsigned int)id->driver_data;
up->dma = devm_kzalloc(p->dev, sizeof(*up->dma), GFP_KERNEL); up->dma = &data->dma;
if (!up->dma)
return -ENOMEM;
up->dma->rxconf.src_maxburst = p->fifosize / 4; up->dma->rxconf.src_maxburst = p->fifosize / 4;
up->dma->txconf.dst_maxburst = p->fifosize / 4; up->dma->txconf.dst_maxburst = p->fifosize / 4;
@ -324,7 +324,7 @@ static int dw8250_probe(struct platform_device *pdev)
if (err) if (err)
return err; return err;
} else if (ACPI_HANDLE(&pdev->dev)) { } else if (ACPI_HANDLE(&pdev->dev)) {
err = dw8250_probe_acpi(&uart); err = dw8250_probe_acpi(&uart, data);
if (err) if (err)
return err; return err;
} else { } else {