[PATCH 02/16] ASoC: sun4i-i2s: Adjust LRCLK width

25 views
Skip to first unread message

Clément Péron

unread,
Jul 4, 2020, 7:39:10 AM7/4/20
to Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Marcus Cooper, Jernej Skrabec, alsa-...@alsa-project.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Clément Péron, Maxime Ripard
From: Marcus Cooper <codek...@gmail.com>

Some codecs such as i2s based HDMI audio and the Pine64 DAC require
a different amount of bit clocks per frame than what is calculated
by the sample width. Use the values obtained by the tdm slot bindings
to adjust the LRCLK width accordingly.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
Signed-off-by: Clément Péron <peron...@gmail.com>
Acked-by: Maxime Ripard <max...@cerno.tech>
---
sound/soc/sunxi/sun4i-i2s.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 9690389cb68e..8bae97efea30 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -470,6 +470,9 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s,
return -EINVAL;
}

+ if (i2s->slot_width)
+ lrck_period = i2s->slot_width;
+
regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT0_REG,
SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
SUN8I_I2S_FMT0_LRCK_PERIOD(lrck_period));
--
2.25.1

Samuel Holland

unread,
Jul 10, 2020, 1:44:44 AM7/10/20
to peron...@gmail.com, Maxime Ripard, Chen-Yu Tsai, Rob Herring, Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Marcus Cooper, Jernej Skrabec, alsa-...@alsa-project.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Maxime Ripard
It looks like the existing code would have the same problem, that this should be
lrck_period - 1 according to the manual (I checked H3).

Regards,
Samuel
Reply all
Reply to author
Forward
0 new messages