From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: javier Martin <javier.martin@vista-silicon.com>
Cc: alsa-devel@alsa-project.org,
"Mark Brown" <broonie@opensource.wolfsonmicro.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Eric Bénard" <eric@eukrea.com>
Subject: Re: [Q] ASoC: What's the real meaning of SND_SOC_DAIFMT_NB_NF?
Date: Fri, 24 Feb 2012 10:34:31 +0200 [thread overview]
Message-ID: <4F474B97.6020407@ti.com> (raw)
In-Reply-To: <CACKLOr10yUYpMSrebnLvMkc=XQLUXNDxwM+P6U8ysH_Xre3Tmw@mail.gmail.com>
On 02/24/2012 09:53 AM, javier Martin wrote:
> If TFSI bit is 1, frame clock is active high.
> If TFSI bit is 0, frame clock is active low.
>
> In the piece of code I've shown to you, when someone configures
> (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF) he's really selecting an
> active high frame clock when the standard says just the opposite
> (wm8974 datasheet p50).
We had similar issues on OMAP McBSP in the past. If you take a look at
the omap-mcbsp.c: omap_mcbsp_dai_set_dai_fmt() function we have inv_fs
variable to handle such a case.
We do the FS/BCLK configuration only in DAIFMT_INV config phase. The FS
active level is different in these formats. We invert the FS based on
the used format (LEFT/RIGHT just, DSP). The DAIFMT_INV switch configures
according to I2S, but we invert the FS if we are in DSP, Justified modes
afterwards.
>>> there is at least one platform relying on this misleading behavior
>>> that I can't test:
>>> http://lxr.linux.no/#linux+v3.2.7/sound/soc/imx/wm1133-ev1.c#L81
>>
>> That was correct at the time it was written, though the code has changed
>> since then and I don't know when it was last retested. Of course
>> depending on the signal it may interoperate well even if the setup isn't
>> actually correct. I'd just fix the driver and if it works for yours
>> it's probably OK for that board too.
>
> It is not one but two boards that are affected:
> http://lxr.linux.no/#linux+v3.2.7/sound/soc/imx/wm1133-ev1.c#L81
> http://lxr.linux.no/#linux+v3.2.7/sound/soc/imx/eukrea-tlv320.c#L32
>
> If I fixed the bug in the SSI I would break both of them, since I
> would be changing frame clock polarity.
I don't think it is going to break. I would guess that the channels are
swapped on these machines at the moment. If you correct the CPU dai
driver the only thing that will happen is that the channels will jump in
their correct place.
--
Péter
next prev parent reply other threads:[~2012-02-24 8:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-23 12:40 [Q] ASoC: What's the real meaning of SND_SOC_DAIFMT_NB_NF? javier Martin
2012-02-23 15:19 ` Mark Brown
2012-02-23 15:58 ` javier Martin
2012-02-23 16:14 ` Mark Brown
2012-02-24 7:53 ` javier Martin
2012-02-24 8:34 ` Peter Ujfalusi [this message]
2012-02-24 11:05 ` javier Martin
2012-02-24 11:53 ` Mark Brown
2012-02-24 14:09 ` Peter Ujfalusi
2012-02-24 11:20 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F474B97.6020407@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=eric@eukrea.com \
--cc=javier.martin@vista-silicon.com \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.