Re: [PATCH] ASoC: DaVinci: Updates to EVM hardware params callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 20, 2010 at 05:02:41PM +0530, Chaithrika U S wrote:

> @@ -64,9 +64,11 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
>  		return -EINVAL;
>  
>  	/* set codec DAI configuration */
> -	ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
> -	if (ret < 0)
> -		return ret;
> +	if (codec_dai->ops->set_fmt) {
> +		ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
> +		if (ret < 0)
> +			return ret;
> +	}

It would be better to have separate hw_params() functions for separate
links rather than do things like this.  There's a strong expectation
that the board driver knows exactly what CODEC it's talking to and how
to configure it so code like this looks odd.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux