[PATCH 2/7] serial: at91: add tx dma support

Ludovic Desroches ludovic.desroches at atmel.com
Tue Jul 9 05:57:04 EDT 2013


On Tue, Jul 09, 2013 at 02:33:41PM +0800, Elen Song wrote:

[...]
  
> @@ -977,6 +1172,8 @@ static int atmel_startup(struct uart_port *port)
>  		pdc->ofs = 0;
>  	}
>  
> +	atmel_tx_request_dma(atmel_port);
> +
>  	/*
>  	 * If there is a specific "open" function (to register
>  	 * control line interrupts)

Here we can have both use_pdc_tx and use_dma_tx set to true. To avoid this, we
can do:

if (atmel_use_pdc_tx(port)) {

} else {
	atmel_tx_request_dma(atmel_port);
}

or force use_pdc_tx to 0 in atmel_tx_request_dma function when we set
use_dma_tx to 1.

I prefer the second one since using dma has a higher priority than using pdc
contrary to the first one.


Regards

Ludovic



More information about the linux-arm-kernel mailing list