* [PATCH] ASoC: wm8978: SND_SOC_DAIFMT_NB_NF become default clock inversion
@ 2013-01-16 0:18 Kuninori Morimoto
2013-01-16 1:04 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2013-01-16 0:18 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto
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);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: wm8978: SND_SOC_DAIFMT_NB_NF become default clock inversion
2013-01-16 0:18 [PATCH] ASoC: wm8978: SND_SOC_DAIFMT_NB_NF become default clock inversion Kuninori Morimoto
@ 2013-01-16 1:04 ` Mark Brown
2013-01-16 4:18 ` [PATCH] ASoC: SND_SOC_DAIFMT_NB_NF become 0 as default settings Kuninori Morimoto
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-01-16 1:04 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ASoC: SND_SOC_DAIFMT_NB_NF become 0 as default settings
2013-01-16 1:04 ` Mark Brown
@ 2013-01-16 4:18 ` Kuninori Morimoto
2013-01-16 11:28 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2013-01-16 4:18 UTC (permalink / raw)
To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto
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 */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-16 11:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 0:18 [PATCH] ASoC: wm8978: SND_SOC_DAIFMT_NB_NF become default clock inversion Kuninori Morimoto
2013-01-16 1:04 ` Mark Brown
2013-01-16 4:18 ` [PATCH] ASoC: SND_SOC_DAIFMT_NB_NF become 0 as default settings Kuninori Morimoto
2013-01-16 11:28 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.