[Sound-open-firmware] [PATCH] hda-dma: fix configure direction wrong issue

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Mar 6 22:44:22 CET 2018


On Tue, 2018-03-06 at 22:32 +0800, Keyon Jie wrote:
> The directions configured in sg_elem are actually dma transfer type,
> not playback/capture direction, here correct them.
> 
> Signed-off-by: Keyon Jie <yang.jie at linux.intel.com>
> ---
>  src/drivers/hda-dma.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/drivers/hda-dma.c b/src/drivers/hda-dma.c
> index 87221a8..57cb7fc 100644
> --- a/src/drivers/hda-dma.c
> +++ b/src/drivers/hda-dma.c
> @@ -313,7 +313,7 @@ static int hda_dma_set_config(struct dma *dma,
> int channel,
>  	list_for_item(plist, &config->elem_list) {
>  		sg_elem = container_of(plist, struct dma_sg_elem,
> list);
>  
> -		if (config->direction == SOF_IPC_STREAM_PLAYBACK)
> +		if (config->direction == DMA_DIR_HMEM_TO_LMEM)
>  			addr = sg_elem->dest;
>  		else
>  			addr = sg_elem->src;
> @@ -344,10 +344,10 @@ static int hda_dma_set_config(struct dma *dma,
> int channel,
>  	dgcs = DGCS_FWCB;
>  
>  	/* set DGCS.SCS bit to 0 for 32 bit container */
> -	if ((config->direction == SOF_IPC_STREAM_PLAYBACK &&
> -	    config->dest_width <= 16) ||
> -	    (config->direction == SOF_IPC_STREAM_CAPTURE &&
> -	    config->src_width <= 16))
> +	if ((config->direction == DMA_DIR_HMEM_TO_LMEM &&
> +	     config->dest_width <= 16) ||
> +	    (config->direction == DMA_DIR_LMEM_TO_HMEM &&
> +	     config->src_width <= 16))
>  		dgcs |= DGCS_SCS;


Both applied. Best we make these all enums in a subsequent patch and
then the compiler will complain if they mismatch.

Liam

>  
>  	/* init channel in HW */


More information about the Sound-open-firmware mailing list