Commit 937bb6e4 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Vinod Koul

serial: sh-sci: don't filter on DMA device, use only channel ID

On some sh-mobile systems there are more than one DMA controllers, that
can be used for serial ports. Specifying a DMA device in sh-sci platform
data unnecessarily restricts the driver to only use one DMA controller.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
[Fixed the trivial conflict in include/linux/serial_sci.h]
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 7703eac9
...@@ -1439,12 +1439,8 @@ static bool filter(struct dma_chan *chan, void *slave) ...@@ -1439,12 +1439,8 @@ static bool filter(struct dma_chan *chan, void *slave)
dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__, dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__,
param->slave_id); param->slave_id);
if (param->dma_dev == chan->device->dev) { chan->private = param;
chan->private = param; return true;
return true;
} else {
return false;
}
} }
static void rx_timer_fn(unsigned long arg) static void rx_timer_fn(unsigned long arg)
...@@ -1470,10 +1466,10 @@ static void sci_request_dma(struct uart_port *port) ...@@ -1470,10 +1466,10 @@ static void sci_request_dma(struct uart_port *port)
dma_cap_mask_t mask; dma_cap_mask_t mask;
int nent; int nent;
dev_dbg(port->dev, "%s: port %d DMA %p\n", __func__, dev_dbg(port->dev, "%s: port %d\n", __func__,
port->line, s->cfg->dma_dev); port->line);
if (!s->cfg->dma_dev) if (s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0)
return; return;
dma_cap_zero(mask); dma_cap_zero(mask);
...@@ -1483,7 +1479,6 @@ static void sci_request_dma(struct uart_port *port) ...@@ -1483,7 +1479,6 @@ static void sci_request_dma(struct uart_port *port)
/* Slave ID, e.g., SHDMA_SLAVE_SCIF0_TX */ /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_TX */
param->slave_id = s->cfg->dma_slave_tx; param->slave_id = s->cfg->dma_slave_tx;
param->dma_dev = s->cfg->dma_dev;
s->cookie_tx = -EINVAL; s->cookie_tx = -EINVAL;
chan = dma_request_channel(mask, filter, param); chan = dma_request_channel(mask, filter, param);
...@@ -1512,7 +1507,6 @@ static void sci_request_dma(struct uart_port *port) ...@@ -1512,7 +1507,6 @@ static void sci_request_dma(struct uart_port *port)
/* Slave ID, e.g., SHDMA_SLAVE_SCIF0_RX */ /* Slave ID, e.g., SHDMA_SLAVE_SCIF0_RX */
param->slave_id = s->cfg->dma_slave_rx; param->slave_id = s->cfg->dma_slave_rx;
param->dma_dev = s->cfg->dma_dev;
chan = dma_request_channel(mask, filter, param); chan = dma_request_channel(mask, filter, param);
dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan); dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan);
...@@ -1557,9 +1551,6 @@ static void sci_free_dma(struct uart_port *port) ...@@ -1557,9 +1551,6 @@ static void sci_free_dma(struct uart_port *port)
{ {
struct sci_port *s = to_sci_port(port); struct sci_port *s = to_sci_port(port);
if (!s->cfg->dma_dev)
return;
if (s->chan_tx) if (s->chan_tx)
sci_tx_dma_release(s, false); sci_tx_dma_release(s, false);
if (s->chan_rx) if (s->chan_rx)
...@@ -1967,9 +1958,9 @@ static int __devinit sci_init_single(struct platform_device *dev, ...@@ -1967,9 +1958,9 @@ static int __devinit sci_init_single(struct platform_device *dev,
port->serial_in = sci_serial_in; port->serial_in = sci_serial_in;
port->serial_out = sci_serial_out; port->serial_out = sci_serial_out;
if (p->dma_dev) if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0)
dev_dbg(port->dev, "DMA device %p, tx %d, rx %d\n", dev_dbg(port->dev, "DMA tx %d, rx %d\n",
p->dma_dev, p->dma_slave_tx, p->dma_slave_rx); p->dma_slave_tx, p->dma_slave_rx);
return 0; return 0;
} }
......
...@@ -131,8 +131,6 @@ struct plat_sci_port { ...@@ -131,8 +131,6 @@ struct plat_sci_port {
struct plat_sci_port_ops *ops; struct plat_sci_port_ops *ops;
struct device *dma_dev;
unsigned int dma_slave_tx; unsigned int dma_slave_tx;
unsigned int dma_slave_rx; unsigned int dma_slave_rx;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment