| From bec65954c2918c1a826fc21b29e41b788d2a0f86 Mon Sep 17 00:00:00 2001 |
| From: Heikki Krogerus <heikki.krogerus@linux.intel.com> |
| Date: Thu, 5 Sep 2013 17:34:53 +0300 |
| Subject: 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> |
| (cherry picked from commit fe95855539fd0a0e54412efc596adfe802a5c605) |
| Signed-off-by: Darren Hart <dvhart@linux.intel.com> |
| --- |
| drivers/tty/serial/8250/8250_dw.c | 18 +++++++++--------- |
| 1 file changed, 9 insertions(+), 9 deletions(-) |
| |
| --- a/drivers/tty/serial/8250/8250_dw.c |
| +++ b/drivers/tty/serial/8250/8250_dw.c |
| @@ -56,10 +56,11 @@ |
| |
| |
| struct dw8250_data { |
| - int last_mcr; |
| - int line; |
| - struct clk *clk; |
| - u8 usr_reg; |
| + u8 usr_reg; |
| + int last_mcr; |
| + int line; |
| + struct clk *clk; |
| + struct uart_8250_dma dma; |
| }; |
| |
| static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value) |
| @@ -271,7 +272,8 @@ static int dw8250_probe_of(struct uart_p |
| } |
| |
| #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; |
| struct uart_port *p = &up->port; |
| @@ -290,9 +292,7 @@ static int dw8250_probe_acpi(struct uart |
| if (!p->uartclk) |
| p->uartclk = (unsigned int)id->driver_data; |
| |
| - up->dma = devm_kzalloc(p->dev, sizeof(*up->dma), GFP_KERNEL); |
| - if (!up->dma) |
| - return -ENOMEM; |
| + up->dma = &data->dma; |
| |
| up->dma->rxconf.src_maxburst = p->fifosize / 4; |
| up->dma->txconf.dst_maxburst = p->fifosize / 4; |
| @@ -354,7 +354,7 @@ static int dw8250_probe(struct platform_ |
| if (err) |
| return err; |
| } else if (ACPI_HANDLE(&pdev->dev)) { |
| - err = dw8250_probe_acpi(&uart); |
| + err = dw8250_probe_acpi(&uart, data); |
| if (err) |
| return err; |
| } else { |