[alsa-devel] [PATCH] AC97 atmel: add support for AT91(common with AVR32).

Takashi Iwai tiwai at suse.de
Fri Jul 10 11:05:55 CEST 2009


At Fri, 10 Jul 2009 11:08:37 +0200,
Sedji Gaouaou wrote:
> 
> This patch add AC97 support for ATMEL AT91 boards, using the AVR32 code.
> It is based on Takashi git tree(sound-2.6/for-next).

Thanks.  The changes look almost fine.
Some comments below.


> @@ -167,6 +173,7 @@ static int atmel_ac97c_playback_open(struct snd_pcm_substream *substream)
>  	mutex_lock(&opened_mutex);
>  	chip->opened++;
>  	runtime->hw = atmel_ac97c_hw;
> +	chip->period = 0;

Shouldn't be this initialized rather in the prepare callback?

> @@ -239,12 +247,14 @@ static int atmel_ac97c_playback_hw_params(struct snd_pcm_substream *substream,
>  
>  	retval = snd_pcm_lib_malloc_pages(substream,
>  					params_buffer_bytes(hw_params));
> -	if (retval < 0)
> -		return retval;
> -	/* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */
> -	if (retval == 1)
> -		if (test_and_clear_bit(DMA_TX_READY, &chip->flags))
> -			dw_dma_cyclic_free(chip->dma.tx_chan);
> +	if(cpu_is_at32ap7000()) {

Put a space after if.

> +		if (retval < 0)
> +			return retval;

The error check should be independent from the cpu type.

> @@ -324,7 +341,9 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
>  
>  	switch (runtime->format) {
>  	case SNDRV_PCM_FORMAT_S16_LE:
> -		word |= AC97C_CMR_CEM_LITTLE;
> +		if(cpu_is_at32ap7000()) {
> +			word |= AC97C_CMR_CEM_LITTLE;
> +		}

No need braces here.
Better to run $LINUX/scripts/checkpatch.pl once and fix warnings
suggested there.


thanks,

Takashi


More information about the Alsa-devel mailing list