Skip to content

Commit

Permalink
ASoC: UDA1380: DATAI is slave only
Browse files Browse the repository at this point in the history
Only allow SND_SOC_DAIFMT_CBS_CFS for the playback DAI.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Philipp Zabel authored and Mark Brown committed Mar 3, 2009
1 parent aa4ef01 commit 5f2a938
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sound/soc/codecs/uda1380.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,9 @@ static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai,
iface |= R01_SFORI_MSB | R01_SFORO_MSB;
}

if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) == SND_SOC_DAIFMT_CBM_CFM)
iface |= R01_SIM;
/* DATAI is slave only, so in single-link mode, this has to be slave */
if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
return -EINVAL;

uda1380_write(codec, UDA1380_IFACE, iface);

Expand Down Expand Up @@ -428,6 +429,10 @@ static int uda1380_set_dai_fmt_playback(struct snd_soc_dai *codec_dai,
iface |= R01_SFORI_MSB;
}

/* DATAI is slave only, so this has to be slave */
if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
return -EINVAL;

uda1380_write(codec, UDA1380_IFACE, iface);

return 0;
Expand Down

0 comments on commit 5f2a938

Please sign in to comment.