summaryrefslogtreecommitdiffstats
path: root/sound/soc/meson/axg-tdm-formatter.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2020-07-29 17:44:55 +0200
committerMark Brown <broonie@kernel.org>2020-07-30 20:45:01 +0200
commit0d3f01dcdc234001f979a0af0b6b31cb9f25b6c1 (patch)
treea0283de0767c42e5c9f2cb49180658ffbe96286c /sound/soc/meson/axg-tdm-formatter.c
parentASoC: meson: axg-tdmin: fix g12a skew (diff)
downloadlinux-0d3f01dcdc234001f979a0af0b6b31cb9f25b6c1.tar.xz
linux-0d3f01dcdc234001f979a0af0b6b31cb9f25b6c1.zip
ASoC: meson: axg-tdm-formatters: fix sclk inversion
After carefully checking, it appears that both tdmout and tdmin require the rising edge of the sclk they get to be synchronized with the frame sync event (which should be a rising edge of lrclk). TDMIN was improperly set before this patch. Remove the sclk_invert quirk which is no longer needed and fix the sclk phase. Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20200729154456.1983396-4-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/meson/axg-tdm-formatter.c')
-rw-r--r--sound/soc/meson/axg-tdm-formatter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/meson/axg-tdm-formatter.c b/sound/soc/meson/axg-tdm-formatter.c
index 358c8c0d861c..f7e8e9da68a0 100644
--- a/sound/soc/meson/axg-tdm-formatter.c
+++ b/sound/soc/meson/axg-tdm-formatter.c
@@ -70,7 +70,7 @@ EXPORT_SYMBOL_GPL(axg_tdm_formatter_set_channel_masks);
static int axg_tdm_formatter_enable(struct axg_tdm_formatter *formatter)
{
struct axg_tdm_stream *ts = formatter->stream;
- bool invert = formatter->drv->quirks->invert_sclk;
+ bool invert;
int ret;
/* Do nothing if the formatter is already enabled */
@@ -96,11 +96,12 @@ static int axg_tdm_formatter_enable(struct axg_tdm_formatter *formatter)
return ret;
/*
- * If sclk is inverted, invert it back and provide the inversion
- * required by the formatter
+ * If sclk is inverted, it means the bit should latched on the
+ * rising edge which is what our HW expects. If not, we need to
+ * invert it before the formatter.
*/
- invert ^= axg_tdm_sclk_invert(ts->iface->fmt);
- ret = clk_set_phase(formatter->sclk, invert ? 180 : 0);
+ invert = axg_tdm_sclk_invert(ts->iface->fmt);
+ ret = clk_set_phase(formatter->sclk, invert ? 0 : 180);
if (ret)
return ret;