aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/sh-sci.c23
-rw-r--r--include/linux/serial_sci.h3
2 files changed, 6 insertions, 20 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index a8607cacee6c..c6aa5b9c2bfd 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1387,20 +1387,14 @@ static void rx_timer_fn(unsigned long arg)
1387} 1387}
1388 1388
1389static struct dma_chan *sci_request_dma_chan(struct uart_port *port, 1389static struct dma_chan *sci_request_dma_chan(struct uart_port *port,
1390 enum dma_transfer_direction dir, 1390 enum dma_transfer_direction dir)
1391 unsigned int id)
1392{ 1391{
1393 dma_cap_mask_t mask;
1394 struct dma_chan *chan; 1392 struct dma_chan *chan;
1395 struct dma_slave_config cfg; 1393 struct dma_slave_config cfg;
1396 int ret; 1394 int ret;
1397 1395
1398 dma_cap_zero(mask); 1396 chan = dma_request_slave_channel(port->dev,
1399 dma_cap_set(DMA_SLAVE, mask); 1397 dir == DMA_MEM_TO_DEV ? "tx" : "rx");
1400
1401 chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
1402 (void *)(unsigned long)id, port->dev,
1403 dir == DMA_MEM_TO_DEV ? "tx" : "rx");
1404 if (!chan) { 1398 if (!chan) {
1405 dev_warn(port->dev, 1399 dev_warn(port->dev,
1406 "dma_request_slave_channel_compat failed\n"); 1400 "dma_request_slave_channel_compat failed\n");
@@ -1436,12 +1430,11 @@ static void sci_request_dma(struct uart_port *port)
1436 1430
1437 dev_dbg(port->dev, "%s: port %d\n", __func__, port->line); 1431 dev_dbg(port->dev, "%s: port %d\n", __func__, port->line);
1438 1432
1439 if (!port->dev->of_node && 1433 if (!port->dev->of_node)
1440 (s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0))
1441 return; 1434 return;
1442 1435
1443 s->cookie_tx = -EINVAL; 1436 s->cookie_tx = -EINVAL;
1444 chan = sci_request_dma_chan(port, DMA_MEM_TO_DEV, s->cfg->dma_slave_tx); 1437 chan = sci_request_dma_chan(port, DMA_MEM_TO_DEV);
1445 dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan); 1438 dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan);
1446 if (chan) { 1439 if (chan) {
1447 s->chan_tx = chan; 1440 s->chan_tx = chan;
@@ -1463,7 +1456,7 @@ static void sci_request_dma(struct uart_port *port)
1463 INIT_WORK(&s->work_tx, work_fn_tx); 1456 INIT_WORK(&s->work_tx, work_fn_tx);
1464 } 1457 }
1465 1458
1466 chan = sci_request_dma_chan(port, DMA_DEV_TO_MEM, s->cfg->dma_slave_rx); 1459 chan = sci_request_dma_chan(port, DMA_DEV_TO_MEM);
1467 dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan); 1460 dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan);
1468 if (chan) { 1461 if (chan) {
1469 unsigned int i; 1462 unsigned int i;
@@ -2706,10 +2699,6 @@ static int sci_init_single(struct platform_device *dev,
2706 port->serial_in = sci_serial_in; 2699 port->serial_in = sci_serial_in;
2707 port->serial_out = sci_serial_out; 2700 port->serial_out = sci_serial_out;
2708 2701
2709 if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0)
2710 dev_dbg(port->dev, "DMA tx %d, rx %d\n",
2711 p->dma_slave_tx, p->dma_slave_rx);
2712
2713 return 0; 2702 return 0;
2714} 2703}
2715 2704
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 9f2bfd055742..1a894c47bfc0 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -71,9 +71,6 @@ struct plat_sci_port {
71 unsigned char regtype; 71 unsigned char regtype;
72 72
73 struct plat_sci_port_ops *ops; 73 struct plat_sci_port_ops *ops;
74
75 unsigned int dma_slave_tx;
76 unsigned int dma_slave_rx;
77}; 74};
78 75
79#endif /* __LINUX_SERIAL_SCI_H */ 76#endif /* __LINUX_SERIAL_SCI_H */