ASoC: codecs: add SoundWire mockup device support
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 14 Jul 2021 03:22:00 +0000 (11:22 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jul 2021 17:02:05 +0000 (18:02 +0100)
commit81d3d3d0bf09e606dbc1e3daad1c7cef3976fca2
treedfddac372d7f6ec25039f005be6924fe04e8838c
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
ASoC: codecs: add SoundWire mockup device support

To test the host controller and bus management code, it is currently
required to have a physical SoundWire peripheral attached to the
bus. To help with pre-silicon or early hardware enablement, it would
be very useful to have a SoundWire 'mockup' device that is exposed in
platform firmware but does not drive any signal on the bus.

This is different to the existing ASoC 'dummy' codec uses for I2S/TDM,
the SoundWire spec makes it clear that a device that is not attached
to the bus is not permitted to interact with the bus, be it for
command/control or data.

This patch exposes a 'mockup' device, with a minimalist driver, with 4
partID values reserved by Intel for such test configurations. The
mockup device exposes one full-duplex DAI based on 2 ports (DP1 for
playback and DP8 for capture). The capture data port is just virtual,
such a mockup device is prevented by the SoundWire specification from
presenting any data generated by a Source port without being Attached.

All the callbacks exposed by the SoundWire Slave interface are
populated, even if they just return immediately. This is intentional
to describe what a minimal codec driver should do and implement and
help new codec vendors provide support for their devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/sdw-mockup.c [new file with mode: 0644]