Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adcb8bc0 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

ASoC: tlv320dac33: Safety check for codec slave mode



The currently available FIFO modes (mode1 and mode7) require master
mode from the codec.
Do not allow the slave configuration when the FIFO is in use.

Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 28e05d98
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -993,6 +993,7 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai,
			     unsigned int fmt)
{
	struct snd_soc_codec *codec = codec_dai->codec;
	struct tlv320dac33_priv *dac33 = codec->private_data;
	u8 aictrl_a, aictrl_b;

	aictrl_a = dac33_read_reg_cache(codec, DAC33_SER_AUDIOIF_CTRL_A);
@@ -1005,6 +1006,10 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai,
		break;
	case SND_SOC_DAIFMT_CBS_CFS:
		/* Codec Slave */
		if (dac33->fifo_mode) {
			dev_err(codec->dev, "FIFO mode requires master mode\n");
			return -EINVAL;
		} else
			aictrl_a &= ~(DAC33_MSBCLK | DAC33_MSWCLK);
		break;
	default: