From: Jerome Brunet <jbrunet@baylibre.com>
To: Valerio Setti via B4 Relay <devnull+vsetti.baylibre.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
vsetti@baylibre.com, linux-sound@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: meson: aiu-encoder-i2s: fix bit clock polarity
Date: Tue, 07 Oct 2025 11:09:57 +0200 [thread overview]
Message-ID: <1jplaz3wnu.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20251007-fix-i2s-polarity-v1-1-86704d9cda10@baylibre.com> (Valerio Setti via's message of "Tue, 07 Oct 2025 00:12:19 +0200")
On Tue 07 Oct 2025 at 00:12, Valerio Setti via B4 Relay <devnull+vsetti.baylibre.com@kernel.org> wrote:
> From: Valerio Setti <vsetti@baylibre.com>
>
> According to I2S specs audio data is sampled on the rising edge of the
> clock and it can change on the falling one. When operating in normal mode
> this SoC behaves the opposite so a clock polarity inversion is required
> in this case.
>
> This was tested on an OdroidC2 (Amlogic S905 SoC) board.
>
> Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Tested on the libretech cc s905x (GXL)
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
> sound/soc/meson/aiu-encoder-i2s.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c
> index a0dd914c8ed13616fbcbc0828e36418cfd255391..3b4061508c18047fe8d6f3f98061720f8ce238f2 100644
> --- a/sound/soc/meson/aiu-encoder-i2s.c
> +++ b/sound/soc/meson/aiu-encoder-i2s.c
> @@ -236,8 +236,12 @@ static int aiu_encoder_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
> inv == SND_SOC_DAIFMT_IB_IF)
> val |= AIU_CLK_CTRL_LRCLK_INVERT;
>
> - if (inv == SND_SOC_DAIFMT_IB_NF ||
> - inv == SND_SOC_DAIFMT_IB_IF)
> + /*
> + * The SoC changes data on the rising edge of the bitclock
> + * so an inversion of the bitclock is required in normal mode
> + */
> + if (inv == SND_SOC_DAIFMT_NB_NF ||
> + inv == SND_SOC_DAIFMT_NB_IF)
> val |= AIU_CLK_CTRL_AOCLK_INVERT;
>
> /* Signal skew */
> @@ -328,4 +332,3 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
> .startup = aiu_encoder_i2s_startup,
> .shutdown = aiu_encoder_i2s_shutdown,
> };
> -
>
> ---
> base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
> change-id: 20251006-fix-i2s-polarity-d744338fa223
>
> Best regards,
--
Jerome
next prev parent reply other threads:[~2025-10-07 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 22:12 [PATCH] ASoC: meson: aiu-encoder-i2s: fix bit clock polarity Valerio Setti via B4 Relay
2025-10-07 9:09 ` Jerome Brunet [this message]
2025-10-07 17:03 ` 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=1jplaz3wnu.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=broonie@kernel.org \
--cc=devnull+vsetti.baylibre.com@kernel.org \
--cc=khilman@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=vsetti@baylibre.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox