Commit ec185f95 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: ak4613: disable asymmetric audio interface format

Asymmetric audio interface formats exist in ak4613 by same
register settings.

	Capture		Playback
	24bit LEFT_J	16bit RIGHT_J
	24bit LEFT_J	20bit RIGHT_J
	24bit LEFT_J	24bit RIGHT_J
	24bit LEFT_J	24bit LEFT_J
	24bit I2S	24bit I2S

These asymmetric formats makes driver / behavior difficult.
It is not HW limitation, but SW limitation. To makes code reading
easy, this patch removes asymmetric format support.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
...@@ -139,9 +139,7 @@ static const struct reg_default ak4613_reg[] = { ...@@ -139,9 +139,7 @@ static const struct reg_default ak4613_reg[] = {
#define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt } #define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt }
static const struct ak4613_interface ak4613_iface[] = { static const struct ak4613_interface ak4613_iface[] = {
/* capture */ /* playback */ /* capture */ /* playback */
[0] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(16, RIGHT_J) }, /* [0] - [2] are not supported */
[1] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(20, RIGHT_J) },
[2] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, RIGHT_J) },
[3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) }, [3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) },
[4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) }, [4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) },
}; };
...@@ -262,11 +260,9 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -262,11 +260,9 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
fmt &= SND_SOC_DAIFMT_FORMAT_MASK; fmt &= SND_SOC_DAIFMT_FORMAT_MASK;
switch (fmt) { switch (fmt) {
case SND_SOC_DAIFMT_RIGHT_J:
case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_LEFT_J:
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
priv->fmt = fmt; priv->fmt = fmt;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -286,13 +282,8 @@ static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface, ...@@ -286,13 +282,8 @@ static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface,
if (fmts->fmt != fmt) if (fmts->fmt != fmt)
return false; return false;
if (fmt == SND_SOC_DAIFMT_RIGHT_J) { if (fmts->width != width)
if (fmts->width != width) return false;
return false;
} else {
if (fmts->width < width)
return false;
}
return true; return true;
} }
...@@ -420,8 +411,7 @@ static const struct snd_soc_dai_ops ak4613_dai_ops = { ...@@ -420,8 +411,7 @@ static const struct snd_soc_dai_ops ak4613_dai_ops = {
SNDRV_PCM_RATE_96000 |\ SNDRV_PCM_RATE_96000 |\
SNDRV_PCM_RATE_176400 |\ SNDRV_PCM_RATE_176400 |\
SNDRV_PCM_RATE_192000) SNDRV_PCM_RATE_192000)
#define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S16_LE |\ #define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S24_LE)
SNDRV_PCM_FMTBIT_S24_LE)
static struct snd_soc_dai_driver ak4613_dai = { static struct snd_soc_dai_driver ak4613_dai = {
.name = "ak4613-hifi", .name = "ak4613-hifi",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment