Skip to content

Commit

Permalink
serial: 8250_dma: Provide default slave configuration parameters
Browse files Browse the repository at this point in the history
Some slave channel parameters will be always the same. For
example, direction for the Rx channel will always be
DMA_DEV_TO_MEM and DMA_MEM_TO_DEV for Tx channel.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Heikki Krogerus authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent e4fb3b8 commit ab19479
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/tty/serial/8250/8250_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,14 @@ int serial8250_request_dma(struct uart_8250_port *p)
struct uart_8250_dma *dma = p->dma;
dma_cap_mask_t mask;

dma->rxconf.src_addr = p->port.mapbase + UART_RX;
dma->txconf.dst_addr = p->port.mapbase + UART_TX;
/* Default slave configuration parameters */
dma->rxconf.direction = DMA_DEV_TO_MEM;
dma->rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
dma->rxconf.src_addr = p->port.mapbase + UART_RX;

dma->txconf.direction = DMA_MEM_TO_DEV;
dma->txconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
dma->txconf.dst_addr = p->port.mapbase + UART_TX;

dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
Expand Down

0 comments on commit ab19479

Please sign in to comment.