LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chancel Liu <chancel.liu@oss.nxp.com>
To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
	nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com
Cc: hui.wang@canonical.com, linuxppc-dev@lists.ozlabs.org,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] ASoC: fsl-asoc-card: Restructure to support deferrable card binding
Date: Mon, 10 Aug 2026 18:35:28 +0900	[thread overview]
Message-ID: <20260810093834.1511749-1-chancel.liu@oss.nxp.com> (raw)

From: Chancel Liu <chancel.liu@nxp.com>

The ASoC core has evolved over several kernel releases to support
deferrable card binding: when a component is not yet available,
devm_snd_soc_register_card() no longer propagates -EPROBE_DEFER back to
the machine driver. Instead the card is placed on an internal deferred
list and rebound automatically once the missing component registers.
As a result, registering a sound card no longer guarantees that all CPU
and codec components have already probed successfully.

This exposed two regressions in fsl-asoc-card:

1. The machine driver caches codec MCLK rate during probe(). On platforms
   where the MCLK is derived from the CPU DAI clock and its final rate is
   applied via assigned-clocks in the CPU DAI node, probing before the CPU
   DAI driver completes leaves fsl-asoc-card with a stale mclk_freq.

2. If a card defers due to a missing component, it queues the card onto
   the unbind_card_list and returns 0. The driver then proceeds to call
   simple_util_init_jack(). At this point, the snd_card pointer is NULL.

Patch 1 drops mclk management for nau8822 from this machine driver.

Patch 2 is a pure refactoring with no functional change. the large if/else
chain of of_device_is_compatible() calls in probe() is
replaced by a platform data table approach.

Patch 3 moves all component-dependent initialisation and jacks out of
probe() and into late_probe(), which is the correct place under the
deferrable binding model.

Chancel Liu (3):
  ASoC: fsl-asoc-card: Drop mclk management for nau8822
  ASoC: fsl-asoc-card: Move static compatible data to platform data
  ASoC: fsl-asoc-card: Move bound-component setup to late_probe

 sound/soc/fsl/fsl-asoc-card.c | 728 ++++++++++++++++++++++------------
 1 file changed, 465 insertions(+), 263 deletions(-)

--
2.50.1



             reply	other threads:[~2026-08-10  9:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  9:35 Chancel Liu [this message]
2026-08-10  9:35 ` [PATCH 1/3] ASoC: fsl-asoc-card: Drop mclk management for nau8822 Chancel Liu
2026-08-10  9:35 ` [PATCH 2/3] ASoC: fsl-asoc-card: Move static compatible data to platform data Chancel Liu
2026-08-10  9:35 ` [PATCH 3/3] ASoC: fsl-asoc-card: Move bound-component setup to late_probe Chancel Liu

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=20260810093834.1511749-1-chancel.liu@oss.nxp.com \
    --to=chancel.liu@oss.nxp.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=hui.wang@canonical.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@gmail.com \
    --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