[alsa-devel] [PATCH] ASoC: wm8978: SND_SOC_DAIFMT_NB_NF become default clock inversion
Current wm8978 driver return -EINVAL if it doesn't have SND_SOC_DAIFMT_INV_MASK flags on snd_soc_dai_ops :: set_fmt. But default settings should be treated as SND_SOC_DAIFMT_NB_NF (= no clock inversion).
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm8978.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index f347af3..ba01981 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -692,8 +692,6 @@ static int wm8978_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* clock inversion */ switch (fmt & SND_SOC_DAIFMT_INV_MASK) { - case SND_SOC_DAIFMT_NB_NF: - break; case SND_SOC_DAIFMT_IB_IF: iface |= 0x180; break; @@ -703,8 +701,9 @@ static int wm8978_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) case SND_SOC_DAIFMT_NB_IF: iface |= 0x80; break; + case SND_SOC_DAIFMT_NB_NF: default: - return -EINVAL; + break; }
snd_soc_write(codec, WM8978_AUDIO_INTERFACE, iface);
On Tue, Jan 15, 2013 at 04:18:30PM -0800, Kuninori Morimoto wrote:
Current wm8978 driver return -EINVAL if it doesn't have SND_SOC_DAIFMT_INV_MASK flags on snd_soc_dai_ops :: set_fmt. But default settings should be treated as SND_SOC_DAIFMT_NB_NF (= no clock inversion).
I'd say the fix here is really to change the values of the flags so that _NB_NF is zero - this is a widespread thing in drivers and it makes sense from a user point of view too.
Current soc-dai.h defines SND_SOC_DAIFMT_NB_NF as (1 << 8), but normal bit clock / normal frame should be default settings (= 0). This patch fixup SND_SOC_DAIFMT_NB_NF as (0 << 8).
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- include/sound/soc-dai.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 3953cea..90dc004 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -53,7 +53,7 @@ struct snd_compr_stream; * Specifies whether the DAI can also support inverted clocks for the specified * format. */ -#define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */ +#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
On Tue, Jan 15, 2013 at 08:18:23PM -0800, Kuninori Morimoto wrote:
Current soc-dai.h defines SND_SOC_DAIFMT_NB_NF as (1 << 8), but normal bit clock / normal frame should be default settings (= 0). This patch fixup SND_SOC_DAIFMT_NB_NF as (0 << 8).
Applied, thanks.
participants (2)
-
Kuninori Morimoto
-
Mark Brown