From: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
To: joakim.zhang@cixtech.com, lgirdwood@gmail.com,
broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, perex@perex.cz, tiwai@suse.com,
p.zabel@pengutronix.de
Cc: cix-kernel-upstream@cixtech.com, linux-sound@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
ajay.nandam@oss.qualcomm.com
Subject: Re: [PATCH v2 4/4] ASoC: cdns: Add Cadence I2S-MC controller driver
Date: Wed, 7 Oct 2026 15:23:52 +0530 [thread overview]
Message-ID: <8f75db55-66b2-4b94-b0bd-ccc52f08d197@oss.qualcomm.com> (raw)
In-Reply-To: <20260928053613.2158446-5-joakim.zhang@cixtech.com>
On 9/28/2026 11:06 AM, joakim.zhang@cixtech.com wrote:
> From: Joakim Zhang <joakim.zhang@cixtech.com>
>
> Add support for the Cadence I2S-MC multi-channel controller found in
> the CIX SKY1 audio subsystem.
>
> The controller moves up to 16 channels through a configurable set of
> its 8 data pins, each pin carrying two slots. Wired-out pins may sit
> at any pin index and are described by cix,pin-out-num, cix,pin-rx-mask
> and cix,pin-tx-mask. The driver exposes a transmit DAI and a receive
> DAI which can act as clock provider or consumer independently, and
> streams with fewer channels than the wired pins narrow the enabled
> pin mask at runtime.
>
> The driver registers the dmaengine PCM helper, selects the audio
> reference clock parent for the 8 kHz or 11.025 kHz sample rate family
> and keeps the minimum functional-clock to bit-clock ratio required
> for safe clock domain crossing, with an extra margin cycle when the
> bit clock is sourced externally. Runtime and system suspend/resume
> restore the registers through the regcache.
>
> Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
> ---
> +static void cdns_i2s_mc_rxtx_config(struct cdns_i2s_mc_priv *i2s_mc_priv, bool on,
> + u8 pin_mask, u32 strobe, u32 sync_rst)
> +{
> + u32 irq_mask = 0, clk_mask = 0, i2s_mask = 0;
> +
> + irq_mask |= FIELD_PREP(I2S_CID_CTRL_I2S_MASK, pin_mask);
> +
> + clk_mask |= FIELD_PREP(I2S_CID_CTRL_I2S_STROBE, pin_mask) | strobe;
> +
> + i2s_mask |= FIELD_PREP(I2S_CTRL_I2S_EN, pin_mask);
> +
This patch has the same build issue as the SC driver patch:
cdns-i2s-mc.c uses FIELD_PREP() but does not include <linux/bitfield.h>.
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "Failed to register dmaengine component\n");
> +
> + pm_runtime_get_noresume(&pdev->dev);
> + pm_runtime_set_active(&pdev->dev);
> + ret = devm_pm_runtime_enable(&pdev->dev);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret, "Failed to enable runtime PM\n");
> +
> + ret = cdns_i2s_mc_clks_enable(i2s_mc_priv);
> + if (ret) {
> + dev_err_probe(&pdev->dev, ret, "Failed to enable clocks\n");
> + pm_runtime_put_noidle(&pdev->dev);
> + return ret;
> + }
> +
> + cdns_i2s_mc_rst(i2s_mc_priv);
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> + i2s_mc_priv->irq = irq;
> +
> + ret = devm_request_irq(&pdev->dev, irq, cdns_i2s_mc_isr, 0,
> + dev_name(&pdev->dev), i2s_mc_priv);
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
> + pm_runtime_put_noidle(&pdev->dev);
> + return ret;
> + }
After cdns_i2s_mc_clks_enable() succeeds, the platform_get_irq() failure
path returns directly without disabling the clocks or dropping the
runtime PM usage count. The devm_request_irq() failure path also calls
pm_runtime_put_noidle(), but that will not run the runtime suspend
callback, so the clocks enabled manually above remain prepared/enabled.
Thanks
Ajay Kumar Nandam
> +
> + /*
> + * Let pm_runtime_put_sync() disable the clocks, and take regcache effect.
> + * If CONFIG_PM is not enabled, the clock will stay powered.
prev parent reply other threads:[~2026-10-07 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 5:36 [PATCH v2 0/4] ASoC: cdns: Add Cadence I2S-SC and I2S-MC controller support joakim.zhang
2026-09-28 5:36 ` [PATCH v2 1/4] ASoC: dt-bindings: Add Cadence I2S-SC controller joakim.zhang
2026-09-28 5:36 ` [PATCH v2 2/4] ASoC: cdns: Add Cadence I2S-SC controller driver joakim.zhang
2026-10-07 9:29 ` Ajay Kumar Nandam
2026-09-28 5:36 ` [PATCH v2 3/4] ASoC: dt-bindings: Add Cadence I2S-MC controller joakim.zhang
2026-09-28 5:36 ` [PATCH v2 4/4] ASoC: cdns: Add Cadence I2S-MC controller driver joakim.zhang
2026-10-07 9:53 ` Ajay Kumar Nandam [this message]
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=8f75db55-66b2-4b94-b0bd-ccc52f08d197@oss.qualcomm.com \
--to=ajay.nandam@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=cix-kernel-upstream@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=joakim.zhang@cixtech.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=perex@perex.cz \
--cc=robh@kernel.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
all inboxes | Powered by JetHome®