All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Watts <contact@jookia.org>
To: alsa-devel@alsa-project.org
Subject: Variable mclk-fs in ASoC audio cards?
Date: Fri, 22 Mar 2024 22:13:22 +1100	[thread overview]
Message-ID: <Zf1n0tYNNMBUfbqt@titan> (raw)

Greetings fellow ALSAers :)

Over the past month I have been working on a driver for the 8-channel TDM
CS5368 audio codec. However I've run in to an interesting snag that seems to
be an open problem. Let me explain.

The audio codec generally runs at 8 channels of 32-bit data, so:
MCLK = BCLK = LRCK * 256

However it is possible to read 4 or 2 channels instead:
MCLK = BCLK = LRCK * 128
MCLK = BCLK = LRCK * 64

This trade-off allows avoiding high frequency clocking at the expense of a
reduced channel count.

>From what I current see the way to indicate the multiplier here is using
mclk-fs in the device tree, but this would mean effectively fixing the channel
count in the device tree.

I have searched around found someone has suggested mapping mclk-fs to rates here:
https://lore.kernel.org/all/CAEnQRZDpJu27_pB=-ZYQjsNPC8eA4-Ur-36niT2hCosMWtC7jw@mail.gmail.com/T/#u

This functionality is somewhat adjacent to it, but I was wondering if it would
be better to somehow factor dai-tdm-slot-* in to mclk-fs calculation.

Perhaps mclk-fs could be divided by dai-tdm-slot-num then multiplied by slots?

Has anyone hit this problem before? How did you solve it?

John.

                 reply	other threads:[~2024-03-22 11:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Zf1n0tYNNMBUfbqt@titan \
    --to=contact@jookia.org \
    --cc=alsa-devel@alsa-project.org \
    /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.