ASoC: ak4613: return error if it was setup as clock provider

Renesas is only user of ak4613 on upstream, and it is tested
only under "clock consumer" because of board mounting situation.

Thus, "clock provider" is not supperted/tested.
This patch return error if it was setup as clock provider.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czhwp9lq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2022-04-05 02:06:25 +00:00 committed by Mark Brown
parent f7c0e14f57
commit c08673ede7
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -329,13 +329,13 @@ static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai,
return 0;
}
static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int format)
{
struct snd_soc_component *component = dai->component;
struct ak4613_priv *priv = snd_soc_component_get_drvdata(component);
unsigned int fmt;
fmt &= SND_SOC_DAIFMT_FORMAT_MASK;
fmt = format & SND_SOC_DAIFMT_FORMAT_MASK;
switch (fmt) {
case SND_SOC_DAIFMT_LEFT_J:
case SND_SOC_DAIFMT_I2S:
@ -345,6 +345,19 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL;
}
fmt = format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK;
switch (fmt) {
case SND_SOC_DAIFMT_CBC_CFC:
break;
default:
/*
* SUPPORTME
*
* "clock provider" is not yet supperted
*/
return -EINVAL;
}
return 0;
}