Commit 219fb0c1 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman

serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs

Only SH platforms still use platform data for the sh-sci, and none of
them declare DMA channels connected to the SCI. Remove the corresponding
platform data fields and simplify the driver accordingly.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b2f20ed9
...@@ -1387,19 +1387,13 @@ static void rx_timer_fn(unsigned long arg) ...@@ -1387,19 +1387,13 @@ static void rx_timer_fn(unsigned long arg)
} }
static struct dma_chan *sci_request_dma_chan(struct uart_port *port, static struct dma_chan *sci_request_dma_chan(struct uart_port *port,
enum dma_transfer_direction dir, enum dma_transfer_direction dir)
unsigned int id)
{ {
dma_cap_mask_t mask;
struct dma_chan *chan; struct dma_chan *chan;
struct dma_slave_config cfg; struct dma_slave_config cfg;
int ret; int ret;
dma_cap_zero(mask); chan = dma_request_slave_channel(port->dev,
dma_cap_set(DMA_SLAVE, mask);
chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
(void *)(unsigned long)id, port->dev,
dir == DMA_MEM_TO_DEV ? "tx" : "rx"); dir == DMA_MEM_TO_DEV ? "tx" : "rx");
if (!chan) { if (!chan) {
dev_warn(port->dev, dev_warn(port->dev,
...@@ -1436,12 +1430,11 @@ static void sci_request_dma(struct uart_port *port) ...@@ -1436,12 +1430,11 @@ static void sci_request_dma(struct uart_port *port)
dev_dbg(port->dev, "%s: port %d\n", __func__, port->line); dev_dbg(port->dev, "%s: port %d\n", __func__, port->line);
if (!port->dev->of_node && if (!port->dev->of_node)
(s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0))
return; return;
s->cookie_tx = -EINVAL; s->cookie_tx = -EINVAL;
chan = sci_request_dma_chan(port, DMA_MEM_TO_DEV, s->cfg->dma_slave_tx); chan = sci_request_dma_chan(port, DMA_MEM_TO_DEV);
dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan); dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan);
if (chan) { if (chan) {
s->chan_tx = chan; s->chan_tx = chan;
...@@ -1463,7 +1456,7 @@ static void sci_request_dma(struct uart_port *port) ...@@ -1463,7 +1456,7 @@ static void sci_request_dma(struct uart_port *port)
INIT_WORK(&s->work_tx, work_fn_tx); INIT_WORK(&s->work_tx, work_fn_tx);
} }
chan = sci_request_dma_chan(port, DMA_DEV_TO_MEM, s->cfg->dma_slave_rx); chan = sci_request_dma_chan(port, DMA_DEV_TO_MEM);
dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan); dev_dbg(port->dev, "%s: RX: got channel %p\n", __func__, chan);
if (chan) { if (chan) {
unsigned int i; unsigned int i;
...@@ -2706,10 +2699,6 @@ static int sci_init_single(struct platform_device *dev, ...@@ -2706,10 +2699,6 @@ static int 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_slave_tx > 0 && p->dma_slave_rx > 0)
dev_dbg(port->dev, "DMA tx %d, rx %d\n",
p->dma_slave_tx, p->dma_slave_rx);
return 0; return 0;
} }
......
...@@ -71,9 +71,6 @@ struct plat_sci_port { ...@@ -71,9 +71,6 @@ struct plat_sci_port {
unsigned char regtype; unsigned char regtype;
struct plat_sci_port_ops *ops; struct plat_sci_port_ops *ops;
unsigned int dma_slave_tx;
unsigned int dma_slave_rx;
}; };
#endif /* __LINUX_SERIAL_SCI_H */ #endif /* __LINUX_SERIAL_SCI_H */
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