summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ak4613.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2022-04-05 05:06:25 +0300
committerMark Brown <broonie@kernel.org>2022-04-05 20:49:57 +0300
commitc08673ede71fba70a10be0470565ed2470ef1fe5 (patch)
tree7ac7b5dc45d912614a980f0d196c125a5cc4e921 /sound/soc/codecs/ak4613.c
parentf7c0e14f5717aabc5db7e4eb6324d750d415d022 (diff)
downloadlinux-c08673ede71fba70a10be0470565ed2470ef1fe5.tar.xz
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>
Diffstat (limited to 'sound/soc/codecs/ak4613.c')
-rw-r--r--sound/soc/codecs/ak4613.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index a20bbf82e8df..b19c7c4a1971 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -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;
}