Linux Sound subsystem development
 help / color / mirror / Atom feed
From: "Joshua Peisach" <jpeisach@ubuntu.com>
To: "James Calligeros" <jcalligeros99@gmail.com>,
	"Martin Povišer" <povik+lin@cutebit.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>
Cc: <asahi@lists.linux.dev>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/7] ASoC: apple: mca: Support FEs being clock consumers
Date: Mon, 29 Jun 2026 09:19:27 -0400	[thread overview]
Message-ID: <DJLKAJ8IU0Z5.EU158RDQ31H0@ubuntu.com> (raw)
In-Reply-To: <20260628-apple-audio-redux-v2-4-6328269c9652@gmail.com>

On Sun Jun 28, 2026 at 7:42 AM EDT, James Calligeros wrote:
> From: Martin Povišer <povik+lin@cutebit.org>
>
> Support FEs being I2S clock consumers. This does not mean we support
> accepting clocks from outside the SoC (although it paves the way for
> that support in the future), but it means multiple FEs can attach to one
> BE, one being clock producer and the rest clock consumers.
>
> This is useful for grabbing I/V sense data on some machines, since in
> such a scenario the format of the sense data on the I2S bus differs
> from that of the audio data (the two formats differing in slot width).
> With two FEs attached to the bus, we can split the responsibilities and
> command different slot widths to the two.
>
> Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
> Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
> ---
>  sound/soc/apple/mca.c | 129 ++++++++++++++++++++-----
>  1 file changed, 106 insertions(+), 23 deletions(-)
>
> diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c
> index 730ffe0805e1..0c1fc8242907 100644
> --- a/sound/soc/apple/mca.c
> +++ b/sound/soc/apple/mca.c
> @@ -380,6 +406,57 @@ static int mca_be_hw_free(struct snd_pcm_substream *substream,
>  	return 0;
>  }
>  
> +static int mca_fe_prepare(struct snd_pcm_substream *substream,
> +			  struct snd_soc_dai *dai)
> +{
> +	struct mca_cluster *cl = mca_dai_to_cluster(dai);
> +	struct mca_data *mca = cl->host;
> +
> +	if (cl->clk_provider)
> +		return 0;
> +
> +	/* Turn on the cluster power domain if not already in use */
> +	if (!cl->syncgen_in_use) {
> +		int port = mca_fe_get_port(substream);
> +
> +		cl->pd_link = device_link_add(mca->dev, cl->pd_dev,
> +					      DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME |
> +						DL_FLAG_RPM_ACTIVE);
> +		if (!cl->pd_link) {
> +			dev_err(mca->dev,
> +				"cluster %d: unable to prop-up power domain\n", cl->no);
> +			return -EINVAL;
> +		}
> +
> +		writel_relaxed(port + 6 + 1,
> +			       cl->base + REG_SYNCGEN_MCLK_SEL);

Where does the "6 + 1" come from, and should it have its own #define?

-Josh

  reply	other threads:[~2026-06-29 13:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 11:41 [PATCH v2 0/7] ASoC: apple: mca: support simultaneous I2S capture on the frontend James Calligeros
2026-06-28 11:41 ` [PATCH v2 1/7] ASoC: apple: mca: increase SERDES reset delay James Calligeros
2026-06-28 11:42 ` [PATCH v2 2/7] ASoC: apple: mca: Separate data & clock port setup James Calligeros
2026-06-28 11:42 ` [PATCH v2 3/7] ASoC: apple: mca: Factor out mca_be_get_fe James Calligeros
2026-06-28 11:42 ` [PATCH v2 4/7] ASoC: apple: mca: Support FEs being clock consumers James Calligeros
2026-06-29 13:19   ` Joshua Peisach [this message]
2026-07-05  2:05     ` James Calligeros
2026-06-28 11:42 ` [PATCH v2 5/7] ASoC: apple: mca: Support capture on multiples BEs James Calligeros
2026-06-28 11:42 ` [PATCH v2 6/7] ASoC: apple: mca: Do not mark clocks in use for non-providers James Calligeros
2026-06-28 11:42 ` [PATCH v2 7/7] ASoC: apple: mca: Add delay after configuring clock James Calligeros

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=DJLKAJ8IU0Z5.EU158RDQ31H0@ubuntu.com \
    --to=jpeisach@ubuntu.com \
    --cc=asahi@lists.linux.dev \
    --cc=broonie@kernel.org \
    --cc=jcalligeros99@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=povik+lin@cutebit.org \
    --cc=tiwai@suse.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