soundwire: cadence: override PDI configurations to create loopback
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 14 Jul 2021 03:22:09 +0000 (11:22 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 2 Aug 2021 05:38:22 +0000 (11:08 +0530)
commitdd81e7c3f0bb4fbe48b770b389ab6ccb95058dab
tree383c2949722fda9936c92eda126b802b00cd8a73
parent8fba8acd399b70aeb262983d32baa9cbbf7dc981
soundwire: cadence: override PDI configurations to create loopback

When we set a source PDI, the target PDI parameters will be overridden
by the source register values. The loopback streams can be
independently enabled on each link.

While the loopback source and target can be configured before any
stream is active on each link, the loopback stream should only be
prepared/triggered when the playback stream is prepared. Otherwise all
registers might be programmed to their reset values and the loopback
will not succeed. The SoundWire bus driver currently does not allow
two streams to be triggered at the same time, so the playback will
have to be started first, and later the loopback.

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-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/cadence_master.c