]> git.hungrycats.org Git - linux/commit
ASoC: fsl-asoc-card: Move static compatible data to platform data
authorChancel Liu <chancel.liu@nxp.com>
Mon, 10 Aug 2026 09:35:30 +0000 (18:35 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 13 Aug 2026 14:48:03 +0000 (15:48 +0100)
commit76408e27e60f8deb087f7d84e866d7f03ac750f1
tree5e89e3db38827d3a3fa24c8cca4593271fae29ac
parent4c51a83a4fe85dd58a56bed491740ecefcf8a110
ASoC: fsl-asoc-card: Move static compatible data to platform data

Replace the large if/else chain of of_device_is_compatible() calls in
probe() with a table-driven approach.  Each compatible string now has
a corresponding static const struct fsl_asoc_card_pdata descriptor
stored in the of_device_id .data field.

probe() calls of_device_get_match_data() once and reads all
per-compatible configuration from the returned pointer:
  - DAI format
  - CPU SYSCLK direction and ratio overrides
  - TDM slot width
  - Codec DAI name, MCLK id, FLL/PLL ids, PLL S24 ratio
  - playback_only / capture_only direction restrictions
  - Default DAPM route table
  - Excluded PCM format mask (for SAI + WM8960/WM8962)
  - Optional probe_init callback (SPDIF multi-codec discovery)
  - Optional codec_init callback (codec-specific post-probe logic)

This patch is a pure refactoring, no functional change is intended.

Assisted-by: VeroCoder:claude-sonnet-4-6
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260810093834.1511749-3-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl-asoc-card.c