[alsa-devel] [PATCH v2] ASoC: Add support for cs42l73 codec
Mark Brown
broonie at opensource.wolfsonmicro.com
Wed Oct 5 12:40:53 CEST 2011
On Tue, Oct 04, 2011 at 07:17:16PM +0000, Austin, Brian wrote:
> if (spc & xSPDIF_PCM) {
> spc &= (31 << 3); /* Clear PCM mode, set MSB->LSB */
> switch(format){
> case SND_SOC_DAIFMT_DSP_B:
> if (inv == SND_SOC_DAIFMT_IB_IF)
> spc |= (xPCM_MODE0 << 4);
>
> if (inv == SND_SOC_DAIFMT_IB_NF)
> spc |= (xPCM_MODE1 << 4);
> break;
> case SND_SOC_DAIFMT_DSP_A:
> if (inv == SND_SOC_DAIFMT_IB_IF)
> spc |= (xPCM_MODE1 << 4);
> break;
> default:
> return -EINVAL;
> }
> }
This looks a lot better modulo the coding style issue (switch is not a
function). Using snd_soc_update_bits() would be even better.
More information about the Alsa-devel
mailing list