Skip to content

ASoC: cdns: Add Cadence I2S-SC and I2S-MC controller support

[email protected] linux-arm-kernel linux-devicetree linux-sound lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 4 repliesIn review
  2. v4 posting 2/24 patches 0 repliesSuperseded
  3. v4 posting 1/24 patches 2 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v34 patches5 repliesSuperseded
v24 patches4 repliesSuperseded
v14 patches13 repliesSuperseded

Changes in v5 from the cover letter

- I2S-MC: fix the DSP_A/DSP_B mapping in set_fmt(). The DATA_WS_DEL bit was assigned to the wrong format: per the controller implementation specification, data aligned with the word-select strobe (DSP_B) is DATA_WS_DEL set, and data delayed by one bit clock after the strobe (DSP_A) is DATA_WS_DEL clear. Swap the assignment for both the transmitter and the receiver.
- I2S-MC: return -EBUSY from hw_params() when the sample-rate family of the new stream needs a different i2s clock parent than the one already in use, since the transmit and receive DAIs share the clk_i2s parent mux; the parent is compared with clk_is_match().
- I2S-SC: let set_tdm_slot() switch TDM mode off when called with zero slots, which is how machine drivers return a DAI to standard I2S operation, while still rejecting negative slot counts.
- Both: rework the probe and teardown runtime PM handling. Enable runtime PM only after the IRQ is requested, unwind the clocks and the runtime PM state through a single error path, and gate the clocks in the new remove() callback when the device is still runtime-active; this also covers module removal with CONFIG_PM=n, where nothing else would disable the clocks.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ASoC: dt-bindings: Add Cadence I2S-SC controllerDocumentation/devicetree/bindings/sound/cix,sky1-i2s-sc.yaml+89 -00 replies
2/4ASoC: cdns: Add Cadence I2S-SC controller driversound/soc/Kconfig sound/soc/Makefile sound/soc/cdns/Kconfig +2 more+1189 -01 reply
3/4ASoC: dt-bindings: Add Cadence I2S-MC controllerDocumentation/devicetree/bindings/sound/cix,sky1-i2s-mc.yaml+119 -00 replies
4/4ASoC: cdns: Add Cadence I2S-MC controller driversound/soc/cdns/Kconfig sound/soc/cdns/Makefile sound/soc/cdns/cdns-i2s-mc.c+1166 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchRob Herring (Arm)
1/4R-b
2/4
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/4] ASoC: cdns: Add Cadence I2S-SC and I2S-MC controller support

From: Joakim Zhang <[email protected]>

This series adds support for the Cadence I2S-SC and I2S-MC controllers integrated in the CIX SKY1 audio subsystem, together with their DT bindings.

I2S-SC provides full-duplex stereo playback and capture in standard I2S, left/right-justified and DSP modes, along with TDM operation supporting up to 16 slots. I2S-MC provides multi-channel playback and capture through a configurable set of its 8 data pins, described by cix,pin-out-num, cix,pin-rx-mask and cix,pin-tx-mask, and exposes a transmit DAI and a receive DAI.

Both drivers register the dmaengine PCM helper, select the audio reference clock parent for the 8 kHz or 11.025 kHz sample rate family and keep the minimum functional-clock to bit-clock ratio required for safe clock domain crossing.

The two binding patches are unchanged since v4 and keep Rob's Reviewed-by tags.

Changes in v5:
- I2S-MC: fix the DSP_A/DSP_B mapping in set_fmt(). The DATA_WS_DEL bit was assigned to the wrong format: per the controller implementation specification, data aligned with the word-select strobe (DSP_B) is DATA_WS_DEL set, and data delayed by one bit clock after the strobe (DSP_A) is DATA_WS_DEL clear. Swap the assignment for both the transmitter and the receiver.
- I2S-MC: return -EBUSY from hw_params() when the sample-rate family of the new stream needs a different i2s clock parent than the one already in use, since the transmit and receive DAIs share the clk_i2s parent mux; the parent is compared with clk_is_match().
- I2S-SC: let set_tdm_slot() switch TDM mode off when called with zero slots, which is how machine drivers return a DAI to standard I2S operation, while still rejecting negative slot counts.
- Both: rework the probe and teardown runtime PM handling. Enable runtime PM only after the IRQ is requested, unwind the clocks and the runtime PM state through a single error path, and gate the clocks in the new remove() callback when the device is still runtime-active; this also covers module removal with CONFIG_PM=n, where nothing else would disable the clocks.

Changes in v4:
- Enforce the dma-names order in the bindings: a single "tx" or "rx" name is still allowed for single-direction instances, but a pair must be "tx", "rx".
- Drop the DMA controller stub node from the binding examples.
- Select REGMAP_MMIO; a COMPILE_TEST build without it would fail to link the regmap MMIO users.
- Include the transmitter and receiver synchronizing-unit reset bits in the masked register write of the I2S-MC DAI probe, so that the write actually programs the state its comment describes.

Changes in v3:
- Add the explicit <linux/bitfield.h> include, which a W=1 build of the FIELD_PREP() sites needs (both drivers).
- Fix the probe error paths: disable the manually enabled clocks and drop the runtime PM usage count on every failure path, unwinding through a single goto label (both drivers).
- Return dev_err_probe() directly instead of logging with it and then returning the error separately (both drivers).

Changes in v2:
- Move the IRQ request after the clocks are enabled and the reset is released, so the handler never runs against unclocked hardware.
- Disable the IRQ before switching the regcache to cache-only mode on suspend, and re-enable it only after the cache is synced on resume; check the status read in the ISR (both drivers).
- Replace the manual runtime PM bookkeeping with devm_pm_runtime_enable() and drop the remove() callbacks (both drivers).
- Switch to RUNTIME_PM_OPS()/SYSTEM_SLEEP_PM_OPS() wrapped in pm_ptr() and drop the __maybe_unused annotations (both drivers).
- Serialize the shared transceiver clock state in prepare() against the trigger() state machine with the existing spinlock (I2S-SC).
- Disable clocks in the reverse order of enablement (both drivers).
- Sort the cdns/ entry into the vendor list in sound/soc/Makefile and switch sound/soc/cdns/Makefile to the '-y' object syntax.
- Clean up the includes and initializer style (both drivers).
- Add a NULL check for the match data in probe (both drivers).
- Factor the MC transmitter and receiver configuration into a shared helper.
- Drop the compatible string from the DMAC stub node in the binding examples.

Joakim Zhang (4):
ASoC: dt-bindings: Add Cadence I2S-SC controller
ASoC: cdns: Add Cadence I2S-SC controller driver
ASoC: dt-bindings: Add Cadence I2S-MC controller
ASoC: cdns: Add Cadence I2S-MC controller driver

 .../bindings/sound/cix,sky1-i2s-mc.yaml       |  119 ++
 .../bindings/sound/cix,sky1-i2s-sc.yaml       |   89 ++
 sound/soc/Kconfig                             |    1 +
 sound/soc/Makefile                            |    1 +
 sound/soc/cdns/Kconfig                        |   23 +
 sound/soc/cdns/Makefile                       |    7 +
 sound/soc/cdns/cdns-i2s-mc.c                  | 1152 ++++++++++++++++
 sound/soc/cdns/cdns-i2s-sc.c                  | 1171 +++++++++++++++++
 8 files changed, 2563 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cix,sky1-i2s-mc.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/cix,sky1-i2s-sc.yaml
 create mode 100644 sound/soc/cdns/Kconfig
 create mode 100644 sound/soc/cdns/Makefile
 create mode 100644 sound/soc/cdns/cdns-i2s-mc.c
 create mode 100644 sound/soc/cdns/cdns-i2s-sc.c
Signature · 1 line
2.50.1